support final OM interfaces to @font-face and @font-feature-values rules
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: jtd, Unassigned)
References
(Blocks 3 open bugs, )
Details
(Keywords: dev-doc-needed, parity-chrome, parity-safari)
The final version of the OM interfaces for @font-face and @font-feature-values rules differ from the present Gecko interfaces: http://www.w3.org/TR/css3-fonts/#object-model @font-face: interface CSSFontFaceRule : CSSRule { attribute DOMString family; attribute DOMString src; attribute DOMString style; attribute DOMString weight; attribute DOMString stretch; attribute DOMString unicodeRange; attribute DOMString variant; attribute DOMString featureSettings; } @font-feature-values: interface CSSFontFeatureValuesRule : CSSRule { attribute DOMString fontFamily; readonly attribute CSSFontFeatureValuesMap annotation; readonly attribute CSSFontFeatureValuesMap ornaments; readonly attribute CSSFontFeatureValuesMap stylistic; readonly attribute CSSFontFeatureValuesMap swash; readonly attribute CSSFontFeatureValuesMap characterVariant; readonly attribute CSSFontFeatureValuesMap styleset; } [MapClass(DOMString, sequence<unsigned long>)] interface CSSFontFeatureValuesMap { void set(DOMString featureValueName, (unsigned long or sequence<unsigned long>) values); } The MapClass is a tabbism that got negative feedback from js folks so we probably need to convert that into what we actually want to support.
Updated•10 years ago
|
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Comment 1•9 years ago
|
||
Tab notes that Chrome/Webkit still use the old style rule OM model from CSS2: https://lists.w3.org/Archives/Public/www-style/2015Sep/0055.html
Reporter | ||
Comment 2•9 years ago
|
||
Test for simple @font-face rule OM modifications: http://people.mozilla.org/~jdaggett/tests/fontfaceruleomtest.html
Reporter | ||
Comment 3•9 years ago
|
||
David, I'm going to go ahead and work on the implementation of this. This specifically means moving from the existing problematic "style rule within an @-rule" OM model for @font-face rules to something that roughly corresponds with the FontFace interface: https://drafts.csswg.org/css-fonts/#cssfontfacerule https://drafts.csswg.org/css-font-loading/#fontface-interface This will eliminate the problem of having to add new @font-face descriptors to the CSS2Properties interface. Just wanted to confirm that you are comfortable with this change. If you have any concern/issues, please note them.
Definitely seems good to untie it from CSS2Properties. I'm a little worried about the compatibility of getting rid of the .style indirection. Might it be necessary to continue supporting .style (maybe even with .style being a pointer back to the same object) for compatibility?
Reporter | ||
Comment 5•9 years ago
|
||
Yeah, that's a good question. Modifying attributes seems to only be functional in Safari, both Chrome and Firefox don't update the font matching correctly. So I can't see authors really using this interface in its current state. I think this might be something to simply implement and see if anyone reports bugs on. If need be, we can add something to deal with the .style case.
Comment 6•6 years ago
|
||
The CSSFontFaceRule object model changes seem to have been dropped from the spec, but there is still an interesting CSSFontFeatureValuesRule interface in css-fonts-4.
Comment 7•2 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.
Updated•2 years ago
|
Comment 8•2 years ago
|
||
Jonathan, are you planning to add this? I am working on font-variant-alternates in Chromium and it'd be useful to implement parsing tests based on this.
Comment 9•2 years ago
|
||
(In reply to Dominik Röttsches (drott) from comment #8)
Jonathan, are you planning to add this? I am working on font-variant-alternates in Chromium and it'd be useful to implement parsing tests based on this.
In principle, I'd like us to do it; but I don't know of any current plans/timescale for when it might happen, sorry.
(I believe we do have some tests in place, but they test by comparing with a reference rendering, not via the OM.)
Comment 10•2 years ago
|
||
Related: I added a CSSOM test to WPT: https://wpt.fyi/results/css/cssom/CSSFontFeatureValuesRule.html
Updated•2 months ago
|
Updated•2 months ago
|
Comment 12•2 months ago
|
||
Here's a simple testcase from dupe bug 1906625, which shows that we just report undefined
for various attributes that should in fact be present:
https://bug1906625.bmoattachments.org/attachment.cgi?id=9413136
(Chrome/Safari show the actual values of these attributes, taken from the @font-face {...}
rule defined in CSS.)
Description
•