blob: fc9aad51d20299d6a966f11d54863c5c53597c15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
<!DOCTYPE HTML>
<html>
<head>
<style>
#container {
width: 100px;
height: 100px;
border: 3px solid black;
overflow: scroll;
}
canvas {
background-color: gray;
border: 1px solid black;
transform: translateZ(0);
}
</style>
<script>
if (window.testRunner)
testRunner.dumpAsTextWithPixelResults();
if (window.internals) {
window.internals.settings.setPreferCompositingToLCDTextEnabled(true);
window.internals.settings.setAccelerated2dCanvasEnabled(true);
}
function doTest() {
var canvas = document.getElementById("canvas");
var context = canvas.getContext('2d');
context.fillStyle = 'green';
context.fillRect(0, 0, 150, 100);
canvas.height = "200px";
}
window.onload = doTest;
</script>
</head>
<body>
<div id="container">
<canvas id="canvas" width="50" height="50"></canvas>
</div>
</body>
</html>
|