Chromium Code Reviews| Index: LayoutTests/compositing/canvas-with-object-fit-contain-in-composited-layer-expected.html |
| diff --git a/LayoutTests/compositing/canvas-with-object-fit-contain-in-composited-layer-expected.html b/LayoutTests/compositing/canvas-with-object-fit-contain-in-composited-layer-expected.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9b4b9321c7244e876703b48f7728879e80391244 |
| --- /dev/null |
| +++ b/LayoutTests/compositing/canvas-with-object-fit-contain-in-composited-layer-expected.html |
| @@ -0,0 +1,31 @@ |
| +<!DOCTYPE html> |
| +<style> |
| +canvas { |
| + border: black 1px solid; |
| + background-color: gray; |
| + width: 200px; |
| + height: 200px; |
| + 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
|
| +} |
| +</style> |
| +<p>Test passes if a green square inside a orange rectanlge is shown up without a distortion. |
| +<div> |
| + <canvas width="100" height="200"></canvas> |
| +</div> |
| +<script> |
| +function paintCanvas(canvas) |
| +{ |
| + var ctx = canvas.getContext('2d'); |
| + ctx.fillStyle = 'orange'; |
| + ctx.fillRect(0, 0, canvas.width, canvas.height); |
| + |
| + ctx.beginPath(); |
|
Justin Novosad
2015/06/09 19:20:43
Not necessary
changseok
2015/06/11 05:46:46
Done.
|
| + ctx.fillStyle = 'green'; |
| + var squarWidth = canvas.width / 2; |
| + var squarHalfWidth = squarWidth / 2; |
| + ctx.fillRect(canvas.width / 2 - squarHalfWidth, canvas.height / 2 - squarHalfWidth , squarWidth, squarWidth); |
| + ctx.fill(); |
|
Justin Novosad
2015/06/09 19:20:43
not necessary
changseok
2015/06/11 05:46:47
Done.
|
| +} |
| + |
| +paintCanvas(document.querySelector('canvas')); |
| +</script> |