Fixes the problem with canvas not being rendered when displayed as block level elements

This commit is contained in:
Diego Marcos 2015-03-15 03:02:33 -07:00
parent 389338c28f
commit cd84ab2ddc
4 changed files with 57 additions and 3 deletions

View file

@ -64,6 +64,7 @@ flaky_cpu == append_style_a.html append_style_b.html
== box_sizing_border_box_a.html box_sizing_border_box_ref.html
== box_sizing_sanity_check_a.html box_sizing_sanity_check_ref.html
== br.html br-ref.html
== canvas_as_block_element_a.html canvas_as_block_element_ref.html
== canvas_lineto_a.html canvas_lineto_ref.html
== canvas_transform_a.html canvas_transform_ref.html
== case-insensitive-font-family.html case-insensitive-font-family-ref.html

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
html, body {
margin: 0;
padding: 0;
}
canvas {
display: block;
}
</style>
</head>
<body>
<title>Canvas is displayed as a block-level element</title>
<canvas id="c"></canvas>
<script>
var canvas = document.getElementById('c');
canvas.width = 100;
canvas.height = 100;
var ctx = canvas.getContext('2d');
ctx.fillStyle = '#ff0000';
ctx.fillRect(0, 0, 100, 100);
</script>
</body>
</html>

View file

@ -0,0 +1,18 @@
<html>
<head>
<style>
html, body {
margin: 0;
padding: 0;
}
div {
background: #ff0000;
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div></div>
</body>
</html>