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

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

Issue 2552353003: Setting preferred stylesheet simplified. (Closed)
Patch Set: Rebased. Created 4 years 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 82e9aae40c61d1999b8464dd24799f9147abb2db..3cd7785477ec9fa55318af2fd59c01549fd1176f 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -554,8 +554,7 @@ CSSStyleSheet* StyleEngine::createSheet(Element& element,
DCHECK(styleSheet);
if (!element.isInShadowTree()) {
styleSheet->setTitle(element.title());
- setPreferredStylesheetSetNameIfNotSet(element.title(),
- DontUpdateActiveSheets);
+ setPreferredStylesheetSetNameIfNotSet(element.title());
}
return styleSheet;
}
@@ -924,9 +923,7 @@ void StyleEngine::setStatsEnabled(bool enabled) {
m_styleResolverStats->reset();
}
-void StyleEngine::setPreferredStylesheetSetNameIfNotSet(
- const String& name,
- ActiveSheetsUpdate activeSheetsUpdate) {
+void StyleEngine::setPreferredStylesheetSetNameIfNotSet(const String& name) {
if (!m_preferredStylesheetSetName.isEmpty())
return;
m_preferredStylesheetSetName = name;
@@ -936,14 +933,7 @@ void StyleEngine::setPreferredStylesheetSetNameIfNotSet(
// and either only collects persistent style, or additionally preferred
// style when present.
m_selectedStylesheetSetName = name;
-
- // TODO(rune@opera.com): For async stylesheet update, we should always mark
- // the TreeScope dirty here, and the synchronous active stylesheet update
- // (resolverChanged) should go away.
- if (activeSheetsUpdate == UpdateActiveSheets) {
- markDocumentDirty();
- resolverChanged(AnalyzedStyleUpdate);
- }
+ markDocumentDirty();
}
void StyleEngine::setSelectedStylesheetSetName(const String& name) {
@@ -956,7 +946,7 @@ void StyleEngine::setSelectedStylesheetSetName(const String& name) {
}
void StyleEngine::setHttpDefaultStyle(const String& content) {
- setPreferredStylesheetSetNameIfNotSet(content, UpdateActiveSheets);
+ setPreferredStylesheetSetNameIfNotSet(content);
}
void StyleEngine::ensureUAStyleForFullscreen() {
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698