Changeset 143073 in webkit


Ignore:
Timestamp:
Feb 15, 2013 5:05:20 PM (11 years ago)
Author:
Simon Fraser
Message:

Constrain fixed layers to the viewport, not the document
https://bugs.webkit.org/show_bug.cgi?id=109646

Source/WebCore:

Reviewed by Beth Dakin.

It's bad to constrain position:fixed compositing layers to the
document rect, because their bounds will change every time the scroll
position changes, and we're not good currently at synchronizing scrolling
thread layer updates with main thread layer updates, so jiggles ensue.

Fix by constraining position:fixed layers to the viewport.

Test: compositing/geometry/limit-layer-bounds-fixed.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateCompositedBounds):

LayoutTests:

Reviewed by Beth Dakin.

Test with a big fixed element in a compositing layer.

  • compositing/geometry/limit-layer-bounds-fixed-expected.txt: Added.
  • compositing/geometry/limit-layer-bounds-fixed.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143070 r143073  
     12013-02-15  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Constrain fixed layers to the viewport, not the document
     4        https://bugs.webkit.org/show_bug.cgi?id=109646
     5
     6        Reviewed by Beth Dakin.
     7       
     8        Test with a big fixed element in a compositing layer.
     9
     10        * compositing/geometry/limit-layer-bounds-fixed-expected.txt: Added.
     11        * compositing/geometry/limit-layer-bounds-fixed.html: Added.
     12
    1132013-02-15  Simon Fraser  <simon.fraser@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r143072 r143073  
     12013-02-15  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Constrain fixed layers to the viewport, not the document
     4        https://bugs.webkit.org/show_bug.cgi?id=109646
     5
     6        Reviewed by Beth Dakin.
     7       
     8        It's bad to constrain position:fixed compositing layers to the
     9        document rect, because their bounds will change every time the scroll
     10        position changes, and we're not good currently at synchronizing scrolling
     11        thread layer updates with main thread layer updates, so jiggles ensue.
     12       
     13        Fix by constraining position:fixed layers to the viewport.
     14
     15        Test: compositing/geometry/limit-layer-bounds-fixed.html
     16
     17        * rendering/RenderLayerBacking.cpp:
     18        (WebCore::RenderLayerBacking::updateCompositedBounds):
     19
    1202013-02-13  Jer Noble  <jer.noble@apple.com>
    221
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r142984 r143073  
    406406        RenderLayer* rootLayer = view->layer();
    407407
    408         // Start by clipping to the document's bounds.
    409         LayoutRect clippingBounds = view->unscaledDocumentRect();
     408        LayoutRect clippingBounds;
     409        if (renderer()->style()->position() == FixedPosition && renderer()->container() == view)
     410            clippingBounds = view->frameView()->viewportConstrainedVisibleContentRect();
     411        else
     412            clippingBounds = view->unscaledDocumentRect();
    410413
    411414        if (m_owningLayer != rootLayer)
Note: See TracChangeset for help on using the changeset viewer.