Skip to content

Commit ad4ddd8

Browse files
committed
Improve creation of 2D and ImageBitmap rendering contexts
The former used "let" to change something and the latter used an undefined context variable to define various things.
1 parent 471e869 commit ad4ddd8

File tree

1 file changed

+21
-36
lines changed

1 file changed

+21
-36
lines changed

source

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -59962,42 +59962,35 @@ interface <dfn>Path2D</dfn> {
5996259962
steps:</p>
5996359963

5996459964
<ol>
59965-
5996659965
<li><p>If the algorithm was passed some arguments, then let <var>arg</var> be the first such
5996759966
argument. Otherwise, let <var>arg</var> be undefined.</p></li>
5996859967

5996959968
<li><p>Let <var>settings</var> be the result of <span data-x="coerce context arguments for
5997059969
2D">coercing the <var>arg</var> context arguments for 2D</span>.</p></li>
5997159970

59972-
<li><p>Create a new <code>CanvasRenderingContext2D</code> object.</p></li>
59971+
<li><p>Let <var>context</var> be a new <code>CanvasRenderingContext2D</code> object.</p></li>
5997359972

59974-
<li><p>Initialize its <code data-x="dom-context-2d-canvas">canvas</code> attribute to point to
59975-
<var>target</var>.</p></li>
59973+
<li><p>Initialize <var>context</var>'s <code data-x="dom-context-2d-canvas">canvas</code>
59974+
attribute to point to <var>target</var>.</p></li>
5997659975

59977-
<li><p>Let the new <code>CanvasRenderingContext2D</code> object's <span>output bitmap</span> be
59978-
the same bitmap as <var>target</var>'s bitmap (so that they are shared).</p></li>
59976+
<li><p>Set <var>context</var>'s <span>output bitmap</span> to the same bitmap as
59977+
<var>target</var>'s bitmap (so that they are shared).</p></li>
5997959978

5998059979
<li><p><span data-x="concept-canvas-set-bitmap-dimensions">Set bitmap dimensions</span> to the
5998159980
numeric values of <var>target</var>'s <code data-x="attr-canvas-width">width</code> and
5998259981
<code data-x="attr-canvas-height">height</code> content attributes.</p></li>
5998359982

5998459983
<li>
59985-
5998659984
<p>Process each of the members of <var>settings</var> as follows:</p>
5998759985

5998859986
<dl>
59989-
5999059987
<dt><dfn><code data-x="dom-CanvasRenderingContext2DSettings-alpha">alpha</code></dfn></dt>
59991-
59992-
<dd>If false, then set the new <code>CanvasRenderingContext2D</code> object's <span
59993-
data-x="concept-canvas-alpha">alpha</span> flag to false.</dd>
59994-
59988+
<dd>If false, then set <var>context</var>'s <span data-x="concept-canvas-alpha">alpha</span>
59989+
flag to false.</dd>
5999559990
</dl>
59996-
5999759991
</li>
5999859992

59999-
<li><p>Return the new <code>CanvasRenderingContext2D</code> object.</p></li>
60000-
59993+
<li><p>Return <var>context</var>.</p></li>
6000159994
</ol>
6000259995

6000359996
<hr>
@@ -62591,14 +62584,13 @@ try {
6259162584
data-x="">repeat-y</code>", or "<code data-x="">no-repeat</code>", then throw a
6259262585
<span>"<code>SyntaxError</code>"</span> <code>DOMException</code>.</p></li>
6259362586

62594-
<li><p>Create a new <code>CanvasPattern</code> object with the image <var>image</var>
62595-
and the repetition behavior given by <var>repetition</var>.</p></li>
62587+
<li><p>Let <var>pattern</var> be a new <code>CanvasPattern</code> object with the image
62588+
<var>image</var> and the repetition behavior given by <var>repetition</var>.</p></li>
6259662589

62597-
<li><p>If <var>image</var> <span>is not origin-clean</span>, then mark the
62598-
<code>CanvasPattern</code> object as <dfn data-x="concept-canvas-pattern-not-origin-clean">not
62599-
origin-clean</dfn>.</p></li>
62590+
<li><p>If <var>image</var> <span>is not origin-clean</span>, then mark <var>pattern</var> as <dfn
62591+
data-x="concept-canvas-pattern-not-origin-clean">not origin-clean</dfn>.</p></li>
6260062592

62601-
<li><p>Return the <code>CanvasPattern</code> object.</p></li>
62593+
<li><p>Return <var>pattern</var>.</p></li>
6260262594
</ol>
6260362595

6260462596
<p>Modifying the <var>image</var> used when creating a <code>CanvasPattern</code> object
@@ -64865,39 +64857,32 @@ dictionary <dfn>ImageBitmapRenderingContextSettings</dfn> {
6486564857
ImageBitmapRenderingContext">coercing the <var>arg</var> context arguments for
6486664858
<code>ImageBitmapRenderingContext</code></span>.</p></li>
6486764859

64868-
<li><p>Create a new <code>ImageBitmapRenderingContext</code> object.</p></li>
64860+
<li><p>Let <var>context</var> be a new <code>ImageBitmapRenderingContext</code> object.</p></li>
6486964861

64870-
<li><p>Initialize its <code data-x="dom-context-2d-canvas">canvas</code> attribute to point to
64871-
<var>target</var>.</p></li>
64862+
<li><p>Initialize <var>context</var>'s <code data-x="dom-context-2d-canvas">canvas</code>
64863+
attribute to point to <var>target</var>.</p></li>
6487264864

64873-
<li><p>Let the new <code>ImageBitmapRenderingContext</code> object's <span
64874-
data-x="concept-ImageBitmapRenderingContext-output-bitmap">output bitmap</span> and
64875-
<var>target</var>'s bitmap be a shared reference to the same bitmap.</p></li>
64865+
<li><p>Set <var>context</var>'s <span
64866+
data-x="concept-ImageBitmapRenderingContext-output-bitmap">output bitmap</span> to the same
64867+
bitmap as <var>target</var>'s bitmap (so that they are shared).</p></li>
6487664868

6487764869
<li><p>Run the steps to <span>set an <code>ImageBitmapRenderingContext</code>'s output
64878-
bitmap</span>, using the new <code>ImageBitmapRenderingContext</code> object as the
64879-
<var>context</var> argument, and with no <var>bitmap</var> argument.</p></li>
64870+
bitmap</span> with <var>context</var>.</p></li>
6488064871

6488164872
<li><p>Initialize <var>context</var>'s <span
6488264873
data-x="concept-ImageBitmapRenderingContext-alpha">alpha</span> flag to true.
6488364874

6488464875
<li>
64885-
6488664876
<p>Process each of the members of <var>settings</var> as follows:</p>
6488764877

6488864878
<dl>
64889-
6489064879
<dt><dfn><code data-x="dom-ImageBitmapRenderingContextSettings-alpha">alpha</code></dfn></dt>
64891-
6489264880
<dd>If false, then set <var>context</var>'s <span
6489364881
data-x="concept-ImageBitmapRenderingContext-alpha">alpha</span> flag to false.</dd>
64894-
6489564882
</dl>
64896-
6489764883
</li>
6489864884

64899-
<li><p>Return the new <code>ImageBitmapRenderingContext</code> object.</p></li>
64900-
64885+
<li><p>Return <var>context</var>.</p></li>
6490164886
</ol>
6490264887

6490364888
<hr>

0 commit comments

Comments
 (0)