Implement and ship CanvasRenderingContext2D.getContextAttributes()
Categories
(Core :: Graphics: Canvas2D, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox117 | --- | fixed |
People
(Reporter: mcasas, Assigned: jfkthame)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
Updated•6 years ago
|
Updated•6 years ago
|
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
Updated•6 years ago
|
Comment 5•4 years ago
|
||
Should this be implemented?
Updated•2 years ago
|
Assignee | ||
Comment 6•1 year ago
|
||
This has been in the HTML spec for a while now (see https://html.spec.whatwg.org/multipage/canvas.html#2dcontext),
so we should probably go ahead and implement it.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 8•1 year ago
|
||
I personally don't think we should be adding dummy properties to the dictionary that we don't actually support. Safari also only ships a subset of properties.
Comment 9•1 year ago
|
||
Backed out for causing wpt failures related to CanvasRenderingContext2D.
[task 2023-07-26T00:20:11.580Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: existence and properties of interface prototype object's @@unscopables property
[task 2023-07-26T00:20:11.580Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: attribute canvas
[task 2023-07-26T00:20:11.580Z] 00:20:11 INFO - TEST-UNEXPECTED-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: operation getContextAttributes() - expected FAIL
[task 2023-07-26T00:20:11.581Z] 00:20:11 INFO - TEST-INFO | expected FAIL
[task 2023-07-26T00:20:11.611Z] 00:20:11 INFO - ............................................................................
[task 2023-07-26T00:20:11.611Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: operation quadraticCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double)
[task 2023-07-26T00:20:11.611Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: operation bezierCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)
[task 2023-07-26T00:20:11.611Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: operation arcTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)
[task 2023-07-26T00:20:11.611Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: operation rect(unrestricted double, unrestricted double, unrestricted double, unrestricted double)
[task 2023-07-26T00:20:11.611Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: operation roundRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional (unrestricted double or DOMPointInit or sequence<(unrestricted double or DOMPointInit)>))
[task 2023-07-26T00:20:11.611Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean)
[task 2023-07-26T00:20:11.611Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: operation ellipse(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean)
[task 2023-07-26T00:20:11.611Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D must be primary interface of document.createElement("canvas").getContext("2d")
[task 2023-07-26T00:20:11.612Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | Stringification of document.createElement("canvas").getContext("2d")
[task 2023-07-26T00:20:11.612Z] 00:20:11 INFO - TEST-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "canvas" with the proper type
[task 2023-07-26T00:20:11.612Z] 00:20:11 INFO - TEST-UNEXPECTED-PASS | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "getContextAttributes()" with the proper type - expected FAIL
[task 2023-07-26T00:20:11.612Z] 00:20:11 INFO - TEST-INFO | expected FAIL
[task 2023-07-26T00:20:11.918Z] 00:20:11 INFO - ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
[task 2023-07-26T00:20:11.918Z] 00:20:11 INFO - TEST-OK | /html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*) | took 4467ms
Comment 10•1 year ago
|
||
Assignee | ||
Comment 11•1 year ago
|
||
(In reply to Tom S [:evilpie] from comment #8)
I personally don't think we should be adding dummy properties to the dictionary that we don't actually support. Safari also only ships a subset of properties.
I wondered about that, but this seems to parallel how Chrome is behaving with respect to desynchronized
, which it always includes in the returned dictionary, even though it doesn't appear to be supported. (Trying to set it to true
at context-creation time doesn't make any difference; it remains false
in the returned attributes.)
Comment 12•1 year ago
|
||
I think desynchronized
is a bit of a special case considering that HTML spec doesn't actually require anything to happen when it's enabled and it's more of a hint:
When a CanvasRenderingContext2D object's desynchronized is true, then the user agent may optimize the rendering of the canvas to reduce the latency
https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-desynchronized
That seems quite different to something like colorSpace
, which I presume would actually change how the canvas looks to the user.
Comment 13•1 year ago
|
||
bugherder |
Comment 14•1 year ago
•
|
||
Should we add this to the Fx117 relnotes? Please nominate by setting relnote-firefox?
if so.
Assignee | ||
Comment 15•1 year ago
|
||
It seems minor enough that I'm not sure it's relnote-worthy, IMO.
Comment 16•1 year ago
|
||
FYI FF117 docs work for this can be tracked in https://github.com/mdn/content/issues/28283
I personally don't think we should be adding dummy properties to the dictionary that we don't actually support. Safari also only ships a subset of properties.
FWIW Does it matter in this case because even though FF doesn't support the attributes being set, the result returned by this method is correct - i.e. colorSpace
defaults to srgb
, which is what the color space will be, desynchronized is false if you don't support this attribute, and so on?
Updated•1 year ago
|
Comment 17•1 year ago
|
||
emphasis mine, mdn doc says
Depending on the attributes supported by the browser, the log below should display a string that looks something like: {alpha: false, colorSpace: 'srgb', desynchronized: false, willReadFrequently: false}
RFP (resistFingerprinting), in Bug 1422237, always returns srgb
for color-gamut. So my question is, is the colorSpace here always srgb
or does it depend on the device's color-gamut, i.e do we need to take RFP into consideration ?
Description
•