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

Side by Side Diff: third_party/WebKit/LayoutTests/intersection-observer/iframe-no-root.html

Issue 2662993002: [IntersectionObserver] Add isIntersecting field. (Closed)
Patch Set: webexposed Created 3 years, 10 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="./resources/intersection-observer-test-utils.js"></script> 4 <script src="./resources/intersection-observer-test-utils.js"></script>
5 5
6 <style> 6 <style>
7 pre, #log { 7 pre, #log {
8 position: absolute; 8 position: absolute;
9 top: 0; 9 top: 0;
10 left: 200px; 10 left: 200px;
(...skipping 30 matching lines...) Expand all
41 observer.observe(target); 41 observer.observe(target);
42 entries = entries.concat(observer.takeRecords()); 42 entries = entries.concat(observer.takeRecords());
43 assert_equals(entries.length, 0, "No initial notifications."); 43 assert_equals(entries.length, 0, "No initial notifications.");
44 runTestCycle(step0, "First rAF."); 44 runTestCycle(step0, "First rAF.");
45 }, "Observer with the implicit root; target in a same-origin iframe."); 45 }, "Observer with the implicit root; target in a same-origin iframe.");
46 }; 46 };
47 47
48 function step0() { 48 function step0() {
49 document.scrollingElement.scrollTop = 200; 49 document.scrollingElement.scrollTop = 200;
50 runTestCycle(step1, "document.scrollingElement.scrollTop = 200"); 50 runTestCycle(step1, "document.scrollingElement.scrollTop = 200");
51 checkLastEntry(entries, 0, [8, 108, 208, 308, 0, 0, 0, 0, 0, 785, 0, 600, targ et]); 51 checkLastEntry(entries, 0, [8, 108, 208, 308, 0, 0, 0, 0, 0, 785, 0, 600, fals e]);
52 } 52 }
53 53
54 function step1() { 54 function step1() {
55 iframe.contentDocument.scrollingElement.scrollTop = 250; 55 iframe.contentDocument.scrollingElement.scrollTop = 250;
56 runTestCycle(step2, "iframe.contentDocument.scrollingElement.scrollTop = 250") ; 56 runTestCycle(step2, "iframe.contentDocument.scrollingElement.scrollTop = 250") ;
57 assert_equals(entries.length, 1, "entries.length == 1"); 57 assert_equals(entries.length, 1, "entries.length == 1");
58 } 58 }
59 59
60 function step2() { 60 function step2() {
61 document.scrollingElement.scrollTop = 100; 61 document.scrollingElement.scrollTop = 100;
62 runTestCycle(step3, "document.scrollingElement.scrollTop = 100"); 62 runTestCycle(step3, "document.scrollingElement.scrollTop = 100");
63 checkLastEntry(entries, 1, [8, 108, -42, 58, 8, 108, 0, 58, 0, 785, 0, 600, ta rget]); 63 checkLastEntry(entries, 1, [8, 108, -42, 58, 8, 108, 0, 58, 0, 785, 0, 600, tr ue]);
64 } 64 }
65 65
66 function step3() { 66 function step3() {
67 checkLastEntry(entries, 2, [8, 108, -42, 58, 0, 0, 0, 0, 0, 785, 0, 600, targe t]); 67 checkLastEntry(entries, 2, [8, 108, -42, 58, 0, 0, 0, 0, 0, 785, 0, 600, false ]);
68 document.scrollingElement.scrollTop = 0; 68 document.scrollingElement.scrollTop = 0;
69 } 69 }
70 </script> 70 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698