Skip to content

Commit b637b04

Browse files
committed
[css-font-loading] Define constructor.
--HG-- extra : rebase_source : 29bdaea24b423829c262cb83bb55597d8c688d7b
1 parent 27db861 commit b637b04

2 files changed

Lines changed: 31 additions & 9 deletions

File tree

css-font-loading/Overview.bs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ The <code>FontFaceSet</code> Interface</h2>
367367

368368
callback ForEachCallback = void (FontFace font, long index, FontFaceSet self);
369369

370-
[Exposed=Window,Worker]
370+
[Exposed=Window,Worker,
371+
Constructor(sequence<FontFace> initialFaces)]
371372
interface FontFaceSet : EventTarget {
372373
// Emulate the Set interface, until we can extend Set correctly.
373374
readonly attribute unsigned long size;
@@ -421,6 +422,14 @@ The <code>FontFaceSet</code> Interface</h2>
421422
</dl>
422423

423424
<dl dfn-type=method dfn-for="FontFaceSet">
425+
<dt><dfn title="FontFaceSet()" constructor>FontFaceSet</dfn>(sequence&lt;<a idl>FontFace</a>> <dfn argument for="FontFaceSet/FontFaceSet()">initialFaces</dfn>)
426+
<dd>
427+
The <a idl>FontFaceSet</a> constructor, when called,
428+
must construct a new <a interface>Set</a> object
429+
by passing its <a argument>initialFaces</a> argument
430+
to the <a interface>Set</a> constructor,
431+
then assigning that <a interface>Set</a> object to the <a idl>FontFaceSet</a>'s <a idl>[<!---->[ContainedFonts]]</a> slot.
432+
424433
<dt><dfn title=add()>add</dfn>(<a idl>FontFace</a> font)
425434
<dt><dfn title=has()>has</dfn>(<a idl>FontFace</a> font)
426435
<dt><dfn title=delete()>delete</dfn>(<a idl>FontFace</a> font)
@@ -447,8 +456,9 @@ The <code>FontFaceSet</code> Interface</h2>
447456
a <dfn attribute for=FontFaceSet>[<!---->[ReadyPromise]]</dfn> slot,
448457
which is initialized to a fresh pending <a idl>Promise</a>,
449458
and a <dfn attribute for=FontFaceSet>[<!---->[ContainedFonts]]</dfn> slot,
450-
which is initialized to an empty <a interface>Set</a> object
451-
(though see <a section href="#document-font-face-set"></a> for information on how the Set may be pre-filled).
459+
which is initialized by the <a constructor title="FontFaceSet()">FontFaceSet constructor</a> to a <a interface>Set</a> object
460+
(though see <a section href="#document-font-face-set"></a> for information on how the Set may be pre-filled
461+
for <a idl>FontFaceSet</a> objects created by the user agent).
452462

453463
Because font families are loaded only when they are used,
454464
content sometimes needs to understand when the loading of fonts occurs.

css-font-loading/Overview.html

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</p>
5555
<h1 class="p-name no-ref" id=title>CSS Font Loading Module Level 3</h1>
5656
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
57-
<span class=dt-updated><span class=value-title title=20140626>26 June 2014</span></span></span></h2>
57+
<span class=dt-updated><span class=value-title title=20140627>27 June 2014</span></span></span></h2>
5858
<div data-fill-with=spec-metadata><dl>
5959
<dt>This version:
6060
<dd><a class=u-url href=http://dev.w3.org/csswg/css-font-loading/>http://dev.w3.org/csswg/css-font-loading/</a>
@@ -79,11 +79,11 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class
7979
</div>
8080

8181
<h2 class="no-num no-toc no-ref heading settled heading" id=abstract><span class=content>Abstract</span></h2>
82-
<p class=p-summary data-fill-with=abstract><p>This CSS module describes events and interfaces used for dynamically loading font resources.</p>
82+
<div class=p-summary data-fill-with=abstract><p>This CSS module describes events and interfaces used for dynamically loading font resources.</p>
8383

8484
<a href=http://www.w3.org/TR/CSS/>CSS</a> is a language for describing the rendering of structured documents
8585
(such as HTML and XML)
86-
on screen, on paper, in speech, etc.</p>
86+
on screen, on paper, in speech, etc.</div>
8787

8888
<h2 class="no-num no-toc no-ref heading settled heading" id=status><span class=content>Status of this document</span></h2>
8989
<div data-fill-with=status><p>
@@ -478,7 +478,8 @@ <h2 class="heading settled heading" data-level=3 id=FontFaceSet-interface><span
478478

479479
callback <dfn class=idl-code data-dfn-type=callback data-export="" data-global-name="" id=callbackdef-foreachcallback>ForEachCallback<a class=self-link href=#callbackdef-foreachcallback></a></dfn> = void (<a data-link-type=idl href=#dom-fontface title=fontface>FontFace</a> <dfn class=idl-code data-dfn-for=ForEachCallback data-dfn-type=argument data-export="" data-global-name="ForEachCallback/font<argument>" id=dom-foreachcallback-font>font<a class=self-link href=#dom-foreachcallback-font></a></dfn>, long <dfn class=idl-code data-dfn-for=ForEachCallback data-dfn-type=argument data-export="" data-global-name="ForEachCallback/index<argument>" id=dom-foreachcallback-index>index<a class=self-link href=#dom-foreachcallback-index></a></dfn>, <a data-link-type=idl href=#dom-fontfaceset title=fontfaceset>FontFaceSet</a> <dfn class=idl-code data-dfn-for=ForEachCallback data-dfn-type=argument data-export="" data-global-name="ForEachCallback/self<argument>" id=dom-foreachcallback-self>self<a class=self-link href=#dom-foreachcallback-self></a></dfn>);
480480

481-
[Exposed=Window,Worker]
481+
[Exposed=Window,Worker,
482+
Constructor(sequence initialFaces)]
482483
interface <dfn class=idl-code data-dfn-type=interface data-export="" data-global-name="" id=dom-fontfaceset>FontFaceSet<a class=self-link href=#dom-fontfaceset></a></dfn> : <a data-link-type=idl href=http://dom.spec.whatwg.org/#eventtarget title=eventtarget>EventTarget</a> {
483484
// Emulate the Set interface, until we can extend Set correctly.
484485
readonly attribute unsigned long <a class=idl-code data-global-name="FontFaceSet<interface>/size<attribute>" data-link-for=FontFaceSet data-link-type=attribute data-readonly="" data-type="unsigned long " href=#dom-fontfaceset-size title=size>size</a>;
@@ -533,6 +534,14 @@ <h2 class="heading settled heading" data-level=3 id=FontFaceSet-interface><span
533534
</dl>
534535

535536
<dl data-dfn-for=FontFaceSet data-dfn-type=method>
537+
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=constructor data-export="" id=dom-fontfaceset-fontfaceset title=FontFaceSet()>FontFaceSet<a class=self-link href=#dom-fontfaceset-fontfaceset></a></dfn>(sequence&lt;<a data-link-type=idl href=#dom-fontface title=fontface>FontFace</a>&gt; <dfn class=idl-code data-dfn-for=FontFaceSet/FontFaceSet() data-dfn-type=argument data-export="" id=dom-fontfacesetfontfaceset-initialfaces>initialFaces<a class=self-link href=#dom-fontfacesetfontfaceset-initialfaces></a></dfn>)
538+
<dd>
539+
The <a data-link-type=idl href=#dom-fontfaceset title=fontfaceset>FontFaceSet</a> constructor, when called,
540+
must construct a new <a class=idl-code data-link-type=interface title=set>Set</a> object
541+
by passing its <a class=idl-code data-link-type=argument href=#dom-fontfacesetfontfaceset-initialfaces title=initialfaces>initialFaces</a> argument
542+
to the <a class=idl-code data-link-type=interface title=set>Set</a> constructor,
543+
then assigning that <a class=idl-code data-link-type=interface title=set>Set</a> object to the <a data-link-type=idl href=#dom-fontfaceset title=fontfaceset>FontFaceSet</a>’s <a data-link-type=idl href=#dom-fontfaceset-containedfonts title=[[containedfonts]]>[[ContainedFonts]]</a> slot.
544+
536545
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=method data-export="" id=dom-fontfaceset-add title=add()>add<a class=self-link href=#dom-fontfaceset-add></a></dfn>(<a data-link-type=idl href=#dom-fontface title=fontface>FontFace</a> font)
537546
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=method data-export="" id=dom-fontfaceset-has title=has()>has<a class=self-link href=#dom-fontfaceset-has></a></dfn>(<a data-link-type=idl href=#dom-fontface title=fontface>FontFace</a> font)
538547
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=method data-export="" id=dom-fontfaceset-delete title=delete()>delete<a class=self-link href=#dom-fontfaceset-delete></a></dfn>(<a data-link-type=idl href=#dom-fontface title=fontface>FontFace</a> font)
@@ -559,9 +568,10 @@ <h2 class="heading settled heading" data-level=3 id=FontFaceSet-interface><span
559568
a <dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=attribute data-export="" id=dom-fontfaceset-readypromise>[[ReadyPromise]]<a class=self-link href=#dom-fontfaceset-readypromise></a></dfn> slot,
560569
which is initialized to a fresh pending <a data-link-type=idl href=#dom-promise title=promise>Promise</a>,
561570
and a <dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=attribute data-export="" id=dom-fontfaceset-containedfonts>[[ContainedFonts]]<a class=self-link href=#dom-fontfaceset-containedfonts></a></dfn> slot,
562-
which is initialized to an empty <a class=idl-code data-link-type=interface title=set>Set</a> object
571+
which is initialized by the <a class=idl-code data-link-type=constructor href=#dom-fontfaceset-fontfaceset title=fontfaceset()>FontFaceSet constructor</a> to a <a class=idl-code data-link-type=interface title=set>Set</a> object
563572
(though see <a data-section="" href=#document-font-face-set>§4.2
564-
Interaction with CSS’s @font-face Rule</a> for information on how the Set may be pre-filled).</p>
573+
Interaction with CSS’s @font-face Rule</a> for information on how the Set may be pre-filled
574+
for <a data-link-type=idl href=#dom-fontfaceset title=fontfaceset>FontFaceSet</a> objects created by the user agent).</p>
565575

566576
<p>Because font families are loaded only when they are used,
567577
content sometimes needs to understand when the loading of fonts occurs.
@@ -1269,6 +1279,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
12691279
<li>fontfaces<ul><li>dict-member for FontFaceSetLoadEventInit, <a href=#dom-fontfacesetloadeventinit-fontfaces title="section 3">3</a>
12701280
<li>attribute for FontFaceSetLoadEvent, <a href=#dom-fontfacesetloadevent-fontfaces title="section 3">3</a>
12711281
</ul><li>FontFaceSet, <a href=#dom-fontfaceset title="section 3">3</a>
1282+
<li>FontFaceSet(), <a href=#dom-fontfaceset-fontfaceset title="section 3">3</a>
12721283
<li>FontFaceSetLoadEvent, <a href=#dom-fontfacesetloadevent title="section 3">3</a>
12731284
<li>FontFaceSetLoadEventInit, <a href=#dictdef-fontfacesetloadeventinit title="section 3">3</a>
12741285
<li>FontFaceSetLoadStatus, <a href=#enumdef-fontfacesetloadstatus title="section 3">3</a>
@@ -1280,6 +1291,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
12801291
<li>ForEachCallback, <a href=#callbackdef-foreachcallback title="section 3">3</a>
12811292
<li>has(), <a href=#dom-fontfaceset-has title="section 3">3</a>
12821293
<li>index, <a href=#dom-foreachcallback-index title="section 3">3</a>
1294+
<li>initialFaces, <a href=#dom-fontfacesetfontfaceset-initialfaces title="section 3">3</a>
12831295
<li>iterator, <a href=#dom-fontfaceset-iterator title="section 3">3</a>
12841296
<li>keys(), <a href=#dom-fontfaceset-keys title="section 3">3</a>
12851297
<li>load()<ul><li>method for FontFace, <a href=#dom-fontface-load title="section 2.2">2.2</a>

0 commit comments

Comments
 (0)