Title: [237468] trunk/Source/WebCore
Revision
237468
Author
[email protected]
Date
2018-10-26 11:16:54 -0700 (Fri, 26 Oct 2018)

Log Message

Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
https://bugs.webkit.org/show_bug.cgi?id=190955

Patch by Antoine Quint <[email protected]> on 2018-10-26
Reviewed by Dean Jackson.

We can get in situations when running tests where runtime flags are not consistent throughout the time a test is run since
showing the Web Inspector can cause flags to be re-set after the initial test was loaded. As such, to avoid crashes due to
the ASSERT(!frame().animation().hasAnimations()) in FrameView::didDestroyRenderTree(), we now cancel animations upon teardown
no matter what the value of the runtime flag for the Web Animations CSS Integration on both the DocumentTimeline (if it exists)
and the CSSAnimationController.

* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (237467 => 237468)


--- trunk/Source/WebCore/ChangeLog	2018-10-26 18:01:39 UTC (rev 237467)
+++ trunk/Source/WebCore/ChangeLog	2018-10-26 18:16:54 UTC (rev 237468)
@@ -1,3 +1,25 @@
+2018-10-26  Antoine Quint  <[email protected]>
+
+        Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
+        https://bugs.webkit.org/show_bug.cgi?id=190955
+
+        Reviewed by Dean Jackson.
+
+        We can get in situations when running tests where runtime flags are not consistent throughout the time a test is run since
+        showing the Web Inspector can cause flags to be re-set after the initial test was loaded. As such, to avoid crashes due to
+        the ASSERT(!frame().animation().hasAnimations()) in FrameView::didDestroyRenderTree(), we now cancel animations upon teardown
+        no matter what the value of the runtime flag for the Web Animations CSS Integration on both the DocumentTimeline (if it exists)
+        and the CSSAnimationController.
+
+        * dom/Element.cpp:
+        (WebCore::Element::removedFromAncestor):
+        * dom/PseudoElement.cpp:
+        (WebCore::PseudoElement::clearHostElement):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::didDestroyRenderTree):
+        * rendering/updating/RenderTreeUpdater.cpp:
+        (WebCore::RenderTreeUpdater::tearDownRenderers):
+
 2018-10-26  Timothy Hatcher  <[email protected]>
 
         Use dark appearance scrollbar when page background is dark or document supports dark mode.

Modified: trunk/Source/WebCore/dom/Element.cpp (237467 => 237468)


--- trunk/Source/WebCore/dom/Element.cpp	2018-10-26 18:01:39 UTC (rev 237467)
+++ trunk/Source/WebCore/dom/Element.cpp	2018-10-26 18:16:54 UTC (rev 237468)
@@ -1962,10 +1962,9 @@
         document().accessSVGExtensions().removeElementFromPendingResources(this);
 
     RefPtr<Frame> frame = document().frame();
-    if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) {
-        if (auto* timeline = document().existingTimeline())
-            timeline->elementWasRemoved(*this);
-    } else if (frame)
+    if (auto* timeline = document().existingTimeline())
+        timeline->elementWasRemoved(*this);
+    if (frame)
         frame->animation().cancelAnimations(*this);
 
 #if PLATFORM(MAC)

Modified: trunk/Source/WebCore/dom/PseudoElement.cpp (237467 => 237468)


--- trunk/Source/WebCore/dom/PseudoElement.cpp	2018-10-26 18:01:39 UTC (rev 237467)
+++ trunk/Source/WebCore/dom/PseudoElement.cpp	2018-10-26 18:16:54 UTC (rev 237468)
@@ -90,10 +90,9 @@
 {
     InspectorInstrumentation::pseudoElementDestroyed(document().page(), *this);
 
-    if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) {
-        if (auto* timeline = document().existingTimeline())
-            timeline->removeAnimationsForElement(*this);
-    } else if (auto* frame = document().frame())
+    if (auto* timeline = document().existingTimeline())
+        timeline->removeAnimationsForElement(*this);
+    if (auto* frame = document().frame())
         frame->animation().cancelAnimations(*this);
 
     m_hostElement = nullptr;

Modified: trunk/Source/WebCore/page/FrameView.cpp (237467 => 237468)


--- trunk/Source/WebCore/page/FrameView.cpp	2018-10-26 18:01:39 UTC (rev 237467)
+++ trunk/Source/WebCore/page/FrameView.cpp	2018-10-26 18:16:54 UTC (rev 237468)
@@ -607,8 +607,7 @@
     ASSERT(!m_viewportConstrainedObjects || m_viewportConstrainedObjects->isEmpty());
     ASSERT(!m_slowRepaintObjects || m_slowRepaintObjects->isEmpty());
 
-    if (!RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled())
-        ASSERT(!frame().animation().hasAnimations());
+    ASSERT(!frame().animation().hasAnimations());
 }
 
 void FrameView::setContentsSize(const IntSize& size)

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp (237467 => 237468)


--- trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp	2018-10-26 18:01:39 UTC (rev 237467)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp	2018-10-26 18:16:54 UTC (rev 237468)
@@ -555,15 +555,13 @@
             auto& element = *teardownStack.takeLast();
 
             if (teardownType == TeardownType::Full || teardownType == TeardownType::RendererUpdateCancelingAnimations) {
-                if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) {
-                    if (timeline) {
-                        if (document.renderTreeBeingDestroyed())
-                            timeline->elementWasRemoved(element);
-                        else if (teardownType == TeardownType::RendererUpdateCancelingAnimations)
-                            timeline->cancelDeclarativeAnimationsForElement(element);
-                    }
-                } else
-                    animationController.cancelAnimations(element);
+                if (timeline) {
+                    if (document.renderTreeBeingDestroyed())
+                        timeline->elementWasRemoved(element);
+                    else if (teardownType == TeardownType::RendererUpdateCancelingAnimations)
+                        timeline->cancelDeclarativeAnimationsForElement(element);
+                }
+                animationController.cancelAnimations(element);
             }
 
             if (teardownType == TeardownType::Full)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to