REGRESSION(r162744): wsj.com paints white
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Jan 2014 17:15:51 +0000 (17:15 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Jan 2014 17:15:51 +0000 (17:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127619

Reviewed by Sam Weinig.

Source/WebCore:

Test: fast/css/stylesheet-layout-with-pending-paint.html

* dom/Document.cpp:
(WebCore::Document::styleResolverChanged):

    Ensure we switch out from IgnoreLayoutWithPendingSheets state after stylesheet loads complete.

LayoutTests:

* fast/css/stylesheet-layout-with-pending-paint-expected.html: Added.
* fast/css/stylesheet-layout-with-pending-paint.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/css/stylesheet-layout-with-pending-paint-expected.html [new file with mode: 0644]
LayoutTests/fast/css/stylesheet-layout-with-pending-paint.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp

index f1c6baa..e2f5eca 100644 (file)
@@ -1,3 +1,13 @@
+2014-01-25  Antti Koivisto  <antti@apple.com>
+
+        REGRESSION(r162744): wsj.com paints white
+        https://bugs.webkit.org/show_bug.cgi?id=127619
+
+        Reviewed by Sam Weinig.
+
+        * fast/css/stylesheet-layout-with-pending-paint-expected.html: Added.
+        * fast/css/stylesheet-layout-with-pending-paint.html: Added.
+
 2014-01-24  Tamas Gergely  <tgergely.u-szeged@partner.samsung.com>
 
         ASSERT(time.isFinite()) in SVGSMILElement::createInstanceTimesFromSyncbase
diff --git a/LayoutTests/fast/css/stylesheet-layout-with-pending-paint-expected.html b/LayoutTests/fast/css/stylesheet-layout-with-pending-paint-expected.html
new file mode 100644 (file)
index 0000000..08de413
--- /dev/null
@@ -0,0 +1 @@
+<div style="color:green">PASS</div>
diff --git a/LayoutTests/fast/css/stylesheet-layout-with-pending-paint.html b/LayoutTests/fast/css/stylesheet-layout-with-pending-paint.html
new file mode 100644 (file)
index 0000000..cf68796
--- /dev/null
@@ -0,0 +1,6 @@
+<body>
+<script>
+document.write("<link rel=stylesheet href='data:text/css,div{color:green}'>");
+document.body.offsetWidth;
+</script>
+<div>PASS</div>
index 8afb74e..4b18121 100644 (file)
@@ -1,3 +1,17 @@
+2014-01-25  Antti Koivisto  <antti@apple.com>
+
+        REGRESSION(r162744): wsj.com paints white
+        https://bugs.webkit.org/show_bug.cgi?id=127619
+
+        Reviewed by Sam Weinig.
+
+        Test: fast/css/stylesheet-layout-with-pending-paint.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::styleResolverChanged):
+        
+            Ensure we switch out from IgnoreLayoutWithPendingSheets state after stylesheet loads complete.
+
 2014-01-24  Dan Bernstein  <mitz@apple.com>
 
         Reverted r162760. It broke more things.
index b0e6b78..e61cb4f 100644 (file)
@@ -2800,6 +2800,12 @@ void Document::didRemoveAllPendingStylesheet()
 
     styleResolverChanged(DeferRecalcStyleIfNeeded);
 
+    if (m_pendingSheetLayout == DidLayoutWithPendingSheets) {
+        m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
+        if (renderView())
+            renderView()->repaintViewAndCompositedLayers();
+    }
+
     if (ScriptableDocumentParser* parser = scriptableDocumentParser())
         parser->executeScriptsWaitingForStylesheets();
 
@@ -3232,12 +3238,6 @@ void Document::styleResolverChanged(StyleResolverUpdateFlag updateFlag)
         return;
     }
 
-    if (didLayoutWithPendingStylesheets() && !m_styleSheetCollection.hasPendingSheets()) {
-        m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
-        if (renderView())
-            renderView()->repaintViewAndCompositedLayers();
-    }
-
     if (!stylesheetChangeRequiresStyleRecalc)
         return;