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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngine.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/StyleEngine.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
index 8d064daae7b4616bf5b20da5bfe97e7391e6d664..6ff6b18a295c537935e2ef94d45f731e93831b29 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -37,6 +37,7 @@
#include "core/css/StyleSheetContents.h"
#include "core/css/invalidation/InvalidationSet.h"
#include "core/css/resolver/ScopedStyleResolver.h"
+#include "core/css/resolver/ViewportStyleResolver.h"
#include "core/dom/DocumentStyleSheetCollector.h"
#include "core/dom/Element.h"
#include "core/dom/ElementTraversal.h"
@@ -393,6 +394,8 @@ void StyleEngine::shadowRootRemovedFromDocument(ShadowRoot* shadowRoot) {
void StyleEngine::appendActiveAuthorStyleSheets() {
DCHECK(isMaster());
+ documentStyleSheetCollection().updateViewport();
+
m_resolver->appendAuthorStyleSheets(
documentStyleSheetCollection().activeAuthorStyleSheets());
for (TreeScope* treeScope : m_activeTreeScopes) {
@@ -442,6 +445,7 @@ void StyleEngine::clearMasterResolver() {
void StyleEngine::didDetach() {
clearResolver();
+ m_viewportResolver.clear();
}
bool StyleEngine::shouldClearResolver() const {
@@ -499,6 +503,12 @@ void StyleEngine::removeFontFaceRules(
m_resolver->invalidateMatchedPropertiesCache();
}
+ViewportStyleResolver& StyleEngine::ensureViewportStyleResolver() {
+ if (!m_viewportResolver)
+ m_viewportResolver = ViewportStyleResolver::create(m_document);
+ return *m_viewportResolver.get();
+}
+
void StyleEngine::markTreeScopeDirty(TreeScope& scope) {
if (scope == m_document) {
markDocumentDirty();
@@ -947,6 +957,12 @@ void StyleEngine::ensureFullscreenUAStyle() {
m_resolver->resetRuleFeatures();
}
+void StyleEngine::initialViewportChanged() {
+ if (m_viewportResolver &&
+ m_viewportResolver->isAffectedByInitialViewportChange())
+ updateViewport();
+}
+
DEFINE_TRACE(StyleEngine) {
visitor->trace(m_document);
visitor->trace(m_injectedAuthorStyleSheets);
@@ -954,6 +970,7 @@ DEFINE_TRACE(StyleEngine) {
visitor->trace(m_documentStyleSheetCollection);
visitor->trace(m_styleSheetCollectionMap);
visitor->trace(m_resolver);
+ visitor->trace(m_viewportResolver);
visitor->trace(m_styleInvalidator);
visitor->trace(m_dirtyTreeScopes);
visitor->trace(m_activeTreeScopes);
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/dom/StyleEngineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698