Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / parsing-object-fit.html
blob0f9d13fefe004b2e8e5f2cc8d7c02574f8ebea9e
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("This tests checks that all of the input values for object-fit parse correctly.");
10 function test(value)
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);
18 return result;
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);
29 return result;
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%;")', '');
45 </script>
46 </body>
47 </html>