Incorrect position of layers for fixed position elements when page is scaled smaller...
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2012 23:22:05 +0000 (23:22 +0000)
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2012 23:22:05 +0000 (23:22 +0000)
commit1e89ef8f2dad401b20326e2162ace7e036510ba2
treea12f238c12795d909067b58c688cebcfe522525b
parent0d8b712304b1981bdb86b83608425eff20e8d03e
Incorrect position of layers for fixed position elements when page is scaled smaller than viewport
https://bugs.webkit.org/show_bug.cgi?id=104294

Reviewed by James Robinson.

Source/WebCore:

Fixed issue in scrollOffsetForFixedPosition when contentRect is smaller than visibleContentRect.
This happens when a page originally bigger than viewport is scaled down to smaller than the viewport.

Test: compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::fixedPositionScrollOffset): Moved common code in scrollOffsetForFixedPosition here. Fixed issue when contentsSize < visibleContentSize.
(WebCore::scrollOffsetForFixedPosition):

LayoutTests:

Test the case that a page containing a composited fixed position element originally bigger than the viewport
is scaled down to be smaller than the viewport.

* compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html: Added.
* compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport-expected.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137368 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport-expected.html [new file with mode: 0644]
LayoutTests/compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp