You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Gap Decorations]: Major paint logic for Optimized GapGeometry
This CL implements the core paint logic for the optimized approach to
gap geometry. The main changes are in the "population" methods in
`gap_geometry.h` and the addition of the new `GapPainter` class in
`gap_painter.h`.
Gap decorations are painted relative to intersections within a gap, as a
result this change generates these intersection points at paint time
rather than storing precomputed intersections from layout. The general
principle for generating intersection points is:
content-start → intersections between main × cross gaps → content-end
However, the way we compute the middle intersections depends on the
container type. For flex cross gaps, there are only two intersections
(start and end), so the pattern doesn’t fully apply. This distinction
requires calculating the end offset for flex cross gaps dynamically.
The code is exercised through existing web tests in the
virtual/css-gap-decorations-optimized/external/wpt/css/css-gaps/ folder
as all changes are behind the CSSGapDecorationOptimized feature flag.
Note: This CL does not yet handle rule-break behavior as a result tests
that are exercising that logic are marked as failing in this CL.
Currently, decorations are painted from the start to the end of a gap
without interruption. Rule-break handling will be addressed in an
upcoming change.
Other changes made in this CL are:
* For flex:
- Previously, ContentStart and ContentEnd offsets were not set when a flex line contained only a single item. This has been corrected.
- The offset for the main gap no longer needs to be adjusted based on flex direction. It now consistently represents the position where the flex line ends plus the gap. (Relevant test updated accordingly.)
* For `MainGap` and `CrossGapRange`:
- Introduced getters and setters for `CrossGapRange`, improving ease of use during paint time.
* For grid tests:
- Updated test references to use standard div elements instead of relying on column rules from multi-column layout.
Bug: 436140061, 357648037
Change-Id: I0a0eadbad7f4911a98ae22060327ef1acc526ab3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6848348
Reviewed-by: Alison Maher <[email protected]>
Commit-Queue: Sam Davis Omekara <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1511107}
0 commit comments