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

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

Issue 1769903002: Move preferred stylesheet logic into StyleEngine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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 85c5bdaaa09d2adc15d196f8a1f378b406bbaa19..3cffb282c004269030573c3210599111d71a630b 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -714,6 +714,38 @@ void StyleEngine::setStatsEnabled(bool enabled)
m_styleResolverStats->reset();
}
+void StyleEngine::setPreferredStylesheetSetNameIfNotSet(const String& name)
+{
+ if (!m_preferredStylesheetSetName.isEmpty())
+ return;
+ m_preferredStylesheetSetName = name;
+ // TODO(rune@opera.com): Setting the selected set here is wrong if the set
+ // has been previously set by through Document.selectedStylesheetSet. Our
+ // current implementation ignores the effect of Document.selectedStylesheetSet
+ // and either only collects persistent style, or additionally preferred
+ // style when present. We are currently not marking the document scope dirty
+ // because preferred style is updated during active stylesheet update which
+ // would make this method re-entrant. Will need to change for async update.
+ m_selectedStylesheetSetName = name;
+}
+
+void StyleEngine::setSelectedStylesheetSetName(const String& name)
+{
+ m_selectedStylesheetSetName = name;
+ // TODO(rune@opera.com): Setting Document.selectedStylesheetSet currently
+ // has no other effect than the ability to read back the set value using
+ // the same api. If it did have an effect, we should have marked the
+ // document scope dirty and triggered an update of the active stylesheets
+ // from here.
+}
+
+void StyleEngine::setHttpDefaultStyle(const String& content)
+{
+ setPreferredStylesheetSetNameIfNotSet(content);
+ markDocumentDirty();
+ resolverChanged(FullStyleUpdate);
+}
+
DEFINE_TRACE(StyleEngine)
{
#if ENABLE(OILPAN)
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/dom/StyleSheetCandidate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698