Skip to content

Commit ded7e00

Browse files
committed
Bug 1986987 [wpt PR 54697] - [Gap Decorations]: Major paint logic for Optimized GapGeometry, a=testonly
Automatic update from web-platform-tests [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 <almahermicrosoft.com> Commit-Queue: Sam Davis Omekara <samomekarajrmicrosoft.com> Cr-Commit-Position: refs/heads/main{#1511107} -- wpt-commits: 6c1e98272dfd3f340eff1a5250832ebf02bf2fbe wpt-pr: 54697 UltraBlame original commit: b82e85be6eb3ec6c2f57f812e349ae6122c39a52
1 parent bd00b3a commit ded7e00

3 files changed

Lines changed: 237 additions & 314 deletions

File tree

testing/web-platform/tests/css/css-gaps/grid/grid-gap-decorations-003-ref.html

Lines changed: 68 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -71,58 +71,42 @@
7171
.
7272
container
7373
{
74-
width
75-
:
76-
110px
77-
;
7874
height
7975
:
8076
110px
8177
;
82-
column
83-
-
84-
count
78+
width
8579
:
86-
2
80+
110px
8781
;
88-
column
89-
-
90-
gap
82+
display
9183
:
92-
10px
84+
grid
9385
;
94-
column
86+
grid
9587
-
96-
rule
88+
template
9789
-
98-
color
90+
columns
9991
:
100-
pink
92+
repeat
93+
(
94+
2
95+
1fr
96+
)
10197
;
10298
column
10399
-
104-
rule
105-
-
106-
style
100+
gap
107101
:
108-
dotted
102+
10px
109103
;
110-
column
111-
-
112-
rule
104+
row
113105
-
114-
width
106+
gap
115107
:
116108
10px
117109
;
118-
overflow
119-
:
120-
hidden
121-
;
122-
position
123-
:
124-
relative
125-
;
126110
}
127111
.
128112
item
@@ -145,53 +129,51 @@
145129
0
146130
;
147131
}
148-
/
149-
*
150-
For
151-
2x2
152-
grid
153-
-
154-
like
155-
layout
156-
add
157-
a
158-
10px
159-
bottom
160-
margin
161-
to
162-
odd
163-
children
164-
(
165-
#
166-
1
167-
&
168-
#
169-
3
170-
)
171-
to
172-
simulate
173-
a
174-
horizontal
175-
row
176-
gap
177132
.
178-
*
179-
/
180-
.
181-
item
182-
:
183-
nth
133+
col
184134
-
185-
child
186-
(
187-
odd
188-
)
135+
rule
189136
{
190137
margin
138+
:
139+
0px
140+
;
141+
padding
142+
:
143+
0px
144+
;
145+
width
146+
:
147+
0px
148+
;
149+
height
150+
:
151+
110px
152+
;
153+
border
191154
-
192-
bottom
155+
right
193156
:
194157
10px
158+
dotted
159+
;
160+
border
161+
-
162+
color
163+
:
164+
pink
165+
;
166+
position
167+
:
168+
absolute
169+
;
170+
left
171+
:
172+
50px
173+
;
174+
top
175+
:
176+
0px
195177
;
196178
}
197179
.
@@ -306,6 +288,20 @@
306288
class
307289
=
308290
"
291+
col
292+
-
293+
rule
294+
"
295+
>
296+
<
297+
/
298+
div
299+
>
300+
<
301+
div
302+
class
303+
=
304+
"
309305
row
310306
-
311307
rule

0 commit comments

Comments
 (0)