Consider CSS attr() fallback
Categories
(DevTools :: Inspector: Rules, enhancement, P3)
Tracking
(relnote-firefox -, firefox149 fixed)
People
(Reporter: canadahonk, Assigned: nchevobbe)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-needed)
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
Bug 1854104 - [devtools] Strike through unused attr() parameter in Rules view. r=#devtools-reviewers
48 bytes,
text/x-phabricator-request
|
Details | Review |
Support for CSS attr()'s fallback (eg attr(foo, "fallback")) is being implemented and shipped in Bug 1448248. It should display okay in DevTools currently but it could possibly be improved (needs investigation). No other browsers implement or ship it at this time.
| Assignee | ||
Comment 1•2 years ago
|
||
We could do what is done for var() and display the value not being used in a "disabled"-grey color
CanadaHonk, can we detect that in javascript that the fallback is used?
| Reporter | ||
Comment 2•2 years ago
|
||
No unfortunately, the spec doesn't add anything to DOM/etc exposing any fallback info afaik. I would be happy to add it but would likely need an upstream spec issue deciding how best to do so.
Comment 3•2 years ago
|
||
Well, we can detect it using element.hasAttribute(...) right?
Updated•2 years ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 4•4 months ago
|
||
This adds unmatched class to the attribute name or the fallback depending
on the existence of the attribute (provided via a getAttributeValue option.
In #parseMatchingParens, we know also return whitespace tokens so we can
reconstruct the authored value properly from it.
Test cases are added in browser_outputparser.js to cover this.
Updated•4 months ago
|
| Assignee | ||
Comment 5•4 months ago
|
||
Comment 7•4 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/67683182d95c
https://hg.mozilla.org/mozilla-central/rev/e056a92f93f3
Updated•3 months ago
|
Comment 8•3 months ago
|
||
Similarily to bug 2011646, I believe this should be mentioned at least in the dev release notes for Firefox 149 and maybe even in the general release notes together with the addition in 2011646.
Sebastian
Comment 9•2 months ago
|
||
(In reply to Sebastian Zartner [:sebo] from comment #8)
Similarily to bug 2011646, I believe this should be mentioned at least in the dev release notes for Firefox 149 and maybe even in the general release notes together with the addition in 2011646.
A little late now, though I'll try it anyway.
[Why is this notable]: New DevTools feature
[Affects Firefox for Android]: no
[Suggested wording]: In the Rules view, the unused value within the attr() function is now crossed out and there's a tooltip shown displaying the referenced HTML attribute's value.
[Links (documentation, blog post, etc)]:
Bug 2011646
Updated•2 months ago
|
| Assignee | ||
Comment 10•2 months ago
|
||
Thanks Sebo (and sorry for dropping the ball here)
Updated•2 months ago
|
Description
•