Make it possible to zoom on pages that claim to lay out to device size and then fail...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Mar 2015 19:16:20 +0000 (19:16 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Mar 2015 19:16:20 +0000 (19:16 +0000)
commita10290c0e4179e15ee989c013d6342dbe478583a
tree89c0c979c655429529bb48a3e156b81d40fdb266
parent19ff0548a21caeac02125eee9a5a706c046ff387
Make it possible to zoom on pages that claim to lay out to device size and then fail to do so
https://bugs.webkit.org/show_bug.cgi?id=142549

Reviewed by Simon Fraser.

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
Rename m_ignoreScalingConstraints to m_canIgnoreScalingConstraints,
because it being true does not guarantee that we will ignore scaling constraints,
but it being false does guarantee that we won't.

(WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
Ignore scaling constraints if the page:
    a) claimed to want to lay out to device-width and then laid out too wide
    b) claimed to want to lay out to device-height and then laid out too tall
    c) claimed to want to lay out with initialScale=1 and then laid out too wide

(WebCore::ViewportConfiguration::initialScale):
(WebCore::ViewportConfiguration::minimumScale):
(WebCore::ViewportConfiguration::allowsUserScaling):
Call shouldIgnoreScalingConstraints() instead of looking at the local, so we can
have some more logic here (as above).

(WebCore::ViewportConfiguration::description):
Dump whether we're ignoring scaling constraints.

(WebCore::ViewportConfiguration::dump):
Use WTFLogAlways so that the output goes to various other logging mechanisms
instead of just stderr.

* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints):
(WebCore::ViewportConfiguration::setIgnoreScalingConstraints): Deleted.

* Shared/WebPreferencesDefinitions.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Flip the pref on by default.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/ViewportConfiguration.cpp
Source/WebCore/page/ViewportConfiguration.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp