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

Side by Side Diff: third_party/WebKit/LayoutTests/intersection-observer/observer-without-js-reference.html

Issue 2645283008: IntersectionObserver: Always send an initial notification. (Closed)
Patch Set: 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 25 matching lines...) Expand all
36 entries = entries.concat(changes) 36 entries = entries.concat(changes)
37 }).observe(target); 37 }).observe(target);
38 } 38 }
39 createObserver(); 39 createObserver();
40 runTestCycle(step0, "First rAF"); 40 runTestCycle(step0, "First rAF");
41 }, "IntersectionObserver that is unreachable in js should still generate notific ations."); 41 }, "IntersectionObserver that is unreachable in js should still generate notific ations.");
42 42
43 function step0() { 43 function step0() {
44 document.scrollingElement.scrollTop = 300; 44 document.scrollingElement.scrollTop = 300;
45 runTestCycle(step1, "document.scrollingElement.scrollTop = 300"); 45 runTestCycle(step1, "document.scrollingElement.scrollTop = 300");
46 assert_equals(entries.length, 0, "No notifications after first rAF."); 46 assert_equals(entries.length, 1, "One notification.");
47 } 47 }
48 48
49 function step1() { 49 function step1() {
50 document.scrollingElement.scrollTop = 0; 50 document.scrollingElement.scrollTop = 0;
51 assert_equals(entries.length, 1, "One notification."); 51 assert_equals(entries.length, 2, "Two notifications.");
52 } 52 }
53 </script> 53 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698