Changeset 235923 in webkit
- Timestamp:
- Sep 11, 2018 5:17:24 PM (6 years ago)
- Location:
- trunk/LayoutTests/imported/w3c
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r235920 r235923 1 2018-09-11 Ali Juma <ajuma@chromium.org> 2 3 [IntersectionObserver] Update WPTs to the latest upstream version 4 https://bugs.webkit.org/show_bug.cgi?id=189515 5 6 Reviewed by Youenn Fablet. 7 8 * web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.txt: Added. 9 * web-platform-tests/intersection-observer/initial-observation-with-threshold.html: Added. 10 * web-platform-tests/intersection-observer/resources/intersection-observer-test-utils.js: 11 (waitForNotification): 12 * web-platform-tests/intersection-observer/w3c-import.log: 13 1 14 2018-09-11 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/resources/intersection-observer-test-utils.js
r234723 r235923 7 7 // - BeginFrame 8 8 // - requestAnimationFrame handler runs 9 // - First step_timeout()9 // - Second requestAnimationFrame() 10 10 // - Style, layout, paint 11 11 // - IntersectionObserver generates new notifications 12 12 // - Posts a task to deliver notifications 13 // - First step_timeout handler runs14 // - Second step_timeout()15 13 // - Task to deliver IntersectionObserver notifications runs 16 14 // - IntersectionObserver callbacks run 17 // - Second step_timeout handler runs 15 // - Second requestAnimationFrameHandler runs 16 // - step_timeout() 17 // - step_timeout handler runs 18 18 // - myTestFunction1() 19 19 // - [optional] waitForNotification(myTestFunction2) … … 21 21 // - Verify newly-arrived IntersectionObserver notifications 22 22 // - [optional] Modify DOM to trigger new notifications 23 // 24 // Ideally, it should be sufficient to use requestAnimationFrame followed 25 // by two step_timeouts, with the first step_timeout firing in between the 26 // requestAnimationFrame handler and the task to deliver notifications. 27 // However, the precise timing of requestAnimationFrame, the generation of 28 // a new display frame (when IntersectionObserver notifications are 29 // generated), and the delivery of these events varies between engines, making 30 // this tricky to test in a non-flaky way. 31 // 32 // In particular, in WebKit, requestAnimationFrame and the generation of 33 // a display frame are two separate tasks, so a step_timeout called within 34 // requestAnimationFrame can fire before a display frame is generated. 35 // 36 // In Gecko, on the other hand, requestAnimationFrame and the generation of 37 // a display frame are a single task, and IntersectionObserver notifications 38 // are generated during this task. However, the task posted to deliver these 39 // notifications can fire after the following requestAnimationFrame. 40 // 41 // This means that in general, by the time the second requestAnimationFrame 42 // handler runs, we know that IntersectionObservations have been generated, 43 // and that a task to deliver these notifications has been posted (though 44 // possibly not yet delivered). Then, by the time the step_timeout() handler 45 // runs, these notifications have been delivered. 46 // 47 // Since waitForNotification uses a double-rAF, it is now possible that 48 // IntersectionObservers may have generated more notifications than what is 49 // under test, but have not yet scheduled the new batch of notifications for 50 // delivery. As a result, observer.takeRecords should NOT be used in tests: 51 // 52 // - myTestFunction0() 53 // - waitForNotification(myTestFunction1) 54 // - requestAnimationFrame() 55 // - Modify DOM in a way that should trigger an IntersectionObserver callback. 56 // - BeginFrame 57 // - requestAnimationFrame handler runs 58 // - Second requestAnimationFrame() 59 // - Style, layout, paint 60 // - IntersectionObserver generates a batch of notifications 61 // - Posts a task to deliver notifications 62 // - Task to deliver IntersectionObserver notifications runs 63 // - IntersectionObserver callbacks run 64 // - BeginFrame 65 // - Second requestAnimationFrameHandler runs 66 // - step_timeout() 67 // - IntersectionObserver generates another batch of notifications 68 // - Post task to deliver notifications 69 // - step_timeout handler runs 70 // - myTestFunction1() 71 // - At this point, observer.takeRecords will get the second batch of 72 // notifications. 23 73 function waitForNotification(t, f) { 24 74 requestAnimationFrame(function() { 25 t.step_timeout(function() { t.step_timeout(f); });75 requestAnimationFrame(function() { t.step_timeout(f); }); 26 76 }); 27 77 } -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/w3c-import.log
r234723 r235923 25 25 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/idlharness.window.js 26 26 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/iframe-no-root.html 27 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold.html 27 28 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/inline-client-rect.html 28 29 /LayoutTests/imported/w3c/web-platform-tests/intersection-observer/isIntersecting-change-events.html
Note: See TracChangeset
for help on using the changeset viewer.