Chromium Code Reviews| 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 481 | 481 |
| 482 return availableLogicalSpaceIgnoringFractionTracks / accumulatedFractions; | 482 return availableLogicalSpaceIgnoringFractionTracks / accumulatedFractions; |
| 483 } | 483 } |
| 484 | 484 |
| 485 const GridTrackSize& RenderGrid::gridTrackSize(GridTrackSizingDirection directio n, size_t i) const | 485 const GridTrackSize& RenderGrid::gridTrackSize(GridTrackSizingDirection directio n, size_t i) const |
| 486 { | 486 { |
| 487 const Vector<GridTrackSize>& trackStyles = (direction == ForColumns) ? style ()->gridDefinitionColumns() : style()->gridDefinitionRows(); | 487 const Vector<GridTrackSize>& trackStyles = (direction == ForColumns) ? style ()->gridDefinitionColumns() : style()->gridDefinitionRows(); |
| 488 if (i >= trackStyles.size()) | 488 if (i >= trackStyles.size()) |
| 489 return (direction == ForColumns) ? style()->gridAutoColumns() : style()- >gridAutoRows(); | 489 return (direction == ForColumns) ? style()->gridAutoColumns() : style()- >gridAutoRows(); |
| 490 | 490 |
| 491 return trackStyles[i]; | 491 const GridTrackSize& trackSize = trackStyles[i]; |
| 492 // If the logical width/height of the grid container is indefinite, percenta ge values are treated as <auto>. | |
| 493 if (trackSize.isPercentage()) { | |
| 494 Length logicalSize = direction == ForColumns ? style()->logicalWidth() : style()->logicalHeight(); | |
| 495 if (logicalSize.isIntrinsic()) { | |
|
ojan
2013/12/10 22:53:26
Should this be isInstrinsicOrAuto? Also, what if i
svillar
2013/12/16 17:46:51
Yeah I guess auto should be considered here as ind
| |
| 496 DEFINE_STATIC_LOCAL(GridTrackSize, autoTrackSize, (Auto)); | |
|
ojan
2013/12/10 22:53:26
I don't expect you gain anything here by making th
svillar
2013/12/16 17:46:51
Well, we need to return a reference to a GridTrack
| |
| 497 return autoTrackSize; | |
| 498 } | |
| 499 } | |
| 500 | |
| 501 return trackSize; | |
| 492 } | 502 } |
| 493 | 503 |
| 494 size_t RenderGrid::explicitGridColumnCount() const | 504 size_t RenderGrid::explicitGridColumnCount() const |
| 495 { | 505 { |
| 496 return style()->gridDefinitionColumns().size(); | 506 return style()->gridDefinitionColumns().size(); |
| 497 } | 507 } |
| 498 | 508 |
| 499 size_t RenderGrid::explicitGridRowCount() const | 509 size_t RenderGrid::explicitGridRowCount() const |
| 500 { | 510 { |
| 501 return style()->gridDefinitionRows().size(); | 511 return style()->gridDefinitionRows().size(); |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1143 if (isOutOfFlowPositioned()) | 1153 if (isOutOfFlowPositioned()) |
| 1144 return "RenderGrid (positioned)"; | 1154 return "RenderGrid (positioned)"; |
| 1145 if (isAnonymous()) | 1155 if (isAnonymous()) |
| 1146 return "RenderGrid (generated)"; | 1156 return "RenderGrid (generated)"; |
| 1147 if (isRelPositioned()) | 1157 if (isRelPositioned()) |
| 1148 return "RenderGrid (relative positioned)"; | 1158 return "RenderGrid (relative positioned)"; |
| 1149 return "RenderGrid"; | 1159 return "RenderGrid"; |
| 1150 } | 1160 } |
| 1151 | 1161 |
| 1152 } // namespace WebCore | 1162 } // namespace WebCore |
| OLD | NEW |