| Index: Source/core/css/resolver/ViewportStyleResolver.cpp
|
| diff --git a/Source/core/css/resolver/ViewportStyleResolver.cpp b/Source/core/css/resolver/ViewportStyleResolver.cpp
|
| index 34239374452d71ee590cdda4ac0ae685e9848c03..9ef92be215bbb201784cb9d9f55e194741e07dc4 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,17 @@ 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) {
|
| + if (!m_hasAuthorStyle && (m_document->useLegacyViewportArguments() || !m_propertySet)) {
|
| + if (!m_propertySet)
|
| m_document->setViewportArguments(ViewportArguments());
|
| - m_document->updateViewportArguments();
|
| - }
|
| + else
|
| + m_propertySet = 0;
|
| return;
|
| }
|
|
|
| - ViewportArguments arguments(ViewportArguments::CSSDeviceAdaptation);
|
| + ASSERT(m_propertySet);
|
| +
|
| + ViewportArguments arguments(m_hasAuthorStyle ? ViewportArguments::CSSDeviceAdaptation : ViewportArguments::UserAgent);
|
|
|
| arguments.userZoom = getViewportArgumentValue(CSSPropertyUserZoom);
|
| arguments.zoom = getViewportArgumentValue(CSSPropertyZoom);
|
| @@ -103,9 +102,9 @@ void ViewportStyleResolver::resolve()
|
| arguments.orientation = getViewportArgumentValue(CSSPropertyOrientation);
|
|
|
| m_document->setViewportArguments(arguments);
|
| - m_document->updateViewportArguments();
|
|
|
| m_propertySet = 0;
|
| + m_hasAuthorStyle = false;
|
| }
|
|
|
| float ViewportStyleResolver::getViewportArgumentValue(CSSPropertyID id) const
|
|
|