Title: [226653] trunk
Revision
226653
Author
[email protected]
Date
2018-01-09 11:27:34 -0800 (Tue, 09 Jan 2018)

Log Message

Blank page except for inner iframes because pending stylesheets cause style.isNotFinal() to be true
https://bugs.webkit.org/show_bug.cgi?id=180940
<rdar://problem/36116507>

Reviewed by Darin Adler.

Source/WebCore:

Test: http/tests/local/loading-stylesheet-import-remove.html

If a <link> referencing a stylesheet containing an @import that was still loading was removed
from the document, the loading state was never cleared. For head stylesheets this blocked
rendering permanently.

Test reduction by Justin Ridgewell.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFromAncestor):

Test if the stylesheet it loading before clearing the pointer.

LayoutTests:

* http/tests/local/loading-stylesheet-import-remove.html: Added.
* http/tests/local/loading-stylesheet-import-remove-expected.html: Added.
* http/tests/local/resources/slow-import.css: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (226652 => 226653)


--- trunk/LayoutTests/ChangeLog	2018-01-09 19:14:32 UTC (rev 226652)
+++ trunk/LayoutTests/ChangeLog	2018-01-09 19:27:34 UTC (rev 226653)
@@ -1,3 +1,15 @@
+2018-01-09  Antti Koivisto  <[email protected]>
+
+        Blank page except for inner iframes because pending stylesheets cause style.isNotFinal() to be true
+        https://bugs.webkit.org/show_bug.cgi?id=180940
+        <rdar://problem/36116507>
+
+        Reviewed by Darin Adler.
+
+        * http/tests/local/loading-stylesheet-import-remove.html: Added.
+        * http/tests/local/loading-stylesheet-import-remove-expected.html: Added.
+        * http/tests/local/resources/slow-import.css: Added.
+
 2018-01-09  Youenn Fablet  <[email protected]>
 
         Make imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https.html robust to quota error

Added: trunk/LayoutTests/http/tests/local/loading-stylesheet-import-remove-expected.html (0 => 226653)


--- trunk/LayoutTests/http/tests/local/loading-stylesheet-import-remove-expected.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/local/loading-stylesheet-import-remove-expected.html	2018-01-09 19:27:34 UTC (rev 226653)
@@ -0,0 +1,6 @@
+<!doctype html>
+<html>
+<body>
+<h1>CAN YOU SEE ME NOW?</h1>
+</body>
+</html>

Added: trunk/LayoutTests/http/tests/local/loading-stylesheet-import-remove.html (0 => 226653)


--- trunk/LayoutTests/http/tests/local/loading-stylesheet-import-remove.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/local/loading-stylesheet-import-remove.html	2018-01-09 19:27:34 UTC (rev 226653)
@@ -0,0 +1,19 @@
+<!doctype html>
+<html>
+<head>
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+setTimeout(() => {
+    const stylesheet = document.querySelector('link');
+    stylesheet.remove();
+    if (window.testRunner)
+        testRunner.notifyDone();
+}, 100);
+</script>
+<link rel="stylesheet" href=""
+</head>
+<body>
+<h1>CAN YOU SEE ME NOW?</h1>
+</body>
+</html>

Added: trunk/LayoutTests/http/tests/local/resources/slow-import.css (0 => 226653)


--- trunk/LayoutTests/http/tests/local/resources/slow-import.css	                        (rev 0)
+++ trunk/LayoutTests/http/tests/local/resources/slow-import.css	2018-01-09 19:27:34 UTC (rev 226653)
@@ -0,0 +1 @@
+@import url("../slow-css-pass.cgi");

Modified: trunk/Source/WebCore/ChangeLog (226652 => 226653)


--- trunk/Source/WebCore/ChangeLog	2018-01-09 19:14:32 UTC (rev 226652)
+++ trunk/Source/WebCore/ChangeLog	2018-01-09 19:27:34 UTC (rev 226653)
@@ -1,3 +1,24 @@
+2018-01-09  Antti Koivisto  <[email protected]>
+
+        Blank page except for inner iframes because pending stylesheets cause style.isNotFinal() to be true
+        https://bugs.webkit.org/show_bug.cgi?id=180940
+        <rdar://problem/36116507>
+
+        Reviewed by Darin Adler.
+
+        Test: http/tests/local/loading-stylesheet-import-remove.html
+
+        If a <link> referencing a stylesheet containing an @import that was still loading was removed
+        from the document, the loading state was never cleared. For head stylesheets this blocked
+        rendering permanently.
+
+        Test reduction by Justin Ridgewell.
+
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::removedFromAncestor):
+
+        Test if the stylesheet it loading before clearing the pointer.
+
 2018-01-09  Dan Bernstein  <[email protected]>
 
         Removed some empty directories that were left behind

Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (226652 => 226653)


--- trunk/Source/WebCore/html/HTMLLinkElement.cpp	2018-01-09 19:14:32 UTC (rev 226652)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp	2018-01-09 19:27:34 UTC (rev 226653)
@@ -365,10 +365,12 @@
 
     m_linkLoader.cancelLoad();
 
+    bool wasLoading = styleSheetIsLoading();
+
     if (m_sheet)
         clearSheet();
 
-    if (styleSheetIsLoading())
+    if (wasLoading)
         removePendingSheet();
     
     if (m_styleScope) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to