Re: [css3-fonts][cssom] Load events for webfonts?

On Wed, Aug 22, 2012 at 12:43 PM, John Daggett <jdaggett@mozilla.com> wrote:

> Tab Atkins wrote:
>
> > Modified proposal based on advice on how to spec events properly:
> >
> > [Constructor(DOMString type, optional FontFaceEventInit eventInitDict)]
> > interface FontFaceEvent : Event {
> >   readonly attribute DOMString? family;
> >   readonly attribute DOMString? src;
> >   readonly attribute DOMString? style;
> >   readonly attribute DOMString? weight;
> >   readonly attribute DOMString? stretch;
> >   readonly attribute DOMString? unicodeRange;
> >   readonly attribute DOMString? variant;
> >   readonly attribute DOMString? featureSettings;
> > };
>

If we are going to be using CSSStyleDeclaration to represent the
descriptors of @font-face, then why not do so in the event as well rather
than redefining such a bushy interface. That is, change the above to:

interface FontFaceEvent : Event {
  readonly attribute CSSStyleDeclaration descriptors;
}

and define descriptors to be non-mutable (like that returned by
getComputedStyle).

Received on Wednesday, 22 August 2012 10:41:41 UTC