Changeset 107624 in webkit
- Timestamp:
- Feb 13, 2012 3:37:55 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r107622 r107624 1 2012-02-09 Ojan Vafai <ojan@chromium.org> 2 3 nesting horizontal flexboxes is broken 4 https://bugs.webkit.org/show_bug.cgi?id=76867 5 6 Reviewed by David Hyatt. 7 8 * css3/flexbox/floated-flexbox-expected.txt: 9 * css3/flexbox/line-wrapping.html: 10 The old results here were wrong because they wrapped the contents of each flex item. 11 12 * css3/flexbox/preferred-widths-expected.txt: Added. 13 * css3/flexbox/preferred-widths-orthogonal-expected.txt: Added. 14 * css3/flexbox/preferred-widths-orthogonal.html: Added. 15 * css3/flexbox/preferred-widths.html: Added. 16 1 17 2012-02-13 Mihnea Ovidenie <mihnea@adobe.com> 2 18 -
trunk/LayoutTests/css3/flexbox/floated-flexbox-expected.txt
r107112 r107624 1 FAIL: 2 Expected 130 for width, but got 110. 3 4 <div data-expected-width="130" data-expected-height="30" class="flexbox"> 5 <div style="background-color:pink; width: 20px; height: 20px;"></div> 6 <div style="background-color:red; width: 100px; height: 20px;"></div> 7 </div> 1 PASS -
trunk/LayoutTests/css3/flexbox/line-wrapping.html
r104625 r107624 188 188 </div> 189 189 190 <div class="flexbox auto row vertical-lr" data-expected-height= 300>191 <div data-expected-height= 150 data-expected-width=100>192 <div data-offset-x=4></div><div data-offset-x= 24></div><div data-offset-x=44 data-offset-y=0></div>193 </div> 194 <div data-expected-height= 150 data-expected-width=60 style="-webkit-flex-item-align: start;">195 <div data-offset-x=4></div><div data-offset-x= 24></div><div data-offset-x=44 data-offset-y=150></div>190 <div class="flexbox auto row vertical-lr" data-expected-height=500> 191 <div data-expected-height=250 data-expected-width=100> 192 <div data-offset-x=4></div><div data-offset-x=4></div><div data-offset-x=24 data-offset-y=0></div> 193 </div> 194 <div data-expected-height=250 data-expected-width=40 style="-webkit-flex-item-align: start;"> 195 <div data-offset-x=4></div><div data-offset-x=4></div><div data-offset-x=24 data-offset-y=250></div> 196 196 </div> 197 197 </div> … … 234 234 </div> 235 235 236 <div class="flexbox auto row vertical-rl" data-expected-height= 300>237 <div data-expected-height= 150 data-expected-width=100>238 <div data-offset-x=80></div><div data-offset-x= 60></div><div data-offset-x=40 data-offset-y=0></div>239 </div> 240 <div data-expected-height= 150 data-expected-width=60 style="-webkit-flex-item-align: start;">241 <div data-offset-x=80></div><div data-offset-x= 60></div><div data-offset-x=40 data-offset-y=150></div>236 <div class="flexbox auto row vertical-rl" data-expected-height=500> 237 <div data-expected-height=250 data-expected-width=100> 238 <div data-offset-x=80></div><div data-offset-x=80></div><div data-offset-x=60 data-offset-y=0></div> 239 </div> 240 <div data-expected-height=250 data-expected-width=40 style="-webkit-flex-item-align: start;"> 241 <div data-offset-x=80></div><div data-offset-x=80></div><div data-offset-x=60 data-offset-y=250></div> 242 242 </div> 243 243 </div> -
trunk/Source/WebCore/ChangeLog
r107622 r107624 1 2012-02-09 Ojan Vafai <ojan@chromium.org> 2 3 nesting horizontal flexboxes is broken 4 https://bugs.webkit.org/show_bug.cgi?id=76867 5 6 Reviewed by David Hyatt. 7 8 This is copied from RenderDeprecatedFlexibleBox and updated 9 for RenderFlexibleBox and to handle vertical writing mode. 10 11 Tests: css3/flexbox/preferred-widths-orthogonal.html 12 css3/flexbox/preferred-widths.html 13 14 * rendering/RenderBlock.cpp: 15 (WebCore::RenderBlock::computePreferredLogicalWidths): 16 * rendering/RenderFlexibleBox.cpp: 17 (WebCore::marginWidthForChild): 18 (WebCore): 19 (WebCore::RenderFlexibleBox::computePreferredLogicalWidths): 20 * rendering/RenderFlexibleBox.h: 21 (RenderFlexibleBox): 22 1 23 2012-02-13 Mihnea Ovidenie <mihnea@adobe.com> 2 24 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r107622 r107624 5024 5024 5025 5025 int scrollbarWidth = 0; 5026 // FIXME: This should only be done for horizontal writing mode. 5027 // For vertical writing mode, this should check overflowX and use the horizontalScrollbarHeight. 5026 5028 if (hasOverflowClip() && styleToUse->overflowY() == OSCROLL) { 5027 5029 layer()->setHasVerticalScrollbar(true); -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r107446 r107624 115 115 } 116 116 117 static LayoutUnit marginLogicalWidthForChild(RenderBox* child, RenderStyle* parentStyle) 118 { 119 // A margin has three types: fixed, percentage, and auto (variable). 120 // Auto and percentage margins become 0 when computing min/max width. 121 // Fixed margins can be added in as is. 122 Length marginLeft = child->style()->marginStartUsing(parentStyle); 123 Length marginRight = child->style()->marginEndUsing(parentStyle); 124 LayoutUnit margin = 0; 125 if (marginLeft.isFixed()) 126 margin += marginLeft.value(); 127 if (marginRight.isFixed()) 128 margin += marginRight.value(); 129 return margin; 130 } 131 132 void RenderFlexibleBox::computePreferredLogicalWidths() 133 { 134 ASSERT(preferredLogicalWidthsDirty()); 135 136 RenderStyle* styleToUse = style(); 137 if (styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() > 0) 138 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(styleToUse->logicalWidth().value()); 139 else { 140 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0; 141 142 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) { 143 if (child->isPositioned()) 144 continue; 145 146 LayoutUnit margin = marginLogicalWidthForChild(child, style()); 147 bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizontalWritingMode(); 148 LayoutUnit minPreferredLogicalWidth = hasOrthogonalWritingMode ? child->logicalHeight() : child->minPreferredLogicalWidth(); 149 LayoutUnit maxPreferredLogicalWidth = hasOrthogonalWritingMode ? child->logicalHeight() : child->maxPreferredLogicalWidth(); 150 minPreferredLogicalWidth += margin; 151 maxPreferredLogicalWidth += margin; 152 if (!isColumnFlow()) { 153 m_minPreferredLogicalWidth += minPreferredLogicalWidth; 154 m_maxPreferredLogicalWidth += maxPreferredLogicalWidth; 155 } else { 156 m_minPreferredLogicalWidth = std::max(minPreferredLogicalWidth, m_minPreferredLogicalWidth); 157 m_maxPreferredLogicalWidth = std::max(maxPreferredLogicalWidth, m_maxPreferredLogicalWidth); 158 } 159 } 160 161 m_maxPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 162 } 163 164 LayoutUnit scrollbarWidth = 0; 165 if (hasOverflowClip()) { 166 if (isHorizontalWritingMode() && styleToUse->overflowY() == OSCROLL) { 167 layer()->setHasVerticalScrollbar(true); 168 scrollbarWidth = verticalScrollbarWidth(); 169 } else if (!isHorizontalWritingMode() && styleToUse->overflowX() == OSCROLL) { 170 layer()->setHasHorizontalScrollbar(true); 171 scrollbarWidth = horizontalScrollbarHeight(); 172 } 173 } 174 175 m_maxPreferredLogicalWidth += scrollbarWidth; 176 m_minPreferredLogicalWidth += scrollbarWidth; 177 178 if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) { 179 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMinWidth().value())); 180 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMinWidth().value())); 181 } 182 183 if (styleToUse->logicalMaxWidth().isFixed()) { 184 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMaxWidth().value())); 185 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(styleToUse->logicalMaxWidth().value())); 186 } 187 188 LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth(); 189 m_minPreferredLogicalWidth += borderAndPadding; 190 m_maxPreferredLogicalWidth += borderAndPadding; 191 192 setPreferredLogicalWidthsDirty(false); 193 } 194 117 195 void RenderFlexibleBox::layoutBlock(bool relayoutChildren, int, BlockLayoutPass) 118 196 { -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r107446 r107624 44 44 45 45 virtual bool isFlexibleBox() const { return true; } 46 46 virtual void computePreferredLogicalWidths(); 47 47 virtual void layoutBlock(bool relayoutChildren, int pageLogicalHeight = 0, BlockLayoutPass = NormalLayoutPass); 48 48
Note: See TracChangeset
for help on using the changeset viewer.