Closed Bug 1448248 Opened 6 years ago Closed 6 months ago

Implement CSS attr(<attr-name>, <attr-fallback>)

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
relnote-firefox --- 119+
firefox119 --- fixed

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
Priority: -- → P3
Severity: normal → S3

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
Attachment #9330947 - Attachment description: WIP: Bug 1448248 - Implement CSS attr func fallback → Bug 1448248 - Implement CSS attr func fallback
Assignee: nobody → oj
Status: NEW → ASSIGNED
Attachment #9330947 - Attachment description: Bug 1448248 - Implement CSS attr func fallback → WIP: Bug 1448248 - Implement CSS attr func fallback
Attachment #9330947 - Attachment description: WIP: Bug 1448248 - Implement CSS attr func fallback → Bug 1448248 - Implement CSS attr() fallback
Blocks: 1854104
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
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
Upstream PR merged by moz-wptsync-bot

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.

relnote-firefox: --- → ?

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

You need to log in before you can comment on or make changes to this bug.