Backed out 2 changesets (bug 1906804, bug 1882553) for causing artifact build bustage...
[gecko.git] / testing / web-platform / tests / css / css-backgrounds / background-attachment-353.html
blobca5a41d05ab9e13541e2725289a59d8908b51e41
1 <!DOCTYPE html>
2 <html class="reftest-wait">
3 <meta charset="UTF-8">
5 <title>CSS Background and Borders Test: 'background-attachment: local' and 'overflow: hidden'</title>
7 <link rel="author" title="GĂ©rard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
8 <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-attachment">
9 <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
10 <script src="/common/reftest-wait.js"></script>
11 <link rel="preload" as="image" href="support/100x100-gr-rr.png" onload="takeScreenshot()" />
12 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
14 <!--
16 More info:
18 Re: [css3-background] background-attachment: local
19 http://lists.w3.org/Archives/Public/www-style/2013May/0542.html
21 -->
23 <meta content="This test checks that when an element has 'background-attachment: local', then the background image is fixed with regard to what is the element's scrollable area and not to its viewport. In this test, what would be the scrollable area for the div#target element is where the red area of its background image 100x100-gr-rr.png is and such area is clipped due to 'overflow: hidden'." name="assert">
25 <style>
26 div#control
28 background-color: red;
29 border: solid green;
30 border-width: 50px 0 0 50px;
31 height: 50px;
32 margin-bottom: -100px;
33 width: 50px;
36 div#target
38 background-attachment: local;
39 background-image: url("support/100x100-gr-rr.png");
40 background-repeat: no-repeat;
41 background-position: center;
42 font-family: Ahem;
43 font-size: 100px;
44 line-height: 1;
45 height: 100px;
46 overflow: hidden;
47 width: 100px;
49 </style>
51 <body>
53 <p>Test passes if there is a filled green square and <strong>no red</strong>.
55 <div id="control"></div>
57 <div id="target">&nbsp;&nbsp;<br>&nbsp;&nbsp;</div>
59 <!--
61 div#control is
63 (0px, 0px) (100px, 0px)
64 +.......................+
65 | |
66 | |
67 | green area |
68 | |
69 | |
70 | green area |
71 | |
72 | +........+|
73 | green | red ||
74 | area | area ||
75 | | ||
76 | +........+|
77 +.......................+
78 (0px, 100px) (100px, 100px)
81 = = = = = = =
84 div#target with background-position: top left
86 (0px, 0px) (100px, 0px)
87 +.......................+
88 | +........+ |
89 | | green | red |
90 | | area | area |
91 | | | |
92 | +........+ |
93 | |
94 | red area |
95 | |
96 | |
97 | red area |
98 | |
99 | |
100 +.......................+
101 (0px, 100px) (100px, 100px)
104 = = = = = = =
107 div#target with background-position: center
109 (0px, 0px) (100px, 0px)
110 +.......................+
112 | green area |
113 | | overflowed
114 | | area
115 | green area | |
116 | | V
117 | +...........| ...........+
118 | | +........+| |
119 | green | | green || red |
120 | area | | area || area |
121 | | | || |
122 | | +........+| |
123 +.......................+ |
125 | red area | <== overflowed
126 | | <== area
127 | red area |
130 +.........................+