Implementation of AXIsolatedObject::press().
authorandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jan 2020 14:42:44 +0000 (14:42 +0000)
committerandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jan 2020 14:42:44 +0000 (14:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=206177

Reviewed by Chris Fleizach.

- Implemented AXIsolatedObject::press().
- For link objects, press causes the destruction and re-creation of the
isolated tree. Thus also added AXIsolatedTree:removeTreeForPageID.
- AXIsolatedTree::applyPendingChanges now also properly detaches isolated
objects that have been removed.
- Moved set and get wrapper to AXCoreObject so that it can be used for
both isolated and live objects.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::~AXObjectCache):
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::createIsolatedTreeHierarchy):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::detachWrapper):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::wrapper const):
(WebCore::AXCoreObject::setWrapper):
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::detachWrapper):
* accessibility/ios/AXObjectCacheIOS.mm:
(WebCore::AXObjectCache::detachWrapper):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::removeTreeForPageID):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/isolatedtree/AXIsolatedTree.h:
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
(WebCore::AXIsolatedObject::detach):
(WebCore::AXIsolatedObject::detachFromParent):
(WebCore::AXIsolatedObject::children):
(WebCore::AXIsolatedObject::isDetachedFromParent):
(WebCore::AXIsolatedObject::performFunctionOnMainThread):
(WebCore::AXIsolatedObject::findTextRanges const):
(WebCore::AXIsolatedObject::performTextOperation):
(WebCore::AXIsolatedObject::press):
(WebCore::AXIsolatedObject::widget const):
(WebCore::AXIsolatedObject::page const):
(WebCore::AXIsolatedObject::document const):
(WebCore::AXIsolatedObject::documentFrameView const):
* accessibility/isolatedtree/AXIsolatedTreeNode.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::detachWrapper):
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::detachWrapper):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AXObjectCache.h
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityObjectInterface.h
Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp
Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm
Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp
Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h
Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
Source/WebCore/accessibility/win/AXObjectCacheWin.cpp

index b7dc0c6..ee14a5c 100644 (file)
@@ -1,3 +1,55 @@
+2020-01-15  Andres Gonzalez  <andresg_22@apple.com>
+
+        Implementation of AXIsolatedObject::press().
+        https://bugs.webkit.org/show_bug.cgi?id=206177
+
+        Reviewed by Chris Fleizach.
+
+        - Implemented AXIsolatedObject::press().
+        - For link objects, press causes the destruction and re-creation of the
+        isolated tree. Thus also added AXIsolatedTree:removeTreeForPageID.
+        - AXIsolatedTree::applyPendingChanges now also properly detaches isolated
+        objects that have been removed.
+        - Moved set and get wrapper to AXCoreObject so that it can be used for
+        both isolated and live objects.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::~AXObjectCache):
+        (WebCore::AXObjectCache::remove):
+        (WebCore::AXObjectCache::createIsolatedTreeHierarchy):
+        * accessibility/AXObjectCache.h:
+        (WebCore::AXObjectCache::detachWrapper):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityObjectInterface.h:
+        (WebCore::AXCoreObject::wrapper const):
+        (WebCore::AXCoreObject::setWrapper):
+        * accessibility/atk/AXObjectCacheAtk.cpp:
+        (WebCore::AXObjectCache::detachWrapper):
+        * accessibility/ios/AXObjectCacheIOS.mm:
+        (WebCore::AXObjectCache::detachWrapper):
+        * accessibility/isolatedtree/AXIsolatedTree.cpp:
+        (WebCore::AXIsolatedTree::removeTreeForPageID):
+        (WebCore::AXIsolatedTree::applyPendingChanges):
+        * accessibility/isolatedtree/AXIsolatedTree.h:
+        * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
+        (WebCore::AXIsolatedObject::detach):
+        (WebCore::AXIsolatedObject::detachFromParent):
+        (WebCore::AXIsolatedObject::children):
+        (WebCore::AXIsolatedObject::isDetachedFromParent):
+        (WebCore::AXIsolatedObject::performFunctionOnMainThread):
+        (WebCore::AXIsolatedObject::findTextRanges const):
+        (WebCore::AXIsolatedObject::performTextOperation):
+        (WebCore::AXIsolatedObject::press):
+        (WebCore::AXIsolatedObject::widget const):
+        (WebCore::AXIsolatedObject::page const):
+        (WebCore::AXIsolatedObject::document const):
+        (WebCore::AXIsolatedObject::documentFrameView const):
+        * accessibility/isolatedtree/AXIsolatedTreeNode.h:
+        * accessibility/mac/AXObjectCacheMac.mm:
+        (WebCore::AXObjectCache::detachWrapper):
+        * accessibility/win/AXObjectCacheWin.cpp:
+        (WebCore::AXObjectCache::detachWrapper):
+
 2020-01-15  Thibault Saunier  <tsaunier@igalia.com>
 
         [GStreamer] Several buffering fixes
index dc6c04a..e36a20d 100644 (file)
@@ -233,6 +233,12 @@ AXObjectCache::~AXObjectCache()
     m_focusModalNodeTimer.stop();
     m_performCacheUpdateTimer.stop();
 
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    // Destroy the IsolatedTree before destroying the live tree.
+    if (m_pageID)
+        AXIsolatedTree::removeTreeForPageID(*m_pageID);
+#endif
+
     for (const auto& object : m_objects.values()) {
         detachWrapper(object.get(), AccessibilityDetachmentType::CacheDestroyed);
         object->detach(AccessibilityDetachmentType::CacheDestroyed);
@@ -743,8 +749,11 @@ AXCoreObject* AXObjectCache::isolatedTreeRootObject()
         return nullptr;
 
     auto tree = AXIsolatedTree::treeForPageID(*m_pageID);
-    if (!tree && isMainThread()) {
-        tree = generateIsolatedTree(*m_pageID, m_document);
+    if (!tree) {
+        tree = Accessibility::retrieveValueFromMainThread<RefPtr<AXIsolatedTree>>([this] () -> RefPtr<AXIsolatedTree> {
+            return generateIsolatedTree(*m_pageID, m_document);
+        });
+
         // Now that we have created our tree, initialize the secondary thread,
         // so future requests come in on the other thread.
         _AXUIElementUseSecondaryAXThread(true);
@@ -837,6 +846,13 @@ void AXObjectCache::remove(AXID axID)
     if (!axID)
         return;
 
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    if (m_pageID) {
+        if (auto tree = AXIsolatedTree::treeForPageID(*m_pageID))
+            tree->removeNode(axID);
+    }
+#endif
+
     auto object = m_objects.take(axID);
     if (!object)
         return;
@@ -846,13 +862,6 @@ void AXObjectCache::remove(AXID axID)
     object->setObjectID(0);
 
     m_idsInUse.remove(axID);
-#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
-    if (m_pageID) {
-        if (auto tree = AXIsolatedTree::treeForPageID(*m_pageID))
-            tree->removeNode(axID);
-    }
-#endif
-
     ASSERT(m_objects.size() >= m_idsInUse.size());
 }
     
@@ -3071,6 +3080,7 @@ Ref<AXIsolatedObject> AXObjectCache::createIsolatedTreeHierarchy(AXCoreObject& o
 
     isolatedTreeNode->setTreeIdentifier(tree.treeIdentifier());
     isolatedTreeNode->setParent(parentID);
+    axObjectCache->detachWrapper(&object, AccessibilityDetachmentType::ElementChange);
     axObjectCache->attachWrapper(&isolatedTreeNode.get());
 
     for (const auto& child : object.children()) {
@@ -3085,9 +3095,7 @@ Ref<AXIsolatedTree> AXObjectCache::generateIsolatedTree(PageIdentifier pageID, D
 {
     RELEASE_ASSERT(isMainThread());
 
-    auto tree = AXIsolatedTree::treeForPageID(pageID);
-    if (!tree)
-        tree = AXIsolatedTree::createTreeForPageID(pageID);
+    RefPtr<AXIsolatedTree> tree(AXIsolatedTree::createTreeForPageID(pageID));
 
     // Set the root and focused objects in the isolated tree. For that, we need
     // the root and the focused object in the AXObject tree.
index e604ecb..d3d45f3 100644 (file)
@@ -171,7 +171,7 @@ public:
     void remove(Widget*);
     void remove(AXID);
 
-    void detachWrapper(AccessibilityObject*, AccessibilityDetachmentType);
+    void detachWrapper(AXCoreObject*, AccessibilityDetachmentType);
     void attachWrapper(AXCoreObject*);
     void childrenChanged(Node*, Node* newChild = nullptr);
     void childrenChanged(RenderObject*, RenderObject* newChild = nullptr);
@@ -547,7 +547,7 @@ inline void AXObjectCache::deferRecomputeIsIgnored(Element*) { }
 inline void AXObjectCache::deferTextChangedIfNeeded(Node*) { }
 inline void AXObjectCache::deferSelectedChildrenChangedIfNeeded(Element&) { }
 inline void AXObjectCache::deferTextReplacementNotificationForTextControl(HTMLTextFormControlElement&, const String&) { }
-inline void AXObjectCache::detachWrapper(AccessibilityObject*, AccessibilityDetachmentType) { }
+inline void AXObjectCache::detachWrapper(AXCoreObject*, AccessibilityDetachmentType) { }
 inline void AXObjectCache::focusModalNodeTimerFired() { }
 inline void AXObjectCache::performCacheUpdateTimerFired() { }
 inline void AXObjectCache::frameLoadingEventNotification(Frame*, AXLoadingEvent) { }
index 386bf03..9bf0497 100644 (file)
@@ -681,14 +681,6 @@ public:
     bool isDOMHidden() const override;
     bool isHidden() const override { return isAXHidden() || isDOMHidden(); }
 
-#if ENABLE(ACCESSIBILITY)
-    AccessibilityObjectWrapper* wrapper() const override { return m_wrapper.get(); }
-    void setWrapper(AccessibilityObjectWrapper* wrapper) override { m_wrapper = wrapper; }
-#else
-    AccessibilityObjectWrapper* wrapper() const override { return nullptr; }
-    void setWrapper(AccessibilityObjectWrapper*) override { }
-#endif
-
 #if PLATFORM(COCOA)
     void overrideAttachmentParent(AXCoreObject* parent) override;
 #else
@@ -785,14 +777,6 @@ protected:
     bool allowsTextRanges() const { return isTextControl(); }
     unsigned getLengthForTextRange() const { return text().length(); }
 #endif
-
-#if PLATFORM(COCOA)
-    RetainPtr<WebAccessibilityObjectWrapper> m_wrapper;
-#elif PLATFORM(WIN)
-    COMPtr<AccessibilityObjectWrapper> m_wrapper;
-#elif USE(ATK)
-    GRefPtr<WebKitAccessible> m_wrapper;
-#endif
 };
 
 #if !ENABLE(ACCESSIBILITY)
index 61bb9c9..1dfd342 100644 (file)
@@ -1075,8 +1075,13 @@ public:
     virtual bool isDOMHidden() const = 0;
     virtual bool isHidden() const = 0;
 
-    virtual AccessibilityObjectWrapper* wrapper() const = 0;
-    virtual void setWrapper(AccessibilityObjectWrapper*) = 0;
+#if ENABLE(ACCESSIBILITY)
+    AccessibilityObjectWrapper* wrapper() const { return m_wrapper.get(); }
+    void setWrapper(AccessibilityObjectWrapper* wrapper) { m_wrapper = wrapper; }
+#else
+    AccessibilityObjectWrapper* wrapper() const override { return nullptr; }
+    void setWrapper(AccessibilityObjectWrapper*) override { }
+#endif
 
     virtual void overrideAttachmentParent(AXCoreObject* parent) = 0;
 
@@ -1124,6 +1129,14 @@ public:
     virtual uint64_t sessionID() const = 0;
     virtual String documentURI() const = 0;
     virtual String documentEncoding() const = 0;
+protected:
+#if PLATFORM(COCOA)
+    RetainPtr<WebAccessibilityObjectWrapper> m_wrapper;
+#elif PLATFORM(WIN)
+    COMPtr<AccessibilityObjectWrapper> m_wrapper;
+#elif USE(ATK)
+    GRefPtr<WebKitAccessible> m_wrapper;
+#endif
 };
 
 namespace Accessibility {
index d60395a..fe1260d 100644 (file)
@@ -48,7 +48,7 @@ static AtkObject* wrapperParent(WebKitAccessible* wrapper)
     return WEBKIT_IS_ACCESSIBLE(atkParent) ? atkParent : nullptr;
 }
 
-void AXObjectCache::detachWrapper(AccessibilityObject* obj, AccessibilityDetachmentType detachmentType)
+void AXObjectCache::detachWrapper(AXCoreObject* obj, AccessibilityDetachmentType detachmentType)
 {
     auto* wrapper = obj->wrapper();
     ASSERT(wrapper);
index 8d5a1cf..f11bfa8 100644 (file)
@@ -36,7 +36,7 @@
 
 namespace WebCore {
     
-void AXObjectCache::detachWrapper(AccessibilityObject* obj, AccessibilityDetachmentType)
+void AXObjectCache::detachWrapper(AXCoreObject* obj, AccessibilityDetachmentType)
 {
     [obj->wrapper() detach];
     obj->setWrapper(nullptr);
index 3c3918a..ef9eed3 100644 (file)
@@ -80,6 +80,7 @@ RefPtr<AXIsolatedTree> AXIsolatedTree::treeForID(AXIsolatedTreeID treeID)
 Ref<AXIsolatedTree> AXIsolatedTree::createTreeForPageID(PageIdentifier pageID)
 {
     LockHolder locker(s_cacheLock);
+    ASSERT(!treePageCache().contains(pageID));
 
     auto newTree = AXIsolatedTree::create();
     treePageCache().set(pageID, newTree.copyRef());
@@ -87,6 +88,24 @@ Ref<AXIsolatedTree> AXIsolatedTree::createTreeForPageID(PageIdentifier pageID)
     return newTree;
 }
 
+void AXIsolatedTree::removeTreeForPageID(PageIdentifier pageID)
+{
+    LockHolder locker(s_cacheLock);
+
+    if (auto optionalTree = treePageCache().take(pageID)) {
+        auto& tree { *optionalTree };
+        LockHolder treeLocker { tree->m_changeLogLock };
+        for (const auto& axID : tree->m_readerThreadNodeMap.keys()) {
+            if (auto object = tree->nodeForID(axID))
+                object->disconnect();
+        }
+        tree->m_readerThreadNodeMap.clear();
+        treeLocker.unlockEarly();
+
+        treeIDCache().remove(tree->treeIdentifier());
+    }
+}
+
 RefPtr<AXIsolatedTree> AXIsolatedTree::treeForPageID(PageIdentifier pageID)
 {
     LockHolder locker(s_cacheLock);
@@ -157,8 +176,11 @@ void AXIsolatedTree::applyPendingChanges()
     for (auto& item : appendCopy)
         m_readerThreadNodeMap.add(item->objectID(), WTFMove(item));
 
-    for (auto item : removeCopy)
+    for (auto item : removeCopy) {
+        if (auto object = nodeForID(item))
+            object->disconnect();
         m_readerThreadNodeMap.remove(item);
+    }
 }
     
 } // namespace WebCore
index 68f5231..38b4dc5 100644 (file)
@@ -44,7 +44,9 @@ public:
     static Ref<AXIsolatedTree> create();
     virtual ~AXIsolatedTree();
 
-    WEBCORE_EXPORT static Ref<AXIsolatedTree> createTreeForPageID(PageIdentifier);
+    static Ref<AXIsolatedTree> createTreeForPageID(PageIdentifier);
+    static void removeTreeForPageID(PageIdentifier);
+
     WEBCORE_EXPORT static RefPtr<AXIsolatedTree> treeForPageID(PageIdentifier);
     WEBCORE_EXPORT static RefPtr<AXIsolatedTree> treeForID(AXIsolatedTreeID);
     AXObjectCache* axObjectCache() const { return m_axObjectCache; }
index f19d831..1d41047 100644 (file)
@@ -404,12 +404,34 @@ void AXIsolatedObject::setParent(AXID parent)
     m_parent = parent;
 }
 
+void AXIsolatedObject::detach(AccessibilityDetachmentType, AXObjectCache*)
+{
+    ASSERT(isMainThread());
+    for (const auto& childID : m_childrenIDs)
+        tree()->nodeForID(childID)->detachFromParent();
+
+    m_childrenIDs.clear();
+}
+
 bool AXIsolatedObject::isDetached() const
 {
     ASSERT_NOT_REACHED();
     return false;
 }
 
+void AXIsolatedObject::detachFromParent()
+{
+    m_parent = InvalidAXID;
+}
+
+void AXIsolatedObject::disconnect()
+{
+    ASSERT(isMainThread());
+    tree()->axObjectCache()->detachWrapper(this, AccessibilityDetachmentType::ElementDestroyed);
+    detach(AccessibilityDetachmentType::ElementDestroyed);
+    setObjectID(InvalidAXID);
+}
+
 void AXIsolatedObject::setTreeIdentifier(AXIsolatedTreeID treeIdentifier)
 {
     m_treeIdentifier = treeIdentifier;
@@ -419,7 +441,6 @@ void AXIsolatedObject::setTreeIdentifier(AXIsolatedTreeID treeIdentifier)
 
 const AXCoreObject::AccessibilityChildrenVector& AXIsolatedObject::children(bool)
 {
-    ASSERT(!isMainThread());
     if (!isMainThread()) {
         m_children.clear();
         m_children.reserveInitialCapacity(m_childrenIDs.size());
@@ -432,7 +453,13 @@ const AXCoreObject::AccessibilityChildrenVector& AXIsolatedObject::children(bool
 
 bool AXIsolatedObject::isDetachedFromParent()
 {
-    return parent() == InvalidAXID && tree()->rootNode()->objectID() != m_id;
+    if (parent() != InvalidAXID)
+        return false;
+
+    // Check whether this is the root node, in which case we should return false.
+    if (auto root = tree()->rootNode())
+        return root->objectID() != m_id;
+    return false;
 }
 
 void AXIsolatedObject::accessibilityText(Vector<AccessibilityText>& texts) const
@@ -527,7 +554,7 @@ template<typename U>
 void AXIsolatedObject::performFunctionOnMainThread(U&& lambda)
 {
     Accessibility::performFunctionOnMainThread([&lambda, this] () {
-        if (auto object = associatedAXObject())
+        if (auto* object = associatedAXObject())
             lambda(object);
     });
 }
@@ -790,7 +817,7 @@ void AXIsolatedObject::updateBackingStore()
 Vector<RefPtr<Range>> AXIsolatedObject::findTextRanges(AccessibilitySearchTextCriteria const& criteria) const
 {
     return Accessibility::retrieveValueFromMainThread<Vector<RefPtr<Range>>>([&criteria, this] () -> Vector<RefPtr<Range>> {
-        if (auto object = associatedAXObject())
+        if (auto* object = associatedAXObject())
             return object->findTextRanges(criteria);
         return Vector<RefPtr<Range>>();
     });
@@ -799,7 +826,7 @@ Vector<RefPtr<Range>> AXIsolatedObject::findTextRanges(AccessibilitySearchTextCr
 Vector<String> AXIsolatedObject::performTextOperation(AccessibilityTextOperation const& textOperation)
 {
     return Accessibility::retrieveValueFromMainThread<Vector<String>>([&textOperation, this] () -> Vector<String> {
-        if (auto object = associatedAXObject())
+        if (auto* object = associatedAXObject())
             return object->performTextOperation(textOperation);
         return Vector<String>();
     });
@@ -829,7 +856,8 @@ bool AXIsolatedObject::insertText(const String&)
 
 bool AXIsolatedObject::press()
 {
-    ASSERT_NOT_REACHED();
+    if (auto* object = associatedAXObject())
+        return object->press();
     return false;
 }
 
@@ -1467,7 +1495,7 @@ TextIteratorBehavior AXIsolatedObject::textIteratorBehaviorForTextRange() const
 
 Widget* AXIsolatedObject::widget() const
 {
-    if (auto object = associatedAXObject())
+    if (auto* object = associatedAXObject())
         return object->widget();
     return nullptr;
 }
@@ -1480,20 +1508,23 @@ Widget* AXIsolatedObject::widgetForAttachmentView() const
 
 Page* AXIsolatedObject::page() const
 {
+    if (auto* object = associatedAXObject())
+        return object->page();
     ASSERT_NOT_REACHED();
     return nullptr;
 }
 
 Document* AXIsolatedObject::document() const
 {
-    if (auto object = associatedAXObject())
+    if (auto* object = associatedAXObject())
         return object->document();
+    ASSERT_NOT_REACHED();
     return nullptr;
 }
 
 FrameView* AXIsolatedObject::documentFrameView() const
 {
-    if (auto object = associatedAXObject())
+    if (auto* object = associatedAXObject())
         return object->documentFrameView();
     return nullptr;
 }
@@ -1591,11 +1622,6 @@ bool AXIsolatedObject::needsToUpdateChildren() const
     return false;
 }
 
-void AXIsolatedObject::detachFromParent()
-{
-    ASSERT_NOT_REACHED();
-}
-
 bool AXIsolatedObject::shouldFocusActiveDescendant() const
 {
     ASSERT_NOT_REACHED();
index 1628787..ce62197 100644 (file)
@@ -54,9 +54,9 @@ public:
     AXID objectID() const override { return m_id; }
     void init() override { }
 
-    AccessibilityObjectWrapper* wrapper() const override { return m_wrapper.get(); }
-    void detach(AccessibilityDetachmentType, AXObjectCache* = nullptr) override { }
+    void detach(AccessibilityDetachmentType, AXObjectCache* = nullptr) override;
     bool isDetached() const override;
+    void disconnect();
 
     void setTreeIdentifier(AXIsolatedTreeID);
     void setParent(AXID);
@@ -72,7 +72,11 @@ private:
     AXIsolatedObject() = default;
     AXIsolatedObject(AXCoreObject&, bool isRoot);
     void initializeAttributeData(AXCoreObject&, bool isRoot);
-    AXCoreObject* associatedAXObject() const { return axObjectCache()->objectFromAXID(objectID()); }
+    AXCoreObject* associatedAXObject() const
+    {
+        ASSERT(isMainThread());
+        return axObjectCache()->objectFromAXID(objectID());
+    }
 
     enum class AXPropertyName : uint8_t {
         None = 0,
@@ -816,8 +820,7 @@ private:
     void setIsIgnoredFromParentDataForChild(AXCoreObject*) override;
 
     void updateBackingStore() override;
-    void setWrapper(AccessibilityObjectWrapper* wrapper) override { m_wrapper = wrapper; }
-    
+
     AXID m_parent { InvalidAXID };
     AXID m_id { InvalidAXID };
     bool m_initialized { false };
@@ -826,11 +829,8 @@ private:
     Vector<AXID> m_childrenIDs;
     Vector<RefPtr<AXCoreObject>> m_children;
 
-#if PLATFORM(COCOA)
-    RetainPtr<WebAccessibilityObjectWrapper> m_wrapper;
-#endif
-
     HashMap<AXPropertyName, AttributeValueVariant, WTF::IntHash<AXPropertyName>, WTF::StrongEnumHashTraits<AXPropertyName>> m_attributeMap;
+    Lock m_attributeMapLock;
 };
 
 } // namespace WebCore
index 6901dac..b74e6d9 100644 (file)
@@ -232,7 +232,7 @@ static AXTextSelectionGranularity platformGranularityForWebCoreGranularity(WebCo
 
 namespace WebCore {
 
-void AXObjectCache::detachWrapper(AccessibilityObject* obj, AccessibilityDetachmentType)
+void AXObjectCache::detachWrapper(AXCoreObject* obj, AccessibilityDetachmentType)
 {
     [obj->wrapper() detach];
     obj->setWrapper(nullptr);
index 79bac47..3f55586 100644 (file)
@@ -41,7 +41,7 @@
 
 namespace WebCore {
 
-void AXObjectCache::detachWrapper(AccessibilityObject* obj, AccessibilityDetachmentType)
+void AXObjectCache::detachWrapper(AXCoreObject* obj, AccessibilityDetachmentType)
 {
     // On Windows, AccessibilityObjects are created when get_accChildCount is
     // called, but they are not wrapped until get_accChild is called, so this