Title: [225649] trunk/Source/WebCore
Revision
225649
Author
[email protected]
Date
2017-12-07 15:55:42 -0800 (Thu, 07 Dec 2017)

Log Message

AX: Document::existingAXObjectCache() should always return the existing AXObjectCache.
https://bugs.webkit.org/show_bug.cgi?id=180548
<rdar://problem/35917755>

Reviewed by Chris Fleizach.

Currently the AX cache becomes unreachable through Document::existingAXObjectCache soon after the render tree is destroyed.
>From this point, the Node objects can't deregister themselves from the AX cache anymore. In some cases, it's
redundant/not advised to notify the cache about certain changes when the document is being destroyed, but the
callsites should make that decision.

Covered by existing tests.

* dom/Document.cpp:
(WebCore::Document::existingAXObjectCacheSlow const):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::takeChildInternal):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (225648 => 225649)


--- trunk/Source/WebCore/ChangeLog	2017-12-07 23:30:33 UTC (rev 225648)
+++ trunk/Source/WebCore/ChangeLog	2017-12-07 23:55:42 UTC (rev 225649)
@@ -1,3 +1,23 @@
+2017-12-07  Zalan Bujtas  <[email protected]>
+
+        AX: Document::existingAXObjectCache() should always return the existing AXObjectCache.
+        https://bugs.webkit.org/show_bug.cgi?id=180548
+        <rdar://problem/35917755>
+
+        Reviewed by Chris Fleizach.
+
+        Currently the AX cache becomes unreachable through Document::existingAXObjectCache soon after the render tree is destroyed.
+        From this point, the Node objects can't deregister themselves from the AX cache anymore. In some cases, it's
+        redundant/not advised to notify the cache about certain changes when the document is being destroyed, but the
+        callsites should make that decision.
+
+        Covered by existing tests.
+
+        * dom/Document.cpp:
+        (WebCore::Document::existingAXObjectCacheSlow const):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::takeChildInternal):
+
 2017-12-07  Youenn Fablet  <[email protected]>
 
         Fix erroneous ASSERT in DocumentThreadableLoader::didFail

Modified: trunk/Source/WebCore/dom/Document.cpp (225648 => 225649)


--- trunk/Source/WebCore/dom/Document.cpp	2017-12-07 23:30:33 UTC (rev 225648)
+++ trunk/Source/WebCore/dom/Document.cpp	2017-12-07 23:55:42 UTC (rev 225649)
@@ -2515,10 +2515,7 @@
 AXObjectCache* Document::existingAXObjectCacheSlow() const
 {
     ASSERT(hasEverCreatedAnAXObjectCache);
-    Document& topDocument = this->topDocument();
-    if (!topDocument.hasLivingRenderTree())
-        return nullptr;
-    return topDocument.m_axObjectCache.get();
+    return topDocument().m_axObjectCache.get();
 }
 
 AXObjectCache* Document::axObjectCache() const

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (225648 => 225649)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2017-12-07 23:30:33 UTC (rev 225648)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2017-12-07 23:55:42 UTC (rev 225649)
@@ -651,8 +651,10 @@
     if (!renderTreeBeingDestroyed() && is<RenderElement>(oldChild))
         RenderCounter::rendererRemovedFromTree(downcast<RenderElement>(oldChild));
 
-    if (AXObjectCache* cache = document().existingAXObjectCache())
-        cache->childrenChanged(this);
+    if (!renderTreeBeingDestroyed()) {
+        if (AXObjectCache* cache = document().existingAXObjectCache())
+            cache->childrenChanged(this);
+    }
 
     return RenderPtr<RenderObject>(&oldChild);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to