forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.html
More file actions
837 lines (681 loc) · 51 KB
/
Overview.html
File metadata and controls
837 lines (681 loc) · 51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
<!DOCTYPE html><html lang=en><head>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Font Load Events Module Level 3</title>
<link href=../default.css rel=stylesheet type=text/css>
<link href=../csslogo.ico rel="shortcut icon" type=image/x-icon>
<link href=https://www.w3.org/StyleSheets/TR/W3C-ED rel=stylesheet type=text/css>
<script src=http://use.typekit.com/xon2bky.js type=text/javascript></script>
<script type=text/javascript>try{Typekit.load();}catch(e){}</script>
</head>
<body class=h-entry>
<style scoped type=text/css>
body, th, td, h1, h2, h3, h4, h5, h6 {
font-family: "myriad-pro", sans-serif !important;
}
body {
padding: 2em 70px 2em 70px;
}
p + p, p.mtb {
margin-top: 0.8em;
text-indent: 0px;
}
#bolderlighter {
width: 40%;
}
#bolderlighter th {
text-align: center;
}
#fontformats td, #eventhandlers td, #fontformats th, #eventhandlers th {
padding-right: 2em;
text-align: left;
}
dd {
margin-bottom: 1em;
}
#authors dd {
margin-bottom: 0;
}
#fontstylematchingalg {
list-style-type: lower-alpha;
}
#fontmatchingalg ul, #fontmatchingalg ol {
margin-top: 0.8em;
}
#fontmatchingalg li + li {
margin-top: 0.8em;
}
div.example {
padding: 1em;
margin-top: 1em;
}
div.example + div.example {
margin-top: 2em;
}
div.figure {
page-break-inside: avoid;
}
pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
div.featex {
width: 700px;
}
div.featex img {
margin: auto;
display: block;
}
span.tag {
font-family: monospace;
font-size: 120%;
}
ol ol {
list-style-type: lower-alpha;
}
.idl-code {
font-weight: bold;
color: #c50;
font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
font-size: .9em;
}
</style>
<div class=head>
<p data-fill-with=logo><a class=logo href=http://www.w3.org/>
<img alt=W3C height=48 src=http://www.w3.org/Icons/w3c_home width=72>
</a></p>
<h1 class="p-name no-ref" id=title>CSS Font Load Events Module Level 3</h1>
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
<span class=dt-updated><span class=value-title title=20130830>30 August 2013</span></span></span></h2>
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-font-load-events/>http://dev.w3.org/csswg/css-font-load-events/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-font-load-events-3/>http://www.w3.org/TR/css-font-load-events-3/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-font-load-events/>http://dev.w3.org/csswg/css-font-load-events/</a>
<dt>Feedback:</dt>
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-font-load-events%5D%20feedback">www-style@w3.org</a>
with subject line
“<kbd>[css-font-load-events] <var>… message topic …</var></kbd>”
(<a href=http://lists.w3.org/Archives/Public/www-style/ rel=discussion>archives</a>)<dt>Test Suite:<dd>None Yet<dt>Editors:
<dd class="p-author h-card vcard"><a class="p-name fn u-url url" href=http://xanthir.com/contact/>Tab Atkins Jr.</a> (<span class="p-org org">Google</span>)<dd class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:jdaggett@mozilla.com>John Daggett</a> (<span class="p-org org">Mozilla</span>)</dl></div>
<div data-fill-with=warning></div>
<p class=copyright data-fill-with=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a> © 2013 <a href=http://www.w3.org/><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href=http://www.csail.mit.edu/><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href=http://www.ercim.eu/><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href=http://www.keio.ac.jp/>Keio</a>, <a href=http://ev.buaa.edu.cn/>Beihang</a>), All Rights Reserved. W3C <a href=http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer>liability</a>, <a href=http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks>trademark</a> and <a href=http://www.w3.org/Consortium/Legal/copyright-documents>document use</a> rules apply.</p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled heading" id=abstract><span class=content>Abstract</span></h2>
<p class=p-summary data-fill-with=abstract>This CSS module describes events and interfaces used for dynamically loading font resources.
<a href=http://www.w3.org/TR/CSS/>CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.</p>
<h2 class="no-num no-toc no-ref heading settled heading" id=status><span class=content>Status of this document</span></h2>
<div data-fill-with=status><p>
This is a public copy of the editors' draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress.
<p>
The (<a href=http://lists.w3.org/Archives/Public/www-style/>archived</a>) public mailing list
<a href="mailto:www-style@w3.org?Subject=%5Bcss-font-load-events%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>
(see <a href=http://www.w3.org/Mail/Request>instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-font-load-events” in the subject,
preferably like this:
“[css-font-load-events] <em>…summary of comment…</em>”
<p>
This document was produced by the <a href=/Style/CSS/members>CSS Working Group</a>
(part of the <a href=/Style/>Style Activity</a>).
<p>
This document was produced by a group operating under
the <a href=/Consortium/Patent-Policy-20040205/>5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href=/2004/01/pp-impl/32061/status rel=disclosure>public list of any patent disclosures</a>
made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href=/Consortium/Patent-Policy-20040205/#def-essential>Essential Claim(s)</a>
must disclose the information in accordance with <a href=/Consortium/Patent-Policy-20040205/#sec-Disclosure>section 6 of the W3C Patent Policy</a>.</div>
<div data-fill-with=at-risk></div>
<h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class=content>Table of contents</span></h2>
<div data-fill-with=table-of-contents><ul class=toc><li><a href=#introduction><span class=secno>1</span>
Introduction</a><li><a href=#font-load-events><span class=secno>2</span>
Font Load Events</a><ul class=toc><li><a href=#document-fontloader><span class=secno>2.1</span>
Extension to the <code>document</code> interface</a><li><a href=#fontloader-interface><span class=secno>2.2</span>
The <code>FontLoader</code> Interface</a><ul class=toc><li><a href=#fontloader-events><span class=secno>2.2.1</span>
Events</a><li><a href=#fontloader-methods><span class=secno>2.2.2</span>
Methods</a></ul><li><a href=#font-load-event-examples><span class=secno>2.3</span>
Font load event examples</a></ul><li><a href=#changes><span class=secno></span>Changes</a><ul class=toc><li><a href=#changes-since-20130212><span class=secno></span>
Changes from the <span>February 2013 CSS3 Fonts Working Draft</span></a></ul><li><a href=#acknowledgments><span class=secno></span>
Acknowledgments</a><li><a href=#conformance><span class=secno></span>
Conformance</a><ul class=toc><li><a href=#conventions><span class=secno></span>
Document conventions</a><li><a href=#conformance-classes><span class=secno></span>
Conformance classes</a><li><a href=#partial><span class=secno></span>
Partial implementations</a><li><a href=#experimental><span class=secno></span>
Experimental implementations</a><li><a href=#testing><span class=secno></span>
Non-experimental implementations</a></ul><li><a href=#references><span class=secno></span>
References</a><ul class=toc><li><a href=#normative><span class=secno></span>
Normative References</a><li><a href=#informative><span class=secno></span>
Informative References</a></ul><li><a href=#index><span class=secno></span>
Index</a><li><a href=#property-index><span class=se
2A0
cno></span>
Property index</a><li><a href=#issues-index><span class=secno></span>Issues Index</a></ul></div>
<h2 class="heading settled heading" data-level=1 id=introduction><span class=secno>1 </span><span class=content>
Introduction</span><a class=self-link href=#introduction></a></h2>
<p class=issue id=issue-c42e0891><a class=self-link href=#issue-c42e0891></a>
Fill in intro.
<h2 class="heading settled heading" data-level=2 id=font-load-events><span class=secno>2 </span><span class=content>
Font Load Events</span><a class=self-link href=#font-load-events></a></h2>
<p> Since fonts defined via <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a> rules are loaded on demand,
pages may need to know precisely when fonts have completed
downloading before measuring text elements on the page or to
show some form of interim user interface state.
<h3 class="heading settled heading" data-level=2.1 id=document-fontloader><span class=secno>2.1 </span><span class=content>
Extension to the <code>document</code> interface</span><a class=self-link href=#document-fontloader></a></h3>
<p> To allow font loading to be tracked explicitly within content
the following event target is added to the <code>document</code> of the page:
<pre class=idl> partial interface Document {
readonly attribute FontLoader <dfn class=idl-code data-dfn-for=Document data-dfn-type=attribute data-export="" id=dom-document-fontloader>fontloader<a class=self-link href=#dom-document-fontloader></a></dfn>;
};
</pre>
<h3 class="heading settled heading" data-level=2.2 id=fontloader-interface><span class=secno>2.2 </span><span class=content>
The <code>FontLoader</code> Interface</span><a class=self-link href=#fontloader-interface></a></h3>
<pre class=idl> dictionary <dfn class=idl-code data-dfn-type=dictionary data-export="" id=dictdef-cssfontfaceloadeventinit>CSSFontFaceLoadEventInit<a class=self-link href=#dictdef-cssfontfaceloadeventinit></a></dfn> : EventInit {
CSSFontFaceRule <dfn class=idl-code data-dfn-for=CSSFontFaceLoadEventInit data-dfn-type=dictmember data-export="" id=dom-cssfontfaceloadeventinit-fontface>fontface<a class=self-link href=#dom-cssfontfaceloadeventinit-fontface></a></dfn> = null;
DOMError <dfn class=idl-code data-dfn-for=CSSFontFaceLoadEventInit data-dfn-type=dictmember data-export="" id=dom-cssfontfaceloadeventinit-error>error<a class=self-link href=#dom-cssfontfaceloadeventinit-error></a></dfn> = null;
};
dictionary <dfn class=idl-code data-dfn-type=dictionary data-export="" id=dictdef-loadfontparameters>LoadFontParameters<a class=self-link href=#dictdef-loadfontparameters></a></dfn> {
DOMString <dfn class=idl-code data-dfn-for=LoadFontParameters data-dfn-type=dictmember data-export="" id=dom-loadfontparameters-font>font<a class=self-link href=#dom-loadfontparameters-font></a></dfn>;
DOMString <dfn class=idl-code data-dfn-for=LoadFontParameters data-dfn-type=dictmember data-export="" id=dom-loadfontparameters-text>text<a class=self-link href=#dom-loadfontparameters-text></a></dfn> = " ";
FontsReadyCallback <dfn class=idl-code data-dfn-for=LoadFontParameters data-dfn-type=dictmember data-export="" id=dom-loadfontparameters-success>success<a class=self-link href=#dom-loadfontparameters-success></a></dfn>;
FontsReadyCallback <dfn class=idl-code data-dfn-for=LoadFontParameters data-dfn-type=dictmember data-export="" id=dom-loadfontparameters-error>error<a class=self-link href=#dom-loadfontparameters-error></a></dfn>;
};
[Constructor(DOMString type, optional CSSFontFaceLoadEventInit eventInitDict)]
interface <dfn class=idl-code data-dfn-type=interface data-export="" id=dom-cssfontfaceloadevent>CSSFontFaceLoadEvent<a class=self-link href=#dom-cssfontfaceloadevent></a></dfn> : Event {
readonly attribute CSSFontFaceRule <dfn class=idl-code data-dfn-for=CSSFontFaceLoadEvent data-dfn-type=attribute data-export="" id=dom-cssfontfaceloadevent-fontface>fontface<a class=self-link href=#dom-cssfontfaceloadevent-fontface></a></dfn>;
readonly attribute DOMError? <dfn class=idl-code data-dfn-for=CSSFontFaceLoadEvent data-dfn-type=attribute data-export="" id=dom-cssfontfaceloadevent-error>error<a class=self-link href=#dom-cssfontfaceloadevent-error></a></dfn> = null;
}
callback <dfn class=idl-code data-dfn-type=callback data-export="" id=callbackdef-fontsreadycallback>FontsReadyCallback<a class=self-link href=#callbackdef-fontsreadycallback></a></dfn> = void ();
interface <dfn class=idl-code data-dfn-type=interface data-export="" id=dom-fontloader>FontLoader<a class=self-link href=#dom-fontloader></a></dfn> : EventTarget {
// -- events for when loading state changes
attribute EventHandler <dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=attribute data-export="" id=dom-fontloader-onloading>onloading<a class=self-link href=#dom-fontloader-onloading></a></dfn>;
attribute EventHandler <dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=attribute data-export="" id=dom-fontloader-onloadingdone>onloadingdone<a class=self-link href=#dom-fontloader-onloadingdone></a></dfn>;
// -- events for each individual font load
attribute EventHandler <dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=attribute data-export="" id=dom-fontloader-onloadstart>onloadstart<a class=self-link href=#dom-fontloader-onloadstart></a></dfn>;
attribute EventHandler <dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=attribute data-export="" id=dom-fontloader-onload>onload<a class=self-link href=#dom-fontloader-onload></a></dfn>;
attribute EventHandler <dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=attribute data-export="" id=dom-fontloader-onerror>onerror<a class=self-link href=#dom-fontloader-onerror></a></dfn>;
// check and start load if appropriate
// and fire callback when all loads complete
void <a class=idl-code data-link-for=FontLoader data-link-type=method href=#dom-fontloader-loadfontparams title=loadFont()>loadFont</a>(LoadFontParameters params);
// return whether all fonts in the fontlist are loaded
// (does not initiate load if not available)
boolean <a class=idl-code data-link-for=FontLoader data-link-type=method href=#dom-fontloader-checkfontfont-text title=checkFont()>checkFont</a>(DOMString font, optional DOMString text = " ");
// async notify upon completion, pending layout changes
void <a class=idl-code data-link-for=FontLoader data-link-type=method href=#dom-fontloader-notifywhenfontsreadyfontsreadycallback title=notifyWhenFontsReady()>notifyWhenFontsReady</a>(FontsReadyCallback fontsReadyCallback);
// loading state, true while one or more fonts loading, false otherwise
readonly attribute boolean <dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=attribute data-export="" id=dom-fontloader-loading0>loading<a class=self-link href=#dom-fontloader-loading0></a></dfn>;
};
</pre>
<p> Because font families defined with <code>@font-face</code> rules are
loaded only when they are used, content sometimes needs to understand
when the loading of fonts occurs. Authors can use the events and methods
defined here to allow greater control over actions that are dependent upon
the availability of specific fonts.
<p> The term <dfn data-dfn-type=dfn data-noexport="" id=font-load>font load<a class=self-link href=#font-load></a></dfn> is used below to indicate when the
loading of content for a given <code>@font-face</code> rule completes.
An <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a> rule may list multiple alternate resources
within the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#descdef-src title=src>src</a> descriptor, including references to local fonts, but
the term font load only refers to the loading of the finally selected
resource for a given rule, not to the loading of each individual
resource.
<p class=issue id=issue-37f1437d><a class=self-link href=#issue-37f1437d></a>
Given that the FontLoader object is defined to be attached to the
document, how will canvas worker threads load fonts?
<h4 class="heading settled heading" data-level=2.2.1 id=fontloader-events><span class=secno>2.2.1 </span><span class=content>
Events</span><a class=self-link href=#fontloader-events></a></h4>
<p> Font load events are grouped into two general categories, events
associated with a group of fonts loading (<dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=event data-export="" id=dom-fontloader-loading>loading<a class=self-link href=#dom-fontloader-loading></a></dfn>,
<dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=event data-export="" id=dom-fontloader-loadingdone>loadingdone<a class=self-link href=#dom-fontloader-loadingdone></a></dfn>) or finer-grained events associated
with each individual font loaded (<dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=event data-export="" id=dom-fontloader-loadstart>loadstart<a class=self-link href=#dom-fontloader-loadstart></a></dfn>,
<dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=event data-export="" id=dom-fontloader-load>load<a class=self-link href=#dom-fontloader-load></a></dfn>, <dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=event data-export="" id=dom-fontloader-error>error<a class=self-link href=#dom-fontloader-error></a></dfn>).
<p> The following are the event handlers (and their corresponding event handler event types)
that must be supported by <code>FontLoader</code> objects as IDL attributes:
<table class=data id=eventhandlers>
<thead>
<tr>
<th>Event handler
<th>Event handler event type
<tbody>
<tr>
<th><a class=idl-code data-link-type=attribute href=#dom-fontloader-onloading>onloading</a>
<td><a class=idl-code data-link-type=event href=#dom-fontloader-loading>loading</a>
<tr>
<th><a class=idl-code data-link-type=attribute href=#dom-fontloader-onloadingdone>onloadingdone</a>
<td><a class=idl-code data-link-type=event href=#dom-fontloader-loadingdone>loadingdone</a>
<tr>
<th><a class=idl-code data-link-type=attribute href=#dom-fontloader-onloadstart>onloadstart</a>
<td><a class=idl-code data-link-type=event href=#dom-fontloader-loadstart>loadstart</a>
<tr>
<th><a class=idl-code data-link-type=attribute href=#dom-fontloader-onload>onload</a>
<td><a class=idl-code data-link-type=event href=#dom-fontloader-load>load</a>
<tr>
<th><a class=idl-code data-link-type=attribute href=#dom-fontloader-onerror>onerror</a>
<td><a class=idl-code data-link-type=event href=#dom-fontloader-error>error</a>
</table>
<p> To <dfn data-dfn-type=dfn data-noexport="" id=fire-a-font-load-event>fire a font load event<a class=self-link href=#fire-a-font-load-event></a></dfn> named <var>e</var> at a <a class=idl-code data-link-type=interface href=#dom-fontloader>FontLoader</a> target
means to
<a href=http://www.w3.org/TR/html5/webappapis.html#event-firing>fire a simple event</a> named <var>e</var>
using the <a class=idl-code data-link-type=interface href=#dom-cssfontfaceloadevent>CSSFontFaceLoadEvent</a> interface that also meets these conditions:
<ol>
<li>
The <a class=idl-code data-link-type=attribute href=#dom-cssfontfaceloadevent-fontface>fontface</a> attribute is initialized to the given <var>font
face rule</var>.
<li>
The <a class=idl-code data-link-type=attribute href=#dom-cssfontfaceloadevent-error>error</a> attribute is initialized to the given <var>error</var>, if one occurred during the font load.
</ol>
<p> When the user agent determines that one or more fonts
defined via <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a> rules in a document <var>doc</var>
need to be loaded, it must run the following steps:
<ol>
<li>
Let <var>font loader</var> be the value of the <a class=idl-code data-link-type=attribute href=#dom-document-fontloader>fontloader</a> attribute of <var>doc</var>.
<li>
Set the <code class=idl-code>loading</code> attribute of <var>font loader</var> to true.
<li>
<a href=#fire-a-font-load-event>Fire a font load event</a> named <a class=idl-code data-link-type=event href=#dom-fontloader-loading>loading</a> at <var>font loader</var>
with <a class=idl-code data-link-type=attribute href=#dom-cssfontfaceloadevent-fontface>fontface</a> set to the first <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a> rule.
<li>
When the user agent begins loading the first resource for a given <code>@font-face</code> rule, it must <a href=#fire-a-font-load-event>fire a
font load event</a> named <a class=idl-code data-link-type=event href=#dom-fontloader-loadstart>loadstart</a> at <var>font loader</var>
with <a class=idl-code data-link-type=attribute href=#dom-cssfontfaceloadevent-fontface>fontface</a> set to the given <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a> rule.
</ol>
<p> These steps imply that if fonts are loaded concurrently, the
<a class=idl-code data-link-type=event href=#dom-fontloader-loading>loading</a> event will fire just once, while
the <a class=idl-code data-link-type=event href=#dom-fontloader-loadstart>loadstart</a> event will be fired once
for each <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a> rule whose load is initiated.
User agents must only set the <a class=idl-code data-link-type=event href=#dom-fontloader-error>error</a>
attribute of a font load event to a non-null value in the cases
noted in this section.
<p> The term “font load” covers any of the resources listed in the
<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#descdef-src title=src>src</a> descriptor, including local fonts. When multiple resources are
listed, the “font load” is the first resource in the list to
successfully load or the error that occurs on the last resource for
which a load is attempted.
<p> When the user agent completes each font load for a document <var>doc</var>,
it must run the following steps:
<ol>
<li>
Let <var>font loader</var> be the value of the <a class=idl-code data-link-type=attribute href=#dom-document-fontloader>fontloader</a> attribute of <var>doc</var>.
<li>
If a font data was successfully loaded and activated,
<a href=#fire-a-font-load-event>fire a font load event</a> named
<a class=idl-code data-link-type=event href=#dom-fontloader-load>load</a> at <var>font loader</var> with
<a class=idl-code data-link-type=attribute href=#dom-cssfontfaceloadevent-fontface>fontface</a> set to the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a>
rule for which the font data was loaded.
<li>
Otherwise, <a href=#fire-a-font-load-event>fire a font load event</a>
named <a class=idl-code data-link-type=event href=#dom-fontloader-error>error</a>
at <var>font loader</var> with <a class=idl-code data-link-type=attribute href=#dom-cssfontfaceloadevent-fontface>fontface</a>
set to the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a> rule for which the error occurred.
If the font data can’t be loaded <a class=idl-code data-link-type=attribute href=#dom-cssfontfaceloadevent-error>error</a>
is set to one of the standard <a class=idl-code data-link-type=interface>DOMError</a> types (e.g. <a class=idl-code data-link-type=event>NotFoundError</a>,
<a class=idl-code data-link-type=event>NetworkError</a>). If the font data was downloaded but invalid,
then <a class=idl-code data-link-type=attribute href=#dom-cssfontfaceloadevent-error>error</a> is set to <code>"InvalidFontDataError"</code>.
If several resources are listed in the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#descdef-src title=src>src</a> descriptor, the
error that caused the last font resource in the list to fail must be used.
</ol>
<p> When the user agent completes the final font load for document
<var>doc</var>, after all pending layout operations that might affect
font selection have completed and no font loads are pending, it must
run the following steps:
<ol>
<li>
Let <var>font loader</var> be the value of the <a class=idl-code data-link-type=attribute href=#dom-document-fontloader>fontloader</a> attribute of <var>doc</var>.
<li>
Set the <a class=idl-code data-link-type=attribute href=#dom-fontloader-loading0>loading</a> attribute of <var>font loader</var> to false.
<li>
<a href=#fire-a-font-load-event>Fire a font load event</a>
named <a class=idl-code data-link-type=event href=#dom-fontloader-loadingdone>loadingdone</a>
at <var>font loader</var> with <a class=idl-code data-link-type=attribute href=#dom-cssfontfaceloadevent-fontface>fontface</a>
set to the <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a> rule of the last font loaded.
</ol>
<p> For example, if three fonts are loaded at the same time, a
<a class=idl-code data-link-type=event href=#dom-fontloader-loading>loading</a> event followed by three <a class=idl-code data-link-type=event href=#dom-fontloader-loadstart>loadstart</a> events and three
<a class=idl-code data-link-type=event href=#dom-fontloader-load>load</a> or <a class=idl-code data-link-type=event href=#dom-fontloader-error>error</a> events, followed by a
<a class=idl-code data-link-type=event href=#dom-fontloader-loadingdone>loadingdone</a> event will occur.
<p class=issue id=issue-1b6714d3><a class=self-link href=#issue-1b6714d3></a>
Errors will go "unreported" when using the general category of font
load events (i.e. <a class=idl-code data-link-type=event href=#dom-fontloader-loading>loading</a> and <a class=idl-code data-link-type=event href=#dom-fontloader-loadingdone>loadingdone</a>).
This seems fine but need to confirm this.
<h4 class="heading settled heading" data-level=2.2.2 id=fontloader-methods><span class=secno>2.2.2 </span><span class=content>
Methods</span><a class=self-link href=#fontloader-methods></a></h4>
<p> The methods <a href=#dom-fontloader-loadfontparams>loadFont()</a> and <a href=#dom-fontloader-checkfontfont-text>checkFont()</a>
must determine whether all fonts in the given font list have been
loaded and are available. If all fonts are available,
<a href=#dom-fontloader-checkfontfont-text>checkFont()</a> must return true, false if one or more
fonts are not available. In the case of <a href=#dom-fontloader-loadfontparams>loadFont()</a>, if any
fonts are downloadable fonts and have not already been loaded, the
user agent must initiate the load of each of these fonts.
<p> The <dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=method data-export="" id=dom-fontloader-loadfontparams title=loadFont()>loadFont(<dfn class=idl-code data-dfn-for=FontLoader/loadfont() data-dfn-type=argument data-export="" id=dom-fontloaderloadfont-params>params<a class=self-link href=#dom-fontloaderloadfont-params></a></dfn>)<a class=self-link href=#dom-fontloader-loadfontparams></a></dfn> method must use these steps:
<ol>
<li>
Parse the value of the <a class=idl-code data-link-for=LoadFontParameters data-link-type=dictmember href=#dom-loadfontparameters-font>font</a> member of <a class=idl-code data-link-type=argument href=#dom-fontloaderloadfont-params>params</a>,
using the CSS value syntax of the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#propdef-font title=font>font</a> property.
<li>
If a syntax error occurs, return.
<li>
Otherwise, let <var>font family list</var> be the set of families and
<var>font style</var> be the other font style attributes.
<li>
For each family in <var>font family list</var>,
use the font matching rules to select the font faces that match the <var>font style</var>.
In the case where these are font faces defined via <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a> rules,
the use of <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#descdef-unicode-range title=unicode-range>unicode-range</a> means that this may be more than just a single font face.
<li>
Remove from the set of font faces all faces that have defined <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#descdef-unicode-range title=unicode-range>unicode-range</a>
values that don’t intersect the range of character values in the <a class=idl-code data-link-for=LoadFontParameters data-link-type=dictmember href=#dom-loadfontparameters-text>text</a>
member of <a class=idl-code data-link-type=argument href=#dom-fontloaderloadfont-params>params</a> and set this to be the <var>font load list</var>.
<li>
For all of the font faces in the <var>font load list</var>, initiate the load of any font that has
not already been loaded and return.
<li>
When all fonts in the <var>font load list</var> have been loaded, fire the appropriate callback handler.
If all fonts loaded successfully, call the callback specified by the <a class=idl-code data-link-for=LoadFontParameters data-link-type=dictmember href=#dom-loadfontparameters-success>success</a>
member of <a class=idl-code data-link-type=argument href=#dom-fontloaderloadfont-params>params</a>. If an error occurred with any one of the fonts in
the <var>font load list</var> or if the list is empty, call the callback specified by the
<a class=idl-code data-link-for=LoadFontParameters data-link-type=dictmember href=#dom-loadfontparameters-error>error</a> member of <a class=idl-code data-link-type=argument href=#dom-fontloaderloadfont-params>params</a>.
</ol>
<p> Callbacks for <a href=#dom-fontloader-loadfontparams>loadFont()</a> fire in addition to the callbacks that fire due to
font event handlers.
<p> The <dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=method data-export="" id=dom-fontloader-checkfontfont-text title=checkFont()>checkFont(<dfn class=idl-code data-dfn-for=FontLoader/checkfont() data-dfn-type=argument data-export="" id=dom-fontloadercheckfont-font>font<a class=self-link href=#dom-fontloadercheckfont-font></a></dfn>, <dfn class=idl-code data-dfn-for=FontLoader/checkfont() data-dfn-type=argument data-export="" id=dom-fontloadercheckfont-text>text<a class=self-link href=#dom-fontloadercheckfont-text></a></dfn>)<a class=self-link href=#dom-fontloader-checkfontfont-text></a></dfn> method must use these steps:
<ol>
<li>
Parse the value of the <a class=idl-code data-link-type=argument href=#dom-fontloadercheckfont-font>font</a> parameter,
using the CSS value syntax of the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#propdef-font title=font>font</a> property.
<li>
If a syntax error occurs, return <code>false</code>.
<li>
Otherwise, let <var>font family list</var> be the set of families and
<var>font style</var> be the other font style attributes.
<li>
For each family in <var>font family list</var>,
use the font matching rules to select the font faces that match the <var>font style</var>.
In the case where these are font faces defined via <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule>@font-face</a> rules,
the use of 'unicode-range’means that this may be more than just a single font face.
<li>
Remove from the set of font faces all faces that have defined <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#descdef-unicode-range title=unicode-range>unicode-range</a>
values that don’t intersect the range of character values in the <a class=idl-code data-link-type=argument href=#dom-fontloadercheckfont-text>text</a>
parameter and set this to be the <var>font load list</var>.
<li>
If the <var>font load list</var> contains no font faces, return <code class=idl-code>false</code>.
<li>
If all fonts in the <var>font load list</var> have already successfully been loaded,
return <code>true</code>. Otherwise, return <code>false</code>.
</ol>
<p> The <a class=idl-code data-link-type=argument href=#dom-fontloadercheckfont-font>font</a> parameter of <a href=#dom-fontloader-checkfontfont-text>checkFont()</a>
and the <a class=idl-code data-link-for=LoadFontParameters data-link-type=dictmember href=#dom-loadfontparameters-font>font</a> member of <a class=idl-code data-link-type=argument href=#dom-fontloaderloadfont-params>params</a> parameter
of <a href=#dom-fontloader-loadfontparams>loadFont()</a> both specify the list of fonts to load. These values must
be parsed using the same syntax as values for the CSS <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#propdef-font title=font>font</a> property, the same way the
<a class=idl-code data-link-type=attribute>font</a> attribute of the
<a class=idl-code data-link-type=interface>CanvasRenderingContext2D</a> is interpreted. <a data-biblio-type=normative data-link-type=biblio href=#html5 title=HTML5>[HTML5]</a>
This yields a list of font families along with font style attributes.
<p> Because the number of fonts loaded depends on the how many fonts
are used for a given piece of text, in some cases whether fonts need
to be loaded or not may not be known. The
<a href=#dom-fontloader-notifywhenfontsreadyfontsreadycallback>notifyWhenFontsReady()</a>
method provides a way for authors to avoid having to keep track of
which fonts have or haven’t been loaded before examining content
affected by which font is used.
<p> The <dfn class=idl-code data-dfn-for=FontLoader data-dfn-type=method data-export="" id=dom-fontloader-notifywhenfontsreadyfontsreadycallback title=notifyWhenFontsReady()>notifyWhenFontsReady(<dfn class=idl-code data-dfn-for=FontLoader/notifywhenfontsready() data-dfn-type=argument data-export="" id=dom-fontloadernotifywhenfontsready-fontsreadycallback>fontsReadyCallback<a class=self-link href=#dom-fontloadernotifywhenfontsready-fontsreadycallback></a></dfn>)<a class=self-link href=#dom-fontloader-notifywhenfontsreadyfontsreadycallback></a></dfn>
method must use these steps:
<ol>
<li>
Let <var>font loader</var> be the value of the <a class=idl-code data-link-type=attribute href=#dom-document-fontloader>fontloader</a> attribute of <var>doc</var>.
<li>
Add the value of the <a class=idl-code data-link-type=argument href=#dom-fontloadernotifywhenfontsready-fontsreadycallback>fontsReadyCallback</a> parameter
to the <var>notify</var> callback list of the <var>font loader</var> and return.
<li>
Once all pending layout operations have completed,
determine whether font resources need to be loaded.
<li>
If no loads are in progress, copy the contents of the <var>notify</var> callback list
to the <var>notify pending</var> list of the <var>font loader</var> and clear out the
<var>notify</var> list. After the <a class=idl-code data-link-type=event href=#dom-fontloader-loadingdone>loadingdone</a> event fires,
call each of the callbacks in the <var>notify pending</var>
list and clear out the <var>notify pending</var> list.
<li>
Otherwise, after all font loads complete and subsequent layout operations finish,
again check whether loads are in progress. If no loads are in progress, execute
the previous step. If fonts are still loading, continue waiting until those loads
complete and repeat this step.
</ol>
<p> Authors should note here that the callback only fires once, the
method needs to be called again when further font loads might occur.
This method is similar to the callback function of the
<a class=idl-code data-link-type=event href=#dom-fontloader-loadingdone>loadingdone</a> event handler, except that
in this case the callback will <strong>always</strong> get called,
even when no font loads occur because the fonts in question are
already loaded. It’s a simple, easy way to sync code to font loads
without the need to keep track of what fonts are needed and precisely
when they load.
<p> Note that the user agent may need to iterate over multiple font loads before
the notify callback is called. This can occur with font fallback situations, where
one font in the fontlist is loaded but doesn’t contain a particular glyph and other
fonts in the fontlist need to be loaded. The notify callback only fires
after layout operations complete and no additional font loads are necessary.
<h3 class="heading settled heading" data-level=2.3 id=font-load-event-examples><span class=secno>2.3 </span><span class=content>
Font load event examples</span><a class=self-link href=#font-load-event-examples></a></h3>
<div class=example>
To show content only after all font loads complete:
<pre> document.fontloader.onloadingdone = function() {
var content = document.getElementById("content");
content.style.visibility = "visible";
}
</pre> </div>
<div class=example>
Drawing text in a canvas with a downloadable font, explicitly
initiating the font download and drawing upon completion:
<pre> function drawStuff() {
var ctx = document.getElementById("c").getContext("2d");
ctx.fillStyle = "red";
ctx.font = "50px MyDownloadableFont";
ctx.fillText("Hello!", 100, 100);
}
document.fontloader.loadFont({font: "50px MyDownloadableFont",
success: drawStuff,
error: handleError});
</pre> </div>
<div class=example>
A rich text editing application may need to measure text elements
after editing operations have taken place. Since style changes may
or may not require additional fonts to be downloaded, or the fonts
may already have been downloaded, the measurement procedures need to
occur after those font loads complete:
<pre> function measureTextElements() {
// contents can now be measured using the metrics of
// the downloadable font(s)
}
function doEditing() {
// content/layout operations that may cause additional font loads
document.fontloader.notifyWhenFontsReady(measureTextElements);
}
</pre> </div>
<div class=example>
Unlike the per-font load events, the
<a class=idl-code data-link-type=event href=#dom-fontloader-loadingdone>loadingdone</a> event only fires after all
font related loads have completed <strong>and</strong> text has been
laid out without causing additional font loads:
<pre> @font-face {
font-family: latin-serif;
src: url(latinserif.woff) format("woff"); /* contains no kanji/kana */
}
@font-face {
font-family: jpn-mincho;
src: url(mincho.woff) format("woff");
}
body { font-family: latin-serif, jpn-mincho; }
<p>納豆はいかがでしょうか
</pre>
<p> In this situation, the user agent first downloads “latinserif.woff”
and then tries to use this to draw the Japanese text. But because no
Japanese glyphs are present in that font, fallback occurs and the font
“mincho.woff” is downloaded. Only after the second font is downloaded
and the Japanese text laid out does the <a class=idl-code data-link-type=event href=#dom-fontloader-loadingdone>loadingdone</a>
event fire.
</div>
<h2 class="no-num heading settled heading" id=changes><span class=content>Changes</span><a class=self-link href=#changes></a></h2>
<h3 class="no-num heading settled heading" id=changes-since-20130212><span class=content>
Changes from the <a href=http://www.w3.org/TR/2013/WD-css3-fonts-20130212/>February 2013 CSS3 Fonts Working Draft</a></span><a class=self-link href=#changes-since-20130212></a></h3>
<p> Major changes include:
<p> <ul>
<li>Add details of font load errors
</ul>
<h2 class="no-num heading settled heading" id=acknowledgments><span class=content>
Acknowledgments</span><a class=self-link href=#acknowledgments></a></h2>
<p> Several members of the Google Fonts team provided helpful feedback on font load events,
as did Boris Zbarsky, Jonas Sicking and ms2ger.
<h2 class="no-ref no-num heading settled heading" id=conformance><span class=content>
Conformance</span><a class=self-link href=#conformance></a></h2>
<h3 class="no-ref heading settled heading" id=conventions><span class=content>
Document conventions</span><a class=self-link href=#conventions></a></h3>
<p>Conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words "MUST",
"MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this
document are to be interpreted as described in RFC 2119.
However, for readability, these words do not appear in all uppercase
letters in this specification.
<p>All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes. <a data-biblio-type=normative data-link-type=biblio href=#rfc2119 title=RFC2119>[RFC2119]</a></p>
<p>Examples in this specification are introduced with the words "for example"
or are set apart from the normative text with <code>class="example"</code>,
like this:
<div class=example>
<p>This is an example of an informative example.</p>
</div>
<p>Informative notes begin with the word "Note" and are set apart from the
normative text with <code>class="note"</code>, like this:
<p class=note>Note, this is an informative note.</p>
<h3 class="no-ref heading settled heading" id=conformance-classes><span class=content>
Conformance classes</span><a class=self-link href=#conformance-classes></a></h3>
<p>Conformance to this specification
is defined for three conformance classes:
<dl>
<dt>style sheet
<dd>A <a href=http://www.w3.org/TR/CSS21/conform.html#style-sheet>CSS
style sheet</a>.
<dt>renderer
<dd>A <a href=http://www.w3.org/TR/CSS21/conform.html#user-agent>UA</a>
that interprets the semantics of a style sheet and renders
documents that use them.
<dt>authoring tool
<dd>A <a href=http://www.w3.org/TR/CSS21/conform.html#user-agent>UA</a>
that writes a style sheet.
</dl>
<p>A style sheet is conformant to this specification
if all of its statements that use syntax defined in this module are valid
according to the generic CSS grammar and the individual grammars of each
feature defined in this module.
<p>A renderer is conformant to this specification
if, in addition to interpreting the style sheet as defined by the
appropriate specifications, it supports all the features defined
by this specification by parsing them correctly
and rendering the document accordingly. However, the inability of a
UA to correctly render a document due to limitations of the device
does not make the UA non-conformant. (For example, a UA is not
required to render color on a monochrome monitor.)
<p>An authoring tool is conformant to this specification
if it writes style sheets that are syntactically correct according to the
generic CSS grammar and the individual grammars of each feature in
this module, and meet all other conformance requirements of style sheets
as described in this module.
<h3 class="no-ref heading settled heading" id=partial><span class=content>
Partial implementations</span><a class=self-link href=#partial></a></h3>
<p>So that authors can exploit the forward-compatible parsing rules to
assign fallback values, CSS renderers <strong>must</strong>
treat as invalid (and <a href=http://www.w3.org/TR/CSS21/conform.html#ignore>ignore
as appropriate</a>) any at-rules, properties, property values, keywords,
and other syntactic constructs for which they have no usable level of
support. In particular, user agents <strong>must not</strong> selectively
ignore unsupported component values and honor supported values in a single
multi-value property declaration: if any value is considered invalid
(as unsupported values must be), CSS requires that the entire declaration
be ignored.</p>
<h3 class="no-ref heading settled heading" id=experimental><span class=content>
Experimental implementations</span><a class=self-link href=#experimental></a></h3>
<p>To avoid clashes with future CSS features, the CSS2.1 specification
reserves a <a href=http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords>prefixed
syntax</a> for proprietary and experimental extensions to CSS.
<p>Prior to a specification reaching the Candidate Recommendation stage
in the W3C process, all implementations of a CSS feature are considered
experimental. The CSS Working Group recommends that implementations
use a vendor-prefixed syntax for such features, including those in
W3C Working Drafts. This avoids incompatibilities with future changes
in the draft.
</p>
<h3 class="no-ref heading settled heading" id=testing><span class=content>
Non-experimental implementations</span><a class=self-link href=#testing></a></h3>
<p>Once a specification reaches the Candidate Recommendation stage,
non-experimental implementations are possible, and implementors should
release an unprefixed implementation of any CR-level feature they
can demonstrate to be correctly implemented according to spec.
<p>To establish and maintain the interoperability of CSS across
implementations, the CSS Working Group requests that non-experimental
CSS renderers submit an implementation report (and, if necessary, the
testcases used for that implementation report) to the W3C before
releasing an unprefixed implementation of any CSS features. Testcases
submitted to W3C are subject to review and correction by the CSS
Working Group.
<p>Further information on submitting testcases and implementation reports
can be found from on the CSS Working Group’s website at
<a href=http://www.w3.org/Style/CSS/Test/>http://www.w3.org/Style/CSS/Test/</a>.
Questions should be directed to the
<a href=http://lists.w3.org/Archives/Public/public-css-testsuite>public-css-testsuite@w3.org</a>
mailing list.
<h2 class="no-num no-ref heading settled heading" id=references><span class=content>
References</span><a class=self-link href=#references></a></h2>
<h3 class="no-num no-ref heading settled heading" id=normative><span class=content>
Normative References</span><a class=self-link href=#normative></a></h3>
<div data-fill-with=normative-references><dl><dt id=html5 title=HTML5><a class=self-link href=#html5></a>[HTML5]<dd>Ian Hickson. <a href=http://www.w3.org/TR/2012/CR-html5-20121217/>HTML5</a>. 17 December 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/CR-html5-20121217/>http://www.w3.org/TR/2012/CR-html5-20121217/</a><dt id=rfc2119 title=RFC2119><a class=self-link href=#rfc2119></a>[RFC2119]<dd>S. Bradner. <a href=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <a href=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a></dl></div>
<h3 class="no-num no-ref heading settled heading" id=informative><span class=content>
Informative References</span><a class=self-link href=#informative></a></h3>
<div data-fill-with=informative-references><dl></dl></div>
<h2 class="no-num no-ref heading settled heading" id=index><span class=content>
Index</span><a class=self-link href=#index></a></h2>
<div data-fill-with=index><ul class=indexlist>
<li>checkFont(), <a href=#dom-fontloader-checkfontfont-text title="section 2.2.2">2.2.2</a>
<li>CSSFontFaceLoadEvent, <a href=#dom-cssfontfaceloadevent title="section 2.2">2.2</a>
<li>CSSFontFaceLoadEventInit, <a href=#dictdef-cssfontfaceloadeventinit title="section 2.2">2.2</a>
<li>error, <a href=#dom-cssfontfaceloadeventinit-error title="section 2.2">2.2</a>
<li>error, <a href=#dom-loadfontparameters-error title="section 2.2">2.2</a>
<li>error, <a href=#dom-cssfontfaceloadevent-error title="section 2.2">2.2</a>
<li>error, <a href=#dom-fontloader-error title="section 2.2.1">2.2.1</a>
<li>fire a font load event, <a href=#fire-a-font-load-event title="section 2.2.1">2.2.1</a>
<li>font, <a href=#dom-loadfontparameters-font title="section 2.2">2.2</a>
<li>font, <a href=#dom-fontloadercheckfont-font title="section 2.2.2">2.2.2</a>
<li>fontface, <a href=#dom-cssfontfaceloadeventinit-fontface title="section 2.2">2.2</a>
<li>fontface, <a href=#dom-cssfontfaceloadevent-fontface title="section 2.2">2.2</a>
<li>font load, <a href=#font-load title="section 2.2">2.2</a>
<li>fontloader, <a href=#dom-document-fontloader title="section 2.1">2.1</a>
<li>FontLoader, <a href=#dom-fontloader title="section 2.2">2.2</a>
<li>FontsReadyCallback, <a href=#callbackdef-fontsreadycallback title="section 2.2">2.2</a>
<li>fontsReadyCallback, <a href=#dom-fontloadernotifywhenfontsready-fontsreadycallback title="section 2.2.2">2.2.2</a>
<li>load, <a href=#dom-fontloader-load title="section 2.2.1">2.2.1</a>
<li>loadFont(), <a href=#dom-fontloader-loadfontparams title="section 2.2.2">2.2.2</a>
<li>LoadFontParameters, <a href=#dictdef-loadfontparameters title="section 2.2">2.2</a>
<li>loading, <a href=#dom-fontloader-loading0 title="section 2.2">2.2</a>
<li>loading, <a href=#dom-fontloader-loading title="section 2.2.1">2.2.1</a>
<li>loadingdone, <a href=#dom-fontloader-loadingdone title="section 2.2.1">2.2.1</a>
<li>loadstart, <a href=#dom-fontloader-loadstart title="section 2.2.1">2.2.1</a>
<li>notifyWhenFontsReady(), <a href=#dom-fontloader-notifywhenfontsreadyfontsreadycallback title="section 2.2.2">2.2.2</a>
<li>onerror, <a href=#dom-fontloader-onerror title="section 2.2">2.2</a>
<li>onload, <a href=#dom-fontloader-onload title="section 2.2">2.2</a>
<li>onloading, <a href=#dom-fontloader-onloading title="section 2.2">2.2</a>
<li>onloadingdone, <a href=#dom-fontloader-onloadingdone title="section 2.2">2.2</a>
<li>onloadstart, <a href=#dom-fontloader-onloadstart title="section 2.2">2.2</a>
<li>params, <a href=#dom-fontloaderloadfont-params title="section 2.2.2">2.2.2</a>
<li>success, <a href=#dom-loadfontparameters-success title="section 2.2">2.2</a>
<li>text, <a href=#dom-loadfontparameters-text title="section 2.2">2.2</a>
<li>text, <a href=#dom-fontloadercheckfont-text title="section 2.2.2">2.2.2</a>
</ul></div>
<h2 class="no-num no-ref heading settled heading" id=property-index><span class=content>
Property index</span><a class=self-link href=#property-index></a></h2>
<div data-fill-with=property-index><p>No properties defined.</div>
<h2 class="no-num heading settled" id=issues-index><span class=content>Issues Index</span><a class=self-link href=#issues-index></a></h2><div style="counter-reset: issue"><p class=issue>
Fill in intro.
<a href=#issue-c42e0891> ↵ </a><p class=issue>
Given that the FontLoader object is defined to be attached to the
document, how will canvas worker threads load fonts?
<a href=#issue-37f1437d> ↵ </a><p class=issue>
Errors will go "unreported" when using the general category of font
load events (i.e. <a class=idl-code data-link-type=event href=#dom-fontloader-loading>loading</a> and <a class=idl-code data-link-type=event href=#dom-fontloader-loadingdone>loadingdone</a>).
This seems fine but need to confirm this.
<a href=#issue-1b6714d3> ↵ </a></div>