OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 return baseline; | 189 return baseline; |
190 | 190 |
191 int marginAscent = direction == HorizontalLine ? marginTop() : marginRight() ; | 191 int marginAscent = direction == HorizontalLine ? marginTop() : marginRight() ; |
192 return synthesizedBaselineFromContentBox(this, direction) + marginAscent; | 192 return synthesizedBaselineFromContentBox(this, direction) + marginAscent; |
193 } | 193 } |
194 | 194 |
195 static ItemPosition resolveAlignment(const RenderStyle* parentStyle, const Rende rStyle* childStyle) | 195 static ItemPosition resolveAlignment(const RenderStyle* parentStyle, const Rende rStyle* childStyle) |
196 { | 196 { |
197 ItemPosition align = childStyle->alignSelf(); | 197 ItemPosition align = childStyle->alignSelf(); |
198 if (align == ItemPositionAuto) | 198 if (align == ItemPositionAuto) |
199 align = (parentStyle->alignItems() == ItemPositionAuto) ? ItemPositionSt retch : parentStyle->alignItems(); | 199 align = parentStyle->alignItems(); |
esprehn
2014/08/19 00:56:33
What if your parent is also auto? This doesn't see
jfernandez
2014/08/19 21:39:18
It shouldn't be; the 'align-items' property value
esprehn
2014/09/03 21:45:28
That doesn't make sense, if childStyle->alignSelf(
jfernandez
2014/09/03 22:27:49
Well, it's not that it can't, but it shouldn't. Cu
| |
200 return align; | 200 return align; |
201 } | 201 } |
202 | 202 |
203 void RenderFlexibleBox::removeChild(RenderObject* child) | 203 void RenderFlexibleBox::removeChild(RenderObject* child) |
204 { | 204 { |
205 RenderBlock::removeChild(child); | 205 RenderBlock::removeChild(child); |
206 m_intrinsicSizeAlongMainAxis.remove(child); | 206 m_intrinsicSizeAlongMainAxis.remove(child); |
207 } | 207 } |
208 | 208 |
209 void RenderFlexibleBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) | 209 void RenderFlexibleBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1309 break; | 1309 break; |
1310 } | 1310 } |
1311 case ItemPositionLastBaseline: | 1311 case ItemPositionLastBaseline: |
1312 case ItemPositionSelfStart: | 1312 case ItemPositionSelfStart: |
1313 case ItemPositionSelfEnd: | 1313 case ItemPositionSelfEnd: |
1314 case ItemPositionStart: | 1314 case ItemPositionStart: |
1315 case ItemPositionEnd: | 1315 case ItemPositionEnd: |
1316 case ItemPositionLeft: | 1316 case ItemPositionLeft: |
1317 case ItemPositionRight: | 1317 case ItemPositionRight: |
1318 // FIXME: File a bug about implementing that. The extended gramm ar | 1318 // FIXME: File a bug about implementing that. The extended gramm ar |
1319 // is not enabled by default so we shouldn't hit this codepath. | 1319 // is not implemented yet so we default to "stretch" for now. |
1320 break; | |
1321 default: | |
1320 ASSERT_NOT_REACHED(); | 1322 ASSERT_NOT_REACHED(); |
1321 break; | 1323 break; |
1322 } | 1324 } |
1323 } | 1325 } |
1324 minMarginAfterBaselines.append(minMarginAfterBaseline); | 1326 minMarginAfterBaselines.append(minMarginAfterBaseline); |
1325 } | 1327 } |
1326 | 1328 |
1327 if (style()->flexWrap() != FlexWrapReverse) | 1329 if (style()->flexWrap() != FlexWrapReverse) |
1328 return; | 1330 return; |
1329 | 1331 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1397 ASSERT(child); | 1399 ASSERT(child); |
1398 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; | 1400 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; |
1399 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; | 1401 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; |
1400 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; | 1402 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; |
1401 adjustAlignmentForChild(child, newOffset - originalOffset); | 1403 adjustAlignmentForChild(child, newOffset - originalOffset); |
1402 } | 1404 } |
1403 } | 1405 } |
1404 } | 1406 } |
1405 | 1407 |
1406 } | 1408 } |
OLD | NEW |