[Extra zoom mode] fast/viewport/extrazoom/viewport-change-min-device-width.html somet...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 May 2018 23:15:49 +0000 (23:15 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 May 2018 23:15:49 +0000 (23:15 +0000)
commitd60c99bce890cfd08a551f4b030508bfa8311080
tree926579b960405ca66b2e7a8e09589e0c02c07d04
parent51b8d5e2f338d0b18296af427aca7d841daee490
[Extra zoom mode] fast/viewport/extrazoom/viewport-change-min-device-width.html sometimes fails
https://bugs.webkit.org/show_bug.cgi?id=185490
<rdar://problem/40097629>

Reviewed by Tim Horton.

This test is currently flaky due to incorrect logic when computing the unobscured content rect, in the slice of
time after a frame load has been committed, and before the first visible content rect update from the UI process
after the frame load has been committed.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::viewportConfigurationChanged):

In the case where !m_hasReceivedVisibleContentRectsAfterDidCommitLoad, we try to set the unobscured content size
to be the view size divided by the initial scale. However, in extra zoom mode, `ViewportConfiguration`'s
`minimumLayoutSize()` is the layout size, which is larger than the size of the view by default, so dividing this
by the initial scale yields a bogus value. Instead, use `viewLayoutSize()` instead.

(WebKit::WebPage::updateViewportSizeForCSSViewportUnits):

We also try to divide the view size by the initial scale when computing the effective viewport size for `vw` and
`vh`. Additionally, fix the misleading name of a variable (largestUnobscuredRect) that stores a size.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm