Changeset 162605 in webkit


Ignore:
Timestamp:
Jan 23, 2014 6:19:54 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Regions] Fix positioning composited layers when the region has overflow:hidden
https://bugs.webkit.org/show_bug.cgi?id=124042

Patch by Mihai Maerean <Mihai Maerean> on 2014-01-23
Reviewed by Mihnea Ovidenie.

Source/WebCore:

If there's a clipping GraphicsLayer on the hierarchy, substract its offset, since it's its
parent that positions us.

Tests: compositing/regions/position-layer-inside-region-overflow-hidden.html

compositing/regions/position-layer-inside-overflow-hidden.html
compositing/regions/position-layers-inside-region-overflow-hidden.html
compositing/regions/position-layers-inside-regions-overflow-hidden.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread): The position
must also be correct when the region has box-shadow that inflates the region's layer. The
composited layers from the flow thread should be rendered in the same position whether the
associated region has clipping or not.
Using the position of the clipping layer instead of the location of the clipbox makes it
also work with box-shadow that inflates the region's graphics layer.

LayoutTests:

  • compositing/regions/position-layer-inside-region-overflow-hidden.html: Added.
  • compositing/regions/position-layer-inside-region-overflow-hidden-expected.html: Added.
  • compositing/regions/position-layer-inside-overflow-hidden.html: Added.
  • compositing/regions/position-layer-inside-overflow-hidden-expected.html: Added.
  • compositing/regions/position-layers-inside-region-overflow-hidden.html: Added.
  • compositing/regions/position-layers-inside-region-overflow-hidden-expected.html: Added.
  • compositing/regions/position-layers-inside-regions-overflow-hidden.html: Added.
  • compositing/regions/position-layers-inside-regions-overflow-hidden-expected.html: Added.
Location:
trunk
Files:
8 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r162604 r162605  
     12014-01-23  Mihai Maerean  <mmaerean@adobe.com>
     2
     3        [CSS Regions] Fix positioning composited layers when the region has overflow:hidden
     4        https://bugs.webkit.org/show_bug.cgi?id=124042
     5
     6        Reviewed by Mihnea Ovidenie.
     7
     8        * compositing/regions/position-layer-inside-region-overflow-hidden.html: Added.
     9        * compositing/regions/position-layer-inside-region-overflow-hidden-expected.html: Added.
     10        * compositing/regions/position-layer-inside-overflow-hidden.html: Added.
     11        * compositing/regions/position-layer-inside-overflow-hidden-expected.html: Added.
     12        * compositing/regions/position-layers-inside-region-overflow-hidden.html: Added.
     13        * compositing/regions/position-layers-inside-region-overflow-hidden-expected.html: Added.
     14        * compositing/regions/position-layers-inside-regions-overflow-hidden.html: Added.
     15        * compositing/regions/position-layers-inside-regions-overflow-hidden-expected.html: Added.
     16
    1172014-01-23  Csaba Osztrogonác  <ossy@webkit.org>
    218
  • trunk/Source/WebCore/ChangeLog

    r162602 r162605  
     12014-01-23  Mihai Maerean  <mmaerean@adobe.com>
     2
     3        [CSS Regions] Fix positioning composited layers when the region has overflow:hidden
     4        https://bugs.webkit.org/show_bug.cgi?id=124042
     5
     6        Reviewed by Mihnea Ovidenie.
     7
     8        If there's a clipping GraphicsLayer on the hierarchy, substract its offset, since it's its
     9        parent that positions us.
     10
     11        Tests: compositing/regions/position-layer-inside-region-overflow-hidden.html
     12               compositing/regions/position-layer-inside-overflow-hidden.html
     13               compositing/regions/position-layers-inside-region-overflow-hidden.html
     14               compositing/regions/position-layers-inside-regions-overflow-hidden.html
     15
     16        * rendering/RenderLayerBacking.cpp:
     17        (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread): The position
     18        must also be correct when the region has box-shadow that inflates the region's layer. The
     19        composited layers from the flow thread should be rendered in the same position whether the
     20        associated region has clipping or not.
     21        Using the position of the clipping layer instead of the location of the clipbox makes it
     22        also work with box-shadow that inflates the region's graphics layer.
     23
    1242014-01-23  Andrei Bucur  <abucur@adobe.com>
    225
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r162523 r162605  
    986986    RenderLayer* flowThreadLayer = m_owningLayer.isInsideOutOfFlowThread() ? m_owningLayer.stackingContainer() : m_owningLayer.enclosingFlowThreadAncestor();
    987987    if (flowThreadLayer && flowThreadLayer->isRenderFlowThread()) {
    988         RenderFlowThread& flowThread = toRenderFlowThread(flowThreadLayer->renderer());
    989988        if (m_owningLayer.isFlowThreadCollectingGraphicsLayersUnderRegions()) {
    990989            // The RenderNamedFlowThread is not composited, as we need it to paint the
     
    997996
    998997        // Move the ancestor position at the top of the region where the composited layer is going to display.
     998        RenderFlowThread& flowThread = toRenderFlowThread(flowThreadLayer->renderer());
    999999        RenderNamedFlowFragment* parentRegion = flowThread.cachedRegionForCompositedLayer(m_owningLayer);
    1000         if (parentRegion) {
    1001             IntPoint flowDelta;
    1002             m_owningLayer.convertToPixelSnappedLayerCoords(flowThreadLayer, flowDelta);
    1003             parentRegion->adjustRegionBoundsFromFlowThreadPortionRect(flowDelta, ancestorCompositingBounds);
    1004             RenderBoxModelObject& layerOwner = toRenderBoxModelObject(parentRegion->layerOwner());
    1005             if (layerOwner.layer()->backing()) {
    1006                 // Make sure that the region propagates its borders, paddings, outlines or box-shadows to layers inside it.
    1007                 // Note that the composited bounds of the RenderRegion are already calculated
    1008                 // because RenderLayerCompositor::rebuildCompositingLayerTree will only
    1009                 // iterate on the content of the region after the region itself is computed.
    1010                 ancestorCompositingBounds.moveBy(roundedIntPoint(layerOwner.layer()->backing()->compositedBounds().location()));
    1011                 ancestorCompositingBounds.move(-layerOwner.borderAndPaddingStart(), -layerOwner.borderAndPaddingBefore());
    1012             }
    1013         }
     1000        if (!parentRegion)
     1001            return;
     1002
     1003        IntPoint flowDelta;
     1004        m_owningLayer.convertToPixelSnappedLayerCoords(flowThreadLayer, flowDelta);
     1005        parentRegion->adjustRegionBoundsFromFlowThreadPortionRect(flowDelta, ancestorCompositingBounds);
     1006        RenderBoxModelObject& layerOwner = toRenderBoxModelObject(parentRegion->layerOwner());
     1007        RenderLayerBacking* layerOwnerBacking = layerOwner.layer()->backing();
     1008        if (!layerOwnerBacking)
     1009            return;
     1010
     1011        // Make sure that the region propagates its borders, paddings, outlines or box-shadows to layers inside it.
     1012        // Note that the composited bounds of the RenderRegion are already calculated because
     1013        // RenderLayerCompositor::rebuildCompositingLayerTree will only iterate on the content of the region after the
     1014        // region itself is computed.
     1015        ancestorCompositingBounds.moveBy(roundedIntPoint(layerOwnerBacking->compositedBounds().location()));
     1016        ancestorCompositingBounds.move(-layerOwner.borderAndPaddingStart(), -layerOwner.borderAndPaddingBefore());
     1017
     1018        // If there's a clipping GraphicsLayer on the hierarchy (region graphics layer -> clipping graphics layer ->
     1019        // composited content graphics layer), substract the offset of the clipping layer, since it's its parent
     1020        // that positions us (the graphics layer of the region).
     1021        if (layerOwnerBacking->clippingLayer())
     1022            ancestorCompositingBounds.moveBy(roundedIntPoint(layerOwnerBacking->clippingLayer()->position()));
    10141023    }
    10151024}
Note: See TracChangeset for help on using the changeset viewer.