Skip to content

Commit d8f6aef

Browse files
committed
[css-font-loading] Fold the 'exception to Set methods' section into the method definitions.
1 parent a908d2e commit d8f6aef

2 files changed

Lines changed: 42 additions & 49 deletions

File tree

css-font-loading/Overview.bs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -442,16 +442,24 @@ The <code>FontFaceSet</code> Interface</h2>
442442
<dt><dfn title=add()>add</dfn>(<a idl>FontFace</a> font)
443443
<dt><dfn title=has()>has</dfn>(<a idl>FontFace</a> font)
444444
<dt><dfn title=delete()>delete</dfn>(<a idl>FontFace</a> font)
445-
<dt><dfn title=clear()>clear</dfn>()
446445
<dt><dfn title=entries()>entries</dfn>()
447446
<dt><dfn title=keys()>keys</dfn>()
448447
<dt><dfn title=values()>values</dfn>()
449448
<dt><dfn title=forEach()>forEach</dfn>(<a idl>ForEachCallback</a> cb, optional any thisArg)
450449
<dd>
450+
If <a method>add()</a> or <a method>delete()</a> are called
451+
with an argument that is a <a>CSS-connected</a> <a interface>FontFace</a> object,
452+
they must throw an InvalidModificationError exception.
453+
451454
All of these methods call the corresponding method of the <a idl>FontFaceSet</a>'s <a idl>[<!---->[ContainedFonts]]</a> slot
452455
with the same arguments as were passed to them,
453456
and return the value returned by the called method.
454457

458+
<dt><dfn title=clear()>clear</dfn>()
459+
<dd>
460+
This must remove all non-<a>CSS-connected</a> <a idl>FontFace</a> objects
461+
from the <a idl>FontFaceSet</a>'s <a idl>[<!---->[ContainedFonts]]</a> slot.
462+
455463
<dt><dfn iterator title="iterator">iterator behavior</dfn>
456464
<dd>
457465
The <a spec=webidl>iterator behavior</a> is the iterator behavior of the <a idl>FontFaceSet</a>'s <a idl>[<!---->[ContainedFonts]]</a> slot.
@@ -498,17 +506,6 @@ The <code>FontFaceSet</code> Interface</h2>
498506
The <a idl for=FontFaceSet>status</a> promise needs to pay attention to what <a idl>FontFaceSet</a> it's attached to.
499507
I guess only the <a>font source's</a> <a idl for=FontFaceSet>status</a> promise should care about pending layout operations.
500508

501-
<h3 id='set-modifications'>
502-
Modifications of normal Set methods</h3>
503-
504-
The <a interface>FontFaceSet</a> methods <code>add()</code> and <code>delete()</code>
505-
must throw an InvalidModificationError exception
506-
if their argument is a <a>CSS-connected</a> <a interface>FontFace</a> object.
507-
508-
The <a interface>FontFaceSet</a> method <code>clear()</code>
509-
must only remove the manually-added <a interface>FontFace</a> objects;
510-
the <a>CSS-connected</a> <a interface>FontFace</a> objects are unaffected.
511-
512509
<!--
513510
████████ ██ ██ ████████ ██ ██ ████████ ██████
514511
██ ██ ██ ██ ███ ██ ██ ██ ██

css-font-loading/Overview.html

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,11 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
128128
<li><a href=#font-face-css-connection><span class=secno>2.3</span> Interaction with CSS’s <span>@font-face</span> Rule</a></ul>
129129
<li><a href=#FontFaceSet-interface><span class=secno>3</span> The <code>FontFaceSet</code> Interface</a>
130130
<ul class=toc>
131-
<li><a href=#set-modifications><span class=secno>3.1</span> Modifications of normal Set methods</a>
132-
<li><a href=#FontFaceSet-events><span class=secno>3.2</span> Events</a>
133-
<li><a href=#font-face-set-load><span class=secno>3.3</span> The <code>load()</code> method</a>
134-
<li><a href=#font-face-set-check><span class=secno>3.4</span> The <code>check()</code> method</a>
135-
<li><a href=#font-face-set-ready><span class=secno>3.5</span> The <code>ready</code> attribute</a>
136-
<li><a href=#font-face-set-css><span class=secno>3.6</span> Interaction with CSS Font Loading and Matching</a></ul>
131+
<li><a href=#FontFaceSet-events><span class=secno>3.1</span> Events</a>
132+
<li><a href=#font-face-set-load><span class=secno>3.2</span> The <code>load()</code> method</a>
133+
<li><a href=#font-face-set-check><span class=secno>3.3</span> The <code>check()</code> method</a>
134+
<li><a href=#font-face-set-ready><span class=secno>3.4</span> The <code>ready</code> attribute</a>
135+
<li><a href=#font-face-set-css><span class=secno>3.5</span> Interaction with CSS Font Loading and Matching</a></ul>
137136
<li><a href=#font-face-source><span class=secno>4</span> The <code>FontFaceSource</code> interface</a>
138137
<ul class=toc>
139138
<li><a href=#fontfacesource-workers><span class=secno>4.1</span> Worker FontFaceSources</a>
@@ -528,7 +527,7 @@ <h2 class="heading settled heading" data-level=3 id=FontFaceSet-interface><span
528527
<dd>
529528
This attribute reflects the <a data-link-type=idl href=#dom-fontfaceset title=fontfaceset>FontFaceSet</a>’s <a data-link-type=idl href=#dom-fontfaceset-readypromise title=[[readypromise]]>[[ReadyPromise]]</a> slot.
530529

531-
<p>See <a data-section="" href=#font-face-set-ready>§3.5
530+
<p>See <a data-section="" href=#font-face-set-ready>§3.4
532531
The ready attribute</a> for more details on this <a data-link-type=idl href=#dom-promise title=promise>Promise</a> and its use.</p>
533532

534533
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=attribute data-export="" id=dom-fontfaceset-size>size<a class=self-link href=#dom-fontfaceset-size></a></dfn> <span data-attribute-info="" for=FontFaceSet/size> of type <a data-link-type=idl-name title="unsigned long">unsigned long</a>, readonly</span>
@@ -554,15 +553,23 @@ <h2 class="heading settled heading" data-level=3 id=FontFaceSet-interface><span
554553
<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)
555554
<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)
556555
<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)
557-
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=method data-export="" id=dom-fontfaceset-clear title=clear()>clear<a class=self-link href=#dom-fontfaceset-clear></a></dfn>()
558556
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=method data-export="" id=dom-fontfaceset-entries title=entries()>entries<a class=self-link href=#dom-fontfaceset-entries></a></dfn>()
559557
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=method data-export="" id=dom-fontfaceset-keys title=keys()>keys<a class=self-link href=#dom-fontfaceset-keys></a></dfn>()
560558
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=method data-export="" id=dom-fontfaceset-values title=values()>values<a class=self-link href=#dom-fontfaceset-values></a></dfn>()
561559
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=method data-export="" id=dom-fontfaceset-foreach title=forEach()>forEach<a class=self-link href=#dom-fontfaceset-foreach></a></dfn>(<a data-link-type=idl href=#callbackdef-foreachcallback title=foreachcallback>ForEachCallback</a> cb, optional any thisArg)
562560
<dd>
563-
All of these methods call the corresponding method of 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
561+
If <a class=idl-code data-link-type=method href=#dom-fontfaceset-add title=add()>add()</a> or <a class=idl-code data-link-type=method href=#dom-fontfaceset-delete title=delete()>delete()</a> are called
562+
with an argument that is a <a data-link-type=dfn href=#css-connected title=css-connected>CSS-connected</a> <a class=idl-code data-link-type=interface href=#dom-fontface title=fontface>FontFace</a> object,
563+
they must throw an InvalidModificationError exception.
564+
565+
<p>All of these methods call the corresponding method of 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
564566
with the same arguments as were passed to them,
565-
and return the value returned by the called method.
567+
and return the value returned by the called method.</p>
568+
569+
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=method data-export="" id=dom-fontfaceset-clear title=clear()>clear<a class=self-link href=#dom-fontfaceset-clear></a></dfn>()
570+
<dd>
571+
This must remove all non-<a data-link-type=dfn href=#css-connected title=css-connected>CSS-connected</a> <a data-link-type=idl href=#dom-fontface title=fontface>FontFace</a> objects
572+
from 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.
566573

567574
<dt><dfn class=idl-code data-dfn-for=FontFaceSet data-dfn-type=iterator data-export="" id=dom-fontfaceset-iterator title=iterator>iterator behavior<a class=self-link href=#dom-fontfaceset-iterator></a></dfn>
568575
<dd>
@@ -611,20 +618,9 @@ <h2 class="heading settled heading" data-level=3 id=FontFaceSet-interface><span
611618
The <a data-link-for=FontFaceSet data-link-type=idl href=#dom-fontfaceset-status title=status>status</a> promise needs to pay attention to what <a data-link-type=idl href=#dom-fontfaceset title=fontfaceset>FontFaceSet</a> it’s attached to.
612619
I guess only the <a data-link-type=dfn href=#font-source title="font source’s">font source’s</a> <a data-link-for=FontFaceSet data-link-type=idl href=#dom-fontfaceset-status title=status>status</a> promise should care about pending layout operations.</p>
613620

614-
<h3 class="heading settled heading" data-level=3.1 id=set-modifications><span class=secno>3.1 </span><span class=content>
615-
Modifications of normal Set methods</span><a class=self-link href=#set-modifications></a></h3>
616-
617-
<p>The <a class=idl-code data-link-type=interface href=#dom-fontfaceset title=fontfaceset>FontFaceSet</a> methods <code>add()</code> and <code>delete()</code>
618-
must throw an InvalidModificationError exception
619-
if their argument is a <a data-link-type=dfn href=#css-connected title=css-connected>CSS-connected</a> <a class=idl-code data-link-type=interface href=#dom-fontface title=fontface>FontFace</a> object.</p>
620-
621-
<p>The <a class=idl-code data-link-type=interface href=#dom-fontfaceset title=fontfaceset>FontFaceSet</a> method <code>clear()</code>
622-
must only remove the manually-added <a class=idl-code data-link-type=interface href=#dom-fontface title=fontface>FontFace</a> objects;
623-
the <a data-link-type=dfn href=#css-connected title=css-connected>CSS-connected</a> <a class=idl-code data-link-type=interface href=#dom-fontface title=fontface>FontFace</a> objects are unaffected.</p>
624-
625621

626622

627-
<h3 class="heading settled heading" data-level=3.2 id=FontFaceSet-events><span class=secno>3.2 </span><span class=content>
623+
<h3 class="heading settled heading" data-level=3.1 id=FontFaceSet-events><span class=secno>3.1 </span><span class=content>
628624
Events</span><a class=self-link href=#FontFaceSet-events></a></h3>
629625

630626
<p>Font load events make it easy to respond to the font-loading behavior of the entire document,
@@ -785,7 +781,7 @@ <h3 class="heading settled heading" data-level=3.2 id=FontFaceSet-events><span c
785781

786782

787783

788-
<h3 class="heading settled heading" data-level=3.3 id=font-face-set-load><span class=secno>3.3 </span><span class=content>
784+
<h3 class="heading settled heading" data-level=3.2 id=font-face-set-load><span class=secno>3.2 </span><span class=content>
789785
The <code>load()</code> method</span><a class=self-link href=#font-face-set-load></a></h3>
790786

791787
<p>The <a data-link-for=FontFaceSet data-link-type=functionish href=#dom-fontfaceset-load title=load()>load()</a> method of <a class=idl-code data-link-type=interface href=#dom-fontfaceset title=fontfaceset>FontFaceSet</a> will determine whether all fonts in the given font list
@@ -832,7 +828,7 @@ <h3 class="heading settled heading" data-level=3.3 id=font-face-set-load><span c
832828

833829

834830

835-
<h3 class="heading settled heading" data-level=3.4 id=font-face-set-check><span class=secno>3.4 </span><span class=content>
831+
<h3 class="heading settled heading" data-level=3.3 id=font-face-set-check><span class=secno>3.3 </span><span class=content>
836832
The <code>check()</code> method</span><a class=self-link href=#font-face-set-check></a></h3>
837833

838834
<p>The <a data-link-type=functionish href=#dom-fontfaceset-check title=check()>check()</a> method of <a class=idl-code data-link-type=interface href=#dom-fontfaceset title=fontfaceset>FontFaceSet</a> will determine whether all fonts in the given font list
@@ -870,7 +866,7 @@ <h3 class="heading settled heading" data-level=3.4 id=font-face-set-check><span
870866

871867

872868

873-
<h3 class="heading settled heading" data-level=3.5 id=font-face-set-ready><span class=secno>3.5 </span><span class=content>
869+
<h3 class="heading settled heading" data-level=3.4 id=font-face-set-ready><span class=secno>3.4 </span><span class=content>
874870
The <code>ready</code> attribute</span><a class=self-link href=#font-face-set-ready></a></h3>
875871

876872
<p>Because the number of fonts loaded depends on the how many fonts are used for a given piece of text,
@@ -899,7 +895,7 @@ <h3 class="heading settled heading" data-level=3.5 id=font-face-set-ready><span
899895
never rejected,
900896
unlike the Promise returned by the <a class=idl-code data-link-type=interface href=#dom-fontface title=fontface>FontFace</a> <a class=idl-code data-link-for=FontFace data-link-type=method href=#dom-fontface-load title=load()>load()</a> method.</p>
901897

902-
<h3 class="heading settled heading" data-level=3.6 id=font-face-set-css><span class=secno>3.6 </span><span class=content>
898+
<h3 class="heading settled heading" data-level=3.5 id=font-face-set-css><span class=secno>3.5 </span><span class=content>
903899
Interaction with CSS Font Loading and Matching</span><a class=self-link href=#font-face-set-css></a></h3>
904900

905901
<p>When the font matching algorithm in <a data-biblio-type=informative data-link-type=biblio href=#biblio-css3-fonts title=biblio-css3-fonts>[CSS3-FONTS]</a> is run automatically by the user-agent,
@@ -1259,7 +1255,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
12591255
<li>available font faces, <a href=#available-font-faces title="section 4">4</a>
12601256
<li>BinaryData, <a href=#typedefdef-binarydata title="section 2">2</a>
12611257
<li>cb, <a href=#dom-fontfacesetforeach-cb title="section 3">3</a>
1262-
<li>check(), <a href=#dom-fontfaceset-check title="section 3.4">3.4</a>
1258+
<li>check(), <a href=#dom-fontfaceset-check title="section 3.3">3.3</a>
12631259
<li>clear(), <a href=#dom-fontfaceset-clear title="section 3">3</a>
12641260
<li>[[ContainedFonts]], <a href=#dom-fontfaceset-containedfonts title="section 3">3</a>
12651261
<li>CSS-connected, <a href=#css-connected title="section 2.3">2.3</a>
@@ -1273,14 +1269,14 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
12731269
<li>argument for FontFace/FontFace(), <a href=#dom-fontfacefontface-family title="section 2.1">2.1</a>
12741270
</ul><li>featureSettings<ul><li>dict-member for FontFaceDescriptors, <a href=#dom-fontfacedescriptors-featuresettings title="section 2">2</a>
12751271
<li>attribute for FontFace, <a href=#dom-fontface-featuresettings title="section 2">2</a>
1276-
</ul><li>find the matching font faces, <a href=#find-the-matching-font-faces title="section 3.2">3.2</a>
1277-
<li>fire a font load event, <a href=#fire-a-font-load-event title="section 3.2">3.2</a>
1272+
</ul><li>find the matching font faces, <a href=#find-the-matching-font-faces title="section 3.1">3.1</a>
1273+
<li>fire a font load event, <a href=#fire-a-font-load-event title="section 3.1">3.1</a>
12781274
<li>font<ul><li>argument for ForEachCallback, <a href=#dom-foreachcallback-font title="section 3">3</a>
12791275
<li>argument for FontFaceSet/add(), <a href=#dom-fontfacesetadd-font title="section 3">3</a>
12801276
<li>argument for FontFaceSet/has(), <a href=#dom-fontfacesethas-font title="section 3">3</a>
12811277
<li>argument for FontFaceSet/delete(), <a href=#dom-fontfacesetdelete-font title="section 3">3</a>
1282-
<li>argument for FontFaceSet/load(), <a href=#dom-fontfacesetload-font title="section 3.3">3.3</a>
1283-
<li>argument for FontFaceSet/check(), <a href=#dom-fontfacesetcheck-font title="section 3.4">3.4</a>
1278+
<li>argument for FontFaceSet/load(), <a href=#dom-fontfacesetload-font title="section 3.2">3.2</a>
1279+
<li>argument for FontFaceSet/check(), <a href=#dom-fontfacesetcheck-font title="section 3.3">3.3</a>
12841280
</ul><li>FontFace, <a href=#dom-fontface title="section 2">2</a>
12851281
<li>FontFace(), <a href=#dom-fontface-fontface title="section 2.1">2.1</a>
12861282
<li>FontFaceDescriptors, <a href=#dictdef-fontfacedescriptors title="section 2">2</a>
@@ -1304,12 +1300,12 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
13041300
<li>iterator, <a href=#dom-fontfaceset-iterator title="section 3">3</a>
13051301
<li>keys(), <a href=#dom-fontfaceset-keys title="section 3">3</a>
13061302
<li>load()<ul><li>method for FontFace, <a href=#dom-fontface-load title="section 2.2">2.2</a>
1307-
<li>method for FontFaceSet, <a href=#dom-fontfaceset-load title="section 3.3">3.3</a>
1303+
<li>method for FontFaceSet, <a href=#dom-fontfaceset-load title="section 3.2">3.2</a>
13081304
</ul><li>loaded, <a href=#dom-fontface-loaded title="section 2">2</a>
13091305
<li>[[LoadedFonts]], <a href=#dom-fontfaceset-loadedfonts title="section 3">3</a>
1310-
<li>loading, <a href=#dom-fontfaceset-loading title="section 3.2">3.2</a>
1311-
<li>loadingdone, <a href=#dom-fontfaceset-loadingdone title="section 3.2">3.2</a>
1312-
<li>loadingerror, <a href=#dom-fontfaceset-loadingerror title="section 3.2">3.2</a>
1306+
<li>loading, <a href=#dom-fontfaceset-loading title="section 3.1">3.1</a>
1307+
<li>loadingdone, <a href=#dom-fontfaceset-loadingdone title="section 3.1">3.1</a>
1308+
<li>loadingerror, <a href=#dom-fontfaceset-loadingerror title="section 3.1">3.1</a>
13131309
<li>[[LoadingFonts]], <a href=#dom-fontfaceset-loadingfonts title="section 3">3</a>
13141310
<li>no pending font loads, <a href=#no-pending-font-loads title="section 3">3</a>
13151311
<li>onloading, <a href=#dom-fontfaceset-onloading title="section 3">3</a>
@@ -1328,8 +1324,8 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
13281324
<li>attribute for FontFace, <a href=#dom-fontface-stretch title="section 2">2</a>
13291325
</ul><li>style<ul><li>dict-member for FontFaceDescriptors, <a href=#dom-fontfacedescriptors-style title="section 2">2</a>
13301326
<li>attribute for FontFace, <a href=#dom-fontface-style title="section 2">2</a>
1331-
</ul><li>text<ul><li>argument for FontFaceSet/load(), <a href=#dom-fontfacesetload-text title="section 3.3">3.3</a>
1332-
<li>argument for FontFaceSet/check(), <a href=#dom-fontfacesetcheck-text title="section 3.4">3.4</a>
1327+
</ul><li>text<ul><li>argument for FontFaceSet/load(), <a href=#dom-fontfacesetload-text title="section 3.2">3.2</a>
1328+
<li>argument for FontFaceSet/check(), <a href=#dom-fontfacesetcheck-text title="section 3.3">3.3</a>
13331329
</ul><li>thisArg, <a href=#dom-fontfacesetforeach-thisarg title="section 3">3</a>
13341330
<li>type, <a href=#dom-fontfacesetloadeventfontfacesetloadevent-type title="section 3">3</a>
13351331
<li>unicodeRange<ul><li>dict-member for FontFaceDescriptors, <a href=#dom-fontfacedescriptors-unicoderange title="section 2">2</a>

0 commit comments

Comments
 (0)