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

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;
};

dictionary FontFaceEventInit : EventInit {
  DOMString family;
  DOMString src;
  DOMString style;
  DOMString weight;
  DOMString stretch;
  DOMString unicodeRange;
  DOMString variant;
  DOMString featureSettings;
}

# Attributes #

For each attribute, if the corresponding descriptor is present in the
associated @font-face rule, the attribute's value is the cssText of that
descriptor.  Otherwise, the attribute's value is the value null.

# Behavior #

When a @font-face rule successfully finishes loading its src and is
ready to be used, fire a FontFaceEvent of type "load" at the document
object.
Bubbles: No.
Cancelable: No.

~TJ

Received on Tuesday, 24 July 2012 22:33:01 UTC