Bug 1729777 [wpt PR 30405] - Parsing for contain-intrinsic-size: auto <length>, a...
[gecko.git] / testing / web-platform / tests / css / css-backgrounds / background-attachment-353.html
blob5ed09397a83b94c46242641461dae3f69c7c38a1
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="" name="flags">
24 <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">
26 <style>
27 div#control
29 background-color: red;
30 border: solid green;
31 border-width: 50px 0 0 50px;
32 height: 50px;
33 margin-bottom: -100px;
34 width: 50px;
37 div#target
39 background-attachment: local;
40 background-image: url("support/100x100-gr-rr.png");
41 background-repeat: no-repeat;
42 background-position: center;
43 font-family: Ahem;
44 font-size: 100px;
45 line-height: 1;
46 height: 100px;
47 overflow: hidden;
48 width: 100px;
50 </style>
52 <body>
54 <p>Test passes if there is a filled green square and <strong>no red</strong>.
56 <div id="control"></div>
58 <div id="target">&nbsp;&nbsp;<br>&nbsp;&nbsp;</div>
60 <!--
62 div#control is
64 (0px, 0px) (100px, 0px)
65 +.......................+
66 | |
67 | |
68 | green area |
69 | |
70 | |
71 | green area |
72 | |
73 | +........+|
74 | green | red ||
75 | area | area ||
76 | | ||
77 | +........+|
78 +.......................+
79 (0px, 100px) (100px, 100px)
82 = = = = = = =
85 div#target with background-position: top left
87 (0px, 0px) (100px, 0px)
88 +.......................+
89 | +........+ |
90 | | green | red |
91 | | area | area |
92 | | | |
93 | +........+ |
94 | |
95 | red area |
96 | |
97 | |
98 | red area |
99 | |
101 +.......................+
102 (0px, 100px) (100px, 100px)
105 = = = = = = =
108 div#target with background-position: center
110 (0px, 0px) (100px, 0px)
111 +.......................+
113 | green area |
114 | | overflowed
115 | | area
116 | green area | |
117 | | V
118 | +...........| ...........+
119 | | +........+| |
120 | green | | green || red |
121 | area | | area || area |
122 | | | || |
123 | | +........+| |
124 +.......................+ |
126 | red area | <== overflowed
127 | | <== area
128 | red area |
131 +.........................+