Commit d944b8a
Bug 1950096 [wpt PR 50907] - [functions] Let parameter defaults reference other parameters, a=testonly
Automatic update from web-platform-tests
[functions] Let parameter defaults reference other parameters
Per "evaluate a custom function" [1], the default value of a parameter
may "see" other parameters, e.g. @function --f(--x, --y:var(--x)).
Before this CL, that var(--x) would resolve in the outer scope,
but now it's supposed to resolve against the actual argument value
passed for --x. At the same time, default values should not have
access to the actual *locals* of the function body, meaning that
they resolve in some gray area *between* the outer scope and inner
scope.
In this CL, that "gray area" is implemented by using a disposable
FunctionContext with the unresolved defaults set as the unresolved
locals. This is convenient, because we get all the needed "dependency
handling" (including cycle detection) for free.
Since various things now need to parse against a type (arguments,
defaults, and the 'result' descriptor), and because these various
things differ in how they are represented (some CSSVariableData,
some StringView), this CL aligns all of those things to use
CSSVariableData, and adjusts ResolveFunctionExpression accordingly.
This would be needed anyway, to actually transport various tainting
information, though that is not explicit handled/tested in this CL.
Finally, note that there is a drive-by fix in this CL: the "already
applied" branch of ApplyLocalVariables now actually skips the work
if it's already applied. This should ideally have a performance test,
which is tracked as a follow-up task (Issue 397164440).
[1] https://drafts.csswg.org/css-mixins-1/#evaluate-a-custom-function
Fixed: 397459622
Bug: 325504770, 397164440
Change-Id: Ic705209d25f4bee6149f2397bda78e1224b16901
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6276516
Commit-Queue: Anders Hartvoll Ruud <[email protected]>
Reviewed-by: Steinar H Gunderson <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1423855}
--
wpt-commits: b5045d03a5a6963f8af68d403e24bb325f2ce2e6
wpt-pr: 509071 parent 7b86ff4 commit d944b8a
File tree
2 files changed
+127
-5
lines changed- testing/web-platform/tests/css/css-mixins
2 files changed
+127
-5
lines changedLines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
310 | 335 | | |
311 | 336 | | |
312 | 337 | | |
Lines changed: 102 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
308 | 365 | | |
309 | 366 | | |
310 | 367 | | |
| |||
420 | 477 | | |
421 | 478 | | |
422 | 479 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | 480 | | |
429 | 481 | | |
430 | 482 | | |
| |||
623 | 675 | | |
624 | 676 | | |
625 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
626 | 723 | | |
627 | 724 | | |
628 | 725 | | |
| |||
0 commit comments