From: antti@apple.com Date: Tue, 9 Jan 2018 19:27:34 +0000 (+0000) Subject: Blank page except for inner iframes because pending stylesheets cause style.isNotFina... X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=13023c0b7a2cd3c4bc8f87c3d486379dff38ab78 Blank page except for inner iframes because pending stylesheets cause style.isNotFinal() to be true https://bugs.webkit.org/show_bug.cgi?id=180940 Reviewed by Darin Adler. Source/WebCore: Test: http/tests/local/loading-stylesheet-import-remove.html If a 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. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226653 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index ce19e18..272c5ac 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,15 @@ +2018-01-09 Antti Koivisto + + Blank page except for inner iframes because pending stylesheets cause style.isNotFinal() to be true + https://bugs.webkit.org/show_bug.cgi?id=180940 + + + 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 Make imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https.html robust to quota error diff --git a/LayoutTests/http/tests/local/loading-stylesheet-import-remove-expected.html b/LayoutTests/http/tests/local/loading-stylesheet-import-remove-expected.html new file mode 100644 index 0000000..429113a --- /dev/null +++ b/LayoutTests/http/tests/local/loading-stylesheet-import-remove-expected.html @@ -0,0 +1,6 @@ + + + +

CAN YOU SEE ME NOW?

+ + diff --git a/LayoutTests/http/tests/local/loading-stylesheet-import-remove.html b/LayoutTests/http/tests/local/loading-stylesheet-import-remove.html new file mode 100644 index 0000000..26cf633 --- /dev/null +++ b/LayoutTests/http/tests/local/loading-stylesheet-import-remove.html @@ -0,0 +1,19 @@ + + + + + + + +

CAN YOU SEE ME NOW?

+ + diff --git a/LayoutTests/http/tests/local/resources/slow-import.css b/LayoutTests/http/tests/local/resources/slow-import.css new file mode 100644 index 0000000..e362cfb --- /dev/null +++ b/LayoutTests/http/tests/local/resources/slow-import.css @@ -0,0 +1 @@ +@import url("../slow-css-pass.cgi"); diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 43d3e4f..34757f9 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,24 @@ +2018-01-09 Antti Koivisto + + Blank page except for inner iframes because pending stylesheets cause style.isNotFinal() to be true + https://bugs.webkit.org/show_bug.cgi?id=180940 + + + Reviewed by Darin Adler. + + Test: http/tests/local/loading-stylesheet-import-remove.html + + If a 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 Removed some empty directories that were left behind diff --git a/Source/WebCore/html/HTMLLinkElement.cpp b/Source/WebCore/html/HTMLLinkElement.cpp index 15840143..8404e34 100644 --- a/Source/WebCore/html/HTMLLinkElement.cpp +++ b/Source/WebCore/html/HTMLLinkElement.cpp @@ -365,10 +365,12 @@ void HTMLLinkElement::removedFromAncestor(RemovalType removalType, ContainerNode m_linkLoader.cancelLoad(); + bool wasLoading = styleSheetIsLoading(); + if (m_sheet) clearSheet(); - if (styleSheetIsLoading()) + if (wasLoading) removePendingSheet(); if (m_styleScope) {