Skip to content

Commit 9bbfc20

Browse files
committed
[css-font-loading] Set status to error when initial descriptors are wrong, too.
1 parent b3dc88e commit 9bbfc20

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

css-font-loading/Overview.bs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,18 @@ The Constructor</h3>
198198
and the members of the <a argument for='FontFace/FontFace()'>descriptors</a> argument,
199199
according to the grammars of the corresponding descriptors of the CSS ''@font-face'' rule.
200200
If any of them fail to parse correctly,
201-
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a DOMException named "SyntaxError" and abort these steps.
201+
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a DOMException named "SyntaxError",
202+
queue a task to set <var>font face’s</var> <a idl>status</a> attribute to "error",
203+
and abort these steps.
202204
Otherwise, queue a task to set <var>font face's</var> corresponding attributes to the serialization of the parsed values.
203205

204206
<li>
205207
If the <a>source</a> argument was a <a>DOMString</a>,
206208
parse it according to the grammar of the 'src' descriptor of the CSS ''@font-face'' rule.
207209
If it fails to parse correctly,
208-
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a DOMException named "SyntaxError" exception and abort these steps;
210+
reject <var>font face's</var> <a>[<!---->[FontStatusPromise]]</a> with a DOMException named "SyntaxError" exception
211+
queue a task to set <var>font face’s</var> <a idl>status</a> attribute to "error",
212+
and abort these steps;
209213
otherwise, set <var>font face's</var> internal <a>[<!---->[Urls]]</a> slot to the string.
210214

211215
Note: Note that this means that passing a naked url as the source argument,

css-font-loading/Overview.html

Lines changed: 9 additions & 5 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=20140703>3 July 2014</span></span></span></h2>
57+
<span class=dt-updated><span class=value-title title=20140707>7 July 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>
@@ -125,7 +125,7 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
125125
<ul class=toc>
126126
<li><a href=#font-face-constructor><span class=secno>2.1</span> The Constructor</a>
127127
<li><a href=#font-face-load><span class=secno>2.2</span> The <code>load()</code> method</a>
128-
<li><a href=#font-face-css-connection><span class=secno>2.3</span> Interaction with CSS’s <span>@font-face</span> Rule</a></ul>
128+
<li><a href=#font-face-css-connection><span class=secno>2.3</span> Interaction with CSS’s <span class=css data-link-type=maybe title=@font-face>@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>
131131
<li><a href=#FontFaceSet-events><span class=secno>3.1</span> Events</a>
@@ -136,7 +136,7 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
136136
<li><a href=#font-face-source><span class=secno>4</span> The <code>FontFaceSource</code> interface</a>
137137
<ul class=toc>
138138
<li><a href=#fontfacesource-workers><span class=secno>4.1</span> Worker FontFaceSources</a>
139-
<li><a href=#document-font-face-set><span class=secno>4.2</span> Interaction with CSS’s <span>@font-face</span> Rule</a></ul>
139+
<li><a href=#document-font-face-set><span class=secno>4.2</span> Interaction with CSS’s <span class=css data-link-type=maybe title=@font-face>@font-face</span> Rule</a></ul>
140140
<li><a href=#font-load-event-examples><span class=secno>5</span> API Examples</a>
141141
<li><a href=#changes><span class=secno></span> Changes</a>
142142
<li><a href=#acknowledgments><span class=secno></span> Acknowledgments</a>
@@ -325,14 +325,18 @@ <h3 class="heading settled heading" data-level=2.1 id=font-face-constructor><spa
325325
and the members of the <a class=idl-code data-link-for=FontFace/FontFace() data-link-type=argument href=#dom-fontfacefontface-descriptors title=descriptors>descriptors</a> argument,
326326
according to the grammars of the corresponding descriptors of the CSS <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule.
327327
If any of them fail to parse correctly,
328-
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a DOMException named "SyntaxError" and abort these steps.
328+
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a DOMException named "SyntaxError",
329+
queue a task to set <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-status title=status>status</a> attribute to "error",
330+
and abort these steps.
329331
Otherwise, queue a task to set <var>font face’s</var> corresponding attributes to the serialization of the parsed values.
330332

331333
<li>
332334
If the <a data-link-type=idl href=#dom-fontfacefontface-source title=source>source</a> argument was a <a data-link-type=idl title=domstring>DOMString</a>,
333335
parse it according to the grammar of the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-fonts-3/#descdef-src title=src>src</a> descriptor of the CSS <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-fonts-3/#at-font-face-rule title=@font-face>@font-face</a> rule.
334336
If it fails to parse correctly,
335-
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a DOMException named "SyntaxError" exception and abort these steps;
337+
reject <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-fontstatuspromise title=[[fontstatuspromise]]>[[FontStatusPromise]]</a> with a DOMException named "SyntaxError" exception
338+
queue a task to set <var>font face’s</var> <a data-link-type=idl href=#dom-fontface-status title=status>status</a> attribute to "error",
339+
and abort these steps;
336340
otherwise, set <var>font face’s</var> internal <a data-link-type=idl href=#dom-fontface-urls title=[[urls]]>[[Urls]]</a> slot to the string.
337341

338342
<p class=note>Note: Note that this means that passing a naked url as the source argument,

0 commit comments

Comments
 (0)