[tbb-commits] [tor-browser] 260/311: Bug 1759600: Don't return a local OuterDoc as the parent of a RemoteAccessible if the RemoteAccessible isn't a document. r=eeejay a=dmeehan

gitolite role git at cupani.torproject.org
Tue Apr 26 15:31:00 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit e9015e3f2ca5dbbaa6ba1160c1bf3f7aa80235bf
Author: James Teh <jteh at mozilla.com>
AuthorDate: Wed Mar 23 00:08:13 2022 +0000

    Bug 1759600: Don't return a local OuterDoc as the parent of a RemoteAccessible if the RemoteAccessible isn't a document. r=eeejay a=dmeehan
    
    A non-document RemoteAccessible can have a null parent while it is being moved.
    This is only temporary, but it's possible for a client call to execute in this state.
    We must not return the local OuterDoc in this case, as this definitely isn't a valid child of an OuterDoc.
    
    To achieve this, the logic for handling document parents was moved to DocAccessibleParent.
    This makes it easier to understand exactly how documents are handled in contrast to normal RemoteAccessibles.
    
    Differential Revision: https://phabricator.services.mozilla.com/D141065
---
 accessible/ipc/DocAccessibleParent.h  | 7 +++++++
 accessible/ipc/RemoteAccessibleBase.h | 8 +-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/accessible/ipc/DocAccessibleParent.h b/accessible/ipc/DocAccessibleParent.h
index 2d0a715877621..ed9fc4afab731 100644
--- a/accessible/ipc/DocAccessibleParent.h
+++ b/accessible/ipc/DocAccessibleParent.h
@@ -281,6 +281,13 @@ class DocAccessibleParent : public RemoteAccessible,
 #endif
 
   // Accessible
+  virtual Accessible* Parent() const override {
+    if (IsTopLevel()) {
+      return OuterDocOfRemoteBrowser();
+    }
+    return RemoteParent();
+  }
+
   virtual int32_t IndexInParent() const override {
     if (IsTopLevel() && OuterDocOfRemoteBrowser()) {
       // An OuterDoc can only have 1 child.
diff --git a/accessible/ipc/RemoteAccessibleBase.h b/accessible/ipc/RemoteAccessibleBase.h
index 0ed2c52b88ac7..0bf9454fc2df5 100644
--- a/accessible/ipc/RemoteAccessibleBase.h
+++ b/accessible/ipc/RemoteAccessibleBase.h
@@ -80,13 +80,7 @@ class RemoteAccessibleBase : public Accessible, public HyperTextAccessibleBase {
 
   // Accessible hierarchy method overrides
 
-  virtual Accessible* Parent() const override {
-    if (Derived* parent = RemoteParent()) {
-      return parent;
-    }
-
-    return OuterDocOfRemoteBrowser();
-  }
+  virtual Accessible* Parent() const override { return RemoteParent(); }
 
   virtual Accessible* ChildAt(uint32_t aIndex) const override {
     return RemoteChildAt(aIndex);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list