Changeset 158934 in webkit


Ignore:
Timestamp:
Nov 8, 2013 11:38:58 AM (10 years ago)
Author:
Simon Fraser
Message:

Left sidebar on cubic-bezier.com flickers
https://bugs.webkit.org/show_bug.cgi?id=123128

Source/WebCore:

Reviewed by Dean Jackson.

The logic that determined whether position:fixed elements outside the viewport
should be composited was incorrect if the fixed element also had a transform.

layer.calculateLayerBounds() only takes into account painted transforms (since they
affect layer bounds). So we need to compute the bounds relative to the layer
itself, then use localToContainerQuad() to map them to document coordinates,
but only to the RenderView so that we don't hit the page scale transform.

Tests: compositing/layer-creation/fixed-position-transformed-into-view.html

compositing/layer-creation/fixed-position-transformed-outside-view.html

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::requiresCompositingForPosition):

LayoutTests:

Reviewed by Dean Jackson.

Tests with transformed, fixed elements which dump the layer tree to see
which layers get composited.

  • compositing/layer-creation/fixed-position-transformed-into-view-expected.txt: Added.
  • compositing/layer-creation/fixed-position-transformed-into-view.html: Added.
  • compositing/layer-creation/fixed-position-transformed-outside-view-expected.txt: Added.
  • compositing/layer-creation/fixed-position-transformed-outside-view.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r158932 r158934  
     12013-11-08  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Left sidebar on cubic-bezier.com flickers
     4        https://bugs.webkit.org/show_bug.cgi?id=123128
     5
     6        Reviewed by Dean Jackson.
     7       
     8        Tests with transformed, fixed elements which dump the layer tree to see
     9        which layers get composited.
     10
     11        * compositing/layer-creation/fixed-position-transformed-into-view-expected.txt: Added.
     12        * compositing/layer-creation/fixed-position-transformed-into-view.html: Added.
     13        * compositing/layer-creation/fixed-position-transformed-outside-view-expected.txt: Added.
     14        * compositing/layer-creation/fixed-position-transformed-outside-view.html: Added.
     15
    1162013-11-08  Oliver Hunt  <oliver@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r158931 r158934  
     12013-11-08  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Left sidebar on cubic-bezier.com flickers
     4        https://bugs.webkit.org/show_bug.cgi?id=123128
     5
     6        Reviewed by Dean Jackson.
     7       
     8        The logic that determined whether position:fixed elements outside the viewport
     9        should be composited was incorrect if the fixed element also had a transform.
     10       
     11        layer.calculateLayerBounds() only takes into account painted transforms (since they
     12        affect layer bounds). So we need to compute the bounds relative to the layer
     13        itself, then use localToContainerQuad() to map them to document coordinates,
     14        but only to the RenderView so that we don't hit the page scale transform.
     15
     16        Tests: compositing/layer-creation/fixed-position-transformed-into-view.html
     17               compositing/layer-creation/fixed-position-transformed-outside-view.html
     18
     19        * rendering/RenderLayerCompositor.cpp:
     20        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
     21
    1222013-11-08  Martin Robinson  <mrobinson@igalia.com>
    223
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r158859 r158934  
    23382338    // Fixed position elements that are invisible in the current view don't get their own layer.
    23392339    LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect();
    2340     LayoutRect layerBounds = layer.calculateLayerBounds(&rootRenderLayer(), 0, RenderLayer::DefaultCalculateLayerBoundsFlags
     2340    LayoutRect layerBounds = layer.calculateLayerBounds(&layer, 0, RenderLayer::UseLocalClipRectIfPossible | RenderLayer::IncludeLayerFilterOutsets | RenderLayer::UseFragmentBoxes
    23412341        | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask | RenderLayer::IncludeCompositedDescendants);
    2342     if (!viewBounds.intersects(enclosingIntRect(layerBounds))) {
     2342    // Map to m_renderView to ignore page scale.
     2343    FloatRect absoluteBounds = layer.renderer().localToContainerQuad(FloatRect(layerBounds), &m_renderView).boundingBox();
     2344    if (!viewBounds.intersects(enclosingIntRect(absoluteBounds))) {
    23432345        if (viewportConstrainedNotCompositedReason)
    23442346            *viewportConstrainedNotCompositedReason = RenderLayer::NotCompositedForBoundsOutOfView;
Note: See TracChangeset for help on using the changeset viewer.