Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1141)

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 2534863002: Introduce markAllTreeScopesDirty. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/StyleEngine.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
index c6e26bdeee1bb3d2796820e628e284466a09e835..fb1be1e4cc2949ffd99343fe1d90da385d0afb91 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -255,14 +255,12 @@ void StyleEngine::watchedSelectorsChanged() {
StyleChangeReason::DeclarativeContent));
}
-bool StyleEngine::shouldUpdateDocumentStyleSheetCollection(
- StyleResolverUpdateMode updateMode) const {
- return m_documentScopeDirty || updateMode == FullStyleUpdate;
+bool StyleEngine::shouldUpdateDocumentStyleSheetCollection() const {
+ return m_allTreeScopesDirty || m_documentScopeDirty;
}
-bool StyleEngine::shouldUpdateShadowTreeStyleSheetCollection(
- StyleResolverUpdateMode updateMode) const {
- return !m_dirtyTreeScopes.isEmpty() || updateMode == FullStyleUpdate;
+bool StyleEngine::shouldUpdateShadowTreeStyleSheetCollection() const {
+ return m_allTreeScopesDirty || !m_dirtyTreeScopes.isEmpty();
}
void StyleEngine::mediaQueryAffectingValueChanged(
@@ -320,13 +318,13 @@ void StyleEngine::updateActiveStyleSheets(StyleResolverUpdateMode updateMode) {
TRACE_EVENT0("blink,blink_style", "StyleEngine::updateActiveStyleSheets");
- if (shouldUpdateDocumentStyleSheetCollection(updateMode))
+ if (shouldUpdateDocumentStyleSheetCollection())
documentStyleSheetCollection().updateActiveStyleSheets(*this, updateMode);
- if (shouldUpdateShadowTreeStyleSheetCollection(updateMode)) {
+ if (shouldUpdateShadowTreeStyleSheetCollection()) {
UnorderedTreeScopeSet treeScopesRemoved;
- if (updateMode == FullStyleUpdate) {
+ if (m_allTreeScopesDirty) {
for (TreeScope* treeScope : m_activeTreeScopes)
updateActiveStyleSheetsInShadow(updateMode, treeScope,
treeScopesRemoved);
@@ -343,6 +341,7 @@ void StyleEngine::updateActiveStyleSheets(StyleResolverUpdateMode updateMode) {
m_dirtyTreeScopes.clear();
m_documentScopeDirty = false;
+ m_allTreeScopesDirty = false;
}
void StyleEngine::updateActiveStyleSheets() {
@@ -527,6 +526,8 @@ void StyleEngine::resolverChanged(StyleResolverUpdateMode mode) {
return;
}
+ if (mode == FullStyleUpdate)
+ markAllTreeScopesDirty();
m_didCalculateResolver = true;
updateActiveStyleSheets(mode);
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/dom/StyleEngineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698