Changeset 110747 in webkit
- Timestamp:
- Mar 14, 2012 2:10:24 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r110745 r110747 1 2012-03-14 Tony Chang <tony@chromium.org> 2 3 multiline column flexbox with auto height wrap too much 4 https://bugs.webkit.org/show_bug.cgi?id=80929 5 6 Reviewed by David Hyatt. 7 8 * css3/flexbox/multiline-column-auto-expected.txt: Added. 9 * css3/flexbox/multiline-column-auto.html: Added. 10 * css3/flexbox/multiline-shrink-to-fit-expected.html: 11 * css3/flexbox/multiline-shrink-to-fit.html: 12 1 13 2012-03-14 Jessie Berlin <jberlin@apple.com> 2 14 -
trunk/LayoutTests/css3/flexbox/multiline-shrink-to-fit-expected.html
r110583 r110747 34 34 <p>Test to make sure that multiline column flexboxes shrink-to-fit properly.</p> 35 35 36 <!-- FIXME: Remove the height once https://bugs.webkit.org/show_bug.cgi?id=80929 is fixed. -->37 36 <div class="testcase" style="height: 60px; width: 400px"> 38 37 <div style="width: 100px; height: 20px"></div> … … 57 56 <p style="clear:left">The grey background should be 400px wide.</p> 58 57 59 <!-- FIXME: Remove the height once https://bugs.webkit.org/show_bug.cgi?id=80929 is fixed. -->60 58 <div style="width: 150px"> 61 59 <div class="testcase" style="height: 60px; width: 150px"> -
trunk/LayoutTests/css3/flexbox/multiline-shrink-to-fit.html
r110583 r110747 27 27 <p>Test to make sure that multiline column flexboxes shrink-to-fit properly.</p> 28 28 29 <!-- FIXME: Remove the height once https://bugs.webkit.org/show_bug.cgi?id=80929 is fixed. --> 30 <div class="flexbox" style="height: 60px"> 29 <div class="flexbox"> 31 30 <div style="width: 100px; height: 20px"></div> 32 31 <div style="width: 100px; height: 10px"></div> … … 44 43 <p style="clear:left">The grey background should be 400px wide.</p> 45 44 46 <!-- FIXME: Remove the height once https://bugs.webkit.org/show_bug.cgi?id=80929 is fixed. -->47 45 <div style="width: 150px"> 48 <div class="flexbox" style="height: 60px">46 <div class="flexbox"> 49 47 <div style="width: 100px; height: 20px"></div> 50 48 <div style="width: 100px; height: 10px"></div> -
trunk/Source/WebCore/ChangeLog
r110744 r110747 1 2012-03-14 Tony Chang <tony@chromium.org> 2 3 multiline column flexbox with auto height wrap too much 4 https://bugs.webkit.org/show_bug.cgi?id=80929 5 6 Reviewed by David Hyatt. 7 8 Test: css3/flexbox/multiline-column-auto.html 9 10 * rendering/RenderBox.cpp: 11 (WebCore::RenderBox::computeLogicalHeightUsing): 12 (WebCore): 13 (WebCore::RenderBox::computeContentLogicalHeightUsing): Pull out into a separate method. 14 * rendering/RenderBox.h: 15 (RenderBox): 16 * rendering/RenderFlexibleBox.cpp: 17 (WebCore::RenderFlexibleBox::lineBreakLength): Compute the value based on height & max-height for column layout. 18 (WebCore): 19 (WebCore::RenderFlexibleBox::computeNextFlexLine): 20 * rendering/RenderFlexibleBox.h: 21 (RenderFlexibleBox): 22 1 23 2012-03-14 Xingnan Wang <xingnan.wang@intel.com> 2 24 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r110135 r110747 2153 2153 } 2154 2154 2155 LayoutUnit RenderBox::computeLogicalHeightUsing(const Length& h) 2155 LayoutUnit RenderBox::computeLogicalHeightUsing(const Length& height) 2156 { 2157 LayoutUnit logicalHeight = computeContentLogicalHeightUsing(height); 2158 if (logicalHeight != -1) 2159 logicalHeight = computeBorderBoxLogicalHeight(logicalHeight); 2160 return logicalHeight; 2161 } 2162 2163 LayoutUnit RenderBox::computeContentLogicalHeightUsing(const Length& height) 2156 2164 { 2157 2165 LayoutUnit logicalHeight = -1; 2158 if (!h.isAuto()) { 2159 if (h.isFixed()) 2160 logicalHeight = h.value(); 2161 else if (h.isPercent()) 2162 logicalHeight = computePercentageLogicalHeight(h); 2163 if (logicalHeight != -1) { 2164 logicalHeight = computeBorderBoxLogicalHeight(logicalHeight); 2165 return logicalHeight; 2166 } 2166 if (!height.isAuto()) { 2167 if (height.isFixed()) 2168 logicalHeight = height.value(); 2169 else if (height.isPercent()) 2170 logicalHeight = computePercentageLogicalHeight(height); 2167 2171 } 2168 2172 return logicalHeight; -
trunk/Source/WebCore/rendering/RenderBox.h
r110732 r110747 342 342 LayoutUnit computeLogicalWidthInRegionUsing(LogicalWidthType, LayoutUnit availableLogicalWidth, const RenderBlock* containingBlock, RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage); 343 343 LayoutUnit computeLogicalHeightUsing(const Length& height); 344 LayoutUnit computeContentLogicalHeightUsing(const Length& height); 344 345 LayoutUnit computeReplacedLogicalWidthUsing(Length width) const; 345 346 LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, bool includeMaxWidth = true) const; -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r110583 r110747 670 670 } 671 671 672 LayoutUnit RenderFlexibleBox::lineBreakLength() 673 { 674 if (!isColumnFlow()) 675 return mainAxisContentExtent(); 676 677 LayoutUnit height = computeContentLogicalHeightUsing(style()->logicalHeight()); 678 if (height == -1) 679 height = std::numeric_limits<LayoutUnit>::max(); 680 LayoutUnit maxHeight = computeContentLogicalHeightUsing(style()->logicalMaxHeight()); 681 if (maxHeight != -1) 682 height = std::min(height, maxHeight); 683 return height; 684 } 685 672 686 bool RenderFlexibleBox::computeNextFlexLine(FlexOrderIterator& iterator, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalPositiveFlexibility, float& totalNegativeFlexibility) 673 687 { … … 678 692 if (!iterator.currentChild()) 679 693 return false; 694 695 LayoutUnit lineBreak = lineBreakLength(); 680 696 681 697 for (RenderBox* child = iterator.currentChild(); child; child = iterator.next()) { … … 691 707 childMainAxisExtent += child->marginHeight(); 692 708 693 // FIXME: For auto sized column flexbox, mainAxisContentExtent (the height) hasn't been computed yet so we break 694 // after the first child. If the height is auto, we need to look at max-height to determine the line breaks. 695 // https://bugs.webkit.org/show_bug.cgi?id=80929 696 if (isMultiline() && preferredMainAxisExtent + childMainAxisExtent > mainAxisContentExtent() && orderedChildren.size() > 0) 709 if (isMultiline() && preferredMainAxisExtent + childMainAxisExtent > lineBreak && orderedChildren.size() > 0) 697 710 break; 698 711 orderedChildren.append(child); -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r110209 r110747 104 104 105 105 void computeMainAxisPreferredSizes(bool relayoutChildren, FlexOrderHashSet&); 106 LayoutUnit lineBreakLength(); 106 107 bool computeNextFlexLine(FlexOrderIterator&, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalPositiveFlexibility, float& totalNegativeFlexibility); 107 108 bool runFreeSpaceAllocationAlgorithm(const OrderedFlexItemList&, LayoutUnit& availableFreeSpace, float& totalPositiveFlexibility, float& totalNegativeFlexibility, InflexibleFlexItemSize&, WTF::Vector<LayoutUnit>& childSizes);
Note: See TracChangeset
for help on using the changeset viewer.