← Back to release summary

CanvasRenderingContext2D.getContextAttributes()

Category
CSS
Type
New or changed feature
Status
In developer trial (Behind a flag) (Chrome 73)
Intent stage
None

Summary

This method allows web developers to read back the ContextAttributes consumed by the platform and compare them to what were requested. Shipping this method will allow lining up with WebGL's homonymous method. [1] https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.idl?l=142

Standards & signals

Docs: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-canvas-getcontextattributes

Samples: https://chromium-review.googlesource.com/c/chromium/src/+/1395882

View on chromestatus.com