Restrict conditions when the page's viewport meta overrides setInitialScale

1. The initial scale provided must be <= 100%. Larger scales are never got
overridden. On Blink side, this means that
m_userAgentConstraints.initialScale * deviceScaleFactor <= 1.0f

2. m_pageDefinedConstraints.initialScale can be reset in loadWithOverviewMode
handling code when adjustForAndroidWebViewQuirks is called from inside
WebViewImpl::Resize flow, and the viewport meta tag hasn't been parsed yet.
So check the original updated scale value instead of the one adjusted inside
adjustForAndroidWebViewQuirks.

3. Since width=320 is transformed into width=device-width, no additional check
for 320 is needed.

4. Also, re-layout in case userAgentInitialScale has been reset.
This prevents eBay ads pages from regressing.

Bug: 11283805

Corresponding CL upstream: http://crrev.com/55073002

[Android WebView] Add a quirk to clobber initial scale in certain cases

In the following cases, the viewport meta tag would take precedence over
the value specified in setInitialPageScaleOverride:

The value provided to setInitialPageScaleOverride is <= 1 / device pixel ratio AND

- viewport meta has width=device-width OR

- viewport meta has auto width, and the page would be displayed at 100% scale.

BUG=313754

Change-Id: I7e82617c395ba1dd66494b1ee2a43aa2904b8ab7
2 files changed