Skip to content

Commit

Permalink
fix: Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Mar 22, 2020
1 parent 8ac089c commit 3e26690
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5972,7 +5972,8 @@ type that corresponds to the set of finite single-precision 32 bit
IEEE 754 floating point numbers. [[!IEEE-754]]

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

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

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

{{double}} constant values in IDL are
represented with <emu-t class="regex"><a href="#prod-decimal">decimal</a></emu-t>
Expand Down Expand Up @@ -7125,8 +7127,8 @@ ECMAScript value type.
return the {{boolean}} value that represents the same truth value.
1. If <a abstract-op>Type</a>(|V|) is Number, then
return the result of <a href="#es-to-double">converting</a> |V|
to an {{double}} [=extended attribute associated with|associated with=]
the [{{Unrestricted}}] [=extended attribute=].
to a {{double}} [=extended attribute associated with|with an associated=]
[{{Unrestricted}}] [=extended attribute=].
1. If <a abstract-op>Type</a>(|V|) is String, then
return the result of <a href="#es-DOMString">converting</a> |V|
to a {{DOMString}}.
Expand Down Expand Up @@ -10691,12 +10693,12 @@ for the specific requirements that the use of
<pre highlight="webidl">
[Exposed=Window]
interface GraphicsContext {
void setColorFloat(double red, double green, double blue);
void setColorUnrestrictedFloat([Unrestricted] double red, [Unrestricted] double green, [Unrestricted] double blue);
void setColorDouble(double red, double green, double blue);
void setColorUnrestrictedDouble([Unrestricted] double red, [Unrestricted] double green, [Unrestricted] double blue);
};
</pre>

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

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

// When setColorFloat is called, floating point values are allowed:
context.setColorFloat(-0.9, 1, 1.1);
// When setColorDouble is called, floating point values are allowed:
context.setColorDouble(-0.9, 1, 1.1);

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

Expand Down

0 comments on commit 3e26690

Please sign in to comment.