Update web-platform-tests to revision 38bd28fe2368c650cf6e57be205cf3118dbd4997

This commit is contained in:
WPT Sync Bot 2019-02-25 20:41:08 -05:00
parent a28e15e4ea
commit 85fe63f512
165 changed files with 2144 additions and 2644 deletions

View file

@ -64,26 +64,56 @@ test(t => {
'elements in this document');
}, 'Test document.getAnimations with null target');
async_test(t => {
promise_test(async t => {
const iframe = document.createElement('iframe');
iframe.addEventListener("load", t.step_func_done(function() {
const div = createDiv(t, iframe.contentDocument)
const effect = new KeyframeEffect(div, null, 100 * MS_PER_SEC);
const anim = new Animation(effect, document.timeline);
anim.play();
// The animation's timeline is from the main document, but the effect's
// target element is part of the iframe document and that is what matters
// for getAnimations.
assert_equals(document.getAnimations().length, 0);
assert_equals(iframe.contentDocument.getAnimations().length, 1);
anim.finish();
}));
const eventWatcher = new EventWatcher(t, iframe, ['load']);
document.body.appendChild(iframe);
t.add_cleanup(function() { document.body.removeChild(iframe); });
t.add_cleanup(() => { document.body.removeChild(iframe); });
await eventWatcher.wait_for('load');
const div = createDiv(t, iframe.contentDocument)
const effect = new KeyframeEffect(div, null, 100 * MS_PER_SEC);
const anim = new Animation(effect, document.timeline);
anim.play();
// The animation's timeline is from the main document, but the effect's
// target element is part of the iframe document and that is what matters
// for getAnimations.
assert_equals(document.getAnimations().length, 0);
assert_equals(iframe.contentDocument.getAnimations().length, 1);
anim.finish();
}, 'Test document.getAnimations for elements inside same-origin iframes');
promise_test(async t => {
const div = createDiv(t);
const watcher = EventWatcher(t, div, 'transitionrun');
// Create a covering animation to prevent transitions from firing after
// calling getAnimations().
const coveringAnimation = new Animation(
new KeyframeEffect(div, { opacity: [0, 1] }, 100 * MS_PER_SEC)
);
// Setup transition start point.
div.style.transition = 'opacity 100s';
getComputedStyle(div).opacity;
// Update specified style but don't flush style.
div.style.opacity = '0.5';
// Fetch animations
document.getAnimations();
// Play the covering animation to ensure that only the call to
// getAnimations() has a chance to trigger transitions.
coveringAnimation.play();
// If getAnimations() flushed style, we should get a transitionrun event.
await watcher.wait_for('transitionrun');
}, 'Triggers a style change event');
</script>
</body>