27 background-color: red;
34 background-color: blue;
38 if (window
.testRunner
)
39 testRunner
.dumpAsText();
43 var pre
= document
.getElementById('console');
44 var testDescription
= 'This test ensures that Layer::scrollsWithRespectTo ' +
45 'always works even with multiple levels of nested ' +
46 'overflow-divs, including positioned and non ' +
47 'positioned elements, and a scrollable viewport.\n\n';
48 var text
= document
.createTextNode(testDescription
);
49 pre
.appendChild(text
);
54 var divs
= ['div1', 'div2', 'containingBlock', 'div4', 'div5', 'abs-descendant', 'fixed-descendant', 'viewportFiller', 'root'];
55 for (var i
= 0; i
< divs
.length
; i
++) {
56 var div1
= document
.getElementById(divs
[i
]);
57 for (var j
= 0; j
< divs
.length
; j
++) {
58 var div2
= document
.getElementById(divs
[j
]);
59 var scrollsWithRespectTo
= window
.internals
.scrollsWithRespectTo(div1
, div2
);
61 var successText
= scrollsWithRespectTo
? 'scrolls with respect to' : 'does not scroll with respect to';
62 var messageText
= div1
.id
+ ' ' + successText
+ ' ' + div2
.id
;
63 text
= document
.createTextNode(messageText
+ '\n');
64 pre
.appendChild(text
);
69 window
.onload
= doTest
;
74 <div style='width:
450px; height:
300px' id='div2'
>
75 <div style='width:
400px; height:
250px' id='containingBlock'
>
76 <div style='width:
350px; height:
200px' id='div4'
>
77 <div id='abs-descendant' style='height:
50px; width:
50px;'
></div>
78 <div id='fixed-descendant' style='height:
50px; width:
50px;'
></div>
79 <div style='width:
300px; height:
150px' id='div5'
>
80 <div class='filler'
></div>
82 <div class='filler'
></div>
84 <div class='filler'
></div>
86 <div class='filler'
></div>
88 <div class='filler'
></div>
91 <pre id='console'
></pre>
92 <div id='viewportFiller' class='filler'
></div>