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

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

Issue 22482004: Add support for the object-fit CSS property. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review 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/parsing-object-fit.html
diff --git a/LayoutTests/fast/css/parsing-object-fit.html b/LayoutTests/fast/css/parsing-object-fit.html
new file mode 100644
index 0000000000000000000000000000000000000000..4c590ad149a8b795b3b16947cb8209133876e47b
--- /dev/null
+++ b/LayoutTests/fast/css/parsing-object-fit.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../js/resources/js-test-pre.js"></script>
+ </head>
+ <body>
+ <script>
+ description("This tests checks that all of the input values for object-fit parse correctly.");
+
+ function test(value)
+ {
+ var div = document.createElement("div");
+ div.setAttribute("style", value);
+ document.body.appendChild(div);
+
+ var result = div.style.getPropertyValue("object-fit");
+ document.body.removeChild(div);
+ return result;
+ }
+
+ function testComputedStyle(value)
+ {
+ var div = document.createElement("div");
+ div.setAttribute("style", value);
+ document.body.appendChild(div);
+
+ var result = window.getComputedStyle(div).objectFit;
+ document.body.removeChild(div);
+ return result;
+ }
+
+ shouldBe('testComputedStyle(";")', '"fill"');
+ shouldBe('test("object-fit: inherit;")', '"inherit"');
+ shouldBe('test("object-fit: initial;")', '"initial"');
+ shouldBe('test("object-fit: fill;")', '"fill"');
+ shouldBe('test("object-fit: contain;")', '"contain"');
+ shouldBe('test("object-fit: cover;")', '"cover"');
+ shouldBe('test("object-fit: none;")', '"none"');
+ shouldBe('test("object-fit: scale-down;")', '"scale-down"');
+
+ shouldBeNull('test("object-fit: fill contain;")');
+ shouldBeNull('test("object-fit: bananas;")');
+ shouldBeNull('test("object-fit: 23px;")');
+ shouldBeNull('test("object-fit: 20%;")');
+ </script>
+ <script src="../js/resources/js-test-post.js"></script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698