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

Unified Diff: Source/core/css/resolver/ScopedStyleResolver.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/ScopedStyleResolver.cpp
diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
index cb60fdc2797d8951a99328e1a12bb8ff11abd8cb..ab6755e20fdc8f70d1457d3b185aeba0c8101e63 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -34,6 +34,7 @@
#include "core/css/RuleSet.h"
#include "core/css/StyleRule.h"
#include "core/css/resolver/StyleResolver.h" // For MatchRequest.
+#include "core/css/resolver/ViewportStyleResolver.h"
#include "core/dom/Document.h"
#include "core/dom/shadow/ElementShadow.h"
#include "core/dom/shadow/ShadowRoot.h"
@@ -427,8 +428,10 @@ void ScopedStyleResolver::matchPageRules(PageRuleCollector& collector)
void ScopedStyleResolver::collectViewportRulesTo(StyleResolver* resolver) const
{
+ // Only consider the global author RuleSet for @viewport rules.
+ ASSERT(m_scopingNode.isDocumentNode());
if (m_authorStyle)
- resolver->collectViewportRules(m_authorStyle.get(), StyleResolver::AuthorOrigin);
+ resolver->viewportStyleResolver()->collectViewportRules(m_authorStyle.get(), ViewportStyleResolver::AuthorOrigin);
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698