10 <script src=
"../../resources/testharness.js"></script>
11 <script src=
"../../resources/testharnessreport.js"></script>
12 <script src=
"resources/scroll-behavior-test.js"></script>
13 <script type=
"text/javascript">
14 function getEndPosition(testCase
, startPosition
) {
16 endPosition
.x
= startPosition
.x
;
17 endPosition
.y
= testCase
.y
;
21 function jsScroll(testCase
) {
22 var subframe
= document
.getElementById("subframe");
23 subframe
.contentDocument
.scrollingElement
.scrollTop
= testCase
.y
;
27 {css
: "auto", x
: 0, y
: 2},
28 {css
: "auto", x
: 0, y
: 4},
29 {css
: "smooth", waitForEnd
: true, x
: 0, y
: 25},
30 {css
: "smooth", waitForEnd
: true, x
: 0, y
: 45},
31 {css
: "smooth", waitForEnd
: false, x
: 0, y
: 4100},
32 {css
: "smooth", waitForEnd
: false, x
: 0, y
: 20},
38 for (var i
= 0; i
< testScrolls
.length
; i
++) {
39 testCases
.push(new ScrollBehaviorTestCase(testScrolls
[i
]));
42 var subframe
= document
.getElementById("subframe");
43 var scrollBehaviorTest
= new ScrollBehaviorTest(subframe
.contentDocument
.scrollingElement
,
44 subframe
.contentDocument
,
48 scrollBehaviorTest
.run();
51 window
.addEventListener('load', doTest
, false);
56 <p>Test that setting scrollTop on a subframe works with both scroll behaviors
</p>
57 <iframe id=
"subframe" src=
"resources/large-subframe.html"></iframe>