OLD | NEW |
1 function testComputedStyle(ancestorValue, childValue) | 1 function testComputedStyle(ancestorValue, childValue) |
2 { | 2 { |
3 shouldBe("window.getComputedStyle(ancestor).getPropertyValue('text-indent')"
, "'" + ancestorValue + "'"); | 3 shouldBe("window.getComputedStyle(ancestor).getPropertyValue('text-indent')"
, "'" + ancestorValue + "'"); |
4 shouldBe("window.getComputedStyle(child).getPropertyValue('text-indent')",
"'" + childValue + "'"); | 4 shouldBe("window.getComputedStyle(child).getPropertyValue('text-indent')",
"'" + childValue + "'"); |
5 debug(''); | 5 debug(''); |
6 } | 6 } |
7 | 7 |
8 function ownValueTest(ancestorValue, childValue) | 8 function ownValueTest(ancestorValue, childValue) |
9 { | 9 { |
10 debug("Value of ancestor is '" + ancestorValue + "', while child is '" + chi
ldValue + "':"); | 10 debug("Value of ancestor is '" + ancestorValue + "', while child is '" + chi
ldValue + "':"); |
11 ancestor.style.textIndent = ancestorValue; | 11 ancestor.style.textIndent = ancestorValue; |
12 child.style.textIndent = childValue; | 12 child.style.textIndent = childValue; |
13 testComputedStyle(ancestorValue, childValue); | 13 testComputedStyle(ancestorValue, childValue); |
14 } | 14 } |
15 | 15 |
16 function inheritanceTest(ancestorValue) | 16 function inheritanceTest(ancestorValue) |
17 { | 17 { |
18 debug("Value of ancestor is '" + ancestorValue + "':"); | 18 debug("Value of ancestor is '" + ancestorValue + "':"); |
19 ancestor.style.textIndent = ancestorValue; | 19 ancestor.style.textIndent = ancestorValue; |
20 testComputedStyle(ancestorValue, ancestorValue); | 20 testComputedStyle(ancestorValue, ancestorValue); |
21 } | 21 } |
22 | 22 |
23 description("This tests check that the value of text-indent is properly inherite
d to the child."); | 23 description("This test checks that the value of text-indent is properly inherite
d to the child."); |
24 | 24 |
25 ancestor = document.getElementById('ancestor'); | 25 ancestor = document.getElementById('ancestor'); |
26 child = document.getElementById('child'); | 26 child = document.getElementById('child'); |
27 | 27 |
28 inheritanceTest("10px"); | 28 inheritanceTest("10px"); |
29 inheritanceTest("10px -webkit-each-line"); | 29 inheritanceTest("10px each-line"); |
30 | 30 |
31 ownValueTest("10px -webkit-each-line", "10px"); | 31 ownValueTest("10px each-line", "10px"); |
OLD | NEW |