Skip to content

Commit 64a8ddc

Browse files
Editorial: Update use of WebIDL "invoke a callback function" (#1127)
* Editorial: Update use of WebIDL "invoke a callback function" Rethrowing is no longer implicit (since reporting is frequently what's desired). Here handling the exception is intended, so this is a very small change. Also included are the various changes required to make these specs build and fixes to some places nearby where a clearly incorrect definition was linked to. Part of whatwg/webidl#1425. * Use link-defaults rather than a manual anchor --------- Co-authored-by: Tab Atkins Jr. <[email protected]>
1 parent d384226 commit 64a8ddc

File tree

2 files changed

+31
-25
lines changed

2 files changed

+31
-25
lines changed

css-layout-api/Overview.bs

+27-22
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ spec:css22; type:property;
5151
text:min-height
5252
text:min-width
5353
spec:css2; type:property; text:max-width
54+
spec:webidl; type:dfn; text:is a platform object
5455
</pre>
5556

5657
<pre class="anchors">
@@ -352,8 +353,9 @@ is called, the user agent <em>must</em> run the following steps:
352353
5. Let |inputPropertiesIterable| be the result of [=Get=](|layoutCtor|, "inputProperties").
353354

354355
6. If |inputPropertiesIterable| is not undefined, then set |inputProperties| to the result of
355-
[=converting=] |inputPropertiesIterable| to a <code>sequence&lt;DOMString></code>. If an
356-
exception is [=thrown=], rethrow the exception and abort all these steps.
356+
[=converted to an IDL value|converting=] |inputPropertiesIterable| to a
357+
<code>sequence&lt;DOMString></code>. If an exception is [=thrown=], rethrow the exception
358+
and abort all these steps.
357359

358360
7. Filter |inputProperties| so that it only contains [=supported CSS properties=] and [=custom
359361
properties=].
@@ -373,7 +375,7 @@ is called, the user agent <em>must</em> run the following steps:
373375
"childInputProperties").
374376

375377
10. If |childInputPropertiesIterable| is not undefined, then set |childInputProperties| to the
376-
result of [=converting=] |childInputPropertiesIterable| to a
378+
result of [=converted to an IDL value|converting=] |childInputPropertiesIterable| to a
377379
<code>sequence&lt;DOMString></code>. If an exception is [=thrown=], rethrow the exception
378380
and abort all these steps.
379381

@@ -382,9 +384,9 @@ is called, the user agent <em>must</em> run the following steps:
382384

383385
12. Let |layoutOptionsValue| be the result of [=Get=](|layoutCtor|, "layoutOptions").
384386

385-
13. Let |layoutOptions| be the result of [=converting=] |layoutOptionsValue| to a
386-
{{LayoutOptions}}. If an exception is [=thrown=], rethrow the exception and abort all these
387-
steps.
387+
13. Let |layoutOptions| be the result of [=converted to an IDL value|converting=]
388+
|layoutOptionsValue| to a {{LayoutOptions}}. If an exception is [=thrown=], rethrow the
389+
exception and abort all these steps.
388390

389391
14. Let |prototype| be the result of [=Get=](|layoutCtor|, "prototype").
390392

@@ -393,13 +395,14 @@ is called, the user agent <em>must</em> run the following steps:
393395

394396
16. Let |intrinsicSizesValue| be the result of [=Get=](|prototype|, "intrinsicSizes").
395397

396-
17. Let |intrinsicSizes| be the result of [=converting=] |intrinsicSizesValue| to the
397-
[=Function=] [=callback function=] type. Rethrow any exceptions from the conversion.
398+
17. Let |intrinsicSizes| be the result of [=converted to an IDL value|converting=]
399+
|intrinsicSizesValue| to the {{Function}} [=callback function=] type. Rethrow any
400+
exceptions from the conversion.
398401

399402
18. Let |layoutValue| be the result of [=Get=](|prototype|, <code>"layout"</code>).
400403

401-
19. Let |layout| be the result of [=converting=] |layoutValue| to the [=Function=] [=callback
402-
function=] type. Rethrow any exceptions from the conversion.
404+
19. Let |layout| be the result of [=converted to an IDL value|converting=] |layoutValue| to
405+
the {{Function}} [=callback function=] type. Rethrow any exceptions from the conversion.
403406

404407
20. Let |definition| be a new [=layout definition=] with:
405408

@@ -1827,8 +1830,9 @@ When the user agent wants to <dfn>invoke an intrinsic sizes callback</dfn> given
18271830

18281831
10. Let |intrinsicSizesFunction| be |definition|'s [=intrinsic sizes function=].
18291832

1830-
11. Let |value| be the result of [=Invoke=](|intrinsicSizesFunction|, |layoutInstance|,
1831-
«|children|, |edges|, |styleMap|»).
1833+
11. Let |value| be the result of [=invoking=] |intrinsicSizesFunction| with « |children|,
1834+
|edges|, |styleMap| » and "`rethrow`", and with |layoutInstance| as the [=callback this
1835+
value=].
18321836

18331837
If an exception is [=thrown=] the let |box| fallback to the [=flow layout=] and abort all
18341838
these steps.
@@ -1847,9 +1851,9 @@ When the user agent wants to <dfn>invoke an intrinsic sizes callback</dfn> given
18471851

18481852
1. Let |intrinsicSizesValue| be |value|.
18491853

1850-
13. Let |intrinsicSizes| be the result of [=converting=] |intrinsicSizesValue| to a
1851-
{{IntrinsicSizesResultOptions}}. If an exception is [=thrown=], let |box| fallback to the
1852-
[=flow layout=] and abort all these steps.
1854+
13. Let |intrinsicSizes| be the result of [=converted to an IDL value|converting=]
1855+
|intrinsicSizesValue| to a {{IntrinsicSizesResultOptions}}. If an exception is [=thrown=],
1856+
let |box| fallback to the [=flow layout=] and abort all these steps.
18531857

18541858
14. Set the [=intrinsic sizes=] of |box|:
18551859

@@ -1950,8 +1954,9 @@ following steps:
19501954

19511955
13. Let |layoutFunction| be |definition|'s [=layout function=].
19521956

1953-
14. Let |value| be the result of [=Invoke=](|layoutFunction|, |layoutInstance|, «|children|,
1954-
|edges|, |layoutConstraints|, |styleMap|, |breakToken|»).
1957+
14. Let |value| be the result of [=invoking =] |layoutFunction| with « |children|, |edges|,
1958+
|layoutConstraints|, |styleMap|, |breakToken| », and with |layoutInstance| as the [=callback
1959+
this value=].
19551960

19561961
If an exception is [=thrown=] the let |box| fallback to the [=flow layout=] and abort all
19571962
these steps.
@@ -1969,20 +1974,20 @@ following steps:
19691974

19701975
1. Let |fragmentResultValue| be |value|.
19711976

1972-
16. If |fragmentResultValue| is a [=platform object=]:
1977+
16. If |fragmentResultValue| [=is a platform object=]:
19731978

19741979
- Then:
19751980

1976-
1. Let |fragmentResult| be the result [=converting=] |fragmentResultValue| to a
1977-
{{FragmentResult}}.
1981+
1. Let |fragmentResult| be the result [=converted to an IDL value|converting=]
1982+
|fragmentResultValue| to a {{FragmentResult}}.
19781983

19791984
If an exception is [=thrown=], let |box| fallback to the [=flow layout=] and abort all
19801985
these steps.
19811986

19821987
- Otherwise:
19831988

1984-
1. Let |fragmentResultOptions| be the result of [=converting=] |fragmentResultValue| to
1985-
a {{FragmentResultOptions}}.
1989+
1. Let |fragmentResultOptions| be the result of [=converted to an IDL value|converting=]
1990+
|fragmentResultValue| to a {{FragmentResultOptions}}.
19861991

19871992
If an exception is [=thrown=], let |box| fallback to the [=flow layout=] and abort
19881993
all these steps.

css-paint-api/Overview.bs

+4-3
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,10 @@ The <<paint()>> function is an additional notation to be supported by the <<imag
307307

308308
<div class="example">
309309
<pre class=lang-markup>
310-
&ltstyle>
310+
&lt;style>
311311
.logo { background-image: paint(company-logo); }
312312
.chat-bubble { background-image: paint(chat-bubble, blue); }
313-
&lt/style>
313+
&lt;/style>
314314
</pre>
315315
</div>
316316

@@ -664,7 +664,8 @@ When the user agent wants to <dfn>invoke a paint callback</dfn> given |name|, |i
664664
11. Let |paintFunctionCallback| be |definition|'s [=paint function=].
665665

666666
12. [=Invoke=] |paintFunctionCallback| with arguments «|renderingContext|, |paintSize|,
667-
|styleMap|, |inputArguments|», and with |paintInstance| as the [=callback this value=].
667+
|styleMap|, |inputArguments|» and "`rethrow`", and with |paintInstance| as the
668+
[=callback this value=].
668669

669670
If |paintFunctionCallback| does not complete within an acceptable time (as determined by the
670671
user agent, i.e. it is a "long running script") the user agent <em>may</em> terminate the

0 commit comments

Comments
 (0)