Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: LayoutTests/fast/scroll-behavior/subframe-element-scroll.html

Issue 1133693002: Update most LayoutTests to be agnostic to scrollTopLeftInterop mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tdresser cr feedback Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <style> 4 <style>
5 #subframe { 5 #subframe {
6 width: 200px; 6 width: 200px;
7 height: 200px; 7 height: 200px;
8 } 8 }
9 </style> 9 </style>
10 <script src="../../resources/testharness.js"></script> 10 <script src="../../resources/testharness.js"></script>
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 function jsScroll(testCase) { 29 function jsScroll(testCase) {
30 var subframe = document.getElementById("subframe"); 30 var subframe = document.getElementById("subframe");
31 if (testCase.js) { 31 if (testCase.js) {
32 var scrollToOptions = {behavior: testCase.js}; 32 var scrollToOptions = {behavior: testCase.js};
33 if (testCase.x) 33 if (testCase.x)
34 scrollToOptions.left = testCase.x; 34 scrollToOptions.left = testCase.x;
35 if (testCase.y) 35 if (testCase.y)
36 scrollToOptions.top = testCase.y; 36 scrollToOptions.top = testCase.y;
37 subframe.contentDocument.body.scroll(scrollToOptions); 37 subframe.contentDocument.scrollingElement.scroll(scrollToOptions);
38 } else { 38 } else {
39 subframe.contentDocument.body.scroll(testCase.x, testCase.y); 39 subframe.contentDocument.scrollingElement.scroll(testCase.x, testCase.y) ;
40 } 40 }
41 } 41 }
42 42
43 const testScrolls = [ 43 const testScrolls = [
44 {js: "instant", css: "auto", x: 1, y: 2}, 44 {js: "instant", css: "auto", x: 1, y: 2},
45 {js: "instant", css: "smooth", x: 2, y: 3}, 45 {js: "instant", css: "smooth", x: 2, y: 3},
46 {js: "auto", css: "auto", x: 3, y: 4}, 46 {js: "auto", css: "auto", x: 3, y: 4},
47 {js: "", css: "auto", x: 4, y: 5}, 47 {js: "", css: "auto", x: 4, y: 5},
48 {js: "auto", css: "auto", x: 3}, 48 {js: "auto", css: "auto", x: 3},
49 {js: "auto", css: "auto", y: 4}, 49 {js: "auto", css: "auto", y: 4},
(...skipping 11 matching lines...) Expand all
61 ]; 61 ];
62 62
63 function doTest() 63 function doTest()
64 { 64 {
65 var testCases = []; 65 var testCases = [];
66 for (var i = 0; i < testScrolls.length; i++) { 66 for (var i = 0; i < testScrolls.length; i++) {
67 testCases.push(new ScrollBehaviorTestCase(testScrolls[i])); 67 testCases.push(new ScrollBehaviorTestCase(testScrolls[i]));
68 } 68 }
69 69
70 var subframe = document.getElementById("subframe"); 70 var subframe = document.getElementById("subframe");
71 var scrollBehaviorTest = new ScrollBehaviorTest(subframe.contentDocument.b ody, 71 var scrollBehaviorTest = new ScrollBehaviorTest(subframe.contentDocument.s crollingElement,
72 subframe.contentDocument, 72 subframe.contentDocument,
73 testCases, 73 testCases,
74 getEndPosition, 74 getEndPosition,
75 jsScroll); 75 jsScroll);
76 scrollBehaviorTest.run(); 76 scrollBehaviorTest.run();
77 } 77 }
78 78
79 window.addEventListener('load', doTest, false); 79 window.addEventListener('load', doTest, false);
80 </script> 80 </script>
81 </head> 81 </head>
82 82
83 <body> 83 <body>
84 <p>Test that calling scroll on a subframe's document element works with both s croll behaviors</p> 84 <p>Test that calling scroll on a subframe's document element works with both s croll behaviors</p>
85 <iframe id="subframe" src="resources/large-subframe.html"></iframe> 85 <iframe id="subframe" src="resources/large-subframe.html"></iframe>
86 </body> 86 </body>
87 </html> 87 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698