summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/multicol/inline-getclientrects.html
blob: 3559f90a51ce68e98093a106a4ec8f2e85288a39 (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
33
34
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script>
    if (window.testRunner)
        testRunner.dumpAsText();
</script>
<body style="margin-left:10px; margin-top:15px;">
    <!-- Make a container with 9 lines. With three columns, that means three lines per column. -->
    <div style="-webkit-columns:3; columns:3; column-gap:1em; -webkit-column-gap:1em; width:32em; orphans:1; widows:1;">
        <br>
        <br>
        <br>
        <br>
        <br>
        <span id="elm">
            <!-- This is at a column boundary, where the first line fits in the second column, while
                 the second line is in the third column. -->
            XXXXXXXXXXXXXXXXXXXXXXXXXX
            XXXXXXXXXXXXXXXXXXXXXXXXXX
        </span><br>
        <br>
        <br>
    </div>
    <script>
        var rects = document.getElementById('elm').getClientRects();
        shouldBe("rects.length", "2");
        shouldBeGreaterThan("rects[1].left", "rects[0].left");
        shouldBeGreaterThan("rects[0].top", "rects[1].top");
        shouldBeGreaterThan("rects[0].right - rects[0].left", "0");
        shouldBe("rects[1].right - rects[1].left", "rects[0].right - rects[0].left");
        shouldBeGreaterThan("rects[0].bottom - rects[0].top", "0");
        shouldBe("rects[1].bottom - rects[1].top", "rects[0].bottom - rects[0].top");
    </script>
</body>