Skip to content

Commit c1b9c88

Browse files
committed
Fixes w3c#9460
1 parent 0d9927d commit c1b9c88

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

css-view-transitions-1/Overview.bs

+6-5
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
179179

180180
1. Rendering paused.
181181

182-
1. Developer's {{UpdateCallback|updateCallback}} function is called,
182+
1. Developer's {{UpdateCallback|updateCallback}} function, if provided, is called,
183183
which updates the document state.
184184

185185
1. <code><var>viewTransition</var>.{{ViewTransition/updateCallbackDone}}</code> fulfills.
@@ -901,7 +901,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
901901

902902
<xmp class=idl>
903903
partial interface Document {
904-
ViewTransition startViewTransition(optional UpdateCallback? updateCallback = null);
904+
ViewTransition startViewTransition(optional UpdateCallback updateCallback);
905905
};
906906

907907
callback UpdateCallback = Promise<any> ();
@@ -912,12 +912,12 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
912912
:: Starts a new [=view transition=]
913913
(canceling the {{Document|document}}’s existing [=active view transition=], if any).
914914

915-
{{UpdateCallback|updateCallback}} is called asynchronously, once the current state of the document is captured.
915+
{{UpdateCallback|updateCallback}}, if provided, is called asynchronously, once the current state of the document is captured.
916916
Then, when the promise returned by {{UpdateCallback|updateCallback}} fulfills,
917917
the new state of the document is captured
918918
and the transition is initiated.
919919

920-
Note that {{UpdateCallback|updateCallback}} is *always* called,
920+
Note that {{UpdateCallback|updateCallback}}, if provided, is *always* called,
921921
even if the transition cannot happen
922922
(e.g. due to duplicate `view-transition-name` values).
923923
The transition is an enhancement around the state change, so a failure to create a transition never prevents the state change.
@@ -933,7 +933,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
933933

934934
1. Let |transition| be a new {{ViewTransition}} object in [=this's=] [=relevant Realm=].
935935

936-
1. Set |transition|'s [=ViewTransition/update callback=] to |updateCallback|.
936+
1. If |updateCallback| is provided, set |transition|'s [=ViewTransition/update callback=] to |updateCallback|.
937937

938938
1. Let |document| be [=this's=] [=relevant global object's=] [=associated document=].
939939

@@ -1884,6 +1884,7 @@ Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230
18841884
* Add mix-blend-mode to list of properties copied over to the ''::view-transition-group''. See <a href="https://github.com/w3c/csswg-drafts/issues/8962">issue 8962</a>.
18851885
* Add text-orientation to list of properties copied over to the ''::view-transition-group''. See <a href="https://github.com/w3c/csswg-drafts/issues/8230">issue 8230</a>.
18861886
* Refactor the old capture algorithm to properly set [=captured in a view transition=] before reading the value.
1887+
* Make the {{Document/startViewTransition()}} parameter non-nullable. See <a href="https://github.com/w3c/csswg-drafts/issues/9460">issue 9460</a>.
18871888

18881889
<h3 id="changes-since-2022-05-25">
18891890
Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230525/">2022-05-25 Working Draft</a>

css-view-transitions-2/Overview.bs

+7-5
Original file line numberDiff line numberDiff line change
@@ -333,20 +333,22 @@ The <dfn attribute for=RevealEvent>viewTransition</dfn> [=getter steps=] are to
333333

334334
partial interface Document {
335335

336-
ViewTransition startViewTransition((UpdateCallback or StartViewTransitionOptions?) callbackOptionsOrNull);
336+
ViewTransition startViewTransition(optional (UpdateCallback or StartViewTransitionOptions) callbackOptions);
337337
};
338338
</xmp>
339339

340340
### {{Document/startViewTransition(options)}} Method Steps ### {#ViewTransition-start-with-options}
341341

342342
<div algorithm="start-vt-with-options">
343-
The [=method steps=] for <dfn method for=Document>startViewTransition(|callbackOptionsOrNull|)</dfn> are as follows:
343+
The [=method steps=] for <dfn method for=Document>startViewTransition(|callbackOptions|)</dfn> are as follows:
344344

345-
1. If |callbackOptionsOrNull| is an {{UpdateCallback}} or null, then run the [=method steps=] for {{Document/startViewTransition(updateCallback)}} given |callbackOptionsOrNull| and return the result.
345+
1. If |callbackOptions| is not provided, then run the [=method steps=] for {{Document/startViewTransition()}} and return the result.
346346

347-
1. Let |viewTransition| be the result of running [=method steps=] for {{Document/startViewTransition(updateCallback)}} given |callbackOptionsOrNull|'s {{StartViewTransitionOptions/update}}.
347+
1. If |callbackOptions| is an {{UpdateCallback}}, then run the [=method steps=] for {{Document/startViewTransition(updateCallback)}} given |callbackOptions| and return the result.
348348

349-
1. Set |transition|'s [=ViewTransition/active types=] to |callbackOptionsOrNull|'s {{StartViewTransitionOptions/types}}.
349+
1. Let |viewTransition| be the result of running [=method steps=] for {{Document/startViewTransition(updateCallback)}} given |callbackOptions|'s {{StartViewTransitionOptions/update}}.
350+
351+
1. Set |transition|'s [=ViewTransition/active types=] to |callbackOptions|'s {{StartViewTransitionOptions/types}}.
350352

351353
1. Return |viewTransition|.
352354
</div>

0 commit comments

Comments
 (0)