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

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

Issue 2424823002: Implement collection of @viewport rules from DocumentStyleCollection. (Closed)
Patch Set: Rebased. 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8ab9f07dee602a2292951304a3cb6f7126be80ff..1a8d918e5ebdfe41a5d9fe729260ee80f7e3b7d0 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,4 +131,22 @@ void DocumentStyleSheetCollection::updateActiveStyleSheets(
collection->dispose();
}
+void DocumentStyleSheetCollection::collectViewportRules(
+ ViewportStyleResolver& viewportResolver) {
+ 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;
+ viewportResolver.collectViewportRulesFromAuthorSheet(
+ *toCSSStyleSheet(sheet));
+ }
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698