summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-writing-modes/box-offsets-rel-pos-vlr-005.xht
blob: 8f09748a8e984942c2c8d30bce4df06ac897dab9 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 <head>

  <title>CSS Writing Modes Test: box offsets - relatively positioned boxes</title>

  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
  <link rel="help" title="7.1 Principles of Layout in Vertical Writing Modes" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" />
  <link rel="match" href="box-offsets-rel-pos-vlr-005-ref.xht" />

  <meta content="image" name="flags" />
  <meta content="Box offsets (bottom, left, right, top) expressed in absolute units (not with percentage unit) for relatively positioned boxes are with respect to the edges of the boxes themselves." name="assert" />

  <style type="text/css"><![CDATA[
  html
    {
      writing-mode: vertical-lr;
    }

  div#statically-positioned-box
    {
      background-color: yellow; /* padding box will be yellow */
      border: orange solid 50px; /* border box will be orange */
      height: 100px; /* a bright green square 100px by 100px image will serve as content box */
      margin-left: 8px;
      padding: 50px;
      position: static;
      width: 100px;
    }

  div.blue-relatively-positioned
    {
      background-color: blue;
      color: white;
      height: 25px;
      position: relative;
      width: 25px;
      writing-mode: horizontal-tb;
    }

  div#top-left
    {
      right: 250px;
      /*
      Calculation of right offset:
          50px (div#statically-positioned-box's border-right)
       +
         200px (div#statically-positioned-box's padding-box width)
       ==================
         250px
      */

      top: 50px;
      /*
      Calculation of top offset:
        50px (div#statically-positioned-box's border-top)
      ==================
        50px
      */
    }

  div#top-right
    {
      right: 100px;
      /*
      Calculation of right offset:
          25px (div#top-left's content width)
       +
          25px (div#top-right's content width)
       +
          50px (div#statically-positioned-box's border-right)
       ==================
         100px
      */

      top: 50px;
      /*
      Calculation of top offset:
        50px (div#statically-positioned-box's border-top)
      ==================
        50px
      */
    }

  div#bottom-left
    {
      top: 225px;
      /*
      Calculation of top offset:
          50px (div#statically-positioned-box's border-top)
       +
         200px (div#statically-positioned-box's padding-box height)
       -
          25px (div#bottom-left's content height)
      ==================
         225px
    */

      right: 300px;
      /*
      Calculation of right offset:
          25px (div#top-left's content width)
       +
          25px (div#top-right's content width)
       +
          50px (div#statically-positioned-box's border-right)
       +
         200px (div#statically-positioned-box's padding-box width)
       ==================
         300px
      */
    }

  div#bottom-right
    {
      top: 225px;
      /*
      Calculation of top offset:
          50px (div#statically-positioned-box's border-top)
       +
         200px (div#statically-positioned-box's padding-box height)
       -
          25px (div#bottom-right's content height)
      ==================
         225px
    */

      right: 150px;
      /*
      Calculation of right offset:
          25px (div#top-left's content width)
       +
          25px (div#top-right's content width)
       +
          25px (div#bottom-left's content width)
       +
          25px (div#bottom-right's content width)
       +
          50px (div#statically-positioned-box's border-left)
       ==================
         150px
      */
  }
  ]]></style>

 </head>

 <body>

  <p><img src="support/pass-cdts-box-offsets-rel-pos.png" width="304" height="35" alt="Image download support must be enabled" /></p>

  <!--
  The image says:
  "
  Test passes if there is a blue square
  at each corner of the yellow square.
  "
  -->

  <div id="statically-positioned-box"><img src="support/100x100-lime.png" alt="Image download support must be enabled" /></div>

  <div class="blue-relatively-positioned" id="top-left">TL</div>

  <div class="blue-relatively-positioned" id="top-right">TR</div>

  <div class="blue-relatively-positioned" id="bottom-left">BL</div>

  <div class="blue-relatively-positioned" id="bottom-right">BR</div>

 </body>
</html>