Changeset 168670 in webkit


Ignore:
Timestamp:
May 12, 2014, 9:32:09 PM (11 years ago)
Author:
Simon Fraser
Message:

[iOS] Fixed items are sometimes clipped after rubber-banding
https://bugs.webkit.org/show_bug.cgi?id=132851
<rdar://problem/16870790>

Reviewed by Benjamin Poulain.

On iOS fixed-position layers would get clipped to the document rect,
but with rubber-banding, we can now have a custom fixed postion rect
that extends outside the document rect.

Another issue was that we would un-composite fixed elements sometimes
when scrolling fast, again because they could fall outside of the document rect.

A final issue was that pinching could reveal parts of fixed elements that should
lie outside the viewport, rather than clipping the layers.

Fix by converting both call points to use viewportConstrainedVisibleContentRect()
rather than viewportConstrainedExtentRect(). On non-iOS platforms these are
the same, but on iOS viewportConstrainedVisibleContentRect() uses the
custom fixed position rect, which is the correct rect to intersect with.

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateCompositedBounds):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::requiresCompositingForPosition):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r168668 r168670  
     12014-05-12  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS] Fixed items are sometimes clipped after rubber-banding
     4        https://bugs.webkit.org/show_bug.cgi?id=132851
     5        <rdar://problem/16870790>
     6
     7        Reviewed by Benjamin Poulain.
     8
     9        On iOS fixed-position layers would get clipped to the document rect,
     10        but with rubber-banding, we can now have a custom fixed postion rect
     11        that extends outside the document rect.
     12       
     13        Another issue was that we would un-composite fixed elements sometimes
     14        when scrolling fast, again because they could fall outside of the document rect.
     15       
     16        A final issue was that pinching could reveal parts of fixed elements that should
     17        lie outside the viewport, rather than clipping the layers.
     18       
     19        Fix by converting both call points to use viewportConstrainedVisibleContentRect()
     20        rather than viewportConstrainedExtentRect(). On non-iOS platforms these are
     21        the same, but on iOS viewportConstrainedVisibleContentRect() uses the
     22        custom fixed position rect, which is the correct rect to intersect with.
     23
     24        * rendering/RenderLayerBacking.cpp:
     25        (WebCore::RenderLayerBacking::updateCompositedBounds):
     26        * rendering/RenderLayerCompositor.cpp:
     27        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
     28
    1292014-05-06  Jon Honeycutt  <jhoneycutt@apple.com>
    230
  • TabularUnified trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r168440 r168670  
    456456        LayoutRect clippingBounds;
    457457        if (renderer().style().position() == FixedPosition && renderer().container() == &view)
    458             clippingBounds = view.frameView().viewportConstrainedExtentRect();
     458            clippingBounds = view.frameView().viewportConstrainedVisibleContentRect();
    459459        else
    460460            clippingBounds = view.unscaledDocumentRect();
  • TabularUnified trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r168655 r168670  
    26302630
    26312631    // Fixed position elements that are invisible in the current view don't get their own layer.
    2632     LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedExtentRect();
     2632    LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect();
    26332633    LayoutRect layerBounds = layer.calculateLayerBounds(&layer, 0, RenderLayer::UseLocalClipRectIfPossible | RenderLayer::IncludeLayerFilterOutsets | RenderLayer::UseFragmentBoxes
    26342634        | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask | RenderLayer::IncludeCompositedDescendants);
Note: See TracChangeset for help on using the changeset viewer.