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

Side by Side Diff: LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js

Issue 249803002: Preserve identical values for background-size and -webkit-mask-size. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove comment. Created 6 years, 8 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
1 description("This tests checks that all of the input values for background-size parse correctly."); 1 description("This tests checks that all of the input values for background-size parse correctly.");
2 2
3 function test(value) 3 function test(value)
4 { 4 {
5 var div = document.createElement("div"); 5 var div = document.createElement("div");
6 div.setAttribute("style", value); 6 div.setAttribute("style", value);
7 document.body.appendChild(div); 7 document.body.appendChild(div);
8 8
9 var result = div.style.getPropertyValue(value.substring(0, value.indexOf(":" ))); 9 var result = div.style.getPropertyValue(value.substring(0, value.indexOf(":" )));
10 document.body.removeChild(div); 10 document.body.removeChild(div);
11 return result; 11 return result;
12 } 12 }
13 13
14 shouldBe('test("background-size: contain;")', '"contain"'); 14 shouldBe('test("background-size: contain;")', '"contain"');
15 shouldBe('test("background-size: cover;")', '"cover"'); 15 shouldBe('test("background-size: cover;")', '"cover"');
16 shouldBe('test("background-size: 100 100;")', '"100px"'); 16 shouldBe('test("background-size: 100 100;")', '"100px 100px"');
17 shouldBe('test("background-size: 100px 100px;")', '"100px"'); 17 shouldBe('test("background-size: 100px 100px;")', '"100px 100px"');
18 shouldBe('test("background-size: auto 50px;")', '"auto 50px"'); 18 shouldBe('test("background-size: auto 50px;")', '"auto 50px"');
19 shouldBe('test("background-size: 50px auto;")', '"50px"'); 19 shouldBe('test("background-size: 50px auto;")', '"50px"');
20 shouldBe('test("background-size: auto auto;")', '"auto"'); 20 shouldBe('test("background-size: auto auto;")', '"auto"');
21 shouldBe('test("background-size: 30% 20%;")', '"30% 20%"'); 21 shouldBe('test("background-size: 30% 20%;")', '"30% 20%"');
22 shouldBe('test("background-size: 4em auto;")', '"4em"'); 22 shouldBe('test("background-size: 4em auto;")', '"4em"');
23 shouldBe('test("background-size: 5em;")', '"5em"'); 23 shouldBe('test("background-size: 5em;")', '"5em"');
24 shouldBe('test("-webkit-background-size: 5em ;")', '"5em"'); 24 shouldBe('test("-webkit-background-size: 5em ;")', '"5em"');
25 25
26 shouldBe('test("background-size: 100 100 100;")', 'null'); 26 shouldBe('test("background-size: 100 100 100;")', 'null');
27 shouldBe('test("background-size: coconut;")', 'null'); 27 shouldBe('test("background-size: coconut;")', 'null');
28 28
29 shouldBe('test("background-size: 100px,;")', 'null'); 29 shouldBe('test("background-size: 100px,;")', 'null');
30 shouldBe('test("background-size: 100px, 50%;")', '"100px, 50%"'); 30 shouldBe('test("background-size: 100px, 50%;")', '"100px, 50%"');
31 shouldBe('test("-webkit-background-size: 100px, 50%;")', '"100px, 50%"'); 31 shouldBe('test("-webkit-background-size: 100px, 50%;")', '"100px, 50%"');
32 shouldBe('test("background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em , 100px 50%"'); 32 shouldBe('test("background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em , 100px 50%"');
33 shouldBe('test("-webkit-background-size: 50% 100px, 2em, 100px 50%;")', '"50% 10 0px, 2em, 100px 50%"'); 33 shouldBe('test("-webkit-background-size: 50% 100px, 2em, 100px 50%;")', '"50% 10 0px, 2em, 100px 50%"');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698