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

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 979033003: Move code from StyleResolver to ViewportStyleResolver. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 5 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
« no previous file with comments | « Source/core/css/resolver/ScopedStyleResolver.cpp ('k') | Source/core/css/resolver/ViewportStyleResolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 86ccd8315df8dc70f0c6594c746d380c713d887f..9608e73c3383553d8695135462280587633c8705 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -217,7 +217,7 @@ void StyleResolver::finishAppendAuthorStyleSheets()
if (document().layoutView() && document().layoutView()->style())
document().layoutView()->style()->font().update(document().styleEngine().fontSelector());
- collectViewportRules();
+ m_viewportStyleResolver->collectViewportRules();
document().styleEngine().resetCSSFeatureFlags(m_features);
}
@@ -245,9 +245,10 @@ void StyleResolver::resetAuthorStyle(TreeScope& treeScope)
if (!resolver)
return;
- resolver->resetAuthorStyle();
- if (treeScope.rootNode().isDocumentNode())
+ if (treeScope.rootNode().isDocumentNode()) {
+ resolver->resetAuthorStyle();
return;
+ }
// resolver is going to be freed below.
treeScope.clearScopedStyleResolver();
@@ -885,23 +886,6 @@ PassRefPtr<LayoutStyle> StyleResolver::styleForPage(int pageIndex)
return state.takeStyle();
}
-void StyleResolver::collectViewportRules()
-{
- CSSDefaultStyleSheets& defaultStyleSheets = CSSDefaultStyleSheets::instance();
- viewportStyleResolver()->collectViewportRules(defaultStyleSheets.defaultStyle(), ViewportStyleResolver::UserAgentOrigin);
-
- if (!InspectorInstrumentation::applyViewportStyleOverride(&document(), this))
- viewportStyleResolver()->collectViewportRules(defaultStyleSheets.defaultViewportStyle(), ViewportStyleResolver::UserAgentOrigin);
-
- if (document().isMobileDocument())
- viewportStyleResolver()->collectViewportRules(defaultStyleSheets.defaultXHTMLMobileProfileStyle(), ViewportStyleResolver::UserAgentOrigin);
-
- if (ScopedStyleResolver* scopedResolver = document().scopedStyleResolver())
- scopedResolver->collectViewportRulesTo(this);
-
- viewportStyleResolver()->resolve();
-}
-
PassRefPtr<LayoutStyle> StyleResolver::defaultStyleForElement()
{
RefPtr<LayoutStyle> style = LayoutStyle::create();
@@ -1320,7 +1304,7 @@ void StyleResolver::invalidateMatchedPropertiesCache()
void StyleResolver::notifyResizeForViewportUnits()
{
- collectViewportRules();
+ m_viewportStyleResolver->collectViewportRules();
m_matchedPropertiesCache.clearViewportDependent();
}
« no previous file with comments | « Source/core/css/resolver/ScopedStyleResolver.cpp ('k') | Source/core/css/resolver/ViewportStyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698