| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 | 168 |
| 169 void LayoutGrid::ComputeTrackSizesForDefiniteSize( | 169 void LayoutGrid::ComputeTrackSizesForDefiniteSize( |
| 170 GridTrackSizingDirection direction, | 170 GridTrackSizingDirection direction, |
| 171 LayoutUnit available_space) { | 171 LayoutUnit available_space) { |
| 172 LayoutUnit free_space = | 172 LayoutUnit free_space = |
| 173 available_space - GuttersSize(grid_, direction, 0, | 173 available_space - GuttersSize(grid_, direction, 0, |
| 174 grid_.NumTracks(direction), | 174 grid_.NumTracks(direction), |
| 175 available_space); | 175 available_space); |
| 176 track_sizing_algorithm_.Setup(direction, NumTracks(direction, grid_), | 176 track_sizing_algorithm_.Setup(direction, NumTracks(direction, grid_), |
| 177 kTrackSizing, available_space, free_space); | 177 available_space, free_space); |
| 178 track_sizing_algorithm_.Run(); | 178 track_sizing_algorithm_.Run(); |
| 179 | 179 |
| 180 #if DCHECK_IS_ON() | 180 #if DCHECK_IS_ON() |
| 181 DCHECK(track_sizing_algorithm_.TracksAreWiderThanMinTrackBreadth()); | 181 DCHECK(track_sizing_algorithm_.TracksAreWiderThanMinTrackBreadth()); |
| 182 #endif | 182 #endif |
| 183 } | 183 } |
| 184 | 184 |
| 185 void LayoutGrid::RepeatTracksSizingIfNeeded( | 185 void LayoutGrid::RepeatTracksSizingIfNeeded( |
| 186 LayoutUnit available_space_for_columns, | 186 LayoutUnit available_space_for_columns, |
| 187 LayoutUnit available_space_for_rows) { | 187 LayoutUnit available_space_for_rows) { |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 min_logical_width += scrollbar_width; | 468 min_logical_width += scrollbar_width; |
| 469 max_logical_width += scrollbar_width; | 469 max_logical_width += scrollbar_width; |
| 470 } | 470 } |
| 471 | 471 |
| 472 void LayoutGrid::ComputeTrackSizesForIndefiniteSize( | 472 void LayoutGrid::ComputeTrackSizesForIndefiniteSize( |
| 473 GridTrackSizingAlgorithm& algo, | 473 GridTrackSizingAlgorithm& algo, |
| 474 GridTrackSizingDirection direction, | 474 GridTrackSizingDirection direction, |
| 475 Grid& grid, | 475 Grid& grid, |
| 476 LayoutUnit& min_intrinsic_size, | 476 LayoutUnit& min_intrinsic_size, |
| 477 LayoutUnit& max_intrinsic_size) const { | 477 LayoutUnit& max_intrinsic_size) const { |
| 478 algo.Setup(direction, NumTracks(direction, grid), kIntrinsicSizeComputation, | 478 algo.Setup(direction, NumTracks(direction, grid), WTF::kNullopt, |
| 479 WTF::kNullopt, WTF::kNullopt); | 479 WTF::kNullopt); |
| 480 algo.Run(); | 480 algo.Run(); |
| 481 | 481 |
| 482 min_intrinsic_size = algo.MinContentSize(); | 482 min_intrinsic_size = algo.MinContentSize(); |
| 483 max_intrinsic_size = algo.MaxContentSize(); | 483 max_intrinsic_size = algo.MaxContentSize(); |
| 484 | 484 |
| 485 size_t number_of_tracks = algo.Tracks(direction).size(); | 485 size_t number_of_tracks = algo.Tracks(direction).size(); |
| 486 LayoutUnit total_gutters_size = | 486 LayoutUnit total_gutters_size = |
| 487 GuttersSize(grid, direction, 0, number_of_tracks, WTF::kNullopt); | 487 GuttersSize(grid, direction, 0, number_of_tracks, WTF::kNullopt); |
| 488 min_intrinsic_size += total_gutters_size; | 488 min_intrinsic_size += total_gutters_size; |
| 489 max_intrinsic_size += total_gutters_size; | 489 max_intrinsic_size += total_gutters_size; |
| (...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2405 if (direction == kForRows) | 2405 if (direction == kForRows) |
| 2406 return grid.NumTracks(kForRows); | 2406 return grid.NumTracks(kForRows); |
| 2407 | 2407 |
| 2408 return grid.NumTracks(kForRows) | 2408 return grid.NumTracks(kForRows) |
| 2409 ? grid.NumTracks(kForColumns) | 2409 ? grid.NumTracks(kForColumns) |
| 2410 : GridPositionsResolver::ExplicitGridColumnCount( | 2410 : GridPositionsResolver::ExplicitGridColumnCount( |
| 2411 StyleRef(), grid.AutoRepeatTracks(kForColumns)); | 2411 StyleRef(), grid.AutoRepeatTracks(kForColumns)); |
| 2412 } | 2412 } |
| 2413 | 2413 |
| 2414 } // namespace blink | 2414 } // namespace blink |
| OLD | NEW |