- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Wed, 26 Mar 2025 00:48:51 +0000
- To: public-css-archive@w3.org
As part of this, btw, dependency tracking was rewritten as well, but that *should* be an editorial change resulting in the same behavior (it's just much easier to describe the if()'s short-circuiting in the new model). Rather than building a dependency graph and looking for cycles, we now more explicitly handle (nested) substitution, keeping track of what context triggered the substitution so we can spot cycles as they appear. This should address Emilio's concerns about the dependency graph being ill-defined if `if()` can short-circuit. It's now strictly defined, algorithmically, how and when dependencies are invoked and checked. Overall, the changes are: 1. Switched how dependencies are tracked, necessitating a rewrite of the substitution algo to be more explicit. Substitution is now recursive, applying only to "top-level" arb-sub functions in a sequence of component values. Anything in the arglist of an arb-sub function is handled *by* the arb-sub function itself. 2. Gave all arb-sub functions an "argument grammar", in addition to its normal grammar, which it's parsed with *first*. Then the "replace a foo() function" algorithm that each arb-sub function defines dictates exactly how and when those arguments are further substituted and parsed. (I'm not the happiest with the verbosity of these algorithms; I want to give this time to stew and see if I can craft some abstractions that make it clearer and easier to both read and write.) 3. Added the "spread syntax", provisionally spelled `...foo()`, which causes an arb-sub function to be replaced *before* applying the parent function's argument grammar. (All other functions are replaced *after* the parent function's contents have been divided into arguments.) 4. Rewrote the algo for replacing arb-sub functions in properties to work with the above framework. (Minimal change, it's just now explicitly recursive and adds the right substitution context.) Assuming these all look good, I'll apply the same changes to `var()` and custom functions, but I'm leaving them alone for the moment to let this set of changes settle. -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11500#issuecomment-2752883041 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 26 March 2025 00:48:52 UTC