Skip to content

Commit 28109b6

Browse files
committed
[css-paint-api] Locally define alpha flag, you can't just magically rely on the inheriting concepts from CanvasRenderingContext2D.
1 parent 766e89f commit 28109b6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

css-paint-api/Overview.bs

+9-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ urlPrefix: https://html.spec.whatwg.org/multipage/; type: dfn;
5656
text: reset the rendering context to its default state
5757
text: output bitmap
5858
text: set bitmap dimensions
59-
url: concept-canvas-alpha; text: alpha
6059
urlPrefix: https://tc39.github.io/ecma262/#sec-; type: dfn;
6160
text: constructor
6261
text: Construct
@@ -362,6 +361,14 @@ A {{PaintRenderingContext2D}} object has a [=output bitmap=]. This is initialise
362361
object is created. The size of the [=output bitmap=] is the size of the fragment it is
363362
rendering.
364363

364+
A {{PaintRenderingContext2D}} object also has an <dfn for="PaintRenderingContext2D">alpha</dfn> flag,
365+
which can be set to true or false.
366+
Initially, when the context is created,
367+
its alpha flag must be set to true.
368+
When a {{PaintRenderingContext2D}} object has its alpha flag set to false,
369+
then its alpha channel must be fixed to 1.0 (fully opaque) for all pixels,
370+
and attempts to change the alpha component of any pixel must be silently ignored.
371+
365372
The size of the [=output bitmap=] does not necessarily represent the size of the actual bitmap
366373
that the user agent will use internally or during rendering. For example, if the visual viewport is
367374
zoomed the user agent may internally use bitmaps which correspond to the number of device pixels in
@@ -392,7 +399,7 @@ When the user agent is to <dfn>create a PaintRenderingContext2D object</dfn> for
392399
|height|, and |paintRenderingContext2DSettings|, it <em>must</em> run the following steps:
393400
1. Create a new {{PaintRenderingContext2D}}.
394401
2. [=Set bitmap dimensions=] for the context's [=output bitmap=] to the rounded values of |width| and |height|.
395-
3. Set the {{PaintRenderingContext2D}}'s [=alpha=] flag to |paintRenderingContext2DSettings|'s {{alpha}}.
402+
3. Set the {{PaintRenderingContext2D}}'s [=PaintRenderingContext2D/alpha=] flag to |paintRenderingContext2DSettings|'s {{alpha}}.
396403
4. Return the new {{PaintRenderingContext2D}}.
397404

398405
Note: The initial state of the rendering context is set inside the [=set bitmap dimensions=]

0 commit comments

Comments
 (0)