summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scroll-animations/css/support/testcommon.js
blob: 91540774d08a1b68a65ff68298f5dbff1ef674a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict';

/**
 * Returns a Promise that is resolved after a CSS scroll timeline is created (as
 * the result of a style change) and a snapshot has been taken, so that the
 * animation style is correctly reflected by getComputedStyle().
 * Technically, this only takes a full frame update. We implement this as two
 * requestAnimationFrame callbacks because the result will be available at the
 * beginning of the second frame.
 */
async function waitForCSSScrollTimelineStyle() {
  await waitForNextFrame();
  await waitForNextFrame();
}

function assert_implements_animation_timeline() {
  assert_implements(CSS.supports('animation-timeline:--foo'),
      'animation-timeline not supported');
}