[Qt][WK2] Fixed elements position is wrong after zooming.
authoryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 14:05:42 +0000 (14:05 +0000)
committeryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 14:05:42 +0000 (14:05 +0000)
commitaea99ef2a607f592ebbd7427f1a6a3cc8d22c461
treed3bfc3b6947f9ba922864e49132f4c62405a7b0f
parent0129c9fe4d893e06d0d1d66f09421d2a674e0e37
[Qt][WK2] Fixed elements position is wrong after zooming.
https://bugs.webkit.org/show_bug.cgi?id=83981

Reviewed by Kenneth Rohde Christiansen.

.:

* ManualTests/remove-add-fixed-position.html: Added.

Source/WebCore:

When setFixedVisibleContentRect is called we mark all fixed elements in the frame for layout.
In order to find these elements, RenderView maintains a list of fixed elements.
They are added and removed at the same time that they are added and removed from their parent RenderBlock.
The idea is taken from the iOS5.1 branch, at opensource.apple.com.
Added a manual test that allows removing and adding fixed elements at will.

* page/FrameView.cpp:
(WebCore::FrameView::setFixedVisibleContentRect):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::insertPositionedObject):
(WebCore::RenderBlock::removePositionedObject):
* rendering/RenderView.cpp:
(WebCore::RenderView::setFixedPositionedObjectsNeedLayout):
(WebCore):
(WebCore::RenderView::insertFixedPositionedObject):
(WebCore::RenderView::removeFixedPositionedObject):
* rendering/RenderView.h:
(RenderView):

Source/WebKit2:

Turn on the flag setFixedElementsLayoutRelativeToFrame. This causes fixed elements position to be calculated based on
visibleWidth and visibleHeight. When zoom level grows, the visibleWidth and visibleHeight become smaller.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setResizesToContentsUsingLayoutSize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ChangeLog
ManualTests/remove-add-fixed-position.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp