summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-exclusions/wrap-through-001.html
blob: 8c2f9d797bc66d113a8fb7122ab1ff46085eccf8 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE HTML>
<html>
    <head>
        <title>CSS Exclusions Test: wrap-through property set to none</title>
        <link rel="author" title="Jacob Goldstein" href="mailto:jacobg@adobe.com">
        <link rel="help" href="http://www.w3.org/TR/css3-exclusions/#wrap-through-property">
        <meta name="flags" content="ahem dom">
        <meta name="assert" content="The wrapping context should not be inheritted from the parent node when wrap-through is set to none">
        <script src="/resources/testharness.js"></script>
        <script src="/resources/testharnessreport.js"></script>
        <script src="resources/helper.js"></script>
        <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
        <style>
            * {
                margin: 0px;
                padding: 0px;
            }
            .exclusion {
                wrap-flow: both;
                position: absolute;
                top: 15px;
                left: 70px;
                width: 60px;
                height: 36px;
                background: blue;
            }
            #content1, #content2 {
                width: 400px;
                line-height: 12px;
                font: 12px Ahem;
            }
            #content2 {
                wrap-through: none;
            }
        </style>
    </head>
    <body>
        <div id="myContainer">
            <div class="exclusion"></div>

            <div id="content1">
                <span id="line1">ethical beer craft</span><BR>
                <span id="line2Left">jean </span><span id="line2Right">vegan</span><BR>
                <span id="line3Left">fund </span><span id="line3Right">selvage</span><BR>
            </div>
            <div id="content2">
                <span id="line4Left">swags </span><span id="line4Right">unami</span>
            </div>
        </div>

        <div id="log"></div>

        <script type="text/javascript">
            setup({ explicit_done: true });

            document.fonts.ready.then(() => {
                /* Line 1 */
                test(function() {assert_equals(checkLinePos("line1",0,"top"), true)}, "Verify top of the first line above the exclusion");
                test(function() {assert_equals(checkLinePos("line1",0,"left"), true)}, "Verify left of the first line above the exclusion");
                /* Line 2 */
                test(function() {assert_equals(checkLinePos("line2Left",12,"top"), true)}, "Verify top of the second line on the left of the exclusion");
                test(function() {assert_equals(checkLinePos("line2Right",130,"left"), true)}, "Verify left of the second line on the right of the exclusion");
                /* Line 3 */
                test(function() {assert_equals(checkLinePos("line3Left",24,"top"), true)}, "Verify top of the third line on the left of the exclusion");
                test(function() {assert_equals(checkLinePos("line3Right",130,"left"), true)}, "Verify left of the third line on the right of the exclusion");
                /* Line 4 */
                test(function() {assert_equals(checkLinePos("line4Left",36,"top"), true)}, "Verify top of the fourth line with no wrapping-through = none");
                test(function() {assert_equals(checkLinePos("line4Right",72,"left"), true)}, "Verify left of the fourth line with wrapping-through = none");
                done();
            });
        </script>
    </body>
</html>