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

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

Issue 23742003: Use css-device-adapt constraining for legacy viewport tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review issue: one assignent per line/statement 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
« no previous file with comments | « Source/core/css/resolver/ViewportStyleResolver.h ('k') | Source/core/css/xhtmlmp.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/ViewportStyleResolver.cpp
diff --git a/Source/core/css/resolver/ViewportStyleResolver.cpp b/Source/core/css/resolver/ViewportStyleResolver.cpp
index 250edd19cab1e0f5ed4baee47a93766eccb40976..f38f7d78060e3820d8a3cfbfe6a31d572e1e7795 100644
--- a/Source/core/css/resolver/ViewportStyleResolver.cpp
+++ b/Source/core/css/resolver/ViewportStyleResolver.cpp
@@ -40,7 +40,8 @@
namespace WebCore {
ViewportStyleResolver::ViewportStyleResolver(Document* document)
- : m_document(document)
+ : m_document(document),
+ m_hasAuthorStyle(false)
{
ASSERT(m_document);
}
@@ -78,19 +79,14 @@ void ViewportStyleResolver::resolve()
if (!m_document)
return;
- if (!m_propertySet) {
- // FIXME: This is not entirely correct. If the doctype is XHTML MP, or there is a Meta
- // element for setting the viewport, the viewport arguments should fall back to those
- // settings when the @viewport rules are all removed. For now, reset to implicit when
- // there was an @viewport rule which has now been removed.
- if (m_document->viewportArguments().type == ViewportArguments::CSSDeviceAdaptation) {
- m_document->setViewportArguments(ViewportArguments());
- m_document->updateViewportArguments();
- }
+ if (!m_propertySet || (!m_hasAuthorStyle && m_document->hasLegacyViewportTag())) {
+ ASSERT(!m_hasAuthorStyle);
+ m_propertySet = 0;
+ m_document->setViewportArguments(ViewportArguments());
return;
}
- ViewportArguments arguments(ViewportArguments::CSSDeviceAdaptation);
+ ViewportArguments arguments(m_hasAuthorStyle ? ViewportArguments::AuthorStyleSheet : ViewportArguments::UserAgentStyleSheet);
arguments.userZoom = viewportArgumentValue(CSSPropertyUserZoom);
arguments.zoom = viewportArgumentValue(CSSPropertyZoom);
@@ -103,9 +99,9 @@ void ViewportStyleResolver::resolve()
arguments.orientation = viewportArgumentValue(CSSPropertyOrientation);
m_document->setViewportArguments(arguments);
- m_document->updateViewportArguments();
m_propertySet = 0;
+ m_hasAuthorStyle = false;
}
float ViewportStyleResolver::viewportArgumentValue(CSSPropertyID id) const
« no previous file with comments | « Source/core/css/resolver/ViewportStyleResolver.h ('k') | Source/core/css/xhtmlmp.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698