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

Unified Diff: LayoutTests/fast/css/object-fit-canvas.html

Issue 22482004: Add support for the object-fit CSS property. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Oops, sorry! Forgot to update UseCounter.cpp Created 7 years, 4 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/fast/css/object-fit-canvas.html
diff --git a/LayoutTests/fast/css/object-fit-canvas.html b/LayoutTests/fast/css/object-fit-canvas.html
new file mode 100644
index 0000000000000000000000000000000000000000..540ca996af06da2a15f9c5374be41924ff19b4da
--- /dev/null
+++ b/LayoutTests/fast/css/object-fit-canvas.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+
+<html>
+ <head>
+ <title>object-fit on canvas</title>
+ <style type="text/css">
+ img, embed, object, input, canvas, video {
+ width: 72px;
+ height: 72px;
+ margin: 2px 10px;
+ border: 1px solid black;
+ background-color: gray;
+ }
+
+ .group { object-fit: contain; }
+ .group > *:nth-child(1) { object-fit: fill; }
+ .group > *:nth-child(2) { object-fit: contain; }
+ .group > *:nth-child(3) { object-fit: cover; }
+ .group > *:nth-child(4) { object-fit: none; }
+ .group > *:nth-child(5) { object-fit: scale-down; }
+ .group > *:nth-child(6) { object-fit: inherit; }
+ .group > *:nth-child(7) { }
+ </style>
+ <script type="text/javascript" charset="utf-8">
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ var circlesImage;
+
+ function paintCanvas(canvas)
+ {
+ var ctx = canvas.getContext('2d');
+ ctx.drawImage(circlesImage, 0, 0);
+ }
+
+ function init()
+ {
+ circlesImage = new Image()
+ circlesImage.addEventListener('load', imageLoaded, false);
+ circlesImage.src = "resources/circles-landscape.png";
+ }
+
+ function imageLoaded()
+ {
+ var canvases = document.getElementsByTagName('canvas');
+ for (var i = 0; i < canvases.length; ++i)
+ paintCanvas(canvases[i])
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+
+ window.addEventListener('load', init, false);
+ </script>
+ </head>
+ <body>
+
+ <div class="group">
+ <canvas width="288" height="144"></canvas>
+ <canvas width="288" height="144"></canvas>
+ <canvas width="288" height="144"></canvas>
+ <canvas width="288" height="144"></canvas>
+ <canvas width="288" height="144"></canvas>
+ <canvas width="288" height="144"></canvas>
+ <canvas width="288" height="144"></canvas>
+ </div>
+
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/css/object-fit-canvas-expected.html » ('j') | LayoutTests/fast/css/parsing-object-fit.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698