Changeset 245208 in webkit


Ignore:
Timestamp:
May 11, 2019 3:22:34 PM (5 years ago)
Author:
Simon Fraser
Message:

Layer bounds are incorrect for sharing layers that paint with transforms
https://bugs.webkit.org/show_bug.cgi?id=197768
<rdar://problem/50695493>

Reviewed by Zalan Bujtas.

Source/WebCore:

We don't need to traverse shared layers if the backing-provider has overflow clip,
because we know they are containing-block descendants and therefore clipped.

Note tha the CSS "clip" property doesn't guarantee this, because the clip rect
can be larger than the element, so in that case we just traverse shared layers.

Tests: compositing/shared-backing/sharing-bounds-clip.html

compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html
compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html
compositing/shared-backing/sharing-bounds.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateCompositedBounds):

LayoutTests:

Tests for backing-shared layer bounds in various configurations.

  • compositing/shared-backing/sharing-bounds-clip-expected.txt: Added.
  • compositing/shared-backing/sharing-bounds-clip.html: Added.
  • compositing/shared-backing/sharing-bounds-expected.txt: Added.
  • compositing/shared-backing/sharing-bounds-non-clipping-shared-layer-expected.txt: Added.
  • compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html: Added.
  • compositing/shared-backing/sharing-bounds-transformed-sharing-layer-expected.txt: Added.
  • compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html: Added.
  • compositing/shared-backing/sharing-bounds.html: Added.
Location:
trunk
Files:
8 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245207 r245208  
     12019-05-11  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Layer bounds are incorrect for sharing layers that paint with transforms
     4        https://bugs.webkit.org/show_bug.cgi?id=197768
     5        <rdar://problem/50695493>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Tests for backing-shared layer bounds in various configurations.
     10
     11        * compositing/shared-backing/sharing-bounds-clip-expected.txt: Added.
     12        * compositing/shared-backing/sharing-bounds-clip.html: Added.
     13        * compositing/shared-backing/sharing-bounds-expected.txt: Added.
     14        * compositing/shared-backing/sharing-bounds-non-clipping-shared-layer-expected.txt: Added.
     15        * compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html: Added.
     16        * compositing/shared-backing/sharing-bounds-transformed-sharing-layer-expected.txt: Added.
     17        * compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html: Added.
     18        * compositing/shared-backing/sharing-bounds.html: Added.
     19
    1202019-05-11  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Source/WebCore/ChangeLog

    r245207 r245208  
     12019-05-11  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Layer bounds are incorrect for sharing layers that paint with transforms
     4        https://bugs.webkit.org/show_bug.cgi?id=197768
     5        <rdar://problem/50695493>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        We don't need to traverse shared layers if the backing-provider has overflow clip,
     10        because we know they are containing-block descendants and therefore clipped.
     11
     12        Note tha the CSS "clip" property doesn't guarantee this, because the clip rect
     13        can be larger than the element, so in that case we just traverse shared layers.
     14
     15        Tests: compositing/shared-backing/sharing-bounds-clip.html
     16               compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html
     17               compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html
     18               compositing/shared-backing/sharing-bounds.html
     19
     20        * rendering/RenderLayerBacking.cpp:
     21        (WebCore::RenderLayerBacking::updateCompositedBounds):
     22
    1232019-05-11  Simon Fraser  <simon.fraser@apple.com>
    224
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r245207 r245208  
    672672    }
    673673
    674     for (auto& layerWeakPtr : m_backingSharingLayers) {
    675         auto* boundsRootLayer = &m_owningLayer;
    676         ASSERT(layerWeakPtr->isDescendantOf(m_owningLayer));
    677         auto offset = layerWeakPtr->offsetFromAncestor(&m_owningLayer);
    678         auto bounds = layerWeakPtr->calculateLayerBounds(boundsRootLayer, offset, RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
    679         layerBounds.unite(bounds);
     674    // If the backing provider has overflow:clip, we know all sharing layers are affected by the clip because they are containing-block descendants.
     675    if (!renderer().hasOverflowClip()) {
     676        for (auto& layerWeakPtr : m_backingSharingLayers) {
     677            auto* boundsRootLayer = &m_owningLayer;
     678            ASSERT(layerWeakPtr->isDescendantOf(m_owningLayer));
     679            auto offset = layerWeakPtr->offsetFromAncestor(&m_owningLayer);
     680            auto bounds = layerWeakPtr->calculateLayerBounds(boundsRootLayer, offset, RenderLayer::defaultCalculateLayerBoundsFlags() | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
     681            layerBounds.unite(bounds);
     682        }
    680683    }
    681684
Note: See TracChangeset for help on using the changeset viewer.