| Index: third_party/WebKit/Source/core/dom/Document.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
|
| index 3a08cfb7e1398a606ce73915bb0c1b314137e08a..83dccc328cae5b967cd24fbeec54850047387add 100644
|
| --- a/third_party/WebKit/Source/core/dom/Document.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
| @@ -3150,47 +3150,46 @@ void Document::maybeHandleHttpRefresh(const String& content, HttpRefreshType htt
|
| m_frame->navigationScheduler().scheduleRedirect(delay, refreshURL);
|
| }
|
|
|
| -bool Document::shouldMergeWithLegacyDescription(ViewportDescription::Type origin)
|
| +bool Document::shouldMergeWithLegacyDescription(ViewportDescription::Type origin) const
|
| {
|
| return settings() && settings()->viewportMetaMergeContentQuirk() && m_legacyViewportDescription.isMetaViewportType() && m_legacyViewportDescription.type == origin;
|
| }
|
|
|
| void Document::setViewportDescription(const ViewportDescription& viewportDescription)
|
| {
|
| - if (viewportDescription == m_viewportDescription)
|
| - return;
|
| -
|
| - if (settings() && !settings()->viewportMetaEnabled() && viewportDescription.isLegacyViewportType())
|
| - return;
|
| -
|
| - // The UA-defined min-width is used by the processing of legacy meta tags.
|
| - if (!viewportDescription.isSpecifiedByAuthor())
|
| - m_viewportDefaultMinWidth = viewportDescription.minWidth;
|
| -
|
| if (viewportDescription.isLegacyViewportType()) {
|
| + if (viewportDescription == m_legacyViewportDescription)
|
| + return;
|
| m_legacyViewportDescription = viewportDescription;
|
| -
|
| - // When no author style for @viewport is present, and a meta tag for defining
|
| - // the viewport is, apply the meta tag viewport instead of the UA styles.
|
| - if (m_viewportDescription.type == ViewportDescription::AuthorStyleSheet)
|
| + } else {
|
| + if (viewportDescription == m_viewportDescription)
|
| return;
|
| m_viewportDescription = viewportDescription;
|
| - } else {
|
| - // If the legacy viewport tag has higher priority than the cascaded @viewport
|
| - // descriptors, use the values from the legacy tag.
|
| - if (!shouldOverrideLegacyDescription(viewportDescription.type))
|
| - m_viewportDescription = m_legacyViewportDescription;
|
| - else
|
| - m_viewportDescription = viewportDescription;
|
| +
|
| + // The UA-defined min-width is considered specifically by Android WebView quirks mode.
|
| + if (!viewportDescription.isSpecifiedByAuthor())
|
| + m_viewportDefaultMinWidth = viewportDescription.minWidth;
|
| }
|
|
|
| updateViewportDescription();
|
| }
|
|
|
| +ViewportDescription Document::viewportDescription() const
|
| +{
|
| + ViewportDescription appliedViewportDescription = m_viewportDescription;
|
| + bool viewportMetaEnabled = settings() && settings()->viewportMetaEnabled();
|
| + if (m_legacyViewportDescription.type != ViewportDescription::UserAgentStyleSheet && viewportMetaEnabled)
|
| + appliedViewportDescription = m_legacyViewportDescription;
|
| + if (shouldOverrideLegacyDescription(m_viewportDescription.type))
|
| + appliedViewportDescription = m_viewportDescription;
|
| +
|
| + return appliedViewportDescription;
|
| +}
|
| +
|
| void Document::updateViewportDescription()
|
| {
|
| if (frame() && frame()->isMainFrame()) {
|
| - frameHost()->chromeClient().dispatchViewportPropertiesDidChange(m_viewportDescription);
|
| + frameHost()->chromeClient().dispatchViewportPropertiesDidChange(viewportDescription());
|
| }
|
| }
|
|
|
|
|