Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/canvas/element/manual/the-canvas-state/2d.zero.size.canvas.html - WPT Dashboard Interop Dashboard
<html>
<head>
</head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<canvas id="canvas" width="0" height="0"></canvas>
<body>
<script>
test(function() {
var context = document.getElementById("canvas").getContext("2d");
context.fillStyle = "green";
}, 'This test ensures that accessing the context of a zero sized canvas does not crash.');
</script>
</body>
</html>