| 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 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 // values. Hence, we need to compute margins in order to determine the | 1411 // values. Hence, we need to compute margins in order to determine the |
| 1412 // available height before stretching. | 1412 // available height before stretching. |
| 1413 return gridAreaBreadthForChild - | 1413 return gridAreaBreadthForChild - |
| 1414 (child.needsLayout() | 1414 (child.needsLayout() |
| 1415 ? computeMarginLogicalSizeForChild(BlockDirection, child) | 1415 ? computeMarginLogicalSizeForChild(BlockDirection, child) |
| 1416 : marginLogicalHeightForChild(child)); | 1416 : marginLogicalHeightForChild(child)); |
| 1417 } | 1417 } |
| 1418 | 1418 |
| 1419 StyleSelfAlignmentData LayoutGrid::alignSelfForChild( | 1419 StyleSelfAlignmentData LayoutGrid::alignSelfForChild( |
| 1420 const LayoutBox& child) const { | 1420 const LayoutBox& child) const { |
| 1421 if (!child.isAnonymous()) | 1421 if (!child.isAnonymous()) { |
| 1422 return child.styleRef().resolvedAlignSelf(selfAlignmentNormalBehavior()); | 1422 return child.styleRef().resolvedAlignSelf( |
| 1423 selfAlignmentNormalBehavior(&child)); |
| 1424 } |
| 1423 // All the 'auto' values has been solved by the StyleAdjuster, but it's | 1425 // All the 'auto' values has been solved by the StyleAdjuster, but it's |
| 1424 // possible that some grid items generate Anonymous boxes, which need to be | 1426 // possible that some grid items generate Anonymous boxes, which need to be |
| 1425 // solved during layout. | 1427 // solved during layout. |
| 1426 return child.styleRef().resolvedAlignSelf(selfAlignmentNormalBehavior(), | 1428 return child.styleRef().resolvedAlignSelf(selfAlignmentNormalBehavior(&child), |
| 1427 style()); | 1429 style()); |
| 1428 } | 1430 } |
| 1429 | 1431 |
| 1430 StyleSelfAlignmentData LayoutGrid::justifySelfForChild( | 1432 StyleSelfAlignmentData LayoutGrid::justifySelfForChild( |
| 1431 const LayoutBox& child) const { | 1433 const LayoutBox& child) const { |
| 1432 if (!child.isAnonymous()) | 1434 if (!child.isAnonymous()) { |
| 1433 return child.styleRef().resolvedJustifySelf(ItemPositionStretch); | 1435 return child.styleRef().resolvedJustifySelf( |
| 1436 selfAlignmentNormalBehavior(&child)); |
| 1437 } |
| 1434 // All the 'auto' values has been solved by the StyleAdjuster, but it's | 1438 // All the 'auto' values has been solved by the StyleAdjuster, but it's |
| 1435 // possible that some grid items generate Anonymous boxes, which need to be | 1439 // possible that some grid items generate Anonymous boxes, which need to be |
| 1436 // solved during layout. | 1440 // solved during layout. |
| 1437 return child.styleRef().resolvedJustifySelf(selfAlignmentNormalBehavior(), | 1441 return child.styleRef().resolvedJustifySelf( |
| 1438 style()); | 1442 selfAlignmentNormalBehavior(&child), style()); |
| 1439 } | 1443 } |
| 1440 | 1444 |
| 1441 GridTrackSizingDirection LayoutGrid::flowAwareDirectionForChild( | 1445 GridTrackSizingDirection LayoutGrid::flowAwareDirectionForChild( |
| 1442 const LayoutBox& child, | 1446 const LayoutBox& child, |
| 1443 GridTrackSizingDirection direction) const { | 1447 GridTrackSizingDirection direction) const { |
| 1444 return !isOrthogonalChild(child) | 1448 return !isOrthogonalChild(child) |
| 1445 ? direction | 1449 ? direction |
| 1446 : (direction == ForColumns ? ForRows : ForColumns); | 1450 : (direction == ForColumns ? ForRows : ForColumns); |
| 1447 } | 1451 } |
| 1448 | 1452 |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2091 if (direction == ForRows) | 2095 if (direction == ForRows) |
| 2092 return grid.numTracks(ForRows); | 2096 return grid.numTracks(ForRows); |
| 2093 | 2097 |
| 2094 return grid.numTracks(ForRows) | 2098 return grid.numTracks(ForRows) |
| 2095 ? grid.numTracks(ForColumns) | 2099 ? grid.numTracks(ForColumns) |
| 2096 : GridPositionsResolver::explicitGridColumnCount( | 2100 : GridPositionsResolver::explicitGridColumnCount( |
| 2097 styleRef(), grid.autoRepeatTracks(ForColumns)); | 2101 styleRef(), grid.autoRepeatTracks(ForColumns)); |
| 2098 } | 2102 } |
| 2099 | 2103 |
| 2100 } // namespace blink | 2104 } // namespace blink |
| OLD | NEW |