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

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

Issue 25257003: Empty @viewport should not override legacy viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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: Source/core/css/resolver/ViewportStyleResolver.cpp
diff --git a/Source/core/css/resolver/ViewportStyleResolver.cpp b/Source/core/css/resolver/ViewportStyleResolver.cpp
index f38f7d78060e3820d8a3cfbfe6a31d572e1e7795..3d701961422c264a127efda12a6bb062d97bbd17 100644
--- a/Source/core/css/resolver/ViewportStyleResolver.cpp
+++ b/Source/core/css/resolver/ViewportStyleResolver.cpp
@@ -50,7 +50,16 @@ ViewportStyleResolver::~ViewportStyleResolver()
{
}
-void ViewportStyleResolver::addViewportRule(StyleRuleViewport* viewportRule)
+void ViewportStyleResolver::collectViewportRules(RuleSet* rules, Origin origin)
+{
+ rules->compactRulesIfNeeded();
+
+ const Vector<StyleRuleViewport*>& viewportRules = rules->viewportRules();
+ for (size_t i = 0; i < viewportRules.size(); ++i)
+ addViewportRule(viewportRules[i], origin);
+}
+
+void ViewportStyleResolver::addViewportRule(StyleRuleViewport* viewportRule, Origin origin)
{
StylePropertySet* propertySet = viewportRule->mutableProperties();
@@ -58,6 +67,9 @@ void ViewportStyleResolver::addViewportRule(StyleRuleViewport* viewportRule)
if (!propertyCount)
return;
+ if (origin == AuthorOrigin)
+ m_hasAuthorStyle = true;
+
if (!m_propertySet) {
m_propertySet = propertySet->mutableCopy();
return;

Powered by Google App Engine
This is Rietveld 408576698