OLD | NEW |
(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; |
OLD | NEW |