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 |