Changeset 137248 in webkit


Ignore:
Timestamp:
Dec 10, 2012, 9:54:06 PM (13 years ago)
Author:
Simon Fraser
Message:

Source/WebCore: REGRESSION (r137215): WebKit stretches and shrinks a part of screen on scroll
https://bugs.webkit.org/show_bug.cgi?id=104626

Reviewed by Beth Dakin.

r137215 removed a compositing layer repaint on size changes. However, there
are cases where the compositing code constrains layer size by clipping
with the viewport and a clipping ancestor. When that happens, we must
invalidate the layer on a size change to avoid showing stretched or
shrunken content.

Test: compositing/repaint/clipped-layer-size-change.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::updateCompositedBounds):
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):

  • rendering/RenderLayerBacking.h:

(RenderLayerBacking):

LayoutTests: REGRESSION(r137215): WebKit stretches and shrinks a part of screen on scroll
https://bugs.webkit.org/show_bug.cgi?id=104626

Reviewed by Beth Dakin.

Testcase that scrolls an overflow area containing a compositing layer.

  • compositing/repaint/clipped-layer-size-change-expected.html: Added.
  • compositing/repaint/clipped-layer-size-change.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r137244 r137248  
     12012-12-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION(r137215): WebKit stretches and shrinks a part of screen on scroll
     4        https://bugs.webkit.org/show_bug.cgi?id=104626
     5
     6        Reviewed by Beth Dakin.
     7
     8        Testcase that scrolls an overflow area containing a compositing layer.
     9
     10        * compositing/repaint/clipped-layer-size-change-expected.html: Added.
     11        * compositing/repaint/clipped-layer-size-change.html: Added.
     12
    1132012-12-10  Noel Gordon  <noel.gordon@gmail.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r137245 r137248  
     12012-12-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r137215): WebKit stretches and shrinks a part of screen on scroll
     4        https://bugs.webkit.org/show_bug.cgi?id=104626
     5
     6        Reviewed by Beth Dakin.
     7
     8        r137215 removed a compositing layer repaint on size changes. However, there
     9        are cases where the compositing code constrains layer size by clipping
     10        with the viewport and a clipping ancestor. When that happens, we must
     11        invalidate the layer on a size change to avoid showing stretched or
     12        shrunken content.
     13
     14        Test: compositing/repaint/clipped-layer-size-change.html
     15
     16        * rendering/RenderLayerBacking.cpp:
     17        (WebCore::RenderLayerBacking::RenderLayerBacking):
     18        (WebCore::RenderLayerBacking::updateCompositedBounds):
     19        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
     20        * rendering/RenderLayerBacking.h:
     21        (RenderLayerBacking):
     22
    1232012-12-10  Dean Jackson  <dino@apple.com>
    224
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r137215 r137248  
    102102    , m_scrollLayerID(0)
    103103    , m_artificiallyInflatedBounds(false)
     104    , m_boundsConstrainedByClipping(false)
    104105    , m_isMainFrameRenderViewLayer(false)
    105106    , m_usingTiledCacheLayer(false)
     
    367368}
    368369
    369 
    370370void RenderLayerBacking::updateCompositedBounds()
    371371{
     
    390390
    391391        layerBounds.intersect(pixelSnappedIntRect(clippingBounds));
    392     }
     392        m_boundsConstrainedByClipping = true;
     393    } else
     394        m_boundsConstrainedByClipping = false;
    393395   
    394396    // If the element has a transform-origin that has fixed lengths, and the renderer has zero size,
     
    632634    FloatSize oldSize = m_graphicsLayer->size();
    633635    FloatSize newSize = relativeCompositingBounds.size();
    634     if (oldSize != newSize)
     636    if (oldSize != newSize) {
    635637        m_graphicsLayer->setSize(newSize);
     638        // Usually invalidation will happen via layout etc, but if we've affected the layer
     639        // size by constraining relative to a clipping ancestor or the viewport, we
     640        // have to invalidate to avoid showing stretched content.
     641        if (m_boundsConstrainedByClipping)
     642            m_graphicsLayer->setNeedsDisplay();
     643    }
    636644
    637645    // If we have a layer that clips children, position it.
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r137108 r137248  
    276276    IntRect m_compositedBounds;
    277277
    278     bool m_artificiallyInflatedBounds;      // bounds had to be made non-zero to make transform-origin work
     278    bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work
     279    bool m_boundsConstrainedByClipping;
    279280    bool m_isMainFrameRenderViewLayer;
    280281    bool m_usingTiledCacheLayer;
Note: See TracChangeset for help on using the changeset viewer.