Changeset 93547 in webkit
- Timestamp:
- Aug 22, 2011 2:49:06 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r93541 r93547 1 2011-08-22 Tony Chang <tony@chromium.org> 2 3 handle child margin values when flexing 4 https://bugs.webkit.org/show_bug.cgi?id=65887 5 6 Reviewed by David Hyatt. 7 8 * css3/flexbox/002-expected.txt: Added. 9 * css3/flexbox/002.html: Added. 10 * css3/flexbox/resources/flexbox.js: 11 (checkHorizontalBoxen): 12 1 13 2011-08-22 Peter Kasting <pkasting@google.com> 2 14 -
trunk/LayoutTests/css3/flexbox/resources/flexbox.js
r92628 r93547 17 17 if (child.offsetWidth && expectedWidth) { 18 18 if (child.offsetWidth != parseInt(expectedWidth)) { 19 failures += "Expected " + expectedWidth + " but got " + child.offsetWidth + ". ";19 failures += "Expected " + expectedWidth + " for width, but got " + child.offsetWidth + ". "; 20 20 } 21 21 } 22 23 var expectedOffset = child.getAttribute && child.getAttribute("data-offset-x"); 24 if (child.offsetLeft && expectedOffset) { 25 if (child.offsetLeft != parseInt(expectedOffset)) { 26 failures += "Expected " + expectedOffset + " for offsetLeft, but got " + child.offsetLeft + ". "; 27 } 28 } 29 22 30 child = child.nextSibling; 23 31 } -
trunk/Source/WebCore/ChangeLog
r93542 r93547 1 2011-08-22 Tony Chang <tony@chromium.org> 2 3 handle child margin values when flexing 4 https://bugs.webkit.org/show_bug.cgi?id=65887 5 6 Reviewed by David Hyatt. 7 8 Test: css3/flexbox/002.html 9 10 * rendering/RenderBox.cpp: 11 (WebCore::RenderBox::computeLogicalWidth): 12 * rendering/RenderFlexibleBox.cpp: 13 (WebCore::RenderFlexibleBox::layoutHorizontalBlock): 14 (WebCore::RenderFlexibleBox::computePreferredSize): If the margin is 15 auto, treat it as flex(1 0 0). 16 * rendering/RenderObject.cpp: 17 (WebCore::RenderObject::isFlexibleBoxIncludingDeprecated): Added. 18 1 19 2011-08-22 Nat Duca <nduca@chromium.org> 2 20 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r93284 r93547 1631 1631 1632 1632 if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLogicalWidth != (logicalWidth() + marginStart() + marginEnd()) 1633 && !isFloating() && !isInline() && !cb->is DeprecatedFlexibleBox())1633 && !isFloating() && !isInline() && !cb->isFlexibleBoxIncludingDeprecated()) 1634 1634 cb->setMarginEndForChild(this, containerLogicalWidth - logicalWidth() - cb->marginStartForChild(this)); 1635 1635 } -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r92628 r93547 149 149 setHeight(std::max(height(), borderTop() + paddingTop() + child->marginTop() + child->height() + child->marginBottom() + paddingBottom() + borderBottom() + horizontalScrollbarHeight())); 150 150 151 // FIXME: Handle child margins. 151 if (child->style()->marginLeft().isAuto()) 152 child->setMarginLeft(availableFreeSpace > 0 ? lroundf(availableFreeSpace / totalPositiveFlexibility) : 0); 153 if (child->style()->marginRight().isAuto()) 154 child->setMarginRight(availableFreeSpace > 0 ? lroundf(availableFreeSpace / totalPositiveFlexibility) : 0); 155 156 xOffset += child->marginLeft(); 152 157 child->setLocation(IntPoint(xOffset, yOffset)); 153 xOffset += child->width() ;158 xOffset += child->width() + child->marginRight(); 154 159 } 155 160 … … 177 182 child->layoutIfNeeded(); 178 183 179 // FIXME: Margins and paddings set to auto have a positive flexibility of 1.180 184 preferredSize += preferredSizeForMarginsAndPadding(child->style()->marginLeft(), flexboxAvailableLogicalWidth); 181 185 preferredSize += preferredSizeForMarginsAndPadding(child->style()->marginRight(), flexboxAvailableLogicalWidth); … … 183 187 preferredSize += preferredSizeForMarginsAndPadding(child->style()->paddingRight(), flexboxAvailableLogicalWidth); 184 188 189 if (child->style()->marginLeft().isAuto()) 190 totalPositiveFlexibility += 1; 191 if (child->style()->marginRight().isAuto()) 192 totalPositiveFlexibility += 1; 193 185 194 preferredSize += child->borderLeft() + child->borderRight(); 186 195 -
trunk/Source/WebCore/rendering/RenderObject.h
r93144 r93547 753 753 virtual bool isFlexibleBox() const { return false; } 754 754 #endif 755 756 bool isFlexibleBoxIncludingDeprecated() const 757 { 758 #if ENABLE(CSS3_FLEXBOX) 759 return isFlexibleBox() || isDeprecatedFlexibleBox(); 760 #else 761 return isDeprecatedFlexibleBox(); 762 #endif 763 } 755 764 756 765 virtual bool isCombineText() const { return false; }
Note: See TracChangeset
for help on using the changeset viewer.