Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: Source/core/css/FontFaceSet.idl

Issue 1100873004: FontFace sync (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: final touches Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/FontFaceDescriptors.idl ('k') | Source/core/css/FontFaceSetForEachCallback.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/FontFaceSet.idl
diff --git a/Source/core/css/FontFaceSet.idl b/Source/core/css/FontFaceSet.idl
index 0ec73b13d88ddde2e382dc51e79d5e404c12dd6e..50525e52f7b144de4d347bc4a3ab92f7f084668c 100644
--- a/Source/core/css/FontFaceSet.idl
+++ b/Source/core/css/FontFaceSet.idl
@@ -28,28 +28,43 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// http://dev.w3.org/csswg/css-font-loading/#FontFaceSet-interface
+
enum FontFaceSetLoadStatus { "loading", "loaded" };
+// TODO(philipj): This interface should be [Exposed=Window,Worker] and should
+// have a constructor, and thus not have [NoInterfaceObject].
[
ActiveDOMObject,
SetWrapperReferenceFrom=document,
NoInterfaceObject,
] interface FontFaceSet : EventTarget {
+ // TODO(ksakamoto): Make FontFaceSet Set-like. crbug.com/392075
+ // setlike<FontFace>;
+ void forEach(FontFaceSetForEachCallback callback, optional any thisArg);
+ [RaisesException] boolean has(FontFace fontFace);
+ readonly attribute unsigned long size;
+ // TODO(philipj): add() should return the FontFaceSet.
+ [RaisesException] void add(FontFace fontFace);
+ [RaisesException, ImplementedAs=remove] boolean delete(FontFace fontFace);
+ void clear();
+ // events for when loading state changes
attribute EventHandler onloading;
attribute EventHandler onloadingdone;
attribute EventHandler onloadingerror;
+ // check and start loads if appropriate
+ // and fulfill promise when all loads complete
+ [CallWith=ScriptState] Promise<sequence<FontFace>> load(DOMString font, optional DOMString text = " ");
+
+ // return whether all fonts in the fontlist are loaded
+ // (does not initiate load if not available)
[RaisesException] boolean check(DOMString font, optional DOMString text = " ");
- [CallWith=ScriptState] Promise load(DOMString font, optional DOMString text = " ");
- [CallWith=ScriptState] readonly attribute Promise ready;
- [RaisesException] void add(FontFace fontFace);
- void clear();
- [RaisesException, ImplementedAs=remove] boolean delete(FontFace fontFace);
- void forEach(FontFaceSetForEachCallback callback, optional any thisArg);
- [RaisesException] boolean has(FontFace fontFace);
+ // async notification that font loading and layout operations are done
+ [CallWith=ScriptState] readonly attribute Promise<FontFaceSet> ready;
- readonly attribute unsigned long size;
+ // loading state, "loading" while one or more fonts loading, "loaded" otherwise
readonly attribute FontFaceSetLoadStatus status;
};
« no previous file with comments | « Source/core/css/FontFaceDescriptors.idl ('k') | Source/core/css/FontFaceSetForEachCallback.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698