Skip to content

Commit

Permalink
Incorporate domenic feedback part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ccameron-chromium committed Apr 13, 2021
1 parent 05d9866 commit 84e7ffc
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -60298,9 +60298,9 @@ interface mixin <dfn>CanvasDrawImage</dfn> {

interface mixin <dfn>CanvasImageData</dfn> {
// <span>pixel manipulation</span>
<span>ImageData</span> <span data-x="dom-context-2d-createImageData">createImageData</span>([EnforceRange] long sw, [EnforceRange] long sh, optional <span>ImageDataSettings</span> settings);
<span>ImageData</span> <span data-x="dom-context-2d-createImageData">createImageData</span>([EnforceRange] long sw, [EnforceRange] long sh, optional <span>ImageDataSettings</span> settings = {});
<span>ImageData</span> <span data-x="dom-context-2d-createImageData">createImageData</span>(<span>ImageData</span> imagedata);
<span>ImageData</span> <span data-x="dom-context-2d-getImageData">getImageData</span>([EnforceRange] long sx, [EnforceRange] long sy, [EnforceRange] long sw, [EnforceRange] long sh, optional <span>ImageDataSettings</span> settings);
<span>ImageData</span> <span data-x="dom-context-2d-getImageData">getImageData</span>([EnforceRange] long sx, [EnforceRange] long sy, [EnforceRange] long sw, [EnforceRange] long sh, optional <span>ImageDataSettings</span> settings = {});
undefined <span data-x="dom-context-2d-putImageData">putImageData</span>(<span>ImageData</span> imagedata, [EnforceRange] long dx, [EnforceRange] long dy);
undefined <span data-x="dom-context-2d-putImageData">putImageData</span>(<span>ImageData</span> imagedata, [EnforceRange] long dx, [EnforceRange] long dy, [EnforceRange] long dirtyX, [EnforceRange] long dirtyY, [EnforceRange] long dirtyWidth, [EnforceRange] long dirtyHeight);
};
Expand Down Expand Up @@ -60377,14 +60377,14 @@ interface <dfn>TextMetrics</dfn> {
};

dictionary <dfn>ImageDataSettings</dfn> {
<span>PredefinedColorSpace</span> <span data-x="dom-ImageDataSettings-colorSpace">colorSpace</span> = "srgb";
<span>PredefinedColorSpace</span> <span data-x="dom-PredefinedColorSpace-srgb">colorSpace</span> = "srgb";
};

[Exposed=(Window,Worker),
<span>Serializable</span>]
interface <dfn>ImageData</dfn> {
<span data-x="dom-imagedata">constructor</span>(unsigned long sw, unsigned long sh, optional <span>ImageDataSettings</span> settings);
<span data-x="dom-imagedata">constructor</span>(<span data-x="idl-Uint8ClampedArray">Uint8ClampedArray</span> data, unsigned long sw, optional unsigned long sh, optional <span>ImageDataSettings</span> settings);
<span data-x="dom-imagedata">constructor</span>(unsigned long sw, unsigned long sh, optional <span>ImageDataSettings</span> settings = {});
<span data-x="dom-imagedata">constructor</span>(<span data-x="idl-Uint8ClampedArray">Uint8ClampedArray</span> data, unsigned long sw, optional unsigned long sh, optional <span>ImageDataSettings</span> settings = {});

readonly attribute unsigned long <span data-x="dom-imagedata-width">width</span>;
readonly attribute unsigned long <span data-x="dom-imagedata-height">height</span>;
Expand Down Expand Up @@ -60642,8 +60642,8 @@ context.fillRect(100,0,50,50); // only this square remains</code></pre>

<hr>

<p>The <code>PredefinedColorSpace</code> enumeration is used to specify the <dfn>color space</dfn>
of the canvas' backing store.</p>
<p>The <code>PredefinedColorSpace</code> enumeration is used to specify the <span
data-x="concept-canvas-colorSpace">color space</span> of the canvas's backing store.</p>

<p>The "<dfn enum-value for="PredefinedColorSpace"><code
data-x="dom-PredefinedColorSpace-srgb">srgb</code></dfn>" value indicates the sRGB color space.
Expand All @@ -60653,8 +60653,9 @@ context.fillRect(100,0,50,50); // only this square remains</code></pre>
data-x="dom-PredefinedColorSpace-display-p3">display-p3</code></dfn>" value indicates the Display P3 color space.
</p>

<p class="note">The color spaces' definitions, as well as functions for converting color spaces, are
found in the predefined color spaces section <ref spec=CSSCOLOR>.</p>
<p class="note">The color spaces' definitions, as well as algorithms for converting between color
spaces, are found in the <a href="https://drafts.csswg.org/css-color/#predefined">Predefined
colorspaces</a> section of <cite>CSS Color</cite>. <ref spec=CSSCOLOR>

<hr>

Expand Down Expand Up @@ -63995,7 +63996,7 @@ try {
<dd><p>Returns an <code>ImageData</code> object with the same dimensions and color space as the argument. All the
pixels in the returned object are <span>transparent black</span>.</p></dd>

<dt><var>imagedata</var> = new <code data-x="dom-imagedata">ImageData</code>(<var>data</var>, <var>sw</var> [, <var>sh</var>, <var>settings</var> ] )</dt>
<dt><var>imagedata</var> = new <code data-x="dom-imagedata">ImageData</code>(<var>data</var>, <var>sw</var> [, <var>sh</var> [, <var>settings</var> ] ] )</dt>
<dd>
<p>Returns an <code>ImageData</code> object using the data provided in the <code
data-x="idl-Uint8ClampedArray">Uint8ClampedArray</code> argument, interpreted using the given
Expand Down Expand Up @@ -64057,7 +64058,7 @@ try {
instantiate new <code>ImageData</code> objects.</p>

<p>When the <code data-x="dom-imagedata">ImageData()</code> constructor is invoked with two
numeric arguments <var>sw</var> and <var>sh</var> and an optional <span>ImageDataSettings</span>
numeric arguments <var>sw</var> and <var>sh</var> and an optional <code>ImageDataSettings</code>
<var>settings</var>, it must run these steps:</p>

<ol>
Expand Down Expand Up @@ -64157,7 +64158,8 @@ try {
values must not be <span data-x="concept-premultiplied-alpha">premultiplied by alpha</span>.
Pixel values must be converted from the <span>output bitmap</span>'s
<span data-x="dom-CanvasRenderingContext2DSettings-colorSpace">color space</span> to the returned
<code>ImageData</code> object's <span data-x="dom-imagedata-colorSpace">color space</span>.
<code>ImageData</code> object's <span data-x="dom-imagedata-colorSpace">color space</span> using
relative colorimetric intent.

<p>When the user agent is required to <dfn>create an <code>ImageData</code> object</dfn>, given a
positive integer number of rows <var>rows</var>, a positive integer number of pixels per row
Expand Down Expand Up @@ -65754,21 +65756,21 @@ interface <dfn>OffscreenCanvasRenderingContext2D</dfn> {

<div w-nodev>

<!--en-GB--><h5 id="color-space-conversion">Color spaces and color space conversion</h5>
<!--en-GB--><h5 id="colour-spaces-and-colour-correction">Color spaces and color space conversion</h5>

<p>The <code>canvas</code> APIs provide mechanisms for specifying the color space of the canvas'
<p>The <code>canvas</code> APIs provide mechanisms for specifying the color space of the canvas's
backing store. The default backing store color space for all canvas APIs is sRGB.</p>

<p>Color space conversion must be applied to the canvas' backing store when rendering the canvas to the
<p>Color space conversion must be applied to the canvas's backing store when rendering the canvas to the
output device. This color space conversion must be identical to the color space conversion that would
be applied to an <code>img</code> element with a color profile that specifies the same color space as
the canvas' backing store.</p>
the canvas's backing store.</p>

<p>Images that specify no color profile information are assumed to be in the sRGB color space, and
must be rendered using the same color space conversion as is applied to sRGB images.</p>

<p>Where output format allows it, the <code data-x="dom-canvas-toDataURL">toDataURL()</code> method, when
invoked, must include color space information specifying the canvas' backing store's color space in the
invoked, must include color space information specifying the canvas's backing store's color space in the
resources it returns.</p>

<p class="note">Thus, in the 2D context, calling the <code
Expand All @@ -65778,7 +65780,7 @@ interface <dfn>OffscreenCanvasRenderingContext2D</dfn> {

<p>When drawing content to a 2D context, all inputs must be converted to the context's color space
before drawing. Interpolation of gradient color stops must be performed on color values after conversion
to the canvas' color space. Alpha blending must be performed on values after conversion to the canvas'
to the canvas's color space. Alpha blending must be performed on values after conversion to the canvas's
color space.</p>

<p class="note">The color space for CSS colors is defined in <cite>CSS Color</cite>: <ref
Expand Down Expand Up @@ -65961,7 +65963,7 @@ interface <dfn>OffscreenCanvasRenderingContext2D</dfn> {
<p>As certain colors can only be represented under premultiplied alpha (for instance, additive
colors), and others can only be represented under non-premultiplied alpha (for instance,
"invisible" colors which hold certain red, green, and blue values even with no opacity); and
division and multiplication on 8-bit integers (which is how canvas' colors are currently stored)
division and multiplication on 8-bit integers (which is how canvas's colors are currently stored)
entails a loss of precision, converting between premultiplied and non-premultiplied alpha is a
lossy operation on colors that are not fully opaque.</p>

Expand Down Expand Up @@ -95526,9 +95528,9 @@ dictionary <dfn>ImageBitmapOptions</dfn> {

<ol>
<li><p>If <var>conversion</var> is "<dfn enum-value for="ColorSpaceConversion"><code
data-x="dom-ColorSpaceConversion-default">default</code></dfn>",
the color space conversion behavior is implementation-specific, and should be a conversion
to the color space specified by <var>cs</var>.</p></li>
data-x="dom-ColorSpaceConversion-default">default</code></dfn>", then the color space of
<var>output</var> must be <var>cs</var>, and its color components must be produced by
converting <var>input</var> to <var>cs</var> using relative colorimetric intent.</p></li>

<li><p>If <var>conversion</var> is "<dfn enum-value for="ColorSpaceConversion"><code
data-x="dom-ColorSpaceConversion-none">none</code></dfn>", <var>output</var> must be decoded
Expand Down

0 comments on commit 84e7ffc

Please sign in to comment.