Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!doctype html>
<meta charset=utf-8>
<title>Historical canvas features</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
var canvas, context, path2d;
setup(function() {
canvas = document.createElement("canvas");
context = canvas.getContext('2d');
path2d = new Path2D();
});
function t(member, obj) {
var name = obj === canvas ? "Canvas" : String(obj).match(/\[object (\S+)\]/)[1];
test(function() {
assert_false(member in obj);
}, name + " support for " + member);
}
t("supportsContext", canvas);
t("probablySupportsContext", canvas);
t("width", context);
t("height", context);
t("setContext", canvas);
t("transferControlToProxy", canvas);
t("CanvasProxy", window);
t("commit", canvas);
test(function() {
assert_throws_js(TypeError, function() {
new CanvasRenderingContext2D();
}, 'no arguments');
assert_throws_js(TypeError, function() {
new CanvasRenderingContext2D(1, 1);
}, 'with arguments');
}, "CanvasRenderingContext2D constructors");
t("addPathByStrokingPath", path2d);
t("addText", path2d);
t("addPathByStrokingText", path2d);
test(function() {
var canvas = document.createElement('canvas');
var context = canvas.getContext('bitmaprenderer');
if (context) {
assert_false('transferImageBitmap' in context);
}
}, 'ImageBitmapRenderingContext support for transferImageBitmap');
t('Path', window);
t('toDataURLHD', canvas);
t('toBlobHD', canvas);
t('createImageDataHD', context);
t('getImageDataHD', context);
t('putImageDataHD', context);
test(function() {
if ('ImageData' in window) {
assert_false('resolution' in new ImageData(1, 1));
}
}, 'ImageData support for resolution');
t('drawSystemFocusRing', context);
t('drawCustomFocusRing', context);
</script>