This shows you the differences between two versions of the page.
Previous revision | |||
— | spec:font-load-events [2014/12/09 15:48] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== @font-face Load Events ====== | ||
+ | There appear to be several good use-cases for wanting to know when a particular @font-face has been loaded, such as delaying any text operations in < | ||
+ | |||
+ | ===== IDL ===== | ||
+ | |||
+ | [Constructor(DOMString type, optional FontFaceEventInit eventInitDict)] | ||
+ | interface FontFaceEvent : Event { | ||
+ | readonly attribute DOMString? family; | ||
+ | readonly attribute DOMString? src; | ||
+ | readonly attribute DOMString? usedSrc; | ||
+ | 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 usedSrc; | ||
+ | DOMString style; | ||
+ | DOMString weight; | ||
+ | DOMString stretch; | ||
+ | DOMString unicodeRange; | ||
+ | DOMString variant; | ||
+ | DOMString featureSettings; | ||
+ | } | ||
+ | |||
+ | ===== Attributes ===== | ||
+ | |||
+ | |||
+ | For the attributes " | ||
+ | if the corresponding descriptor is present in the associated @font-face rule, | ||
+ | the attribute' | ||
+ | Otherwise, the attribute' | ||
+ | |||
+ | For the attribute " | ||
+ | the attribute' | ||
+ | Otherwise, the attribute' | ||
+ | |||
+ | ===== Behavior ===== | ||
+ | |||
+ | When a @font-face rule successfully finishes loading its src and is ready to be used, | ||
+ | or has exhausted all of its sources without finding a valid font file, | ||
+ | fire a FontFaceEvent of type " | ||
+ | Bubbles: No. | ||
+ | Cancelable: No. |