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-start.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-start.html')
-rw-r--r-- | testing/web-platform/tests/css/css-view-transitions/duplicate-tag-rejects-start.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/duplicate-tag-rejects-start.html b/testing/web-platform/tests/css/css-view-transitions/duplicate-tag-rejects-start.html new file mode 100644 index 0000000000..6c99d6426c --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/duplicate-tag-rejects-start.html @@ -0,0 +1,50 @@ +<!DOCTYPE html> +<html> +<title>View transitions: duplicate tags in the new 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"; + let transition = document.startViewTransition(() => { + first.style = "view-transition-name: target"; + second.style = "view-transition-name: target"; + }); + + // First updateCallbackDone resolves since the callback runs successfully. + let updateCallbackDoneResolved = false; + transition.updateCallbackDone.then(() => { updateCallbackDoneResolved = true; }, reject); + + // Then finished resolves since updateCallbackDone was already resolved. + let finishResolved = false; + transition.updateCallbackDone.then(() => { + assert_true(updateCallbackDoneResolved, "updateCallbackDone not resolved before finish"); + finishResolved = true; + }, reject); + + // Finally ready rejects. + transition.ready.then(reject, () => { + assert_true(finishResolved, "finish not resolved before ready"); + resolve(); + }); + }); +}, "Two different elements with the same name in the new DOM should skip the transition"); +</script> |