Changeset 235923 in webkit


Ignore:
Timestamp:
Sep 11, 2018 5:17:24 PM (6 years ago)
Author:
ajuma@chromium.org
Message:

[IntersectionObserver] Update WPTs to the latest upstream version
https://bugs.webkit.org/show_bug.cgi?id=189515

Reviewed by Youenn Fablet.

  • web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.txt: Added.
  • web-platform-tests/intersection-observer/initial-observation-with-threshold.html: Added.
  • web-platform-tests/intersection-observer/resources/intersection-observer-test-utils.js:

(waitForNotification):

  • web-platform-tests/intersection-observer/w3c-import.log:
Location:
trunk/LayoutTests/imported/w3c
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r235920 r235923  
     12018-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
    1142018-09-11  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/resources/intersection-observer-test-utils.js

    r234723 r235923  
    77// - BeginFrame
    88//   - requestAnimationFrame handler runs
    9 //     - First step_timeout()
     9//     - Second requestAnimationFrame()
    1010//   - Style, layout, paint
    1111//   - IntersectionObserver generates new notifications
    1212//     - Posts a task to deliver notifications
    13 // - First step_timeout handler runs
    14 //   - Second step_timeout()
    1513// - Task to deliver IntersectionObserver notifications runs
    1614//   - IntersectionObserver callbacks run
    17 // - Second step_timeout handler runs
     15// - Second requestAnimationFrameHandler runs
     16//     - step_timeout()
     17// - step_timeout handler runs
    1818//   - myTestFunction1()
    1919//     - [optional] waitForNotification(myTestFunction2)
     
    2121//     - Verify newly-arrived IntersectionObserver notifications
    2222//     - [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.
    2373function waitForNotification(t, f) {
    2474  requestAnimationFrame(function() {
    25     t.step_timeout(function() { t.step_timeout(f); });
     75    requestAnimationFrame(function() { t.step_timeout(f); });
    2676  });
    2777}
  • trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/w3c-import.log

    r234723 r235923  
    2525/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/idlharness.window.js
    2626/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
    2728/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/inline-client-rect.html
    2829/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/isIntersecting-change-events.html
Note: See TracChangeset for help on using the changeset viewer.