Skip to content
  • yael.aharon@nokia.com's avatar
    [Qt][WK2] Fixed elements position is wrong after zooming. · a848c9d3
    yael.aharon@nokia.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@114249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    a848c9d3