RE: [css-fonts] Shape of the CSSFontFaceRule interface

>On Sun, Sep 6, 2015 at 5:46 PM, John Daggett <jdaggett@mozilla.com> wrote:
>> Tab Atkins wrote:
>>> It looks like Chrome and Firefox both implement the old DOM L2 Style
>>> definition.  Can we just accept that and converge on that definition?
>>> The current spec appears to be fiction.
>>
>> It doesn't work to use the old DOM L2 Style decl because it doesn't
>> include unicode-range and you end up with weird font shorthand issues
>> that shouldn't exist. So, no, using the old definition is not
>> appropriate. Additionally, the parsing of the 'family' name is
>> different, since for the @font-face rule it's a single value and not a
>> list of names. Same for 'weight', the parsing is different.
>>
>> The mutation of @font-face rules in Firefox doesn't really work anyways.
>> I originally wanted to make this read-only but either you or Daniel
>> said it should be mutable.
>>
>> So I think this is simply a matter of an unimplemented but necessary
>> feature (as are many OM interfaces within CSS). It would be great if
>> you could push to get this changed within Chrome and I can suggest
>> that Firefox matches that.
>
>The .style object in Chrome has a unicodeRange property.
>
>I know there are serious issues with reusing the style object.  I'm not arguing
>about the technical purity of this.  I'm saying that all browsers that I've tested
>have a particular API shape, and it's fairly likely that sites depend on that
>shape, so we should probably accept that and just deal with the fallout.  If you
>think it's possible to change the API shape to match the Fonts 3 draft, I
>encourage you to try it out in Firefox and report back; we'd be happy to match
>if it was compatible.  But let's do this soon, please; I don't want Font Loading
>to match fiction.
>
>~TJ

We currently don't expose any of this in our CSSOM for @font-face, but we don't think that any of the descriptors should reside under .style. We think that it should be in the FontFaceRule as described here with one little change, we think that it should be fontWeight, fontStyle, fontVariant, etc as just having style will be confusing with the .style which is a CSSStyleRuleDeclaration. Regarding that "it's fairly certain that sites depend on that shape" as an argument I can tell you that I have 0 bugs regarding this so you should feel safe to change :)

Greg

Received on Wednesday, 7 October 2015 22:42:52 UTC