commit 8b358559a079b1330a51e2ca68619952179a1d3a parent ee81313552142c076e7421c8a3949ee9d3c9788f Author: Emilio Cobos Álvarez <emilio@crisal.io> Date: Sat, 22 Nov 2025 20:18:16 +0000 Bug 2001836 - Implement Document.activeViewTransition. r=webidl,smaug This implements a minor addition to the document interface as discussed in https://github.com/w3c/csswg-drafts/issues/12407. The change to the test prevents an error status due to an unhandled rejection of the ready promise. Differential Revision: https://phabricator.services.mozilla.com/D273727 Diffstat:
4 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/dom/webidl/Document.webidl b/dom/webidl/Document.webidl @@ -743,6 +743,8 @@ partial interface Document { partial interface Document { [Pref="dom.viewTransitions.enabled"] ViewTransition startViewTransition(optional ViewTransitionUpdateCallback updateCallback); + [Pref="dom.viewTransitions.enabled"] + readonly attribute ViewTransition? activeViewTransition; }; // https://github.com/w3c/csswg-drafts/pull/10767 for the name divergence in the spec diff --git a/testing/web-platform/meta/css/css-view-transitions/document-active-view-transition.html.ini b/testing/web-platform/meta/css/css-view-transitions/document-active-view-transition.html.ini @@ -1,3 +0,0 @@ -[document-active-view-transition.html] - [document.activeViewTransition returns the active transition] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-view-transitions/idlharness.html.ini b/testing/web-platform/meta/css/css-view-transitions/idlharness.html.ini @@ -62,12 +62,6 @@ [ViewTransitionTypeSet interface: setlike<DOMString>] expected: FAIL - [Document interface: document must inherit property "activeViewTransition" with the proper type] - expected: FAIL - - [Document interface: attribute activeViewTransition] - expected: FAIL - [ViewTransition interface: attribute transitionRoot] expected: FAIL diff --git a/testing/web-platform/tests/css/css-view-transitions/document-active-view-transition.html b/testing/web-platform/tests/css/css-view-transitions/document-active-view-transition.html @@ -42,5 +42,7 @@ promise_test(async t => { assert_equals(document.activeViewTransition, null, "activeViewTransition is null after transition is skipped"); + let [result] = await Promise.allSettled([transition2.ready]); + assert_equals(result.status, "rejected", "ready promise should be rejected due to skipTransition call"); }, "document.activeViewTransition returns the active transition"); </script>