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

Unified 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698