Title: [241155] branches/safari-607-branch
Revision
241155
Author
[email protected]
Date
2019-02-07 15:36:38 -0800 (Thu, 07 Feb 2019)

Log Message

Cherry-pick r241018. rdar://problem/47893623

    RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
    https://bugs.webkit.org/show_bug.cgi?id=194333
    <rdar://problem/47822929>

    Reviewed by Zalan Bujtas.

    Source/WebCore:

    Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
    the legacy animation code triggering a resource load.

    Test: http/tests/contentextensions/css-display-none-keyframe.html

    * style/StyleScope.cpp:
    (WebCore::Style::Scope::scheduleUpdate):

    Avoid clearing the style resolver if we are in the middle of a style resolution.
    A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.

    LayoutTests:

    * http/tests/contentextensions/css-display-none-keyframe-expected.txt: Added.
    * http/tests/contentextensions/css-display-none-keyframe.html: Added.
    * http/tests/contentextensions/css-display-none-keyframe.html.json: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-607-branch/LayoutTests/ChangeLog (241154 => 241155)


--- branches/safari-607-branch/LayoutTests/ChangeLog	2019-02-07 23:36:34 UTC (rev 241154)
+++ branches/safari-607-branch/LayoutTests/ChangeLog	2019-02-07 23:36:38 UTC (rev 241155)
@@ -1,5 +1,49 @@
 2019-02-07  Alan Coon  <[email protected]>
 
+        Cherry-pick r241018. rdar://problem/47893623
+
+    RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
+    https://bugs.webkit.org/show_bug.cgi?id=194333
+    <rdar://problem/47822929>
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
+    the legacy animation code triggering a resource load.
+    
+    Test: http/tests/contentextensions/css-display-none-keyframe.html
+    
+    * style/StyleScope.cpp:
+    (WebCore::Style::Scope::scheduleUpdate):
+    
+    Avoid clearing the style resolver if we are in the middle of a style resolution.
+    A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.
+    
+    LayoutTests:
+    
+    * http/tests/contentextensions/css-display-none-keyframe-expected.txt: Added.
+    * http/tests/contentextensions/css-display-none-keyframe.html: Added.
+    * http/tests/contentextensions/css-display-none-keyframe.html.json: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-02-06  Antti Koivisto  <[email protected]>
+
+            RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
+            https://bugs.webkit.org/show_bug.cgi?id=194333
+            <rdar://problem/47822929>
+
+            Reviewed by Zalan Bujtas.
+
+            * http/tests/contentextensions/css-display-none-keyframe-expected.txt: Added.
+            * http/tests/contentextensions/css-display-none-keyframe.html: Added.
+            * http/tests/contentextensions/css-display-none-keyframe.html.json: Added.
+
+2019-02-07  Alan Coon  <[email protected]>
+
         Cherry-pick r239967. rdar://problem/47776476
 
     Bulgarian TLD should not punycode-encode URLs with Bulgarian Cyrillic characters

Added: branches/safari-607-branch/LayoutTests/http/tests/contentextensions/css-display-none-keyframe-expected.txt (0 => 241155)


--- branches/safari-607-branch/LayoutTests/http/tests/contentextensions/css-display-none-keyframe-expected.txt	                        (rev 0)
+++ branches/safari-607-branch/LayoutTests/http/tests/contentextensions/css-display-none-keyframe-expected.txt	2019-02-07 23:36:38 UTC (rev 241155)
@@ -0,0 +1 @@
+Test content extension inserting a display:none rule triggered by a resource in a keyframe.

Added: branches/safari-607-branch/LayoutTests/http/tests/contentextensions/css-display-none-keyframe.html (0 => 241155)


--- branches/safari-607-branch/LayoutTests/http/tests/contentextensions/css-display-none-keyframe.html	                        (rev 0)
+++ branches/safari-607-branch/LayoutTests/http/tests/contentextensions/css-display-none-keyframe.html	2019-02-07 23:36:38 UTC (rev 241155)
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML><!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false ] -->
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+</script>
+<style>
+@keyframes bgimage {
+    from {
+        background-image: url("non-existent.png");
+    }
+    to {
+        background-image: url("non-existent-2.png");
+    }
+}
+div {
+    animation-duration: 0.1s;
+    animation-name: bgimage;
+}
+</style>
+<div _onanimationend_="testRunner.notifyDone()">
+Test content extension inserting a display:none rule triggered by a resource in a keyframe.
+</div>
+<div class="hidden">
+FAIL
+</div>

Added: branches/safari-607-branch/LayoutTests/http/tests/contentextensions/css-display-none-keyframe.html.json (0 => 241155)


--- branches/safari-607-branch/LayoutTests/http/tests/contentextensions/css-display-none-keyframe.html.json	                        (rev 0)
+++ branches/safari-607-branch/LayoutTests/http/tests/contentextensions/css-display-none-keyframe.html.json	2019-02-07 23:36:38 UTC (rev 241155)
@@ -0,0 +1,11 @@
+[
+    {
+        "action": {
+            "type": "css-display-none",
+            "selector": ".hidden"
+        },
+        "trigger": {
+            "url-filter": ".*png"
+        }
+    }
+]

Modified: branches/safari-607-branch/Source/WebCore/ChangeLog (241154 => 241155)


--- branches/safari-607-branch/Source/WebCore/ChangeLog	2019-02-07 23:36:34 UTC (rev 241154)
+++ branches/safari-607-branch/Source/WebCore/ChangeLog	2019-02-07 23:36:38 UTC (rev 241155)
@@ -1,5 +1,56 @@
 2019-02-07  Alan Coon  <[email protected]>
 
+        Cherry-pick r241018. rdar://problem/47893623
+
+    RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
+    https://bugs.webkit.org/show_bug.cgi?id=194333
+    <rdar://problem/47822929>
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
+    the legacy animation code triggering a resource load.
+    
+    Test: http/tests/contentextensions/css-display-none-keyframe.html
+    
+    * style/StyleScope.cpp:
+    (WebCore::Style::Scope::scheduleUpdate):
+    
+    Avoid clearing the style resolver if we are in the middle of a style resolution.
+    A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.
+    
+    LayoutTests:
+    
+    * http/tests/contentextensions/css-display-none-keyframe-expected.txt: Added.
+    * http/tests/contentextensions/css-display-none-keyframe.html: Added.
+    * http/tests/contentextensions/css-display-none-keyframe.html.json: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-02-06  Antti Koivisto  <[email protected]>
+
+            RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
+            https://bugs.webkit.org/show_bug.cgi?id=194333
+            <rdar://problem/47822929>
+
+            Reviewed by Zalan Bujtas.
+
+            Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
+            the legacy animation code triggering a resource load.
+
+            Test: http/tests/contentextensions/css-display-none-keyframe.html
+
+            * style/StyleScope.cpp:
+            (WebCore::Style::Scope::scheduleUpdate):
+
+            Avoid clearing the style resolver if we are in the middle of a style resolution.
+            A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.
+
+2019-02-07  Alan Coon  <[email protected]>
+
         Cherry-pick r240808. rdar://problem/47774548
 
     Revert r238819 which is unneeded and caused a performance regression.

Modified: branches/safari-607-branch/Source/WebCore/style/StyleScope.cpp (241154 => 241155)


--- branches/safari-607-branch/Source/WebCore/style/StyleScope.cpp	2019-02-07 23:36:34 UTC (rev 241154)
+++ branches/safari-607-branch/Source/WebCore/style/StyleScope.cpp	2019-02-07 23:36:38 UTC (rev 241155)
@@ -602,8 +602,10 @@
         // :host and ::slotted rules might go away.
         if (m_shadowRoot && m_resolver)
             invalidateHostAndSlottedStyleIfNeeded(*m_shadowRoot, *m_resolver);
+        // FIXME: Animation code may trigger resource load in middle of style recalc and that can add a rule to a content extension stylesheet.
+        //        Fix and remove isResolvingTreeStyle() test below, see https://bugs.webkit.org/show_bug.cgi?id=194335
         // FIXME: The m_isUpdatingStyleResolver test is here because extension stylesheets can get us here from StyleResolver::appendAuthorStyleSheets.
-        if (!m_isUpdatingStyleResolver)
+        if (!m_isUpdatingStyleResolver && !m_document.isResolvingTreeStyle())
             clearResolver();
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to