summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/writing-mode/flipped-blocks-text-map-local-to-container.html
blob: ea0686b059bcf9adedf9a85697a8251728c2456f (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
<meta name=viewport content="width=device-width">
<div style="border: solid; writing-mode: vertical-rl; -webkit-logical-width: 200px; -webkit-logical-height: 400px;
    font-size: 36px; line-height: 2;
">
    Lorem ipsum dolor <span id="target">sit</span> amet consectetur adipiscing elit.
</div>
<p id="result">
    FAIL: Test did not run.
</p>
<script>
    if (window.testRunner) {
        testRunner.dumpAsText();
    }
    var target = document.getElementById("target");
    var range = document.createRange();
    range.selectNode(target.firstChild);
    var textTop = range.getClientRects()[0].right;
    range.selectNode(target);
    var spanTop = range.getClientRects()[0].right;
    if (spanTop === textTop)
        result.innerText = "PASS";
    else
        result.innerText  = "FAIL: Text top was " + textTop + " but expected " + spanTop + ".";
</script>