On macOS, getBoundingClientRect gives incorrect values when pinch-zoomed
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 19:53:08 +0000 (19:53 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 19:53:08 +0000 (19:53 +0000)
commit857cd829997a692f30df218e74c6c3e17fcbcbe3
tree00d9162d987f66eebe7d763875ec6eeb1357836d
parentbd0699d126fa1bc937bd8bee3a14dd14447a66eb
On macOS, getBoundingClientRect gives incorrect values when pinch-zoomed
https://bugs.webkit.org/show_bug.cgi?id=181511
rdar://problem/33741427

Reviewed by Zalan Bujtas.
Source/WebCore:

When reverting "client coordinates are relative to layout viewport" in r219829
I broke documentToClientOffset() on macOS by failing to take pinch zoom scale into
account (frameScaleFactor() is always 1 on iOs, so this bug doesn't manifest there).

Covered by existing tests.

* page/FrameView.cpp:
(WebCore::FrameView::documentToClientOffset const):

LayoutTests:

New results in tests that get client coordinates after zooming.

* fast/visual-viewport/client-coordinates-relative-to-layout-viewport-expected.txt:
* fast/visual-viewport/client-rects-relative-to-layout-viewport-expected.txt:
* fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html:
* fast/visual-viewport/zoomed-fixed-expected.txt:
* fast/visual-viewport/zoomed-fixed-header-and-footer-expected.txt:
* fast/zooming/client-rect-in-fixed-zoomed-expected.txt:
* fast/zooming/client-rect-in-fixed-zoomed.html: Change the test to create passing results.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/visual-viewport/client-coordinates-relative-to-layout-viewport-expected.txt
LayoutTests/fast/visual-viewport/client-rects-relative-to-layout-viewport-expected.txt
LayoutTests/fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html
LayoutTests/fast/visual-viewport/zoomed-fixed-expected.txt
LayoutTests/fast/visual-viewport/zoomed-fixed-header-and-footer-expected.txt
LayoutTests/fast/zooming/client-rect-in-fixed-zoomed-expected.txt
LayoutTests/fast/zooming/client-rect-in-fixed-zoomed.html
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp