Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: LayoutTests/fast/canvas/bug532148.html

Issue 1350883002: Fix bug where setting canvas size to 0 was treated as if context was lost (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix layout test Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/bug532148-expected.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/canvas/bug532148.html
diff --git a/LayoutTests/fast/canvas/bug532148.html b/LayoutTests/fast/canvas/bug532148.html
new file mode 100644
index 0000000000000000000000000000000000000000..5c0d3e4686f96f7ff5fc0fa2b0615cd962cda7db
--- /dev/null
+++ b/LayoutTests/fast/canvas/bug532148.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<canvas id='c'></canvas>
+
+<script>
+const canvas = document.getElementById('c'),
+ctx = c.getContext('2d', {alpha: false});
+
+// The following would permanently damage the canvas (crbug.com/532148)
+canvas.height = null;
+ctx.fillRect( 0, 0, 128, null );
+
+// Try to use canvas normally
+canvas.width = 128;
+canvas.height = 128;
+
+ctx.fillStyle = 'green';
+ctx.fillRect( 0, 0, 128, 128 );
+ctx.fillStyle = 'blue';
+ctx.fillRect( 0, 0, 64, 64 );
+ctx.fillRect( 64, 64, 64, 64 );
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/bug532148-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698