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

Demo

Documentation

Specification

Specification link


Specification being incubated in a Community Group

Status in Chromium

Blink


In developer trial (Behind a flag) (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • Positive
  • No signal
  • No signals

Owner

Comments

Users provide ContextAttributes on context creation, e.g. let ctx = canvas.getContext("2d", {alpha : false}); this method lets the user read back the actual parameters as the platform consumed them: let alphaValue = ctx.getContextAttributes().alpha; (note that specs in flight add more parameters). Issue trackers for implementation in Firefox and Webkit: https://bugzilla.mozilla.org/show_bug.cgi?id=1517786 https://bugs.webkit.org/show_bug.cgi?id=193144

Last updated on 2020-11-19