Changeset 143616 in webkit


Ignore:
Timestamp:
Feb 21, 2013 9:31:34 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Need to re-layout fixed position elements after scale when using settings()->fixedElementsLayoutRelativeToFrame()
https://bugs.webkit.org/show_bug.cgi?id=105486

Patch by Tien-Ren Chen <trchen@chromium.org> on 2013-02-21
Reviewed by James Robinson.

In settings()->fixedElementsLayoutRelativeToFrame() mode, fixed-position
elements are layout relative to the current visible viewport, which can
be different from the layout viewport when using fixed-layout mode.
We need to re-layout fixed-position elements in case of visible content
size changes.

The test is currently chromium-specific due to difficulties to make this
test works on Mac. The mac port seems to work very differently with
visible content size when a page is scaled. And there is no reliable way
to hide scrollbars in mac-wk1 that doesn't cause a side effect.

Source/WebCore:

Test: platform/chromium/fast/repaint/relayout-fixed-position-after-scale.html

  • page/FrameView.cpp:

(WebCore::FrameView::visibleContentsResized):

  • page/FrameView.h:

(FrameView):

  • page/Page.cpp:

(WebCore::Page::setPageScaleFactor):

LayoutTests:

  • platform/chromium/fast/repaint/relayout-fixed-position-after-scale-expected.html: Added.
  • platform/chromium/fast/repaint/relayout-fixed-position-after-scale.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143613 r143616  
     12013-02-21  Tien-Ren Chen  <trchen@chromium.org>
     2
     3        Need to re-layout fixed position elements after scale when using settings()->fixedElementsLayoutRelativeToFrame()
     4        https://bugs.webkit.org/show_bug.cgi?id=105486
     5
     6        Reviewed by James Robinson.
     7
     8        In settings()->fixedElementsLayoutRelativeToFrame() mode, fixed-position
     9        elements are layout relative to the current visible viewport, which can
     10        be different from the layout viewport when using fixed-layout mode.
     11        We need to re-layout fixed-position elements in case of visible content
     12        size changes.
     13
     14        The test is currently chromium-specific due to difficulties to make this
     15        test works on Mac. The mac port seems to work very differently with
     16        visible content size when a page is scaled. And there is no reliable way
     17        to hide scrollbars in mac-wk1 that doesn't cause a side effect.
     18
     19        * platform/chromium/fast/repaint/relayout-fixed-position-after-scale-expected.html: Added.
     20        * platform/chromium/fast/repaint/relayout-fixed-position-after-scale.html: Added.
     21
    1222013-02-21  Mihnea Ovidenie  <mihnea@adobe.com>
    223
  • trunk/Source/WebCore/ChangeLog

    r143612 r143616  
     12013-02-21  Tien-Ren Chen  <trchen@chromium.org>
     2
     3        Need to re-layout fixed position elements after scale when using settings()->fixedElementsLayoutRelativeToFrame()
     4        https://bugs.webkit.org/show_bug.cgi?id=105486
     5
     6        Reviewed by James Robinson.
     7
     8        In settings()->fixedElementsLayoutRelativeToFrame() mode, fixed-position
     9        elements are layout relative to the current visible viewport, which can
     10        be different from the layout viewport when using fixed-layout mode.
     11        We need to re-layout fixed-position elements in case of visible content
     12        size changes.
     13
     14        The test is currently chromium-specific due to difficulties to make this
     15        test works on Mac. The mac port seems to work very differently with
     16        visible content size when a page is scaled. And there is no reliable way
     17        to hide scrollbars in mac-wk1 that doesn't cause a side effect.
     18
     19        Test: platform/chromium/fast/repaint/relayout-fixed-position-after-scale.html
     20
     21        * page/FrameView.cpp:
     22        (WebCore::FrameView::visibleContentsResized):
     23        * page/FrameView.h:
     24        (FrameView):
     25        * page/Page.cpp:
     26        (WebCore::Page::setPageScaleFactor):
     27
    1282013-02-21  Xan Lopez  <xlopez@rim.com>
    229
  • trunk/Source/WebCore/page/FrameView.cpp

    r143428 r143616  
    20502050        return;
    20512051
     2052    setViewportConstrainedObjectsNeedLayout();
     2053
    20522054    if (!useFixedLayout() && needsLayout())
    20532055        layout();
  • trunk/Source/WebCore/page/FrameView.h

    r143428 r143616  
    112112    bool needsLayout() const;
    113113    void setNeedsLayout();
     114    void setViewportConstrainedObjectsNeedLayout();
    114115
    115116    bool needsFullRepaint() const { return m_doFullRepaint; }
     
    486487    bool doLayoutWithFrameFlattening(bool allowSubtree);
    487488
    488     void setViewportConstrainedObjectsNeedLayout();
    489 
    490489    virtual AXObjectCache* axObjectCache() const;
    491490    void notifyWidgetsInAllFrames(WidgetNotification);
  • trunk/Source/WebCore/page/Page.cpp

    r143428 r143616  
    749749#endif
    750750
     751    if (view)
     752        view->setViewportConstrainedObjectsNeedLayout();
     753
    751754    if (view && view->scrollPosition() != origin) {
    752755        if (!m_settings->applyPageScaleFactorInCompositor() && document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
Note: See TracChangeset for help on using the changeset viewer.