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

Side by Side Diff: LayoutTests/compositing/canvas-with-object-fit-contain-in-composited-layer-expected.html

Issue 1147363009: Use replacedContentBox for LayoutHTMLCanvas when deciding PaintLayer's contentBox. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
(Empty)
1 <!DOCTYPE html>
2 <style>
3 canvas {
4 border: black 1px solid;
5 background-color: gray;
6 width: 200px;
7 height: 200px;
8 object-fit: contain;
Justin Novosad 2015/06/09 19:24:10 Test would be more effective if the reference did
changseok 2015/06/11 05:46:47 I updated the test. Please check it again if it ma
9 }
10 </style>
11 <p>Test passes if a green square inside a orange rectanlge is shown up without a distortion.
12 <div>
13 <canvas width="100" height="200"></canvas>
14 </div>
15 <script>
16 function paintCanvas(canvas)
17 {
18 var ctx = canvas.getContext('2d');
19 ctx.fillStyle = 'orange';
20 ctx.fillRect(0, 0, canvas.width, canvas.height);
21
22 ctx.beginPath();
Justin Novosad 2015/06/09 19:20:43 Not necessary
changseok 2015/06/11 05:46:46 Done.
23 ctx.fillStyle = 'green';
24 var squarWidth = canvas.width / 2;
25 var squarHalfWidth = squarWidth / 2;
26 ctx.fillRect(canvas.width / 2 - squarHalfWidth, canvas.height / 2 - squarHalfW idth , squarWidth, squarWidth);
27 ctx.fill();
Justin Novosad 2015/06/09 19:20:43 not necessary
changseok 2015/06/11 05:46:47 Done.
28 }
29
30 paintCanvas(document.querySelector('canvas'));
31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698