Fix position:-webkit-sticky behavior when zoomed
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Dec 2012 18:07:56 +0000 (18:07 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Dec 2012 18:07:56 +0000 (18:07 +0000)
commit46c1c9058f78842a369b9849a9cf8f473e57d294
tree691578eddd8b56fb1206a7d3e6be710f4a75a8d5
parent6af2597e7c9a5b220f8cf29ccca5dfcf76766dae
Fix position:-webkit-sticky behavior when zoomed
https://bugs.webkit.org/show_bug.cgi?id=105251

Reviewed by Dean Jackson.

Source/WebCore:

Position sticky elements were misplaced when stickily-constrained, under zooming.
The cause was that some of the functions used to compute sticky position
took page scale into account, and some did not.

Fix by using localToContainerQuad(..., view()) to compute RenderView-relative
quads, which avoids page scale, so all the constraints math is done ignoring
page scale. This also requires that we compute a scale-free viewport rect
in stickyPositionOffset().

Test: fast/css/sticky/sticky-top-zoomed.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::computeStickyPositionConstraints):
(WebCore::RenderBoxModelObject::stickyPositionOffset):

LayoutTests:

Ref test for sticky elements in a zoomed page.

This test is marked as failing for WK1, because scrollbars always show on
zoomed pages and cannot be hidden there.

* fast/css/sticky/sticky-top-zoomed-expected.html: Added.
* fast/css/sticky/sticky-top-zoomed.html: Added.
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@138036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/sticky/sticky-top-zoomed-expected.html [new file with mode: 0644]
LayoutTests/fast/css/sticky/sticky-top-zoomed.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBoxModelObject.cpp