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

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

Issue 23185008: Reset viewport to implicit when @viewport is removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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 4480d7f47ed72473c1df70a02e517c538613d8a5..34239374452d71ee590cdda4ac0ae685e9848c03 100644
--- a/Source/core/css/resolver/ViewportStyleResolver.cpp
+++ b/Source/core/css/resolver/ViewportStyleResolver.cpp
@@ -75,9 +75,21 @@ void ViewportStyleResolver::clearDocument()
void ViewportStyleResolver::resolve()
{
- if (!m_document || !m_propertySet)
+ 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) {
kenneth.r.christiansen 2013/08/21 08:28:35 Did you test if this is also an issue after my ->@
+ m_document->setViewportArguments(ViewportArguments());
+ m_document->updateViewportArguments();
+ }
+ return;
+ }
+
ViewportArguments arguments(ViewportArguments::CSSDeviceAdaptation);
arguments.userZoom = getViewportArgumentValue(CSSPropertyUserZoom);

Powered by Google App Engine
This is Rietveld 408576698