[css-attr] Fix failing type(...) parsing tests.
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox151 | --- | fixed |
People
(Reporter: sukil, Assigned: sukil)
References
(Blocks 1 open bug)
Details
(Whiteboard: css-attr , [wptsync upstream])
Attachments
(3 files, 1 obsolete file)
A number of type(...) tests in attr-all-types.html fail like:
test_valid_attr('--y', 'attr(data-foo type(*))', 'var(--x, 3)', '3');test_valid_attr('--y', 'attr(data-foo type(*))', 'attr(data-bar, 11)', '"3"');
These tests expect recursive resolution. I.e. data-foo=attr(data-bar, 3) to be resolved as 3. Right now we resolve it as type(<string>) so data-foo substitutes as "attr(data-bar, 11)" but the test would expect 3.
Updated•4 months ago
|
Comment 1•4 months ago
|
||
Basically, need to support recursive substitution.
Recursive substitution of attr shouldn't be super complicated, but attr -> var substitution could get complicated with registered properties that defer its computation.
Comment 2•4 months ago
|
||
So we need to make correct deferring of attr() substitution for e.g. For --bar: attr(foo) + foo="var(--registered-length)" + --registered-length: 5em; (Depending on attribute, depending on registered property, depending on font-size). Also need to handle circular references e.g. font-size: attr(foo) + foo="var(--registered-length)" + --registered-length: 5em` (Depending on attribute, depending on registered property, depending on a computed value that depends on font size).
Ultimately, this means that we need to do a bit more legwork and try to parse the attribute in question like a declaration value, like we do for fallbacks - These would store references to other properties/attributes to be used during substitution time here for fallbacks
As for when that needs to happen... Well, attributes can be used for prioritary properties, so to be able to detect circular references by then, we need to have references populated by the first substitution time. OTOH we can't handle it exactly like fallbacks, because attributes depend on which element we're styling.
| Assignee | ||
Updated•4 months ago
|
| Assignee | ||
Comment 3•3 months ago
|
||
| Assignee | ||
Comment 4•3 months ago
|
||
The test previously expected width: 3, which passed without
proper attr() substitution. It now compares against width: 3px
using data-baz=3px to test for correct substitution.
Comment 5•2 months ago
|
||
Comment 6•2 months ago
|
||
Updated•2 months ago
|
Comment 9•2 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/2d1dba54adb6
https://hg.mozilla.org/mozilla-central/rev/034bbef95b7e
https://hg.mozilla.org/mozilla-central/rev/f99176341264
Updated•1 month ago
|
Description
•