Open Bug 1058408 Opened 10 years ago Updated 1 year ago

support final OM interfaces to @font-face and @font-feature-values rules


(Core :: CSS Parsing and Computation, defect)





(Reporter: jtd, Unassigned)


(Blocks 3 open bugs)


(Keywords: dev-doc-needed)

The final version of the OM interfaces for @font-face and @font-feature-values rules differ from the present Gecko interfaces:


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;


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.
Assignee: nobody → jdaggett
Tab notes that Chrome/Webkit still use the old style rule OM model from CSS2:
Test for simple @font-face rule OM modifications:
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:

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.
Flags: needinfo?(dbaron)
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?
Flags: needinfo?(dbaron)
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.
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.
Blocks: css-fonts-4
No longer blocks: css-fonts-3
Blocks: 1529054

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: jd.bugzilla → nobody
Severity: normal → S3

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 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.)

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