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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <script>
8 description("This tests checks that all of the input values for obje ct-fit parse correctly.");
9
10 function test(value)
11 {
12 var div = document.createElement("div");
13 div.setAttribute("style", value);
14 document.body.appendChild(div);
15
16 var result = div.style.getPropertyValue("object-fit");
17 document.body.removeChild(div);
18 return result;
19 }
20
21 function testComputedStyle(value)
22 {
23 var div = document.createElement("div");
24 div.setAttribute("style", value);
25 document.body.appendChild(div);
26
27 var result = window.getComputedStyle(div).objectFit;
28 document.body.removeChild(div);
29 return result;
30 }
31
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"');
40
41 shouldBeNull('test("object-fit: fill contain;")');
42 shouldBeNull('test("object-fit: bananas;")');
43 shouldBeNull('test("object-fit: 23px;")');
44 shouldBeNull('test("object-fit: 20%;")');
45 </script>
46 <script src="../js/resources/js-test-post.js"></script>
47 </body>
48 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698