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

Side by Side Diff: third_party/WebKit/LayoutTests/csspaint/paint2d-zoom.html

Issue 2104103003: Fix zoom in CSS paint worklets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/run-after-layout-and-paint.js"></script> 4 <script src="../resources/run-after-layout-and-paint.js"></script>
5 <script src="resources/test-runner-paint-worklet.js"></script> 5 <script src="resources/test-runner-paint-worklet.js"></script>
6 <style> 6 <style>
7 #output { 7 #output {
8 width: 100px; 8 width: 100px;
9 height: 100px; 9 height: 100px;
10 background-image: paint(error); 10 background-image: paint(worklet);
11 background-color: green;
12 } 11 }
13 </style> 12 </style>
14 </head> 13 </head>
15 <body> 14 <body>
16 <div id="output"></div> 15 <div id="output"></div>
17 16
18 <script id="code" type="text/worklet"> 17 <script id="code" type="text/worklet">
19 registerPaint('error', class { 18 registerPaint('worklet', class {
20 constructor() { throw Error('failed!'); }
21 paint(ctx, geom) { 19 paint(ctx, geom) {
22 ctx.fillStyle = 'red'; 20 ctx.strokeStyle = 'blue';
23 ctx.fillRect(0, 0, geom.width, geom.height); 21 ctx.lineWidth = 4;
22 ctx.strokeRect(20, 20, 60, 60);
23 console.log('width: ' + geom.width + ', height: ' + geom.height);
24 } 24 }
25 }); 25 });
26 </script> 26 </script>
27 27
28 <script> 28 <script>
29 document.body.style.zoom = "300%";
30 console.log('The worklet should log: \'width: 100, height: 100\'');
29 importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('c ode').textContent); 31 importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('c ode').textContent);
30 </script> 32 </script>
31
32 </body> 33 </body>
33 </html> 34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698