Rules mistakenly reports system-ui as matched in font-family declarations
Categories
(DevTools :: Inspector, defect, P2)
Tracking
(Not tracked)
People
(Reporter: fvsch, Unassigned)
References
Details
Attachments
(2 files)
Inspector is showing system-ui as matched in font-family: system-ui, foo, bar; but it's not actually matched. It seems Gecko does not yet support this value, according to bug 1226042.
In the attached screenshot, I changed the last part of the declaration from sans-serif to serif, and it does render the default Serif font (none of the earlier options matches, I'm on Linux but don't have Ubuntu or Roboto fonts installed).
I'm getting similar results with:
https://interactive-examples.mdn.mozilla.net/pages/css/font-family.html
Expected result:
- In the attached screenshot, the
serifvalue at the end of the declaration should be underlined instead ofsystem-ui.
| Reporter | ||
Comment 1•6 years ago
|
||
Test case:
<span style="font-family: system-ui">Test</span>
Result in Rules:
In the font-family value, system-ui is underlined.
Expected result:
No part of the font-family value is underlined.
Comment 2•6 years ago
|
||
Thanks for tracking this down, Florens!
I didn't know system-ui is not yet supported by Geko. It certainly complicates the issue.
The underline for the used font in the Rules panel is somewhat optimistic: it highlights the first generic if none of the named font families matched. In most scenarios, that is indeed the fallback. Not with system-ui it sounds.
The optimistic code was introduced before we had a way to actually match generic font families. Following work in bug 1464400, there is a field in the InspectorUtils.getUsedFontFaces() result that can tell us if the used font family is a generic. Rewriting the matching code in TextPropertyEditor to make use of it (via inspector.pageStyle.getUsedFontFaces()) should improve the matching, though I'm not sure how the missing support for system-ui will influence that.
This bug also sounds related to Bug 1473327. I'm not sure if the root cause is the same, so I'll keep both open until we get to investigate the issue more thoroughly.
| Assignee | ||
Updated•5 years ago
|
Updated•3 years ago
|
Description
•