The rects returned by Element/Range.getClientRects() should not be rounded
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 May 2017 05:41:28 +0000 (05:41 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 May 2017 05:41:28 +0000 (05:41 +0000)
commitc69f4e230d7db0f1ed1e5da4bdef82334145eea1
tree17324d10e94b3de796b48990018b17c4c7bbf5fe
parent05cd3c585566ce797745e6af7357545f9db40830
The rects returned by Element/Range.getClientRects() should not be rounded
https://bugs.webkit.org/show_bug.cgi?id=172057

Reviewed by Chris Dumez.

Source/WebCore:

Fix createDOMRectVector() to not expand the rects to integer boundaries (which
quad.enclosingBoundingBox() does), but to return rects with floating point
values. This matches Chrome and Firefox, and matches getBoundingClientRect(),
which does not integral snap.

* dom/DOMRect.cpp:
(WebCore::createDOMRectVector):

LayoutTests:

Fix tests that were sensitive to rounding. I had to mark fast/text/multiglyph-characters.html
as failing (webkit.org/b/172056).

* TestExpectations:
* fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll.html:
* fast/dom/Range/getClientRects-expected.txt:
* fast/dom/Range/getClientRects.html:
* fast/dom/Range/simple-line-layout-getclientrects-expected.html:
* fast/dom/Range/simple-line-layout-getclientrects.html:
* fast/visual-viewport/client-rects-relative-to-layout-viewport-expected.txt:
* platform/ios/TestExpectations:
* platform/ios/fast/multicol/client-rects-expected.txt:
* platform/ios/fast/multicol/client-rects-spanners-complex-expected.txt:
* platform/ios/fast/multicol/client-rects-spanners-expected.txt:
* platform/ios/fast/multicol/newmulticol/client-rects-expected.txt:
* platform/ios/fast/transforms/bounding-rect-zoom-expected.txt:
* platform/mac/fast/multicol/client-rects-expected.txt:
* platform/mac/fast/multicol/client-rects-spanners-complex-expected.txt:
* platform/mac/fast/multicol/client-rects-spanners-expected.txt:
* platform/mac/fast/multicol/newmulticol/client-rects-expected.txt:
* platform/mac/fast/transforms/bounding-rect-zoom-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll.html
LayoutTests/fast/dom/Range/getClientRects-expected.txt
LayoutTests/fast/dom/Range/getClientRects.html
LayoutTests/fast/dom/Range/simple-line-layout-getclientrects-expected.html
LayoutTests/fast/dom/Range/simple-line-layout-getclientrects.html
LayoutTests/fast/visual-viewport/client-rects-relative-to-layout-viewport-expected.txt
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/ios/fast/multicol/client-rects-expected.txt
LayoutTests/platform/ios/fast/multicol/client-rects-spanners-complex-expected.txt
LayoutTests/platform/ios/fast/multicol/client-rects-spanners-expected.txt
LayoutTests/platform/ios/fast/multicol/newmulticol/client-rects-expected.txt
LayoutTests/platform/ios/fast/transforms/bounding-rect-zoom-expected.txt
LayoutTests/platform/mac/fast/multicol/client-rects-expected.txt
LayoutTests/platform/mac/fast/multicol/client-rects-spanners-complex-expected.txt
LayoutTests/platform/mac/fast/multicol/client-rects-spanners-expected.txt
LayoutTests/platform/mac/fast/multicol/newmulticol/client-rects-expected.txt
LayoutTests/platform/mac/fast/transforms/bounding-rect-zoom-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/DOMRect.cpp