OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
zino
2014/09/13 16:00:28
These tags are normally omitted.
<html>, <head>, <
Sergey
2014/09/15 02:45:35
This is probably a recommendation, when you are go
zino
2014/09/15 09:51:03
I don't think the rule is related to "js-test" fra
| |
4 <script> | |
5 var context; | |
6 | |
7 window.onload = function() { | |
8 if (window.testRunner) | |
9 testRunner.waitUntilDone(); | |
zino
2014/09/13 16:00:28
fix indentation?
Either of 2 space and 4 space in
Sergey
2014/09/15 02:45:36
Done.
| |
10 context = document.getElementById("c").getContext("2d"); | |
zino
2014/09/13 16:00:28
"c" -> 'c'
"2d" -> '2d'
Some tests use double quo
Sergey
2014/09/15 02:45:36
Done.
| |
11 context.scale(2,2); | |
zino
2014/09/13 16:00:28
fix spacing?
Sergey
2014/09/15 02:45:36
Here everything seems fine... Please, explain.
zino
2014/09/15 09:51:03
It is not important but it is better to have a con
| |
12 context.beginPath(); | |
13 context.rect(0,0,75,75); | |
14 context.clip(); | |
15 context.fillStyle = 'red'; | |
16 context.fillRect(0, 0, 30, 30); | |
17 context.fillRect(50, 50, 30, 30); | |
18 context.save(); | |
19 context.scale(0.5,0.5); | |
20 context.beginPath(); | |
21 context.rect(0,0,300,300); | |
Justin Novosad
2014/09/12 14:54:35
This test would be more interesting if you used a
zino
2014/09/13 16:00:28
good point.
Sergey
2014/09/15 02:45:36
Done.
| |
22 context.clip(); | |
zino
2014/09/13 16:00:28
Also, I think it is better to add context.fillRect
Sergey
2014/09/15 02:45:36
May be that would be excessive, wouldn't it?
| |
23 requestAnimationFrame(drawSecondFrame); | |
24 } | |
25 | |
26 function drawSecondFrame() { | |
27 context.restore(); | |
28 context.fillStyle = 'green'; | |
29 context.fillRect(0, 0, 30, 30); | |
30 context.fillRect(50, 50, 30, 30); | |
31 if (window.testRunner) | |
32 testRunner.notifyDone(); | |
33 } | |
34 </script> | |
35 </head> | |
36 <body> | |
37 <p>Two green squares of different sizes should appear below</p> | |
38 <canvas id="c" width=300 height=300></canvas> | |
zino
2014/09/13 16:00:28
width="300" height="300"
Sergey
2014/09/15 02:45:36
Done.
| |
39 </body> | |
40 </html> | |
OLD | NEW |