Implement CSS attr(<attr-name>, <attr-fallback>)
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Tracking
()
People
(Reporter: sebo, Assigned: canadahonk)
References
(Blocks 2 open bugs, )
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
The CSS Values and Units Module Level 3 extends the attr() function to optionally specify a fallback value, which is used if the named attribute is missing, or its value cannot be parsed into the given type or is invalid/out-of-range for the property. This bug is meant to implement the basic functionality of the fallback value for the case the attribute is missing. Sebastian
Updated•6 years ago
|
Comment 1•5 years ago
|
||
Tests
background: attr(data-test color);
http://w3c-test.org/css/css-values/attr-color-valid.html
width: attr(data-test length);
http://w3c-test.org/css/css-values/attr-length-valid-zero-nofallback.html
width: attr(data-test length);
http://w3c-test.org/css/css-values/attr-length-valid.html
width: attr(data-test px);
http://w3c-test.org/css/css-values/attr-px-valid.html
Updated•2 years ago
|
Assignee | ||
Comment 2•11 months ago
|
||
Implemented support for a fallback in CSS attr funcs
(attr(<attr-name>, <attr-fallback>)
)
Spec: https://drafts.csswg.org/css-values-5/#attr-notation
WIP. Todo:
- Parse fallback into variable
- Use fallback in C++
- Add WPT tests
Assignee | ||
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Updated•6 months ago
|
Pushed by oj@oojmed.com: https://hg.mozilla.org/integration/autoland/rev/a14395d9ad06 Implement CSS attr() fallback r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42079 for changes under testing/web-platform/tests
Comment 5•6 months ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Assignee | ||
Comment 7•6 months ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: New CSS feature supported
[Affects Firefox for Android]: Yes
[Suggested wording]: The CSS attr()
function now supports a fallback parameter (eg attr(foobar, "Default value")
). First browser to implement, and ship.
[Links (documentation, blog post, etc)]: None yet.
Comment 8•6 months ago
|
||
Added to 119 beta release notes (https://www.mozilla.org/en-US/firefox/119.0beta/releasenotes/) as well as the Draft release notes for 119
Updated•6 months ago
|
Comment 9•6 months ago
|
||
Description
•