Changeset 148120 in webkit


Ignore:
Timestamp:
Apr 10, 2013 11:53:49 AM (11 years ago)
Author:
zoltan@webkit.org
Message:

[CSS Exclusions] Increasing padding does not correctly layout child blocks
https://bugs.webkit.org/show_bug.cgi?id=112929

Reviewed by David Hyatt.

If a child block has changed dimension inside a shape and it has affected the block siblings
we need to relayout the content inside the shape.

Source/WebCore:

Test: fast/exclusions/shape-inside/shape-inside-sibling-block-dimension-change-needs-relayout.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::updateRegionsAndExclusionsAfterChildLayout): Add condition for dimension change.
(WebCore::RenderBlock::layoutBlock): Call updateRegionsAndExclusionsAfterChildLayout with the new parameter.

  • rendering/RenderBlock.h:

(RenderBlock): Add extra parameter to updateRegionsAndExclusionsAfterChildLayout(...)

LayoutTests:

  • fast/exclusions/shape-inside/shape-inside-sibling-block-dimension-change-needs-relayout-expected.html: Added.
  • fast/exclusions/shape-inside/shape-inside-sibling-block-dimension-change-needs-relayout.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148117 r148120  
     12013-04-10  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS Exclusions] Increasing padding does not correctly layout child blocks
     4        https://bugs.webkit.org/show_bug.cgi?id=112929
     5
     6        Reviewed by David Hyatt.
     7
     8        If a child block has changed dimension inside a shape and it has affected the block siblings
     9        we need to relayout the content inside the shape.
     10
     11        * fast/exclusions/shape-inside/shape-inside-sibling-block-dimension-change-needs-relayout-expected.html: Added.
     12        * fast/exclusions/shape-inside/shape-inside-sibling-block-dimension-change-needs-relayout.html: Added.
     13
    1142013-04-10  Alexandru Chiculita  <achicu@adobe.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r148119 r148120  
     12013-04-10  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS Exclusions] Increasing padding does not correctly layout child blocks
     4        https://bugs.webkit.org/show_bug.cgi?id=112929
     5
     6        Reviewed by David Hyatt.
     7
     8        If a child block has changed dimension inside a shape and it has affected the block siblings
     9        we need to relayout the content inside the shape.
     10
     11        Test: fast/exclusions/shape-inside/shape-inside-sibling-block-dimension-change-needs-relayout.html
     12
     13        * rendering/RenderBlock.cpp:
     14        (WebCore::RenderBlock::updateRegionsAndExclusionsAfterChildLayout): Add condition for dimension change.
     15        (WebCore::RenderBlock::layoutBlock): Call updateRegionsAndExclusionsAfterChildLayout with the new parameter.
     16        * rendering/RenderBlock.h:
     17        (RenderBlock): Add extra parameter to updateRegionsAndExclusionsAfterChildLayout(...)
     18
    1192013-04-10  Geoffrey Garen  <ggaren@apple.com>
    220
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r148056 r148120  
    14691469#endif
    14701470
    1471 void RenderBlock::updateRegionsAndExclusionsAfterChildLayout(RenderFlowThread* flowThread)
     1471void RenderBlock::updateRegionsAndExclusionsAfterChildLayout(RenderFlowThread* flowThread, bool heightChanged)
    14721472{
    14731473#if ENABLE(CSS_EXCLUSIONS)
     
    14751475    if (exclusionShapeInsideInfo && exclusionShapeInsideInfo->needsRemoval())
    14761476        setExclusionShapeInsideInfo(nullptr);
     1477
     1478    // A previous sibling has changed dimension, so we need to relayout the shape with the content
     1479    ExclusionShapeInsideInfo* shapeInsideInfo = layoutExclusionShapeInsideInfo();
     1480    if (heightChanged && shapeInsideInfo)
     1481        shapeInsideInfo->dirtyShapeSize();
    14771482#endif
    14781483    computeRegionRangeForBlock(flowThread);
     
    16271632    }
    16281633
    1629     if (previousHeight != newHeight)
     1634    bool heightChanged = (previousHeight != newHeight);
     1635    if (heightChanged)
    16301636        relayoutChildren = true;
    16311637
    16321638    layoutPositionedObjects(relayoutChildren || isRoot());
    16331639
    1634     updateRegionsAndExclusionsAfterChildLayout(flowThread);
     1640    updateRegionsAndExclusionsAfterChildLayout(flowThread, heightChanged);
    16351641
    16361642    // Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r148056 r148120  
    581581
    582582    bool updateRegionsAndExclusionsBeforeChildLayout(RenderFlowThread*);
    583     void updateRegionsAndExclusionsAfterChildLayout(RenderFlowThread*);
     583    void updateRegionsAndExclusionsAfterChildLayout(RenderFlowThread*, bool heightChanged = false);
    584584    void computeRegionRangeForBlock(RenderFlowThread*);
    585585
Note: See TracChangeset for help on using the changeset viewer.