Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1249)

Delta Between Two Patch Sets: LayoutTests/imported/w3c/web-platform-tests/intersection-observer/cross-origin-iframe.html

Issue 359780043: WIP for IO
Left Patch Set: Fixed root parsing Created 5 years, 8 months ago
Right Patch Set: 22 tests pass Created 5 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
LEFTRIGHT
(no file at all)
1 <!DOCTYPE html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <script src="./resources/intersection-observer-test-utils.js"></script>
5
6 <style>
7 pre, #log {
8 position: absolute;
9 top: 0;
10 left: 200px;
11 }
12 iframe {
13 width: 160px;
14 height: 100px;
15 overflow-y: scroll;
16 }
17 .spacer {
18 height: calc(100vh + 100px);
19 }
20 </style>
21
22 <div class="spacer"></div>
23 <iframe src="resources/cross-origin-subframe.html" sandbox="allow-scripts"></ifr ame>
24 <div class="spacer"></div>
25
26 <script>
27 async_test(function(t) {
28 var iframe = document.querySelector("iframe");
29
30 function handleMessage(event) {
31 if (event.data.hasOwnProperty('scrollTo')) {
32 document.scrollingElement.scrollTop = event.data.scrollTo;
33 waitForNotification(t, function() { iframe.contentWindow.postMessage("", " *"); },
34 "document.scrollingElement.scrollTop = " + event.data.scrollTo);
35 } else if (event.data.hasOwnProperty('actual')) {
36 checkJsonEntries(event.data.actual, event.data.expected, event.data.descri ption);
37 } else if (event.data.hasOwnProperty('DONE')) {
38 document.scrollingElement.scrollTop = 0;
39 t.done();
40 } else {
41 var description = event.data.description;
42 waitForNotification(t, function() { iframe.contentWindow.postMessage("", " *"); }, description);
43 }
44 }
45
46 window.addEventListener("message", t.step_func(handleMessage));
47
48 iframe.onload = t.step_func(function() {
49 waitForNotification(t, function() { iframe.contentWindow.postMessage("", "*" ) }, "setup");
50 });
51 }, "Intersection observer test with no explicit root and target in a cross-origi n iframe.");
52 </script>
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b