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

Side by Side Diff: LayoutTests/fast/css/script-tests/parsing-object-fit.js

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 unified diff | Download patch
OLDNEW
(Empty)
1 description("This tests checks that all of the input values for -webkit-object-f it parse correctly.");
2
3 function test(value)
4 {
5 var div = document.createElement("div");
6 div.setAttribute("style", value);
7 document.body.appendChild(div);
8
9 var result = div.style.getPropertyValue("object-fit");
10 document.body.removeChild(div);
11 return result;
12 }
13
14 function testComputedStyle(value)
15 {
16 var div = document.createElement("div");
17 div.setAttribute("style", value);
18 document.body.appendChild(div);
19
20 var result = window.getComputedStyle(div).objectFit;
21 document.body.removeChild(div);
22 return result;
23 }
24
25 shouldBe('testComputedStyle(";")', '"fill"');
26 shouldBe('test("object-fit: inherit;")', '"inherit"');
27 shouldBe('test("object-fit: initial;")', '"initial"');
28 shouldBe('test("object-fit: fill;")', '"fill"');
29 shouldBe('test("object-fit: contain;")', '"contain"');
30 shouldBe('test("object-fit: cover;")', '"cover"');
31 shouldBe('test("object-fit: none;")', '"none"');
32 shouldBe('test("object-fit: scale-down;")', '"scale-down"');
33
34 shouldBeNull('test("object-fit: fill contain;")');
35 shouldBeNull('test("object-fit: bananas;")');
36 shouldBeNull('test("object-fit: 23px;")');
37 shouldBeNull('test("object-fit: 20%;")');
38
39 var successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698