[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-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



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@xxxxxxxxxxx>
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.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits