Skip to content

Commit 04565da

Browse files
andruudmoz-wptsync-bot
authored andcommitted
Bug 1945585 [wpt PR 50449] - [functions] Implement dynamic scoping, a=testonly
Automatic update from web-platform-tests [functions] Implement dynamic scoping The relevant CSSWG resolution is linked in Issue 393207782. Bug: 325504770 Change-Id: I3d6557210e7a4b4d7f72a1851c83f5e6b09ddfc6 Fixed: 393207782 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6225179 Reviewed-by: Steinar H Gunderson <[email protected]> Commit-Queue: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/main@{#1415029} -- wpt-commits: e03db7992264a6a4374f9338127b4ee48b2af6ec wpt-pr: 50449
1 parent bfd0579 commit 04565da

File tree

1 file changed

+198
-0
lines changed

1 file changed

+198
-0
lines changed

testing/web-platform/tests/css/css-mixins/dashed-function-eval.html

+198
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,204 @@
425425
resolves: https://github.com/w3c/csswg-drafts/issues/10954
426426
-->
427427

428+
<template data-name="Substitute local from outer scope">
429+
<style>
430+
@function --f() {
431+
--x: PASS;
432+
result: --g();
433+
}
434+
@function --g() {
435+
result: var(--x);
436+
}
437+
#target {
438+
--x: FAIL;
439+
--actual: --f();
440+
--expected: PASS;
441+
}
442+
</style>
443+
</template>
444+
445+
<template data-name="Substitute argument from outer scope">
446+
<style>
447+
@function --f(--x) {
448+
result: --g();
449+
}
450+
@function --g() {
451+
result: var(--x);
452+
}
453+
#target {
454+
--x: FAIL;
455+
--actual: --f(PASS);
456+
--expected: PASS;
457+
}
458+
</style>
459+
</template>
460+
461+
<template data-name="Inner argument shadowing outer argument">
462+
<style>
463+
@function --f(--x) {
464+
result: --g(PASS);
465+
}
466+
@function --g(--x) {
467+
result: var(--x);
468+
}
469+
#target {
470+
--x: FAIL;
471+
--actual: --f(FAIL);
472+
--expected: PASS;
473+
}
474+
</style>
475+
</template>
476+
477+
<template data-name="Inner argument shadowing outer local">
478+
<style>
479+
@function --f() {
480+
--x: FAIL;
481+
result: --g(PASS);
482+
}
483+
@function --g(--x) {
484+
result: var(--x);
485+
}
486+
#target {
487+
--x: FAIL;
488+
--actual: --f();
489+
--expected: PASS;
490+
}
491+
</style>
492+
</template>
493+
494+
<template data-name="Inner local shadowing outer argument">
495+
<style>
496+
@function --f(--x) {
497+
result: --g();
498+
}
499+
@function --g() {
500+
--x: PASS;
501+
result: var(--x);
502+
}
503+
#target {
504+
--x: FAIL;
505+
--actual: --f(FAIL);
506+
--expected: PASS;
507+
}
508+
</style>
509+
</template>
510+
511+
<template data-name="Inner local shadowing outer local">
512+
<style>
513+
@function --f() {
514+
--x: FAIL;
515+
result: --g();
516+
}
517+
@function --g() {
518+
--x: PASS;
519+
result: var(--x);
520+
}
521+
#target {
522+
--x: FAIL;
523+
--actual: --f();
524+
--expected: PASS;
525+
}
526+
</style>
527+
</template>
528+
529+
<template data-name="Referencing outer local containing var()">
530+
<style>
531+
@function --f() {
532+
--y: 1;
533+
--x: var(--y);
534+
result: --g();
535+
}
536+
@function --g() {
537+
--y: 0;
538+
result: var(--x);
539+
}
540+
#target {
541+
--y: 0;
542+
--x: FAIL;
543+
--actual: --f();
544+
--expected: 1;
545+
}
546+
</style>
547+
</template>
548+
549+
<template data-name="Referencing outer typed argument">
550+
<style>
551+
@function --f(--l <length>: 10.00px) {
552+
result: --g();
553+
}
554+
@function --g() {
555+
result: var(--l);
556+
}
557+
#target {
558+
--actual: --f();
559+
--expected: 10px;
560+
}
561+
</style>
562+
</template>
563+
564+
<template data-name="Same function with different scopes">
565+
<style>
566+
@function --one() {
567+
--x: 1;
568+
result: --f();
569+
}
570+
@function --two() {
571+
--x: 2;
572+
result: --f();
573+
}
574+
@function --three() {
575+
--x: 3;
576+
result: --f();
577+
}
578+
@function --f() {
579+
result: var(--x);
580+
}
581+
#target {
582+
--x: 0;
583+
--actual: --one() --two() --three() --f();
584+
--expected: 1 2 3 0;
585+
}
586+
</style>
587+
</template>
588+
589+
<template data-name="Referencing local two frames up">
590+
<style>
591+
@function --a() {
592+
--x: 1;
593+
result: --b();
594+
}
595+
@function --b() {
596+
result: --c();
597+
}
598+
@function --c() {
599+
result: var(--x);
600+
}
601+
#target {
602+
--x: 0;
603+
--actual: --a();
604+
--expected: 1;
605+
}
606+
</style>
607+
</template>
608+
609+
<template data-name="IACVT outer local shadows property">
610+
<style>
611+
@function --a() {
612+
--x: var(--unknown);
613+
result: --b();
614+
}
615+
@function --b() {
616+
result: var(--x, PASS);
617+
}
618+
#target {
619+
--x: FAIL;
620+
--actual: --a();
621+
--expected: PASS;
622+
}
623+
</style>
624+
</template>
625+
428626
<!-- Shadowing -->
429627

430628
<template data-name="Parameter shadows custom property">

0 commit comments

Comments
 (0)