4 <script src=
"../../resources/js-test.js"></script>
8 description("This tests checks that all of the input values for object-fit parse correctly.");
12 var div
= document
.createElement("div");
13 div
.setAttribute("style", value
);
14 document
.body
.appendChild(div
);
16 var result
= div
.style
.getPropertyValue("object-fit");
17 document
.body
.removeChild(div
);
21 function testComputedStyle(value
)
23 var div
= document
.createElement("div");
24 div
.setAttribute("style", value
);
25 document
.body
.appendChild(div
);
27 var result
= window
.getComputedStyle(div
).objectFit
;
28 document
.body
.removeChild(div
);
32 shouldBe('testComputedStyle(";")', '"fill"');
33 shouldBe('test("object-fit: inherit;")', '"inherit"');
34 shouldBe('test("object-fit: initial;")', '"initial"');
35 shouldBe('test("object-fit: fill;")', '"fill"');
36 shouldBe('test("object-fit: contain;")', '"contain"');
37 shouldBe('test("object-fit: cover;")', '"cover"');
38 shouldBe('test("object-fit: none;")', '"none"');
39 shouldBe('test("object-fit: scale-down;")', '"scale-down"');
41 shouldBeEqualToString('test("object-fit: fill contain;")', '');
42 shouldBeEqualToString('test("object-fit: bananas;")', '');
43 shouldBeEqualToString('test("object-fit: 23px;")', '');
44 shouldBeEqualToString('test("object-fit: 20%;")', '');