Title: [214830] trunk
Revision
214830
Author
an...@apple.com
Date
2017-04-03 12:08:07 -0700 (Mon, 03 Apr 2017)

Log Message

REGRESSION (r207669): FileMaker Pro Help pages do not render correctly
https://bugs.webkit.org/show_bug.cgi?id=170402
<rdar://problem/31004344>

Reviewed by Simon Fraser.

Source/WebCore:

If a new stylesheet load is started from the load event the document.styleSheets does not
always reflect the already loaded stylesheets.

Test: fast/css/document-stylesheets-dynamic.html

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

    Remove an old optimization where we would not update active stylesheets if there were pending
    (head) stylesheet loads and they had not been updated already.
    This is probably not a valuable optimization anymore with the new lazy stylesheet update strategy.

* style/StyleScope.h:

LayoutTests:

* fast/css/document-stylesheets-dynamic-expected.html: Added.
* fast/css/document-stylesheets-dynamic.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (214829 => 214830)


--- trunk/LayoutTests/ChangeLog	2017-04-03 19:07:50 UTC (rev 214829)
+++ trunk/LayoutTests/ChangeLog	2017-04-03 19:08:07 UTC (rev 214830)
@@ -1,3 +1,14 @@
+2017-04-03  Antti Koivisto  <an...@apple.com>
+
+        REGRESSION (r207669): FileMaker Pro Help pages do not render correctly
+        https://bugs.webkit.org/show_bug.cgi?id=170402
+        <rdar://problem/31004344>
+
+        Reviewed by Simon Fraser.
+
+        * fast/css/document-stylesheets-dynamic-expected.html: Added.
+        * fast/css/document-stylesheets-dynamic.html: Added.
+
 2017-04-03  Jeremy Jones  <jere...@apple.com>
 
         LayoutTest pointer-lock/mouse-event-delivery.html is a flaky failure

Added: trunk/LayoutTests/fast/css/document-stylesheets-dynamic-expected.html (0 => 214830)


--- trunk/LayoutTests/fast/css/document-stylesheets-dynamic-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/document-stylesheets-dynamic-expected.html	2017-04-03 19:08:07 UTC (rev 214830)
@@ -0,0 +1 @@
+PASS

Added: trunk/LayoutTests/fast/css/document-stylesheets-dynamic.html (0 => 214830)


--- trunk/LayoutTests/fast/css/document-stylesheets-dynamic.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/document-stylesheets-dynamic.html	2017-04-03 19:08:07 UTC (rev 214830)
@@ -0,0 +1,15 @@
+<head>
+<script>
+function test()
+{
+    const link = document.createElement("link");
+    link.setAttribute("rel", "stylesheet");
+    link.setAttribute("href", "data:text/css,body { background:white !important; }");
+    document.head.appendChild(link);
+    const count = document.styleSheets.length;
+    document.body.innerHTML = (count == 1) ? `PASS` : `FAIL: document.styleSheets.length == ${count}`
+}
+</script>
+<link rel=stylesheet href="" { color:black !important; }">
+</head>
+<body _onload_="test()" style="color:blue; background:red">

Modified: trunk/Source/WebCore/ChangeLog (214829 => 214830)


--- trunk/Source/WebCore/ChangeLog	2017-04-03 19:07:50 UTC (rev 214829)
+++ trunk/Source/WebCore/ChangeLog	2017-04-03 19:08:07 UTC (rev 214830)
@@ -1,3 +1,25 @@
+2017-04-03  Antti Koivisto  <an...@apple.com>
+
+        REGRESSION (r207669): FileMaker Pro Help pages do not render correctly
+        https://bugs.webkit.org/show_bug.cgi?id=170402
+        <rdar://problem/31004344>
+
+        Reviewed by Simon Fraser.
+
+        If a new stylesheet load is started from the load event the document.styleSheets does not
+        always reflect the already loaded stylesheets.
+
+        Test: fast/css/document-stylesheets-dynamic.html
+
+        * style/StyleScope.cpp:
+        (WebCore::Style::Scope::updateActiveStyleSheets):
+
+            Remove an old optimization where we would not update active stylesheets if there were pending
+            (head) stylesheet loads and they had not been updated already.
+            This is probably not a valuable optimization anymore with the new lazy stylesheet update strategy.
+
+        * style/StyleScope.h:
+
 2017-04-03  Anders Carlsson  <ander...@apple.com>
 
         Tweak ApplePaySession API

Modified: trunk/Source/WebCore/style/StyleScope.cpp (214829 => 214830)


--- trunk/Source/WebCore/style/StyleScope.cpp	2017-04-03 19:07:50 UTC (rev 214829)
+++ trunk/Source/WebCore/style/StyleScope.cpp	2017-04-03 19:08:07 UTC (rev 214830)
@@ -443,15 +443,6 @@
         return;
     }
 
-    // Don't bother updating, since we haven't loaded all our style info yet
-    // and haven't calculated the style resolver for the first time.
-    if (!m_shadowRoot && !m_didUpdateActiveStyleSheets && hasPendingSheetsBeforeBody()) {
-        clearResolver();
-        return;
-    }
-
-    m_didUpdateActiveStyleSheets = true;
-
     Vector<RefPtr<StyleSheet>> activeStyleSheets;
     collectActiveStyleSheets(activeStyleSheets);
 

Modified: trunk/Source/WebCore/style/StyleScope.h (214829 => 214830)


--- trunk/Source/WebCore/style/StyleScope.h	2017-04-03 19:07:50 UTC (rev 214829)
+++ trunk/Source/WebCore/style/StyleScope.h	2017-04-03 19:08:07 UTC (rev 214830)
@@ -163,8 +163,6 @@
     HashSet<const Element*> m_elementsInHeadWithPendingSheets;
     HashSet<const Element*> m_elementsInBodyWithPendingSheets;
 
-    bool m_didUpdateActiveStyleSheets { false };
-
     std::optional<UpdateType> m_pendingUpdate;
     bool m_hasDescendantWithPendingUpdate { false };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to