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

Side by Side Diff: third_party/WebKit/LayoutTests/intersection-observer/README

Issue 1780163002: Revert of IntersectionObserver: use an idle callback to send notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 9 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 All of the IntersectionObserver tests feature the following idiom:
2
3 <script>
4 var observer = new IntersectionObserver(...)
5 function test_function() {
6 var entries = observer.takeRecords();
7 // Verify entries
8 }
9 onload = function() {
10 observer.observe(target);
11 requestAnimationFrame(() => { requestAnimationFrame(test_function) });
12 }
13
14
15 Subsequent steps in the test use a single RAF to give the observer a chance to
16 generate notifications, but the double RAF is required in the onload handler.
17 Here's the chain of events:
18
19 - onload
20 - observer.observe()
21 - First RAF handler is registered
22 - BeginFrame
23 - RAF handlers run
24 - Second RAF handler is registered
25 - UpdateAllLifecyclePhases
26 - IntersectionObserver generates notifications
27 - BeginFrame
28 - RAF handlers run
29 - Second RAF handler verifies observer notifications.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698