/
getComputedStyle-text-indent-inherited.html
43 lines (37 loc) · 1.38 KB
/
getComputedStyle-text-indent-inherited.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<script src="../../../../resources/js-test-pre.js"></script>
</head>
<body>
<div id="ancestor"><div id="child"></div></div>
<script>
function testComputedStyle(ancestorValue, childValue)
{
shouldBe("window.getComputedStyle(ancestor).getPropertyValue('text-indent')", "'" + ancestorValue + "'");
shouldBe("window.getComputedStyle(child).getPropertyValue('text-indent')", "'" + childValue + "'");
debug('');
}
function ownValueTest(ancestorValue, childValue)
{
debug("Value of ancestor is '" + ancestorValue + "', while child is '" + childValue + "':");
ancestor.style.textIndent = ancestorValue;
child.style.textIndent = childValue;
testComputedStyle(ancestorValue, childValue);
}
function inheritanceTest(ancestorValue)
{
debug("Value of ancestor is '" + ancestorValue + "':");
ancestor.style.textIndent = ancestorValue;
testComputedStyle(ancestorValue, ancestorValue);
}
description("This tests check that the value of text-indent is properly inherited to the child.");
ancestor = document.getElementById('ancestor');
child = document.getElementById('child');
inheritanceTest("10px");
inheritanceTest("10px -webkit-each-line");
ownValueTest("10px -webkit-each-line", "10px");
</script>
<script src="../../../../resources/js-test-post.js"></script>
</body>
</html>