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

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

Issue 2405143003: Separate @viewport from other RuleSet construction. (Closed)
Patch Set: Missing resolve() Created 4 years, 2 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/DocumentStyleSheetCollection.cpp
diff --git a/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp b/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp
index 8e163a71a496a39f50e18d769632fd26e6d686de..da691ab664931fcfa25e2d705eda46a7abe7f0fe 100644
--- a/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp
+++ b/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp
@@ -29,6 +29,7 @@
#include "core/dom/DocumentStyleSheetCollection.h"
#include "core/css/resolver/StyleResolver.h"
+#include "core/css/resolver/ViewportStyleResolver.h"
#include "core/dom/Document.h"
#include "core/dom/DocumentStyleSheetCollector.h"
#include "core/dom/ProcessingInstruction.h"
@@ -130,6 +131,30 @@ void DocumentStyleSheetCollection::updateActiveStyleSheets(
collection->dispose();
}
+void DocumentStyleSheetCollection::updateViewport() {
+ ViewportStyleResolver& resolver =
+ document().styleEngine().ensureViewportStyleResolver();
+ resolver.reset();
+ resolver.collectViewportRulesFromUASheets();
+
+ if (RuntimeEnabledFeatures::cssViewportEnabled()) {
+ for (Node* node : m_styleSheetCandidateNodes) {
+ StyleSheetCandidate candidate(*node);
+
+ if (candidate.isImport())
+ continue;
+ StyleSheet* sheet = candidate.sheet();
+ if (!sheet)
+ continue;
+ if (!candidate.canBeActivated(
+ document().styleEngine().preferredStylesheetSetName()))
+ continue;
+ resolver.collectViewportRulesFromAuthorSheet(*toCSSStyleSheet(sheet));
+ }
+ }
+ resolver.resolve();
+}
+
DEFINE_TRACE_WRAPPERS(DocumentStyleSheetCollection) {
for (auto sheet : m_styleSheetsForStyleSheetList) {
visitor->traceWrappers(sheet);
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.h ('k') | third_party/WebKit/Source/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698