Re: [css3-fonts][cssom] proposal for revised definition of CSSFontFaceRule

On Thu, Sep 13, 2012 at 12:46 AM, John Daggett <jdaggett@mozilla.com> wrote:
> I think it might make sense to define a new, simpler interface for accessing
> descriptors in @-rules and simply define CSSFontFactRule as an interface
> containing descriptors that implements that interface.
>
>   [NoInterfaceObject] interface DescriptorAccess {
>     DOMString GetDescriptorValue(DOMString descName);
>     void SetDescriptorValue(DOMString descName, DOMString value);
>
>     readonly attribute unsigned long length;
>     DOMString item(unsigned long index);
>   };
>
>   interface CSSFontFaceRule : CSSRule {
>
>     // descriptors
>     attribute DOMString fontFamily;
>     attribute DOMString src;
>     attribute DOMString fontWeight;
>     attribute DOMString fontStyle;
>     attribute DOMString fontStretch;
>     attribute DOMString fontVariant;
>     attribute DOMString fontFeatureSettings;
>     attribute DOMString unicodeRange;
>
>     // load state - whether the font is loaded or not
>     readonly attribute boolean loaded;
>
>   };
>
>   interface CSSFontFaceRule implements DescriptorAccess;
>
> If there's concern about the existing rule.style.xxx accessors,
> implementations could alias those to the properties above.  Other
> rules, such as the @counter-style rule, could follow this model,
> rather than using CSSStyleDeclaration as a global property bucket.
>
> Thoughts?

Yup, sounds great.  I can update the @counter-style OM for this immediately.

~TJ

Received on Thursday, 13 September 2012 14:41:17 UTC