| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 return align; | 1289 return align; |
| 1290 } | 1290 } |
| 1291 | 1291 |
| 1292 LayoutUnit RenderGrid::rowPositionForChild(const RenderBox* child) const | 1292 LayoutUnit RenderGrid::rowPositionForChild(const RenderBox* child) const |
| 1293 { | 1293 { |
| 1294 bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizo
ntalWritingMode(); | 1294 bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizo
ntalWritingMode(); |
| 1295 ItemPosition alignSelf = resolveAlignment(style(), child->style()); | 1295 ItemPosition alignSelf = resolveAlignment(style(), child->style()); |
| 1296 | 1296 |
| 1297 switch (alignSelf) { | 1297 switch (alignSelf) { |
| 1298 case ItemPositionSelfStart: | 1298 case ItemPositionSelfStart: |
| 1299 // If orthogonal writing-modes, this computes to 'Start'. | |
| 1300 // FIXME: grid track sizing and positioning does not support orthogonal
modes yet. | |
| 1301 if (hasOrthogonalWritingMode) | |
| 1302 return startOfRowForChild(child); | |
| 1303 | |
| 1304 // self-start is based on the child's block axis direction. That's why w
e need to check against the grid container's block flow. | |
| 1305 if (child->style()->writingMode() != style()->writingMode()) | |
| 1306 return endOfRowForChild(child); | |
| 1307 | |
| 1308 return startOfRowForChild(child); | 1299 return startOfRowForChild(child); |
| 1309 case ItemPositionSelfEnd: | 1300 case ItemPositionSelfEnd: |
| 1310 // If orthogonal writing-modes, this computes to 'End'. | |
| 1311 // FIXME: grid track sizing and positioning does not support orthogonal
modes yet. | |
| 1312 if (hasOrthogonalWritingMode) | |
| 1313 return endOfRowForChild(child); | |
| 1314 | |
| 1315 // self-end is based on the child's block axis direction. That's why we
need to check against the grid container's block flow. | |
| 1316 if (child->style()->writingMode() != style()->writingMode()) | |
| 1317 return startOfRowForChild(child); | |
| 1318 | |
| 1319 return endOfRowForChild(child); | 1301 return endOfRowForChild(child); |
| 1320 | 1302 |
| 1321 case ItemPositionLeft: | 1303 case ItemPositionLeft: |
| 1322 // orthogonal modes make property and inline axes to be parallel, but in
any case | 1304 // orthogonal modes make property and inline axes to be parallel, but in
any case |
| 1323 // this is always equivalent to 'Start'. | 1305 // this is always equivalent to 'Start'. |
| 1324 // | 1306 // |
| 1325 // self-align's axis is never parallel to the inline axis, except in ort
hogonal | 1307 // self-align's axis is never parallel to the inline axis, except in ort
hogonal |
| 1326 // writing-mode, so this is equivalent to 'Start’. | 1308 // writing-mode, so this is equivalent to 'Start’. |
| 1327 return startOfRowForChild(child); | 1309 return startOfRowForChild(child); |
| 1328 | 1310 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 if (isOutOfFlowPositioned()) | 1424 if (isOutOfFlowPositioned()) |
| 1443 return "RenderGrid (positioned)"; | 1425 return "RenderGrid (positioned)"; |
| 1444 if (isAnonymous()) | 1426 if (isAnonymous()) |
| 1445 return "RenderGrid (generated)"; | 1427 return "RenderGrid (generated)"; |
| 1446 if (isRelPositioned()) | 1428 if (isRelPositioned()) |
| 1447 return "RenderGrid (relative positioned)"; | 1429 return "RenderGrid (relative positioned)"; |
| 1448 return "RenderGrid"; | 1430 return "RenderGrid"; |
| 1449 } | 1431 } |
| 1450 | 1432 |
| 1451 } // namespace blink | 1433 } // namespace blink |
| OLD | NEW |