-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-values] Short-circuit if() evaluation #11500
Comments
This would extend to custom functions as well; none of the following functions are in a cycle:
This probably does place
EDIT: Added |
Yes, --x() and --y() should be non-cyclic; --z() has a cycle inside of itself (--unused is cyclic) but the function itself isn't cyclic; and --w() is cyclic. |
This is now fairly easy to do by extending the CycleElem type introduced in CL:6176920. Both attributes (used by attr()) and locals need the AtomicString type; we can distinguish between the two cases using a StrongAlias. Note that this CL follows the behavior described in Issue 11500, not what the spec currently says. Therefore, the test is marked as tentative. w3c/csswg-drafts#11500 Bug: 325504770 Change-Id: I5a00e03175f0446a0ec6e6ba771253b4ea5f48e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6190327 Commit-Queue: Anders Hartvoll Ruud <[email protected]> Reviewed-by: Munira Tursunova <[email protected]> Cr-Commit-Position: refs/heads/main@{#1415484}
This is now fairly easy to do by extending the CycleElem type introduced in CL:6176920. Both attributes (used by attr()) and locals need the AtomicString type; we can distinguish between the two cases using a StrongAlias. Note that this CL follows the behavior described in Issue 11500, not what the spec currently says. Therefore, the test is marked as tentative. w3c/csswg-drafts#11500 Bug: 325504770 Change-Id: I5a00e03175f0446a0ec6e6ba771253b4ea5f48e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6190327 Commit-Queue: Anders Hartvoll Ruud <[email protected]> Reviewed-by: Munira Tursunova <[email protected]> Cr-Commit-Position: refs/heads/main@{#1415484}
This is now fairly easy to do by extending the CycleElem type introduced in CL:6176920. Both attributes (used by attr()) and locals need the AtomicString type; we can distinguish between the two cases using a StrongAlias. Note that this CL follows the behavior described in Issue 11500, not what the spec currently says. Therefore, the test is marked as tentative. w3c/csswg-drafts#11500 Bug: 325504770 Change-Id: I5a00e03175f0446a0ec6e6ba771253b4ea5f48e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6190327 Commit-Queue: Anders Hartvoll Ruud <[email protected]> Reviewed-by: Munira Tursunova <[email protected]> Cr-Commit-Position: refs/heads/main@{#1415484}
…variables, a=testonly Automatic update from web-platform-tests [functions] Detect cycles between local variables This is now fairly easy to do by extending the CycleElem type introduced in CL:6176920. Both attributes (used by attr()) and locals need the AtomicString type; we can distinguish between the two cases using a StrongAlias. Note that this CL follows the behavior described in Issue 11500, not what the spec currently says. Therefore, the test is marked as tentative. w3c/csswg-drafts#11500 Bug: 325504770 Change-Id: I5a00e03175f0446a0ec6e6ba771253b4ea5f48e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6190327 Commit-Queue: Anders Hartvoll Ruud <[email protected]> Reviewed-by: Munira Tursunova <[email protected]> Cr-Commit-Position: refs/heads/main@{#1415484} -- wpt-commits: c5dda19e7580e26e7f5e538af095fdff241c9301 wpt-pr: 50483
…variables, a=testonly Automatic update from web-platform-tests [functions] Detect cycles between local variables This is now fairly easy to do by extending the CycleElem type introduced in CL:6176920. Both attributes (used by attr()) and locals need the AtomicString type; we can distinguish between the two cases using a StrongAlias. Note that this CL follows the behavior described in Issue 11500, not what the spec currently says. Therefore, the test is marked as tentative. w3c/csswg-drafts#11500 Bug: 325504770 Change-Id: I5a00e03175f0446a0ec6e6ba771253b4ea5f48e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6190327 Commit-Queue: Anders Hartvoll Ruud <[email protected]> Reviewed-by: Munira Tursunova <[email protected]> Cr-Commit-Position: refs/heads/main@{#1415484} -- wpt-commits: c5dda19e7580e26e7f5e538af095fdff241c9301 wpt-pr: 50483
In a world where huge trees of custom function calls and inline if()s need to be evaluated, it would be nice if we could stop evaluating once a matching condition is found:
In the above, we don't want to evaluate (substitute)
--expensive()
if an earlier branch will do.Relatedly, a
var()
function also has up to two branches: the main value produced by the custom property being referenced, and optionally the fallback value. As specified currently, we can not short-circuit this "evaluation", since we need to look for cycles in the fallback value:--x
and--y
are in a cycle above, even though the fallback paths are not taken. By default, I'd expect this to extend to the branches not taken forif()
as well, otherwise we'd miss the cycle in a case like:So:
if()
?var()
when it's not taken? (Requires compat investigation.)attr()
).The text was updated successfully, but these errors were encountered: