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=
"" 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">
29 background-color: red;
31 border-width:
50px
0 0 50px;
33 margin-bottom: -
100px;
39 background-attachment: local;
40 background-image: url(
"support/100x100-gr-rr.png");
41 background-repeat: no-repeat;
42 background-position: center;
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"> <br> </div>
64 (0px, 0px) (100px, 0px)
65 +.......................+
78 +.......................+
79 (0px, 100px) (100px, 100px)
85 div#target with background-position: top left
87 (0px, 0px) (100px, 0px)
88 +.......................+
101 +.......................+
102 (0px, 100px) (100px, 100px)
108 div#target with background-position: center
110 (0px, 0px) (100px, 0px)
111 +.......................+
118 | +...........| ...........+
120 | green | | green || red |
121 | area | | area || area |
124 +.......................+ |
126 | red area | <== overflowed
131 +.........................+