summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-flexbox/flexbox-paint-ordering-002-ref.xhtml
blob: 55ca62df74adb2962542a84c7f78ed9b08c439ca (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
<?xml version="1.0" encoding="UTF-8"?>
<!--
     Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/
-->
<!-- Reference case for flex items containing overlapping content.
     This reference uses inline-block in place of inline-flex, with floated
     children in place of flex items, and with hardcoded DOM-reordering in
     place of "order" reordering. -->
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>CSS Reftest Reference</title>
    <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/>
    <style>
      body {
        line-height: 0;
      }

      .flexbox {
        display: inline-block;
        width: 20px;
        height: 10px;
        border: 2px solid gray;
        margin-bottom: 10px;
        margin-right: 10px;
      }
      .a {
        width: 10px;
        height: 10px;
        background: lightblue;
        float: left; /* to stack horizontally, like a flex item */
      }
      .b {
        width: 10px;
        height: 10px;
        background: pink;
        float: left; /* to stack horizontally, like a flex item */
      }
      .aKid {
         margin-left: 3px;
         margin-top:  3px;
         width: 10px;
         height: 10px;
         background: steelblue;
         border: 1px solid blue;
      }
      .bKid {
         margin-left: 3px;
         margin-top:  6px;
         width: 10px;
         height: 10px;
         background: violet;
         border: 1px solid purple;
      }

      /* Need to set 'position' for z-index to take effect. */
      .zn2 { z-index: -2; position: relative; }
      .zn1 { z-index: -1; position: relative; }
      .z0  { z-index:  0; position: relative; }
      .z1  { z-index:  1; position: relative; }

    </style>
  </head>
  <body>
    <!-- order not set: -->
    <div class="flexbox">
      <div class="a"><div class="aKid"/></div>
      <div class="b"><div class="bKid"/></div>
    </div>

    <br/>

    <!-- order set, but it matches content order, so it shouldn't matter: -->
    <div class="flexbox">
      <div class="a"><div class="aKid"/></div>
      <div class="b"><div class="bKid"/></div>
    </div
    ><div class="flexbox">
      <div class="a"><div class="aKid"/></div>
      <div class="b"><div class="bKid"/></div>
    </div
    ><div class="flexbox">
      <div class="a"><div class="aKid"/></div>
      <div class="b"><div class="bKid"/></div>
    </div
    ><div class="flexbox">
      <div class="a"><div class="aKid"/></div>
      <div class="b"><div class="bKid"/></div>
    </div
    ><div class="flexbox">
      <div class="a"><div class="aKid"/></div>
      <div class="b"><div class="bKid"/></div>
    </div
    ><div class="flexbox">
      <div class="a"><div class="aKid"/></div>
      <div class="b"><div class="bKid"/></div>
    </div>

    <br/>

    <!-- order set to reverse of content-order: -->
    <div class="flexbox">
      <div class="b"><div class="bKid"/></div>
      <div class="a"><div class="aKid"/></div>
    </div
    ><div class="flexbox">
      <div class="b"><div class="bKid"/></div>
      <div class="a"><div class="aKid"/></div>
    </div
    ><div class="flexbox">
      <div class="b"><div class="bKid"/></div>
      <div class="a"><div class="aKid"/></div>
    </div
    ><div class="flexbox">
      <div class="b"><div class="bKid"/></div>
      <div class="a"><div class="aKid"/></div>
    </div>

    <br/>

    <!-- order set to reverse of content-order, AND with z-index set on
         one or both items, but not such that it changes the paint order -->
    <div class="flexbox">
      <div class="b"><div class="bKid"/></div>
      <div class="a"><div class="aKid"/></div>
    </div
    ><div class="flexbox">
      <div class="b"><div class="bKid"/></div>
      <div class="a"><div class="aKid"/></div>
    </div
    ><div class="flexbox">
      <div class="b"><div class="bKid"/></div>
      <div class="a"><div class="aKid"/></div>
    </div
    ><div class="flexbox">
      <div class="b"><div class="bKid"/></div>
      <div class="a"><div class="aKid"/></div>
    </div>

    <br/>

    <!-- order set to reverse of content-order, AND with z-index set on
         one or both items, in such a way that it affects paint order -->
    <div class="flexbox">
      <!-- 'a' is behind the container's border -->
      <div class="b"><div class="bKid"/></div>
      <div class="a zn1"><div class="aKid"/></div>
    </div
    ><div class="flexbox">
      <!-- 'a' and 'b' are both behind the container's border -->
      <div class="b zn1"><div class="bKid"/></div>
      <div class="a zn1"><div class="aKid"/></div>
    </div
    ><div class="flexbox">
      <!-- 'a' and 'b' are both behind the container's border,
           and 'a' is behind 'b' despite coming after it in the 'order'
           ordering-->
      <div class="b zn1"><div class="bKid"/></div>
      <div class="a zn2"><div class="aKid"/></div>
    </div
    ><div class="flexbox">
      <!-- 'a' and 'b' are both in front of the container's border,
           and 'a' is behind 'b' despite coming after it in the 'order'
           ordering-->
      <div class="b z1"><div class="bKid"/></div>
      <div class="a z0"><div class="aKid"/></div>
    </div>

  </body>
</html>