diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-view-transitions/duplicate-tag-rejects-capture.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-view-transitions/duplicate-tag-rejects-capture.html')
-rw-r--r-- | testing/web-platform/tests/css/css-view-transitions/duplicate-tag-rejects-capture.html | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/duplicate-tag-rejects-capture.html b/testing/web-platform/tests/css/css-view-transitions/duplicate-tag-rejects-capture.html new file mode 100644 index 0000000000..951294babc --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/duplicate-tag-rejects-capture.html @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html> +<title>View transitions: duplicate tags in the old DOM skip the transition</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + contain: paint; +} +</style> + +<div id=first></div> +<div id=second></div> + +<script> +promise_test(async t => { + assert_implements(document.startViewTransition, "Missing document.startViewTransition"); + return new Promise((resolve, reject) => { + first.style = "view-transition-name: target"; + second.style = "view-transition-name: target"; + let transition = document.startViewTransition(); + + // Ready rejected first since invoking the dom callback is an async task. + let readyRejected = false; + transition.ready.then(reject, () => {readyRejected = true;}); + + // The domUpdate promise resolves (since there is no callback). + let updateCallbackDoneResolved = false; + transition.updateCallbackDone.then(() => { + assert_true(readyRejected, "ready not rejected before updateCallbackDone"); + updateCallbackDoneResolved = true; + }, reject); + + // Finally finish resolves. + transition.finished.then(() => { + assert_true(updateCallbackDoneResolved, "updateCallbackDone not resolved before finish"); + resolve(); + }, reject); + }); +}, "Two different elements with the same name in the old DOM should skip the transition"); +</script> |