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

Side by Side Diff: third_party/WebKit/LayoutTests/intersection-observer/resources/observer-in-iframe-subframe.html

Issue 2645283008: IntersectionObserver: Always send an initial notification. (Closed)
Patch Set: Fix unit test 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="./intersection-observer-test-utils.js"></script> 4 <script src="./intersection-observer-test-utils.js"></script>
5 5
6 <style> 6 <style>
7 #root { 7 #root {
8 width: 200px; 8 width: 200px;
9 height: 200px; 9 height: 200px;
10 } 10 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 }, {root: root}); 49 }, {root: root});
50 observer.observe(target); 50 observer.observe(target);
51 entries = entries.concat(observer.takeRecords()); 51 entries = entries.concat(observer.takeRecords());
52 assert_equals(entries.length, 0, "No initial notifications.") 52 assert_equals(entries.length, 0, "No initial notifications.")
53 runTestCycle(step1, "First rAF."); 53 runTestCycle(step1, "First rAF.");
54 }, "IntersectionObserver in iframe with explicit root."); 54 }, "IntersectionObserver in iframe with explicit root.");
55 55
56 function step1() { 56 function step1() {
57 scroller.scrollTop = 250; 57 scroller.scrollTop = 250;
58 runTestCycle(step2, "scroller.scrollTop = 250"); 58 runTestCycle(step2, "scroller.scrollTop = 250");
59 assert_equals(entries.length, 0, "No notifications after first rAF."); 59 checkLastEntry(entries, 0, [8, 108, 308, 408, 0, 0, 0, 0, 8, 208, 8, 208, targ et]);
60 } 60 }
61 61
62 function step2() { 62 function step2() {
63 checkLastEntry(entries, 0, [8, 108, 58, 158, 8, 108, 58, 158, 8, 208, 8, 208, target]); 63 checkLastEntry(entries, 1, [8, 108, 58, 158, 8, 108, 58, 158, 8, 208, 8, 208, target]);
64 } 64 }
65 </script> 65 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698