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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/misc/scroll-cross-origin-iframes.html

Issue 2631853002: Give OOPIF FrameViews their own scroll animation timelines and hosts (Closed)
Patch Set: Fixes from bokan comments Created 3 years, 11 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="/js-test-resources/js-test.js"></script>
3 <iframe id="target-iframe1" src="http://localhost:8080/misc/resources/cross-orig in-subframe-for-scrolling.html" style="height: 100px; width: 100px; overflow-y: scroll; position: absolute; left: 50px; top: 50px"></iframe>
4 <iframe id="target-iframe2" src="http://localhost:8080/misc/resources/cross-orig in-subframe-for-scrolling.html" style="height: 100px; width: 100px; overflow-y: scroll; position: absolute; left: 50px; top: 200px"></iframe>
5
6 <script>
7 description("Verify that two sibling cross-origin iframes both correctly scroll on MouseWheel events, as per https://crbug.com/675695.");
8
9 // States:
10 // 0 => Scroll sent to iframe1
11 // 1 => Fetching scroll offset from iframe1
12 // 2 => Scroll sent to iframe2
13 // 3 => Fetching scroll offset from iframe2
14 var state = 0;
15 var iframe1 = document.getElementById("target-iframe1");
16 var iframe2 = document.getElementById("target-iframe2");
17 setPrintTestResultsLazily();
18 self.jsTestIsAsync = true;
19
20 function handleMessage(event) {
21 if (state == 0) {
22 iframe1.contentWindow.postMessage("", "*");
23 state = 1;
24 } else if (state == 1) {
25 shouldBeEqualToNumber("event.data.scrollTop", 40);
26 state = 2;
27 iframe2.contentWindow.postMessage({scrollBy: -1, left: iframe2.offsetLeft, t op: iframe2.offsetTop}, "*");
28 iframe2.contentWindow.postMessage("", "*");
29 } else if (state == 2) {
30 iframe1.contentWindow.postMessage("", "*");
31 state = 3;
32 } else if (state == 3) {
33 shouldBeEqualToNumber("event.data.scrollTop", 40);
34 finishJSTest();
35 }
36 }
37
38 window.addEventListener("message", handleMessage);
39
40 iframe1.onload = (() => {
41 iframe1.contentWindow.postMessage({scrollBy: -1, left: iframe1.offsetLeft, top : iframe1.offsetTop}, "*");
42 });
43
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698