Last item in custom property fallback list is hidden [in DevTools Inspector] if used on font-family property
Categories
(DevTools :: Inspector: Rules, defect, P2)
Tracking
(firefox117 fixed)
Tracking | Status | |
---|---|---|
firefox117 | --- | fixed |
People
(Reporter: chriskirknielsen, Assigned: nchevobbe)
References
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0
Steps to reproduce:
TEST CASE: https://codepen.io/chriskirknielsen/pen/ExOwpdb
- Create markup with a <p> and some text.
- Style the paragraph using the
font-family
property in CSS with a custom property. - Give the
var()
a fallback value of a list of fonts, e.g.:var(--family, Georgia, serif)
. - Open Developer Tools panel and pick the <p> element.
- In the Rules panel, look at the
font-family
value and notice the fallback list is missing the last item, showing:var(--family, Georgia,)
.
Notes:
- The custom property does not need to exist.
- If the fallback has a single value, it will show
var(--family,)
. - The correct styles appear in the Styles Editor panel.
- The expect style is correctly applied (you can test it with
font-family: var(--_not_a_custom_property, NotARealFont, Georgia);
and see the font is applied but you cannot see Georgia in the list with the underline as expected). - If you edit the value in the Rules panel, it will remove the last item upon applying, e.g: editing
var(--family, Georgia,)
tovar(--family, Arial, sans-serif)
will result in a displayed value ofvar(--family, Arial,)
.
I tested the same case with a box-shadow and it did not exhibit the same problem, however it is possible it might affect other comma-separated properties that can be in a fallback, like backgrounds; I have not tested that.
Tested on stable Firefox v114 and Firefox Nightly v117, on macOS Ventura 13.4.1.
Actual results:
Developer Tools omits the last item in a custom property's fallback value if it is a comma-separated list when used on a font-family
property.
Expected results:
The full list of fonts should appear in the Rules panel.
Reporter | ||
Comment 1•3 months ago
|
||
Developer Tools bug also occurs when editing the fallback value in the Rules panel.
Comment 2•3 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•3 months ago
|
||
From the description, it sounds like the values are working correctly; it's just the display of the rule in DevTools that is wrong. So moving this to the DevTools component.
Comment 4•2 months ago
|
||
Thanks for reporting.
We can reproduce the issue.
Updated•2 months ago
|
Updated•2 months ago
|
Assignee | ||
Comment 5•2 months ago
|
||
Doesn't look like this is the same issue as Bug 1841502 as this one can be reproduced on 115 and Bug 1841502 was introduced in 116
Assignee | ||
Comment 6•2 months ago
•
|
||
Also, one thing I didn't notice at first: this is an invalid declaration. var()
only takes a single fallback value, so that might be way we're missing any other param (we definitely shouldn't though).
Also, the value should be marked as invalid, not sure why it's not (there is a CSS warning in the console saying the the value can't be parsed and that the declaration is dropped)
erratum: it's not invalid
Assignee | ||
Comment 7•2 months ago
|
||
Depends on D183384
Updated•2 months ago
|
Updated•2 months ago
|
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/438f5d514a4c [devtools] Consume `fontFamilyNameParts` outside of the loop going over tokens in. r=devtools-reviewers,ochameau.
Comment 9•2 months ago
|
||
bugherder |
Description
•