wpt / css / css-exclusions / wrap-through-001.html

Status: FAIL | Duration: 38ms | Subtests: 0/1 | Open test on wpt.live | wpt.fyi

/css/css-exclusions/wrap-through-001.html

<!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(() => {
                assert_implements(CSS.supports('wrap-through', 'none'), "'wrap-through: none'");
                assert_implements(CSS.supports('wrap-flow', 'both'), "'wrap-flow: both'");
            }, {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>