// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// See https://drafts.csswg.org/css-view-transitions-1/
[
Exposed=Window,
ImplementedAs=DOMViewTransition
] interface ViewTransition {
// Skips the transition. This will cause the UpdateDOMCallback to run if it
// was not yet run. This will also reject ready and finished promises if they
// were not yet settled.
void skipTransition();
// The following promise indicates that the transition has finished.
[CallWith=ScriptState] readonly attribute Promise<undefined> finished;
// The following promise indicates that all the necessary steps have been
// completed and the transition will begin in the following frame. It is
// appropriate to use this promise to synchronize other animations with this
// transition.
[CallWith=ScriptState] readonly attribute Promise<undefined> ready;
// The following promise indicates that the callback given to the document
// has successfully run. Note that if the callback promise rejects, then this
// promise is rejected as well. In the case of a cross-document view
// transition (where this object is provided via an event), this Promise is
// resolved on creation.
[CallWith=ScriptState] readonly attribute Promise<undefined> updateCallbackDone;
// This will return a ViewTransitionTypeSet that represents the active list of types
// for this transition. These types are selectable using the
// :active-view-transition-type pseudo-class.
[RuntimeEnabled=ViewTransitionTypes] readonly attribute ViewTransitionTypeSet types;
};