Changeset 93996 in webkit
- Timestamp:
- Aug 29, 2011 11:53:54 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r93994 r93996 1 2011-08-29 Tony Chang <tony@chromium.org> 2 3 Implement -webkit-flex-pack for horizontal flexboxen 4 https://bugs.webkit.org/show_bug.cgi?id=66898 5 6 Reviewed by Ojan Vafai. 7 8 * css3/flexbox/004-expected.txt: Added. 9 * css3/flexbox/004.html: Added. 10 1 11 2011-08-29 Sam Weinig <sam@webkit.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r93995 r93996 1 2011-08-29 Tony Chang <tony@chromium.org> 2 3 Implement -webkit-flex-pack for horizontal flexboxen 4 https://bugs.webkit.org/show_bug.cgi?id=66898 5 6 Reviewed by Ojan Vafai. 7 8 Test: css3/flexbox/004.html 9 10 * rendering/RenderFlexibleBox.cpp: 11 (WebCore::RenderFlexibleBox::layoutHorizontalBlock): 12 (WebCore::hasPackingSpace): 13 (WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithmHorizontal): 14 1 15 2011-08-29 Alexey Proskuryakov <ap@apple.com> 2 16 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r93651 r93996 139 139 } 140 140 141 // FIXME: Distribute leftover space to the packing space (second distribution round).142 141 // FIXME: Handle distribution of vertical space (third distribution round). 143 142 } … … 180 179 totalNegativeFlexibility += child->style()->flexboxWidthNegativeFlex(); 181 180 } 181 } 182 183 static bool hasPackingSpace(LayoutUnit availableFreeSpace, float totalPositiveFlexibility) 184 { 185 return availableFreeSpace > 0 && !totalPositiveFlexibility; 182 186 } 183 187 … … 227 231 // Now that we know the sizes, layout and position the flex items. 228 232 LayoutUnit xOffset = borderLeft() + paddingLeft(); 233 234 if (hasPackingSpace(availableFreeSpace, totalPositiveFlexibility)) { 235 if (style()->flexPack() == PackEnd) 236 xOffset += availableFreeSpace; 237 else if (style()->flexPack() == PackCenter) 238 xOffset += availableFreeSpace / 2; 239 } 240 229 241 LayoutUnit yOffset = borderTop() + paddingTop(); 230 242 setHeight(0); … … 248 260 child->setLocation(IntPoint(xOffset, yOffset)); 249 261 xOffset += child->width() + child->marginRight(); 262 263 if (hasPackingSpace(availableFreeSpace, totalPositiveFlexibility) && style()->flexPack() == PackJustify && childSizes.size() > 1) 264 xOffset += availableFreeSpace / (childSizes.size() - 1); 250 265 } 251 266 return true;
Note: See TracChangeset
for help on using the changeset viewer.