summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-shapes/shape-outside/shape-image/shape-image-011.html
blob: a1286f07bc8eb7b2d41d3fff02d073ca87fe0ca0 (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
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<head>
    <title>CSS Test: left float, url(svg), real image + shape-image-threshold + shape-margin (px)</title>
    <link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com"/>
    <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shapes-from-image"/>
    <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property"/>
    <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-margin-property"/>
    <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-image-threshold-property"/>
    <link rel="match" href="reference/shape-image-007-ref.html"/>
    <meta name="flags" content="ahem"/>
    <meta name="assert" content="This test verifies that content wraps around the image pixels extracted from
                                 a shape-outside svg file with shape-image-threshold set + the shape-margin in
                                 absolute length."/>
    <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
    <style type="text/css">
        body { margin: 0; }
        #test, #image, #white, .blue, .failure {
            position: absolute;
            top: 70px;
        }
        #test, #image { left: 10px; }
        #image { z-index: -2; }

        #white {
            left: 60px;
            width: 10px;
            height: 100px;
            background-color: white;
            z-index: -1;
        }
        #test {
          font: 50px/1 Ahem;
          width: 200px;
          color: rgb(0,100,0);
          z-index: 2;
        }
        #shape-image {
            float: left;
            width: 100px;
            height: 100px;
            shape-outside: url("support/left-half-rectangle-50.svg");
            shape-margin: 10px;
            shape-image-threshold: 0.55;
        }
        .blue {
            width: 2px;
            height: 100px;
            background-color: blue;
            z-index: 3;
        }
        .left-line { left: 65px; }
        .right-line { left: 125px; }

        .failure {
            left: 70px;
            width: 50px;
            height: 100px;
            background-color: red;
            z-index: 1;
        }
    </style>
</head>
<body>
    <p>
        The test passes if the green rectangle on the right is completely between the two blue lines.
        There should be no red.
    </p>
    <img id="image" src="support/left-half-rectangle-50.svg"/>
    <div id="white"></div>
    <div id="test">
        <div id="shape-image"></div>
        X<br/>X
    </div>
    <div class="blue left-line"></div>
    <div class="blue right-line"></div>
    <div class="failure"></div>
</body>
</html>