Title: [170519] trunk/Source/WebCore
Revision
170519
Author
[email protected]
Date
2014-06-26 22:33:01 -0700 (Thu, 26 Jun 2014)

Log Message

REGRESSION (r170287): SVGDocumentExtensions::rebuildElements() called on removed element
https://bugs.webkit.org/show_bug.cgi?id=134304

Patch by Jeongeun Kim <[email protected]> on 2014-06-26
Reviewed by Daniel Bates.

Roll out <http://trac.webkit.org/170287> (https://bugs.webkit.org/show_bug.cgi?id=134186)
as it led to SVGDocumentExtensions::rebuildElements() being called on an element(s) that
may no longer be in the document.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::removeChildren):
* dom/Document.cpp:
(WebCore::Document::commonTeardown):
(WebCore::Document::implicitClose):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::startAnimations):
(WebCore::SVGDocumentExtensions::pauseAnimations):
(WebCore::SVGDocumentExtensions::unpauseAnimations):
(WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements):
(WebCore::SVGDocumentExtensions::rebuildElements):
* svg/SVGDocumentExtensions.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (170518 => 170519)


--- trunk/Source/WebCore/ChangeLog	2014-06-27 04:31:25 UTC (rev 170518)
+++ trunk/Source/WebCore/ChangeLog	2014-06-27 05:33:01 UTC (rev 170519)
@@ -1,3 +1,30 @@
+2014-06-26  Jeongeun Kim  <[email protected]>
+
+        REGRESSION (r170287): SVGDocumentExtensions::rebuildElements() called on removed element
+        https://bugs.webkit.org/show_bug.cgi?id=134304
+
+        Reviewed by Daniel Bates.
+
+        Roll out <http://trac.webkit.org/170287> (https://bugs.webkit.org/show_bug.cgi?id=134186)
+        as it led to SVGDocumentExtensions::rebuildElements() being called on an element(s) that
+        may no longer be in the document.
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::removeChild):
+        (WebCore::ContainerNode::removeChildren):
+        * dom/Document.cpp:
+        (WebCore::Document::commonTeardown):
+        (WebCore::Document::implicitClose):
+        * history/CachedFrame.cpp:
+        (WebCore::CachedFrameBase::restore):
+        * svg/SVGDocumentExtensions.cpp:
+        (WebCore::SVGDocumentExtensions::startAnimations):
+        (WebCore::SVGDocumentExtensions::pauseAnimations):
+        (WebCore::SVGDocumentExtensions::unpauseAnimations):
+        (WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements):
+        (WebCore::SVGDocumentExtensions::rebuildElements):
+        * svg/SVGDocumentExtensions.h:
+
 2014-06-26  Tim Horton  <[email protected]>
 
         [WK2] Pinch-zoom shadows can overlap headers and footers

Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (170518 => 170519)


--- trunk/Source/WebCore/dom/ContainerNode.cpp	2014-06-27 04:31:25 UTC (rev 170518)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp	2014-06-27 05:33:01 UTC (rev 170519)
@@ -573,7 +573,7 @@
     if (document().svgExtensions()) {
         Element* shadowHost = this->shadowHost();
         if (!shadowHost || !shadowHost->hasTagName(SVGNames::useTag))
-            document().svgExtensions()->rebuildElements();
+            document().accessSVGExtensions()->rebuildElements();
     }
 
     dispatchSubtreeModifiedEvent();
@@ -670,7 +670,7 @@
     if (document().svgExtensions()) {
         Element* shadowHost = this->shadowHost();
         if (!shadowHost || !shadowHost->hasTagName(SVGNames::useTag))
-            document().svgExtensions()->rebuildElements();
+            document().accessSVGExtensions()->rebuildElements();
     }
 
     dispatchSubtreeModifiedEvent();

Modified: trunk/Source/WebCore/dom/Document.cpp (170518 => 170519)


--- trunk/Source/WebCore/dom/Document.cpp	2014-06-27 04:31:25 UTC (rev 170518)
+++ trunk/Source/WebCore/dom/Document.cpp	2014-06-27 05:33:01 UTC (rev 170519)
@@ -691,7 +691,7 @@
 void Document::commonTeardown()
 {
     if (svgExtensions())
-        svgExtensions()->pauseAnimations();
+        accessSVGExtensions()->pauseAnimations();
 
 #if ENABLE(REQUEST_ANIMATION_FRAME)
     clearScriptedAnimationController();
@@ -2386,7 +2386,7 @@
     // here, instead of doing it from SVGElement::finishedParsingChildren (if externalResourcesRequired="false",
     // which is the default, for ='' its fired at a later time, once all external resources finished loading).
     if (svgExtensions())
-        svgExtensions()->dispatchSVGLoadEventToOutermostSVGElements();
+        accessSVGExtensions()->dispatchSVGLoadEventToOutermostSVGElements();
 
     dispatchWindowLoadEvent();
     enqueuePageshowEvent(PageshowEventNotPersisted);
@@ -2451,7 +2451,7 @@
 #endif
 
     if (svgExtensions())
-        svgExtensions()->startAnimations();
+        accessSVGExtensions()->startAnimations();
 }
 
 void Document::setParsing(bool b)

Modified: trunk/Source/WebCore/history/CachedFrame.cpp (170518 => 170519)


--- trunk/Source/WebCore/history/CachedFrame.cpp	2014-06-27 04:31:25 UTC (rev 170518)
+++ trunk/Source/WebCore/history/CachedFrame.cpp	2014-06-27 05:33:01 UTC (rev 170519)
@@ -89,7 +89,7 @@
     m_cachedFrameScriptData->restore(frame);
 
     if (m_document->svgExtensions())
-        m_document->svgExtensions()->unpauseAnimations();
+        m_document->accessSVGExtensions()->unpauseAnimations();
 
     frame.animation().resumeAnimationsForDocument(m_document.get());
     m_document->resumeActiveDOMObjects(ActiveDOMObject::DocumentWillBecomeInactive);

Modified: trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp (170518 => 170519)


--- trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp	2014-06-27 04:31:25 UTC (rev 170518)
+++ trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp	2014-06-27 05:33:01 UTC (rev 170519)
@@ -87,7 +87,7 @@
     return m_resources.get(id);
 }
 
-void SVGDocumentExtensions::startAnimations() const
+void SVGDocumentExtensions::startAnimations()
 {
     // FIXME: Eventually every "Time Container" will need a way to latch on to some global timer
     // starting animations for a document will do this "latching"
@@ -100,21 +100,21 @@
         (*it)->timeContainer()->begin();
 }
 
-void SVGDocumentExtensions::pauseAnimations() const
+void SVGDocumentExtensions::pauseAnimations()
 {
     auto end = m_timeContainers.end();
     for (auto it = m_timeContainers.begin(); it != end; ++it)
         (*it)->pauseAnimations();
 }
 
-void SVGDocumentExtensions::unpauseAnimations() const
+void SVGDocumentExtensions::unpauseAnimations()
 {
     auto end = m_timeContainers.end();
     for (auto it = m_timeContainers.begin(); it != end; ++it)
         (*it)->unpauseAnimations();
 }
 
-void SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements() const
+void SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements()
 {
     Vector<RefPtr<SVGSVGElement>> timeContainers;
     timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end());
@@ -332,7 +332,7 @@
         m_elementDependencies.remove(*it);
 }
 
-void SVGDocumentExtensions::rebuildElements() const
+void SVGDocumentExtensions::rebuildElements()
 {
     Vector<SVGElement*> shadowRebuildElements = std::move(m_rebuildElements);
     for (auto* element : shadowRebuildElements)

Modified: trunk/Source/WebCore/svg/SVGDocumentExtensions.h (170518 => 170519)


--- trunk/Source/WebCore/svg/SVGDocumentExtensions.h	2014-06-27 04:31:25 UTC (rev 170518)
+++ trunk/Source/WebCore/svg/SVGDocumentExtensions.h	2014-06-27 05:33:01 UTC (rev 170519)
@@ -53,10 +53,10 @@
     void removeResource(const AtomicString& id);
     RenderSVGResourceContainer* resourceById(const AtomicString& id) const;
 
-    void startAnimations() const;
-    void pauseAnimations() const;
-    void unpauseAnimations() const;
-    void dispatchSVGLoadEventToOutermostSVGElements() const;
+    void startAnimations();
+    void pauseAnimations();
+    void unpauseAnimations();
+    void dispatchSVGLoadEventToOutermostSVGElements();
 
     void reportWarning(const String&);
     void reportError(const String&);
@@ -70,7 +70,7 @@
     void removeAllElementReferencesForTarget(SVGElement*);
 
     void clearTargetDependencies(SVGElement&);
-    void rebuildElements() const;
+    void rebuildElements();
 
 #if ENABLE(SVG_FONTS)
     const HashSet<SVGFontFaceElement*>& svgFontFaceElements() const { return m_svgFontFaceElements; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to