Title: [280112] trunk/Source/WebCore
- Revision
- 280112
- Author
- za...@apple.com
- Date
- 2021-07-20 16:27:32 -0700 (Tue, 20 Jul 2021)
Log Message
Revert r272370: It delays first paint
https://bugs.webkit.org/show_bug.cgi?id=228121
<rdar://75362363>
Reviewed by Antti Koivisto.
r272370 breaks the cases when the rendering update is initiated when the layer tree is still frozen (circular dependency: visually empty check vs. rendering update)
* dom/Document.cpp:
(WebCore::Document::didInsertInDocumentShadowRoot):
* dom/Element.cpp:
(WebCore::Element::isVisibleWithoutResolvingFullStyle const):
* style/StyleScope.cpp:
(WebCore::Style::Scope::Scope):
(WebCore::Style::Scope::flushPendingSelfUpdate):
(WebCore::Style::Scope::clearPendingUpdate):
(WebCore::Style::Scope::scheduleUpdate):
(WebCore::Style::Scope::pendingUpdateTimerFired):
(WebCore::Style::Scope::insertedInDocument): Deleted.
* style/StyleScope.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (280111 => 280112)
--- trunk/Source/WebCore/ChangeLog 2021-07-20 23:20:32 UTC (rev 280111)
+++ trunk/Source/WebCore/ChangeLog 2021-07-20 23:27:32 UTC (rev 280112)
@@ -1,3 +1,26 @@
+2021-07-20 Alan Bujtas <za...@apple.com>
+
+ Revert r272370: It delays first paint
+ https://bugs.webkit.org/show_bug.cgi?id=228121
+ <rdar://75362363>
+
+ Reviewed by Antti Koivisto.
+
+ r272370 breaks the cases when the rendering update is initiated when the layer tree is still frozen (circular dependency: visually empty check vs. rendering update)
+
+ * dom/Document.cpp:
+ (WebCore::Document::didInsertInDocumentShadowRoot):
+ * dom/Element.cpp:
+ (WebCore::Element::isVisibleWithoutResolvingFullStyle const):
+ * style/StyleScope.cpp:
+ (WebCore::Style::Scope::Scope):
+ (WebCore::Style::Scope::flushPendingSelfUpdate):
+ (WebCore::Style::Scope::clearPendingUpdate):
+ (WebCore::Style::Scope::scheduleUpdate):
+ (WebCore::Style::Scope::pendingUpdateTimerFired):
+ (WebCore::Style::Scope::insertedInDocument): Deleted.
+ * style/StyleScope.h:
+
2021-07-20 Myles C. Maxfield <mmaxfi...@apple.com>
REGRESSION(r272379): Characters with no fonts that support them are drawn as two .notdef glyphs in the fast text codepath
Modified: trunk/Source/WebCore/dom/Document.cpp (280111 => 280112)
--- trunk/Source/WebCore/dom/Document.cpp 2021-07-20 23:20:32 UTC (rev 280111)
+++ trunk/Source/WebCore/dom/Document.cpp 2021-07-20 23:27:32 UTC (rev 280112)
@@ -8116,7 +8116,6 @@
ASSERT(shadowRoot.isConnected());
ASSERT(!m_inDocumentShadowRoots.contains(&shadowRoot));
m_inDocumentShadowRoots.add(&shadowRoot);
- shadowRoot.styleScope().insertedInDocument();
}
void Document::didRemoveInDocumentShadowRoot(ShadowRoot& shadowRoot)
Modified: trunk/Source/WebCore/dom/Element.cpp (280111 => 280112)
--- trunk/Source/WebCore/dom/Element.cpp 2021-07-20 23:20:32 UTC (rev 280111)
+++ trunk/Source/WebCore/dom/Element.cpp 2021-07-20 23:27:32 UTC (rev 280112)
@@ -3459,7 +3459,6 @@
bool Element::isVisibleWithoutResolvingFullStyle() const
{
- document().styleScope().flushPendingUpdate();
if (renderStyle() || hasValidStyle())
return renderStyle() && renderStyle()->visibility() == Visibility::Visible;
Modified: trunk/Source/WebCore/style/StyleScope.cpp (280111 => 280112)
--- trunk/Source/WebCore/style/StyleScope.cpp 2021-07-20 23:20:32 UTC (rev 280111)
+++ trunk/Source/WebCore/style/StyleScope.cpp 2021-07-20 23:27:32 UTC (rev 280112)
@@ -61,6 +61,7 @@
Scope::Scope(Document& document)
: m_document(document)
+ , m_pendingUpdateTimer(*this, &Scope::pendingUpdateTimerFired)
{
}
@@ -67,6 +68,7 @@
Scope::Scope(ShadowRoot& shadowRoot)
: m_document(shadowRoot.documentScope())
, m_shadowRoot(&shadowRoot)
+ , m_pendingUpdateTimer(*this, &Scope::pendingUpdateTimerFired)
{
}
@@ -601,7 +603,8 @@
ASSERT(m_pendingUpdate);
auto updateType = *m_pendingUpdate;
- m_pendingUpdate = { };
+
+ clearPendingUpdate();
updateActiveStyleSheets(updateType);
}
@@ -615,6 +618,12 @@
m_hasDescendantWithPendingUpdate = false;
}
+void Scope::clearPendingUpdate()
+{
+ m_pendingUpdateTimer.stop();
+ m_pendingUpdate = { };
+}
+
void Scope::scheduleUpdate(UpdateType update)
{
if (update == UpdateType::ContentsOrInterpretation) {
@@ -634,16 +643,9 @@
documentScope().m_hasDescendantWithPendingUpdate = true;
}
- m_document.scheduleRenderingUpdate({ });
-}
-
-void Scope::insertedInDocument()
-{
- if (!m_pendingUpdate)
+ if (m_pendingUpdateTimer.isActive())
return;
-
- documentScope().m_hasDescendantWithPendingUpdate = true;
- m_document.scheduleRenderingUpdate({ });
+ m_pendingUpdateTimer.startOneShot(0_s);
}
void Scope::evaluateMediaQueriesForViewportChange()
@@ -753,6 +755,11 @@
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 (280111 => 280112)
--- trunk/Source/WebCore/style/StyleScope.h 2021-07-20 23:20:32 UTC (rev 280111)
+++ trunk/Source/WebCore/style/StyleScope.h 2021-07-20 23:27:32 UTC (rev 280112)
@@ -28,6 +28,7 @@
#pragma once
#include "StyleScopeOrdinal.h"
+#include "Timer.h"
#include <memory>
#include <wtf/CheckedPtr.h>
#include <wtf/FastMalloc.h>
@@ -105,7 +106,6 @@
bool hasPendingUpdate() const { return m_pendingUpdate || m_hasDescendantWithPendingUpdate; }
void flushPendingUpdate();
- void insertedInDocument();
#if ENABLE(XSLT)
Vector<Ref<ProcessingInstruction>> collectXSLTransforms();
@@ -163,6 +163,9 @@
using ResolverSharingKey = std::tuple<Vector<RefPtr<StyleSheetContents>>, bool, bool>;
ResolverSharingKey makeResolverSharingKey();
+ void pendingUpdateTimerFired();
+ void clearPendingUpdate();
+
Document& m_document;
ShadowRoot* m_shadowRoot { nullptr };
@@ -171,6 +174,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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes