Commit 63c2a61
[Gap Decorations]: Refactor GapAccumulator design in Grid
This CL refactors the `GapAccumulator` class to improve its design as
suggested in [1]. The main change is the removal of the `GapGeometry`
object as a member. Instead of initializing a `GapGeometry` member on
construction, its creation is now deferred until its actually needed
(i.e. in the `BuildGapGeometry()` method).
To support this, four members are added: {column}{row}_intersections and
{col}{row}_gutter_size. These are populated during the layout algorithm.
As part of this shift, `MarkGapIntersectionBlocked` has been moved from
the `GapGeometry` class to `GapAccumulator`.
This refactor also resolves two bugs: 1.) Creation of a GapGeometry with
empty rows or columns. 2.) Use of gap intersection points when the gap
property is not specified.
Both issues are addressed in `BuildGapGeometry`, where we now:
* Return nullptr if no intersection points were constructed.
* Set intersection points only when the corresponding gutter size is greater than zero.
[1]:
https://chromium-review.googlesource.com/c/chromium/src/+/6460775/comment/5252c3a9_0b6876ac/
Fixed: 420421606
Fixed: 420421605
Bug: 393631108
Change-Id: I796cf3e2630a30c02f12ffcba32b411ebd876373
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6593336
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Sam Davis Omekara <samomekarajr@microsoft.com>
Reviewed-by: Kurt Catti-Schmidt <kschmi@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1467138}1 parent 0fd8fdc commit 63c2a61
3 files changed
Lines changed: 80 additions & 0 deletions
File tree
- css/css-gaps/grid
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments