Skip to content

Commit ea24af3

Browse files
committed
fix(float‑types): Use “with an associated” instead of “associated with”
1 parent 8ac089c commit ea24af3

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

index.bs

+23-21
Original file line numberDiff line numberDiff line change
@@ -5972,7 +5972,8 @@ type that corresponds to the set of finite single-precision 32 bit
59725972
IEEE 754 floating point numbers. [[!IEEE-754]]
59735973

59745974
When defined with the [{{Unrestricted}}] [=extended attribute=], the {{float}} type
5975-
additionally corresponds to IEEE 754 non-finite, and special "not a number" values (NaNs). [[!IEEE-754]]
5975+
additionally corresponds to the single-precision 32 bit IEEE 754 non-finite,
5976+
and special "not a number" values (NaNs). [[!IEEE-754]]
59765977

59775978
{{float}} constant values in IDL are
59785979
represented with <emu-t class="regex"><a href="#prod-decimal">decimal</a></emu-t>
@@ -5997,7 +5998,8 @@ type that corresponds to the set of finite double-precision 64 bit
59975998
IEEE 754 floating point numbers. [[!IEEE-754]]
59985999

59996000
When defined with the [{{Unrestricted}}] [=extended attribute=], the {{double}} type
6000-
additionally corresponds to IEEE 754 non-finite, and special "not a number" values (NaNs). [[!IEEE-754]]
6001+
additionally corresponds to the double-precision 64 bit IEEE 754 non-finite,
6002+
and special "not a number" values (NaNs). [[!IEEE-754]]
60016003

60026004
{{double}} constant values in IDL are
60036005
represented with <emu-t class="regex"><a href="#prod-decimal">decimal</a></emu-t>
@@ -7125,8 +7127,8 @@ ECMAScript value type.
71257127
return the {{boolean}} value that represents the same truth value.
71267128
1. If <a abstract-op>Type</a>(|V|) is Number, then
71277129
return the result of <a href="#es-to-double">converting</a> |V|
7128-
to an {{double}} [=extended attribute associated with|associated with=]
7129-
the [{{Unrestricted}}] [=extended attribute=].
7130+
to a {{double}} [=extended attribute associated with|with an associated=]
7131+
[{{Unrestricted}}] [=extended attribute=].
71307132
1. If <a abstract-op>Type</a>(|V|) is String, then
71317133
return the result of <a href="#es-DOMString">converting</a> |V|
71327134
to a {{DOMString}}.
@@ -7436,8 +7438,8 @@ In effect, where <var ignore>x</var> is a Number value,
74367438
to an IDL {{float}} value by running the following algorithm:
74377439

74387440
1. Let |x| be [=?=] <a abstract-op>ToNumber</a>(|V|).
7439-
1. If the conversion is to an IDL type [=extended attribute associated with|associated with=]
7440-
the [{{Unrestricted}}] [=extended attribute=], then:
7441+
1. If the conversion is to an IDL type [=extended attribute associated with|with an associated=]
7442+
[{{Unrestricted}}] [=extended attribute=], then:
74417443
1. If |x| is <emu-val>NaN</emu-val>, then
74427444
return the IDL {{float}} value that represents
74437445
the IEEE 754 NaN value with the bit pattern 0x7fc00000 [[!IEEE-754]].
@@ -7451,8 +7453,8 @@ In effect, where <var ignore>x</var> is a Number value,
74517453
<em>even significand</em> if there are two [=equally close values=].
74527454
(The two special values 2<sup>128</sup> and −2<sup>128</sup>
74537455
are considered to have even significands for this purpose.)
7454-
1. If the conversion is to an IDL type [=extended attribute associated with|associated with=]
7455-
the [{{Unrestricted}}] [=extended attribute=], then:
7456+
1. If the conversion is to an IDL type [=extended attribute associated with|with an associated=]
7457+
[{{Unrestricted}}] [=extended attribute=], then:
74567458
1. If |y| is 2<sup>128</sup>, return +∞.
74577459
1. If |y| is −2<sup>128</sup>, return −∞.
74587460
1. Else, if |y| is 2<sup>128</sup> or −2<sup>128</sup>, then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
@@ -7470,8 +7472,8 @@ value when its bit pattern is interpreted as an unsigned 32 bit integer.
74707472
an IDL {{float}} value to an ECMAScript
74717473
value is a Number:
74727474

7473-
1. If the conversion is from an IDL type [=extended attribute associated with|associated with=]
7474-
the [{{Unrestricted}}] [=extended attribute=], then:
7475+
1. If the conversion is from an IDL type [=extended attribute associated with|with an associated=]
7476+
[{{Unrestricted}}] [=extended attribute=], then:
74757477
1. If the IDL {{float}} value is a NaN,
74767478
then the Number value is <emu-val>NaN</emu-val>.
74777479
1. Else, assert: The IDL {{float}} value is not a NaN, +∞ or −∞.
@@ -7489,8 +7491,8 @@ value when its bit pattern is interpreted as an unsigned 32 bit integer.
74897491
to an IDL {{double}} value by running the following algorithm:
74907492

74917493
1. Let |x| be [=?=] <a abstract-op>ToNumber</a>(|V|).
7492-
1. If the conversion is to an IDL type [=extended attribute associated with|associated with=]
7493-
the [{{Unrestricted}}] [=extended attribute=], then:
7494+
1. If the conversion is to an IDL type [=extended attribute associated with|with an associated=]
7495+
[{{Unrestricted}}] [=extended attribute=], then:
74947496
1. If |x| is <emu-val>NaN</emu-val>, then
74957497
return the IDL {{double}} value that represents
74967498
the IEEE 754 NaN value with the bit pattern 0x7ff8000000000000 [[!IEEE-754]].
@@ -7510,8 +7512,8 @@ value when its bit pattern is interpreted as an unsigned 64 bit integer.
75107512
an IDL {{double}} value to an ECMAScript
75117513
value is a Number:
75127514

7513-
1. If the conversion is from an IDL type [=extended attribute associated with|associated with=]
7514-
the [{{Unrestricted}}] [=extended attribute=], then:
7515+
1. If the conversion is from an IDL type [=extended attribute associated with|with an associated=]
7516+
[{{Unrestricted}}] [=extended attribute=], then:
75157517
1. If the IDL {{double}} value is a NaN,
75167518
then the Number value is <emu-val>NaN</emu-val>.
75177519
1. Else, assert: The IDL {{double}} value is not a NaN, +∞ or −∞.
@@ -10691,12 +10693,12 @@ for the specific requirements that the use of
1069110693
<pre highlight="webidl">
1069210694
[Exposed=Window]
1069310695
interface GraphicsContext {
10694-
void setColorFloat(double red, double green, double blue);
10695-
void setColorUnrestrictedFloat([Unrestricted] double red, [Unrestricted] double green, [Unrestricted] double blue);
10696+
void setColorDouble(double red, double green, double blue);
10697+
void setColorUnrestrictedDouble([Unrestricted] double red, [Unrestricted] double green, [Unrestricted] double blue);
1069610698
};
1069710699
</pre>
1069810700

10699-
In an ECMAScript implementation of the IDL, a call to setColor3f with
10701+
In an ECMAScript implementation of the IDL, a call to setColorDouble with
1070010702
Number values that are out of range for a
1070110703
{{double}} will result in an exception being
1070210704
thrown.
@@ -10706,14 +10708,14 @@ for the specific requirements that the use of
1070610708
var context = getGraphicsContext();
1070710709

1070810710
// Calling the [Unrestricted] version uses allows NaN and non-finite numbers values:
10709-
context.setColorUnrestrictedFloat(NaN, +Infinity, -Infinity);
10711+
context.setColorUnrestrictedDouble(NaN, +Infinity, -Infinity);
1071010712

10711-
// When setColorFloat is called, floating point values are allowed:
10712-
context.setColorFloat(-0.9, 1, 1.1);
10713+
// When setColorDouble is called, floating point values are allowed:
10714+
context.setColorDouble(-0.9, 1, 1.1);
1071310715

1071410716
// The following will cause a TypeError to be thrown, since NaN and non-finite
1071510717
// number values are not allowed when [Unrestricted] is not specified:
10716-
context.setColorFloat(NaN, +Infinity, -Infinity);
10718+
context.setColorDouble(NaN, +Infinity, -Infinity);
1071710719
</pre>
1071810720
</div>
1071910721

0 commit comments

Comments
 (0)