context-preserves-canvas.html (870B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Canvas's ImageBitmapRenderingContext test</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <link rel="help" href="https://html.spec.whatwg.org/multipage/canvas.html#the-imagebitmap-rendering-context"> 7 <script> 8 test(function() { 9 var width = 10; 10 var height = 10; 11 var canvas = document.createElement("canvas"); 12 canvas.width = width; 13 canvas.height = height; 14 var ctx = canvas.getContext('bitmaprenderer'); 15 var dstCanvas = ctx.canvas; 16 assert_true("canvas" in ctx); 17 assert_equals(dstCanvas, ctx.canvas); 18 assert_equals(canvas, ctx.canvas); 19 assert_equals(dstCanvas.width, width); 20 assert_equals(dstCanvas.height, height); 21 }, "Test that ctx.canvas on a ImageBitmapRenderingContext returns the original canvas"); 22 </script>