css/css-values/if-cycle.html expects a `style()` test of `--prop` inside `--prop`'s own `if()` to make it guaranteed-invalid, where css-values-5 makes that test false
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- html, javascript, playwright
Research direction
Start with css/css-values/if-cycle.html and compare the five cases where style() tests --prop inside its own if() against the css-values-5 rule quoted in the issue. Run the supplied reproducer to confirm the browser results. Decide whether the test expectations or the spec rule need to change, then update the affected cases and verify the Web Platform Test.
Written by the indexing model from the issue text.
Description
css-values-5's replace an if() function says: "If a <style-query> in condition tests the value of a property, and guarding a substitution context «"property", referenced-property-name» would mark it as a cyclic substitution context, that query evaluates to false." Its example: "in --foo: if(style(--foo: bar): baz); the style() query is automatically false". The rule came with w3c/csswg-drafts#11500, in w3c/csswg-drafts@c7235bb46274.
css/css-values/if-cycle.html puts each if() in --prop, and five cases test --prop itself in a style() query and expect --prop to be guaranteed-invalid (''). By the rule each of those tests is false, so the if() takes its other branch: if(style(--prop): var(--prop); else: value) gives value, if(style(--prop: 3): true_value; else: false_value) gives false_value, and the or/and cases follow from a false (--prop). Chromium and WebKit compute '' as the test expects; Firefox leaves the if()s it does not support as written.
Reproducer: https://gist.github.com/YevheniiKotyrlo/7c169641ce372c86f3fc124dde3a54db
git clone https://gist.github.com/7c169641ce372c86f3fc124dde3a54db.git if-cycle-style-test-of-itself
cd if-cycle-style-test-of-itself
sh ./run.sh
run.sh installs Playwright and runs repro.mjs, which reads the rule from csswg-drafts main and if-cycle.html from wpt master, prints each case whose style() query tests --prop, and computes each in Chromium, Firefox and WebKit as test_if() does. It exits 1 while the rule stands and a case expects ''. On Windows 11 with Node 26.12.1 and Playwright 1.65.0:
css-values-5 from w3c/csswg-drafts@6f177f4c13fbc3153474b66e88c25cf58ce5cfdd; if-cycle.html from web-platform-tests/wpt@7afc7e8f2ae85d916622d5de523a6bf08c55f3c1
css-values-5: "If a <<style-query>> in |condition| tests the value of a property, and [=guarded|guarding=] a [=substitution context=] &bs<<;"property", referenced-property-name&bs>>; would mark it as a [=cyclic substitution context=], that query evaluates to false."
wpt test_if: --prop: if(style(--prop): var(--prop); else: value) with [] expects ''
wpt test_if: --prop: if(style(--prop: 3): true_value; else: false_value) with [["--prop","3"]] expects ''
wpt test_if: --prop: if(style(not (--prop)): true_value; else: false_value) with [] expects ''
wpt test_if: --prop: if(style((--prop) or (--y)): true_value; else: false_value) with [["--y","3"]] expects ''
wpt test_if: --prop: if(style((--prop) and (--y)): true_value; else: false_value) with [["--y","3"]] expects ''
wpt test_if: --prop: if(style(--x: 0): value1; style(--prop): value2) with [["--x","0"]] expects 'value1'
the engines' --prop for each case above, in order:
playwright 1.65.0
chromium 158.0.8127.18: '', '', '', '', '', 'value1'
firefox 159.0: '', 'if(style(--prop: 3): true_value; else: false_value)', 'if(style(not (--prop)): true_value; else: false_value)', 'if(style((--prop) or (--y)): true_value; else: false_value)', 'if(style((--prop) and (--y)): true_value; else: false_value)', 'if(style(--x: 0): value1; style(--prop): value2)'
webkit 27.2: '', '', '', '', '', 'value1'
SUMMARY: css-values-5 makes a style() test of --prop inside --prop's own if() false, and if-cycle.html expects 5 such if()s to make --prop guaranteed-invalid ('')
I'd expect these cases to expect the branch the false test leads to, or the rule to change if the cycle is meant to win.
- Dominant language
- HTML
- Stars
- 6.3k
- Forks
- 4.1k
- Avg merge
- 17h 20m
- Merged PRs (30d)
- 841
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from web-platform-tests/wpt
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
web-platform-tests/wpt#65844 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
web-platform-tests/wpt#65836 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
web-platform-tests/wpt#65831 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
web-platform-tests/wpt#65826 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
web-platform-tests/wpt#65823 ·
Maintainers usually reply within 1 day
All issues in web-platform-tests/wpt
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
agent/scanner bug stage/010-actionable
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
torch-spyre/spyre-inference#1849 ·
Maintainers usually reply within 2 days
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day