ジャンプ先:

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!
この記事を English (US) で読むこともできます。

RenderingContext is a WebIDL typedef which can refer to any one of the interfaces that represent a graphics rendering context within a <canvas> element: CanvasRenderingContext2D, WebGLRenderingContext, or WebGL2RenderingContext.

By using the shorthand RenderingContext, methods and properties which can make use of any of these interfaces can be specified and written more easily; since <canvas> supports several rendering systems, it's helpful from a specification and browser implementation perspective to have a shorthand that means "one of these interfaces."

As such, RenderingContext is an implementation detail, and isn't something web developers directly use. There is no RenderingContext interface, and there are no objects which implement type RenderingContext.

The primary use of this type is the definition of the <canvas> element's HTMLCanvasElement.getContext() method, which returns a RenderingContext (meaning it returns any one of the rendering context types).

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'RenderingContext' in that specification.
Living Standard Initial definition.

See also

ドキュメントのタグと貢献者

このページの貢献者: sideshowbarker, Sheppy, fscholz, teoli
最終更新者: sideshowbarker,