Commit cf38e74
Fix corner-shape shadow & outline rendering
As per resolution in
w3c/csswg-drafts#13037 (comment)
Shadows should be border-aligned, like border inset,
with external "miters" that are clipped to the outer edge.
The miter is computed by extending the start and end tangents of the
curve until they reach the outer edge.
The tangent is the line between the start point, and the "control
point": a point that would be the quadratic control point if this
was a normal quadratic curve with the same half-corner.
As part of this work, refactoring the rendering tests to be both
more precise and closer to something that can be reasoned about being
close to the spec.
See spec PR: w3c/csswg-drafts#13173
The PR and the WPT rendering code were developed side by side to
ensure that the tests assert the spec.
Since the spec defines that curves are approximate, and ref tests can
fail on antialiasing and curve inaccuracies, the corners are also
stroked with a blue 3px line on both the actual and ref versions, to
avoid test failures in these occasions.
(This change is guarded by the BorderRadiusCorrectionCoverageFactor,
as without it shadow rects wouldn't have an origin rect, so the
changed code paths is never reached).
Bug: 463996869
Change-Id: I7f586440f47757416b8eb9a2002629cd29e0174a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7215437
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Noam Rosenthal <nrosenthal@google.com>
Cr-Commit-Position: refs/heads/main@{#1554276}1 parent 9de04ec commit cf38e74
File tree
15 files changed
+755
-364
lines changed- third_party/blink
- renderer
- core/paint
- platform/geometry
- web_tests
- external/wpt/css/css-borders/corner-shape
- resources
- fast/borders
15 files changed
+755
-364
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
351 | 355 | | |
352 | 356 | | |
353 | 357 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
| |||
Lines changed: 38 additions & 59 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
277 | 293 | | |
278 | 294 | | |
279 | 295 | | |
280 | 296 | | |
281 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
282 | 308 | | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 309 | + | |
298 | 310 | | |
| 311 | + | |
299 | 312 | | |
| 313 | + | |
300 | 314 | | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
| 315 | + | |
315 | 316 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
330 | 320 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
| 321 | + | |
| 322 | + | |
345 | 323 | | |
346 | 324 | | |
| 325 | + | |
347 | 326 | | |
348 | 327 | | |
349 | 328 | | |
| |||
Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 0 additions & 50 deletions
This file was deleted.
third_party/blink/web_tests/external/wpt/css/css-borders/corner-shape/render-corner-shape-ref.html
Lines changed: 16 additions & 0 deletions
| 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 | + | |
0 commit comments