1 description('Tests padding-start and padding-end');
3 function test(dir, prop, value, queryProp)
5 var div = document.createElement('div');
6 div.setAttribute('style', 'width:100px;' + prop + ':' + value);
8 document.body.appendChild(div);
10 var result = getComputedStyle(div).getPropertyValue(queryProp);
11 document.body.removeChild(div);
15 function testWidth(dir, prop, value)
17 var div = document.createElement('div');
18 div.setAttribute('style', 'width:100px;' + prop + ':' + value);
20 document.body.appendChild(div);
22 var result = div.offsetWidth;
23 document.body.removeChild(div);
27 shouldBe('testWidth("ltr", "-webkit-padding-start", "10px")', '110');
28 shouldBe('testWidth("ltr", "-webkit-padding-end", "20px")', '120');
29 shouldBeEqualToString('test("ltr", "-webkit-padding-start", "10px", "padding-left")', '10px');
30 shouldBeEqualToString('test("ltr", "-webkit-padding-end", "20px", "padding-right")', '20px');
31 shouldBeEqualToString('test("ltr", "padding-left", "10px", "-webkit-padding-start")', '10px');
32 shouldBeEqualToString('test("ltr", "padding-right", "20px", "-webkit-padding-end")', '20px');
34 shouldBe('testWidth("rtl", "-webkit-padding-start", "10px")', '110');
35 shouldBe('testWidth("rtl", "-webkit-padding-end", "20px")', '120');
36 shouldBeEqualToString('test("rtl", "-webkit-padding-start", "10px", "padding-right")', '10px');
37 shouldBeEqualToString('test("rtl", "-webkit-padding-end", "20px", "padding-left")', '20px');
38 shouldBeEqualToString('test("rtl", "padding-right", "10px", "-webkit-padding-start")', '10px');
39 shouldBeEqualToString('test("rtl", "padding-left", "20px", "-webkit-padding-end")', '20px');