Changeset 110772 in webkit
- Timestamp:
- Mar 14, 2012 3:56:15 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r110771 r110772 1 2012-03-14 Tony Chang <tony@chromium.org> 2 3 fix negative flexing in auto sized columns 4 https://bugs.webkit.org/show_bug.cgi?id=80069 5 6 Reviewed by Ojan Vafai. 7 8 * css3/flexbox/columns-auto-size-expected.txt: 9 * css3/flexbox/columns-auto-size.html: 10 1 11 2012-03-14 Adam Barth <abarth@webkit.org> 2 12 -
trunk/LayoutTests/css3/flexbox/columns-auto-size-expected.txt
r98628 r110772 5 5 PASS 6 6 PASS 7 PASS 8 PASS 9 PASS 10 PASS -
trunk/LayoutTests/css3/flexbox/columns-auto-size.html
r98628 r110772 77 77 </div> 78 78 79 <div class="flexbox horizontal" data-expected-height="20"> 80 <div data-expected-height="10" data-offset-y="0" style="height: -webkit-flex(0 1 auto)"><div style="height: 10px"></div></div> 81 <div data-expected-height="10" data-offset-y="10" style="height: -webkit-flex(0 2 auto)"><div style="height: 10px"></div></div> 82 </div> 83 84 <div class="flexbox horizontal" style="min-height: 10px" data-expected-height="20"> 85 <div data-expected-height="10" data-offset-y="0" style="height: -webkit-flex(0 1 auto)"><div style="height: 10px"></div></div> 86 <div data-expected-height="10" data-offset-y="10" style="height: -webkit-flex(0 2 auto)"><div style="height: 10px"></div></div> 87 </div> 88 89 <div class="flexbox horizontal" style="min-height: 5px; max-height: 17px;" data-expected-height="17"> 90 <div data-expected-height="9" data-offset-y="0" style="height: -webkit-flex(0 1 auto)"><div style="height: 10px"></div></div> 91 <div data-expected-height="8" data-offset-y="9" style="height: -webkit-flex(0 2 auto)"><div style="height: 10px"></div></div> 92 </div> 93 94 <div class="flexbox horizontal" style="min-height: 5px; max-height: 30px; padding-top: 1px; padding-bottom: 2px;" data-expected-height="33"> 95 <div data-expected-height="15" data-offset-y="1" style="height: -webkit-flex(0 1 auto)"><div style="height: 20px"></div></div> 96 <div data-expected-height="15" data-offset-y="16" style="height: -webkit-flex(0 1 auto)"><div style="height: 20px"></div></div> 97 </div> 98 79 99 <div class="flexbox vertical"> 80 100 <div data-expected-width="10" data-offset-x="20" style="width: -webkit-flex(1 0 10px)"></div> -
trunk/Source/WebCore/ChangeLog
r110769 r110772 1 2012-03-14 Tony Chang <tony@chromium.org> 2 3 fix negative flexing in auto sized columns 4 https://bugs.webkit.org/show_bug.cgi?id=80069 5 6 Reviewed by Ojan Vafai. 7 8 New test cases in css3/flexbox/columns-auto-size.html. 9 10 * rendering/RenderFlexibleBox.cpp: 11 (WebCore): 12 (WebCore::RenderFlexibleBox::computeAvailableFreeSpace): Properly compute this for auto sizing columns. Previously, we would always return 0. 13 (WebCore::RenderFlexibleBox::layoutFlexItems): 14 (WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithm): Drop an unnecessary check against undefined. isSpecified covers this for us. 15 * rendering/RenderFlexibleBox.h: 16 (RenderFlexibleBox): 17 1 18 2012-03-14 Grace Ku <gracek@codeaurora.org> 2 19 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r110747 r110772 577 577 } 578 578 579 LayoutUnit RenderFlexibleBox::computeAvailableFreeSpace(LayoutUnit preferredMainAxisExtent) 580 { 581 if (!isColumnFlow()) 582 return mainAxisContentExtent() - preferredMainAxisExtent; 583 584 if (hasOverrideHeight()) 585 return overrideHeight(); 586 587 LayoutUnit heightResult = computeContentLogicalHeightUsing(style()->logicalHeight()); 588 if (heightResult == -1) 589 heightResult = preferredMainAxisExtent; 590 LayoutUnit minHeight = computeContentLogicalHeightUsing(style()->logicalMinHeight()); // Leave as -1 if unset. 591 LayoutUnit maxHeight = style()->logicalMaxHeight().isUndefined() ? heightResult : computeContentLogicalHeightUsing(style()->logicalMaxHeight()); 592 if (maxHeight == -1) 593 maxHeight = heightResult; 594 heightResult = std::min(maxHeight, heightResult); 595 heightResult = std::max(minHeight, heightResult); 596 597 return heightResult - preferredMainAxisExtent; 598 } 599 579 600 void RenderFlexibleBox::layoutFlexItems(bool relayoutChildren) 580 601 { … … 593 614 594 615 LayoutUnit crossAxisOffset = flowAwareBorderBefore() + flowAwarePaddingBefore(); 595 LayoutUnit mainAxisFlexibleSpace = mainAxisContentExtent();596 616 while (computeNextFlexLine(flexIterator, orderedChildren, preferredMainAxisExtent, totalPositiveFlexibility, totalNegativeFlexibility)) { 597 LayoutUnit availableFreeSpace = mainAxisFlexibleSpace - preferredMainAxisExtent;617 LayoutUnit availableFreeSpace = computeAvailableFreeSpace(preferredMainAxisExtent); 598 618 InflexibleFlexItemSize inflexibleItems; 599 619 WTF::Vector<LayoutUnit> childSizes; … … 739 759 740 760 Length childLogicalMaxWidth = isHorizontalFlow() ? child->style()->maxWidth() : child->style()->maxHeight(); 741 if ( !childLogicalMaxWidth.isUndefined() &&childLogicalMaxWidth.isSpecified() && childPreferredSize > childLogicalMaxWidth.calcValue(flexboxAvailableContentExtent)) {761 if (childLogicalMaxWidth.isSpecified() && childPreferredSize > childLogicalMaxWidth.calcValue(flexboxAvailableContentExtent)) { 742 762 childPreferredSize = childLogicalMaxWidth.calcValue(flexboxAvailableContentExtent); 743 763 availableFreeSpace -= childPreferredSize - preferredMainAxisContentExtentForChild(child); … … 751 771 752 772 Length childLogicalMinWidth = isHorizontalFlow() ? child->style()->minWidth() : child->style()->minHeight(); 753 if ( !childLogicalMinWidth.isUndefined() &&childLogicalMinWidth.isSpecified() && childPreferredSize < childLogicalMinWidth.calcValue(flexboxAvailableContentExtent)) {773 if (childLogicalMinWidth.isSpecified() && childPreferredSize < childLogicalMinWidth.calcValue(flexboxAvailableContentExtent)) { 754 774 childPreferredSize = childLogicalMinWidth.calcValue(flexboxAvailableContentExtent); 755 775 availableFreeSpace += preferredMainAxisContentExtentForChild(child) - childPreferredSize; -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r110747 r110772 106 106 LayoutUnit lineBreakLength(); 107 107 bool computeNextFlexLine(FlexOrderIterator&, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalPositiveFlexibility, float& totalNegativeFlexibility); 108 LayoutUnit computeAvailableFreeSpace(LayoutUnit preferredMainAxisExtent); 108 109 bool runFreeSpaceAllocationAlgorithm(const OrderedFlexItemList&, LayoutUnit& availableFreeSpace, float& totalPositiveFlexibility, float& totalNegativeFlexibility, InflexibleFlexItemSize&, WTF::Vector<LayoutUnit>& childSizes); 109 110 void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize);
Note: See TracChangeset
for help on using the changeset viewer.