summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/font-shorthand-line-height.html
blob: 0e4160963101e91dd9e850d70227b400b6441edb (plain)
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
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>
    #system_font_1 { font: caption; line-height: 100px; }
    #system_font_2 { line-height: 100px; font: caption; }

    #shorthand_normal_1 { font: 10px monospace; line-height: 100px; }
    #shorthand_normal_2 { line-height: 100px; font: 10px monospace; }

    #shorthand_line_height_1 { font: 10px/200px monospace; line-height: 100px; }
    #shorthand_line_height_2 { line-height: 100px; font: 10px/200px monospace; }
</style>
<div id="system_font_1"></div>
<div id="system_font_2"></div>
<div id="shorthand_normal_1"></div>
<div id="shorthand_normal_2"></div>
<div id="shorthand_line_height_1"></div>
<div id="shorthand_line_height_2"></div>
<script>
    description("Test that line-height in font shorthands cascades correctly.");

    function lineHeight(target) {
        return getComputedStyle(target).lineHeight;
    }

    shouldBe("lineHeight(system_font_1)", "'100px'");
    shouldBe("lineHeight(system_font_2)", "'normal'");
    shouldBe("lineHeight(shorthand_normal_1)", "'100px'");
    shouldBe("lineHeight(shorthand_normal_2)", "'normal'");
    shouldBe("lineHeight(shorthand_line_height_1)", "'100px'");
    shouldBe("lineHeight(shorthand_line_height_2)", "'200px'");
</script>