|
@@ -0,0 +1,49 @@
|
|
|
+#import <CSS/FontFace.idl>
|
|
|
+
|
|
|
+dictionary FontFaceSetLoadEventInit : EventInit {
|
|
|
+ sequence<FontFace> fontfaces = [];
|
|
|
+};
|
|
|
+
|
|
|
+// FIXME
|
|
|
+// [Exposed=(Window,Worker)]
|
|
|
+//interface FontFaceSetLoadEvent : Event {
|
|
|
+// constructor(CSSOMString type, optional FontFaceSetLoadEventInit eventInitDict = {});
|
|
|
+// [SameObject] readonly attribute FrozenArray<FontFace> fontfaces;
|
|
|
+//};
|
|
|
+
|
|
|
+enum FontFaceSetLoadStatus { "loading", "loaded" };
|
|
|
+
|
|
|
+// https://drafts.csswg.org/css-font-loading/#fontfaceset
|
|
|
+[Exposed=(Window,Worker)]
|
|
|
+interface FontFaceSet : EventTarget {
|
|
|
+ constructor(sequence<FontFace> initialFaces);
|
|
|
+
|
|
|
+ // FIXME: setlike<FontFace>;
|
|
|
+ FontFaceSet add(FontFace font);
|
|
|
+ // FIXME: boolean delete(FontFace font);
|
|
|
+ // FIXME: clear();
|
|
|
+
|
|
|
+ // events for when loading state changes
|
|
|
+ // FIXME: attribute EventHandler onloading;
|
|
|
+ // FIXME: attribute EventHandler onloadingdone;
|
|
|
+ // FIXME: attribute EventHandler onloadingerror;
|
|
|
+
|
|
|
+ // check and start loads if appropriate
|
|
|
+ // and fulfill promise when all loads complete
|
|
|
+ // FIXME: Promise<sequence<FontFace>> load(CSSOMString font, optional CSSOMString text = " ");
|
|
|
+ Promise<sequence<FontFace>> load(CSSOMString font, optional CSSOMString text = "");
|
|
|
+
|
|
|
+ // return whether all fonts in the fontlist are loaded
|
|
|
+ // (does not initiate load if not available)
|
|
|
+ // FIXME: boolean check(CSSOMString font, optional CSSOMString text = " ");
|
|
|
+
|
|
|
+ // async notification that font loading and layout operations are done
|
|
|
+ // FIXME: readonly attribute Promise<FontFaceSet> ready;
|
|
|
+
|
|
|
+ // loading state, "loading" while one or more fonts loading, "loaded" otherwise
|
|
|
+ // FIXME: readonly attribute FontFaceSetLoadStatus status;
|
|
|
+};
|
|
|
+
|
|
|
+interface mixin FontFaceSource {
|
|
|
+ readonly attribute FontFaceSet fonts;
|
|
|
+};
|