Changeset 104313 in webkit


Ignore:
Timestamp:
Jan 6, 2012 12:05:06 PM (12 years ago)
Author:
tony@chromium.org
Message:

Need to relayout when stretching the height of a flex item
https://bugs.webkit.org/show_bug.cgi?id=75661

Reviewed by Ojan Vafai.

Source/WebCore:

Test: css3/flexbox/flex-align-stretch.html

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::computePreferredMainAxisExtent): Always clear the override size since
it may be set when aligning.
(WebCore::RenderFlexibleBox::alignChildren): Only relayout if the height changed.

LayoutTests:

  • css3/flexbox/flex-align-stretch-expected.txt: Added.
  • css3/flexbox/flex-align-stretch.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r104309 r104313  
     12012-01-06  Tony Chang  <tony@chromium.org>
     2
     3        Need to relayout when stretching the height of a flex item
     4        https://bugs.webkit.org/show_bug.cgi?id=75661
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * css3/flexbox/flex-align-stretch-expected.txt: Added.
     9        * css3/flexbox/flex-align-stretch.html: Added.
     10
    1112012-01-06  Dmitry Lomov  <dslomov@google.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r104312 r104313  
     12012-01-06  Tony Chang  <tony@chromium.org>
     2
     3        Need to relayout when stretching the height of a flex item
     4        https://bugs.webkit.org/show_bug.cgi?id=75661
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Test: css3/flexbox/flex-align-stretch.html
     9
     10        * rendering/RenderFlexibleBox.cpp:
     11        (WebCore::RenderFlexibleBox::computePreferredMainAxisExtent): Always clear the override size since
     12        it may be set when aligning.
     13        (WebCore::RenderFlexibleBox::alignChildren): Only relayout if the height changed.
     14
    1152012-01-06  Anders Carlsson  <andersca@apple.com>
    216
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r102837 r104313  
    489489    LayoutUnit flexboxAvailableContentExtent = mainAxisContentExtent();
    490490    for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
     491        child->clearOverrideSize();
    491492        if (mainAxisLengthForChild(child).isAuto()) {
    492             child->clearOverrideSize();
    493493            if (!relayoutChildren)
    494494                child->setChildNeedsLayout(true);
     
    699699        case AlignStretch: {
    700700            if (!isColumnFlow() && child->style()->logicalHeight().isAuto()) {
     701                LayoutUnit logicalHeightBefore = child->logicalHeight();
    701702                LayoutUnit stretchedLogicalHeight = child->logicalHeight() + RenderFlexibleBox::availableAlignmentSpaceForChild(child);
    702703                child->setLogicalHeight(stretchedLogicalHeight);
    703704                child->computeLogicalHeight();
    704                 // FIXME: We need to relayout if the height changed.
     705
     706                if (child->logicalHeight() != logicalHeightBefore) {
     707                    child->setOverrideHeight(child->logicalHeight());
     708                    child->setLogicalHeight(0);
     709                    child->setChildNeedsLayout(true);
     710                    child->layoutIfNeeded();
     711                }
    705712            }
    706713            break;
Note: See TracChangeset for help on using the changeset viewer.