2 <html class=
"reftest-wait">
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">
18 Re: [css3-background] background-attachment: local
19 http://lists.w3.org/Archives/Public/www-style/2013May/0542.html
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">
28 background-color: red;
30 border-width:
50px
0 0 50px;
32 margin-bottom: -
100px;
38 background-attachment: local;
39 background-image: url(
"support/100x100-gr-rr.png");
40 background-repeat: no-repeat;
41 background-position: center;
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"> <br> </div>
63 (0px, 0px) (100px, 0px)
64 +.......................+
77 +.......................+
78 (0px, 100px) (100px, 100px)
84 div#target with background-position: top left
86 (0px, 0px) (100px, 0px)
87 +.......................+
100 +.......................+
101 (0px, 100px) (100px, 100px)
107 div#target with background-position: center
109 (0px, 0px) (100px, 0px)
110 +.......................+
117 | +...........| ...........+
119 | green | | green || red |
120 | area | | area || area |
123 +.......................+ |
125 | red area | <== overflowed
130 +.........................+