OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
ikilpatrick
2016/06/22 16:00:24
For this test, if you can create an equivalent htm
Gleb Lanbin
2016/06/22 21:23:45
Done.
| |
2 <html> | |
3 <head> | |
4 <script src="../resources/run-after-layout-and-paint.js"></script> | |
5 <script src="resources/test-runner-paint-worklet.js"></script> | |
6 <style> | |
7 .container { | |
8 width: 100px; | |
9 height: 100px; | |
10 } | |
11 #canvas-opaque { | |
12 background-image: paint(opaque); | |
13 } | |
14 | |
15 #canvas-nonopaque { | |
16 background-image: paint(nonOpaque); | |
17 } | |
18 | |
19 #background { | |
20 background-color: yellow; | |
21 display: inline-block; | |
22 } | |
23 </style> | |
24 </head> | |
25 <body> | |
26 | |
27 <div id="background"> | |
28 <div id="canvas-opaque" class="container"></div> | |
29 <div id="canvas-nonopaque" class="container"></div> | |
30 </div> | |
31 | |
32 <script id="code" type="text/worklet"> | |
33 | |
34 registerPaint('opaque', class { | |
35 static get alpha() { return false; } | |
36 paint(ctx, geom) { | |
37 ctx.strokeStyle = 'blue'; | |
38 ctx.lineWidth = 4; | |
39 ctx.strokeRect(20, 20, 60, 60); | |
40 } | |
41 }); | |
42 | |
43 registerPaint('nonOpaque', class { | |
44 static get alpha() { return true; } | |
45 paint(ctx, geom) { | |
46 ctx.strokeStyle = 'blue'; | |
47 ctx.lineWidth = 4; | |
48 ctx.strokeRect(20, 20, 60, 60); | |
49 } | |
50 }); | |
51 | |
52 </script> | |
53 | |
54 <script> | |
55 importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('c ode').textContent); | |
56 </script> | |
57 </body> | |
58 </html> | |
OLD | NEW |