Skip to content

Compatibility Status

Zach Bjornson edited this page Aug 10, 2017 · 27 revisions

Canvas

Feature Status
toBlob() No support, see toBuffer()

getContext()

Feature Status
getContext('2d') (yes)
getContext('webgl') No support
getContext('webgl2') No support
2d alpha context attribute 2.0.0
🔬 2d pixelFormat context attribute 2.0.0 ("A8", "RGB24", "RGB16_565", "A1", "RGB30")

toDataURL()

Feature Status
image/png type 0.0.3
image/jpeg type 1.3.5 (2.0.0 on Windows)

⚠️ Non-standard APIs

Feature Status
new Canvas(..., 'pdf') 0.11.0
new Canvas(..., 'svg') 1.2.0
new Canvas(Backend) 2.0.0
pngStream() 0.0.2, returns a true Stream in 0.5.2
jpegStream() 0.9.0 (2.0.0 on Windows)
pdfStream() 1.5.0 TODO this is undocumented
toBuffer() 0.0.1
toBuffer('raw') 1.6.0
toBuffer(callback) (async) 0.0.3
toBuffer PNG filters, compression level 1.1.0
toDataURL(callback) (async) 0.0.3
registerFont() 2.0.0

CanvasRenderingContext2D

Drawing rectangles

Feature Status
clearRect(), fillRect(), strokeRect() 0.0.1

Drawing text

Feature Status
fillText() 0.0.1
strokeText() 0.0.1
measureText() 0.0.1
measureText() returns advanced text metrics 2.0.0: actualBoundingBoxLeft, actualBoundingBoxRight, actualBoundingBoxAscent, actualBoundingBoxDescent, emHeightAscent, emHeightDescent, alphabeticBaseline (all but hangingBaseline, ideographicBaseline, fontBoundingBoxAscent, fontBoundingBoxDescent)

Line styles

Feature Status
lineWidth 0.0.1
lineCap 0.0.1
lineJoin 0.0.1
miterLimit 0.0.1
getLineDash() 1.1.4
setLineDash() 1.1.4
lineDashOffset 1.1.4

Text styles

Feature Status
font 0.0.2
textAlign 0.0.2
textBaseline 0.0.2
🔬 direction No support, Issue #694
font supports font-stretch values No support
font supports variant 1.6.5
font supports line-height No support, not applicable
font shorthand values may be in any order Proposed, #944
font supports size keywords (xx-small, etc.) No support
font supports larger, smaller sizes No support
font supports rem, em, q sizes Proposed, #944
font supports ch, ex, cap, ic sizes No support
font supports vh, vw, vmin, vmax, vi, vb, lh, rlh No support, not applicable

Fill and stroke styles

Feature Status
fillStyle 0.0.1
⚠️ fillColor 0.3.0
strokeStyle 0.0.1
#rgb, #rrggbb 0.0.1
rgb(), rgba() 0.0.1
hsl(), hsla() 1.2.0
transparent 0.0.1
rebeccapurple 1.2.0
#rgba, #rrggbbaa color No support

Gradients and patterns

Feature Status
createLinearGradient() 0.0.01
createRadialGradient() 0.0.01
createPattern() 0.10.0

Shadows

Feature Status
shadowBlur 0.0.1
shadowColor 0.0.1
shadowOffsetX 0.0.1
shadowOffsetY 0.0.1

Paths

Feature Status
beginPath(), closePath() 0.0.1
moveTo(), lineTo() 0.0.1
quadraticCurveTo(), bezierCurveTo() 0.0.1
arc() 0.0.1
arcTo() 0.3.0
🔬 ellipse() 2.0.0
rect() 0.0.1

Drawing paths

Feature Status
fill(), stroke() 0.0.1
drawFocusIfNeeded() No support, not applicable
scrollPathIntoView() No support, not applicable
clip() 0.0.1
isPointInPath() 0.0.1
isPointInStroke() No support

Transformations

Feature Status
🔬 currentTransform No support, Issue #658
rotate(), scale(), translate(), transform() 0.0.1
setTransform() 0.0.1
🔬 resetTransform() 0.0.1

Compositing

Feature Status
globalAlpha 0.0.1
globalCompositeOperation 0.0.1

Drawing images

Feature Status
drawImage() 0.0.8
ImageBitmap as source image No support

Pixel manipulation

Feature Status
createImageData() 0.1.0
getImageData() 0.1.0
putImageData() 0.1.0

Image smoothing

Feature Status
🔬 imageSmoothingEnabled 1.0.2

The canvas state

Feature Status
save() 0.0.1
restore() 0.0.1
canvas 0.0.1

Hit regions

Feature Status
addHitRegion(), removeHitRegion(), clearHitRegions() No support, not applicable

⚠️ Non-standard APIs

Feature Status
patternQuality
textDrawingMode
filter
additional global composite operators
antialias

ImageData

Feature Status
Basic support 0.1.0
imageData.data is a Uint8ClampedArray 1.2.8
ImageData() constructor 1.3.0

CanvasGradient

Feature Status
Basic support 0.1.0

CanvasPattern

Feature Status
Basic support 0.10.0
🔬 setTransform() No support

Image

Feature Status
Basic support 0.0.6
src = dataurl 0.8.0
⚠️ src = buffer 0.0.6
⚠️ dataMode 0.12.1
src = svgdata 2.0.0, but SVG is rasterized with source dimensions (Issue #957)

ImageBitmap, ImageBitmapFactories, ImageBitmapRenderingContext

No support, Issue #876