Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,8 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
[Exposed=Window]
interface ViewTransition {
readonly attribute Promise<undefined> updateCallbackDone;
readonly attribute Promise<undefined> ready;
readonly attribute Promise<undefined> finished;
[SameObject] readonly attribute Promise<undefined> ready;
[SameObject] readonly attribute Promise<undefined> finished;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not valid Web IDL, technically. whatwg/webidl#71

undefined skipTransition();
};
</xmp>
Expand Down Expand Up @@ -1009,15 +1009,23 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;

: <dfn>ready promise</dfn>
:: a {{Promise}}.
Initially [=a new promise=] in [=this's=] [=relevant Realm=].
Initially [=a new promise=] in [=this's=] [=relevant Realm=], [=marked as handled=].

Note: This is [=marked as handled=] to avoid {{unhandledrejection}}s prior to the {{ViewTransition/ready}} property being accessed.

: <dfn>update callback done promise</dfn>
:: a {{Promise}}.
Initially [=a new promise=] in [=this's=] [=relevant Realm=].

Note: This promise is not initially [=marked as handled=],
so rejections will be {{unhandledrejection}}s,
even if the {{ViewTransition/updateCallbackDone}} property is not accessed.

: <dfn>finished promise</dfn>
:: a {{Promise}}.
Initially [=a new promise=] in [=this's=] [=relevant Realm=].
Initially [=a new promise=] in [=this's=] [=relevant Realm=], [=marked as handled=].

Note: This is [=marked as handled=] to avoid {{unhandledrejection}}s prior to the {{ViewTransition/finished}} property being accessed.

: <dfn>transition root pseudo-element</dfn>
:: a ''::view-transition''.
Expand All @@ -1032,9 +1040,12 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
[Discussion of this behavior](https://github.com/w3c/csswg-drafts/issues/8045).
</dl>

The {{ViewTransition/finished}} [=getter steps=] are to return [=this's=] [=ViewTransition/finished promise=].
The {{ViewTransition/finished}} [=getter steps=] are to return [=a promise resolved with=] [=this's=] [=ViewTransition/finished promise=].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will return a new promise each time, since the getter steps are run each time. (Even if [SameObject] were allowed, it doesn't do magic caching behavior for you; it's more of a code comment. See whatwg/webidl#212.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, TIL. I could have sworn I'd seen specs written assuming SameObject had this effect.


The {{ViewTransition/ready}} [=getter steps=] are to return [=a promise resolved with=] [=this's=] [=ViewTransition/ready promise=].

The {{ViewTransition/ready}} [=getter steps=] are to return [=this's=] [=ViewTransition/ready promise=].
Note: These properties return a new promise that is not [=marked as handled=].
They always return the same promise due to {{SameObject}}.

The {{ViewTransition/updateCallbackDone}} [=getter steps=] are to return [=this's=] [=ViewTransition/update callback done promise=].

Expand Down