Title: [272336] trunk/Source/WebCore
Revision
272336
Author
[email protected]
Date
2021-02-03 12:36:28 -0800 (Wed, 03 Feb 2021)

Log Message

Unreviewed, reverting r272300.

Caused imported/w3c/web-platform-tests/css/css-scoping/css-
scoping-shadow-dynamic-remove-style-detached.html to
consistently fail on bots

Reverted changeset:

"Remove the Timer from Style::Scope"
https://bugs.webkit.org/show_bug.cgi?id=221221
https://trac.webkit.org/changeset/272300

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (272335 => 272336)


--- trunk/Source/WebCore/ChangeLog	2021-02-03 20:32:22 UTC (rev 272335)
+++ trunk/Source/WebCore/ChangeLog	2021-02-03 20:36:28 UTC (rev 272336)
@@ -1,3 +1,17 @@
+2021-02-03  Ryan Haddad  <[email protected]>
+
+        Unreviewed, reverting r272300.
+
+        Caused imported/w3c/web-platform-tests/css/css-scoping/css-
+        scoping-shadow-dynamic-remove-style-detached.html to
+        consistently fail on bots
+
+        Reverted changeset:
+
+        "Remove the Timer from Style::Scope"
+        https://bugs.webkit.org/show_bug.cgi?id=221221
+        https://trac.webkit.org/changeset/272300
+
 2021-02-03  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] Move away from using RenderStyle::preserveNewline

Modified: trunk/Source/WebCore/dom/Element.cpp (272335 => 272336)


--- trunk/Source/WebCore/dom/Element.cpp	2021-02-03 20:32:22 UTC (rev 272335)
+++ trunk/Source/WebCore/dom/Element.cpp	2021-02-03 20:36:28 UTC (rev 272336)
@@ -3386,8 +3386,6 @@
 
 bool Element::isVisibleWithoutResolvingFullStyle() const
 {
-    document().styleScope().flushPendingUpdate();
-
     if (renderStyle() || hasValidStyle())
         return renderStyle() && renderStyle()->visibility() == Visibility::Visible;
 

Modified: trunk/Source/WebCore/style/StyleScope.cpp (272335 => 272336)


--- trunk/Source/WebCore/style/StyleScope.cpp	2021-02-03 20:32:22 UTC (rev 272335)
+++ trunk/Source/WebCore/style/StyleScope.cpp	2021-02-03 20:36:28 UTC (rev 272336)
@@ -60,6 +60,7 @@
 
 Scope::Scope(Document& document)
     : m_document(document)
+    , m_pendingUpdateTimer(*this, &Scope::pendingUpdateTimerFired)
 {
 }
 
@@ -66,6 +67,7 @@
 Scope::Scope(ShadowRoot& shadowRoot)
     : m_document(shadowRoot.documentScope())
     , m_shadowRoot(&shadowRoot)
+    , m_pendingUpdateTimer(*this, &Scope::pendingUpdateTimerFired)
 {
 }
 
@@ -551,8 +553,8 @@
     ASSERT(m_pendingUpdate);
 
     auto updateType = *m_pendingUpdate;
-    m_pendingUpdate = { };
-    
+
+    clearPendingUpdate();
     updateActiveStyleSheets(updateType);
 }
 
@@ -565,6 +567,12 @@
     m_hasDescendantWithPendingUpdate = false;
 }
 
+void Scope::clearPendingUpdate()
+{
+    m_pendingUpdateTimer.stop();
+    m_pendingUpdate = { };
+}
+
 void Scope::scheduleUpdate(UpdateType update)
 {
     if (update == UpdateType::ContentsOrInterpretation) {
@@ -584,7 +592,9 @@
             m_document.styleScope().m_hasDescendantWithPendingUpdate = true;
     }
 
-    m_document.scheduleRenderingUpdate({ });
+    if (m_pendingUpdateTimer.isActive())
+        return;
+    m_pendingUpdateTimer.startOneShot(0_s);
 }
 
 void Scope::evaluateMediaQueriesForViewportChange()
@@ -670,6 +680,12 @@
         resolver->invalidateMatchedDeclarationsCache();
 }
 
+
+void Scope::pendingUpdateTimerFired()
+{
+    flushPendingUpdate();
+}
+
 const Vector<RefPtr<StyleSheet>>& Scope::styleSheetsForStyleSheetList()
 {
     // FIXME: StyleSheetList content should be updated separately from style resolver updates.

Modified: trunk/Source/WebCore/style/StyleScope.h (272335 => 272336)


--- trunk/Source/WebCore/style/StyleScope.h	2021-02-03 20:32:22 UTC (rev 272335)
+++ trunk/Source/WebCore/style/StyleScope.h	2021-02-03 20:36:28 UTC (rev 272336)
@@ -160,6 +160,9 @@
 
     void updateResolver(Vector<RefPtr<CSSStyleSheet>>&, ResolverUpdateType);
 
+    void pendingUpdateTimerFired();
+    void clearPendingUpdate();
+
     Document& m_document;
     ShadowRoot* m_shadowRoot { nullptr };
 
@@ -168,6 +171,8 @@
     Vector<RefPtr<StyleSheet>> m_styleSheetsForStyleSheetList;
     Vector<RefPtr<CSSStyleSheet>> m_activeStyleSheets;
 
+    Timer m_pendingUpdateTimer;
+
     mutable std::unique_ptr<HashSet<const CSSStyleSheet*>> m_weakCopyOfActiveStyleSheetListForFastLookup;
 
     // Track the currently loading top-level stylesheets needed for rendering.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to