Changeset 141290 in webkit


Ignore:
Timestamp:
Jan 30, 2013 11:21:26 AM (11 years ago)
Author:
tony@chromium.org
Message:

REGRESSION(r136324): Flexbox should relayout flex children when width changes
https://bugs.webkit.org/show_bug.cgi?id=108231

Reviewed by Ojan Vafai.

Source/WebCore:

If the width of a block changes, we need to set relayoutChildren = true
to relayout the children. This broke when we optimized the layout calls
in layoutAndPlaceChildren.

Test: css3/flexbox/width-change-and-relayout-children.html

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::layoutBlock): Also reorder the code to match RenderBlock.
The bug fix is to use updateLogicalWidthAndColumnWidth() and its return value to set
relayoutChildren = true.

LayoutTests:

  • css3/flexbox/width-change-and-relayout-children-expected.txt: Added.
  • css3/flexbox/width-change-and-relayout-children.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r141286 r141290  
     12013-01-30  Tony Chang  <tony@chromium.org>
     2
     3        REGRESSION(r136324): Flexbox should relayout flex children when width changes
     4        https://bugs.webkit.org/show_bug.cgi?id=108231
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * css3/flexbox/width-change-and-relayout-children-expected.txt: Added.
     9        * css3/flexbox/width-change-and-relayout-children.html: Added.
     10
    1112013-01-30  Florin Malita  <fmalita@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r141288 r141290  
     12013-01-30  Tony Chang  <tony@chromium.org>
     2
     3        REGRESSION(r136324): Flexbox should relayout flex children when width changes
     4        https://bugs.webkit.org/show_bug.cgi?id=108231
     5
     6        Reviewed by Ojan Vafai.
     7
     8        If the width of a block changes, we need to set relayoutChildren = true
     9        to relayout the children. This broke when we optimized the layout calls
     10        in layoutAndPlaceChildren.
     11
     12        Test: css3/flexbox/width-change-and-relayout-children.html
     13
     14        * rendering/RenderFlexibleBox.cpp:
     15        (WebCore::RenderFlexibleBox::layoutBlock): Also reorder the code to match RenderBlock.
     16        The bug fix is to use updateLogicalWidthAndColumnWidth() and its return value to set
     17        relayoutChildren = true.
     18
    1192013-01-30  Tim Horton  <timothy_horton@apple.com>
    220
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r140244 r141290  
    297297
    298298    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
     299
     300    if (updateLogicalWidthAndColumnWidth())
     301        relayoutChildren = true;
     302
     303    m_overflow.clear();
     304
     305    LayoutUnit previousHeight = logicalHeight();
     306    setLogicalHeight(0);
     307
    299308    LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
    300309
     
    306315    updateRegionsAndExclusionsLogicalSize();
    307316
    308     LayoutSize previousSize = size();
    309 
    310     setLogicalHeight(0);
    311     updateLogicalWidth();
    312 
    313317    m_numberOfInFlowChildrenOnFirstLine = -1;
    314     m_overflow.clear();
    315318
    316319    RenderBlock::startDelayUpdateScrollInfo();
     
    331334    RenderBlock::finishDelayUpdateScrollInfo();
    332335
    333     if (size() != previousSize)
     336    if (logicalHeight() != previousHeight)
    334337        relayoutChildren = true;
    335338
Note: See TracChangeset for help on using the changeset viewer.