Title: [286599] trunk
Revision
286599
Author
[email protected]
Date
2021-12-07 10:20:17 -0800 (Tue, 07 Dec 2021)

Log Message

Assertion after removing stylesheet with loading @import rule
https://bugs.webkit.org/show_bug.cgi?id=233928

Reviewed by Alan Bujtas.

Source/WebCore:

Tests: fast/css/import-and-remove-assert.html

* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::removedFromDocument):

Ensure we notify Style::Scope

LayoutTests:

* fast/css/import-and-remove-assert-expected.txt: Added.
* fast/css/import-and-remove-assert.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (286598 => 286599)


--- trunk/LayoutTests/ChangeLog	2021-12-07 17:49:42 UTC (rev 286598)
+++ trunk/LayoutTests/ChangeLog	2021-12-07 18:20:17 UTC (rev 286599)
@@ -1,3 +1,13 @@
+2021-12-07  Antti Koivisto  <[email protected]>
+
+        Assertion after removing stylesheet with loading @import rule
+        https://bugs.webkit.org/show_bug.cgi?id=233928
+
+        Reviewed by Alan Bujtas.
+
+        * fast/css/import-and-remove-assert-expected.txt: Added.
+        * fast/css/import-and-remove-assert.html: Added.
+
 2021-12-03  Sergio Villar Senin  <[email protected]>
 
         [css-flexbox] Account for captions when flexing tables with specified sizes

Added: trunk/LayoutTests/fast/css/import-and-remove-assert-expected.txt (0 => 286599)


--- trunk/LayoutTests/fast/css/import-and-remove-assert-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/import-and-remove-assert-expected.txt	2021-12-07 18:20:17 UTC (rev 286599)
@@ -0,0 +1 @@
+This test passes if it doesn't assert.

Added: trunk/LayoutTests/fast/css/import-and-remove-assert.html (0 => 286599)


--- trunk/LayoutTests/fast/css/import-and-remove-assert.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/import-and-remove-assert.html	2021-12-07 18:20:17 UTC (rev 286599)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<iframe id=frame srcdoc="
+<script>
+const style = document.createElement('style');
+style.textContent = '@import url(data:text/css,)';
+document.head.appendChild(style);
+style.remove();
+</script>">
+</iframe>
+This test passes if it doesn't assert.
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+    
+function end() {
+    if (window.GCController)
+        GCController.collect();
+    testRunner.notifyDone();
+}
+
+frame._onload_ = () => {
+    frame.remove();
+    setTimeout(end, 0);
+};
+</script>

Modified: trunk/Source/WebCore/ChangeLog (286598 => 286599)


--- trunk/Source/WebCore/ChangeLog	2021-12-07 17:49:42 UTC (rev 286598)
+++ trunk/Source/WebCore/ChangeLog	2021-12-07 18:20:17 UTC (rev 286599)
@@ -1,5 +1,19 @@
 2021-12-07  Antti Koivisto  <[email protected]>
 
+        Assertion after removing stylesheet with loading @import rule
+        https://bugs.webkit.org/show_bug.cgi?id=233928
+
+        Reviewed by Alan Bujtas.
+
+        Tests: fast/css/import-and-remove-assert.html
+
+        * dom/InlineStyleSheetOwner.cpp:
+        (WebCore::InlineStyleSheetOwner::removedFromDocument):
+
+        Ensure we notify Style::Scope
+
+2021-12-07  Antti Koivisto  <[email protected]>
+
         Use more specific keys for pseudo-class invalidation
         https://bugs.webkit.org/show_bug.cgi?id=233883
 

Modified: trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp (286598 => 286599)


--- trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp	2021-12-07 17:49:42 UTC (rev 286598)
+++ trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp	2021-12-07 18:20:17 UTC (rev 286599)
@@ -96,6 +96,8 @@
 void InlineStyleSheetOwner::removedFromDocument(Element& element)
 {
     if (m_styleScope) {
+        if (m_sheet && m_sheet->isLoading())
+            m_styleScope->removePendingSheet(element);
         m_styleScope->removeStyleSheetCandidateNode(element);
         m_styleScope = nullptr;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to