Skip to content

Commit c9fdb0a

Browse files
committed
[css-view-transitions-1][editorial] Minor tweaks to API prose
1 parent 3182156 commit c9fdb0a

File tree

1 file changed

+28
-15
lines changed

1 file changed

+28
-15
lines changed

css-view-transitions-1/Overview.bs

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -884,19 +884,24 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
884884

885885
<dl class="domintro non-normative">
886886
: <code>{{ViewTransition|viewTransition}} = {{Document|document}}.{{startViewTransition}}({{UpdateCallback|updateCallback}})</code>
887-
:: Starts a new view transition.
887+
:: Starts a new [=view transition=]
888+
(canceling the {{Document|document}}’s existing [=active view transition=], if any).
888889

889890
{{UpdateCallback|updateCallback}} is called asynchronously, once the current state of the document is captured.
890-
Then, when the promise returned by {{UpdateCallback|updateCallback}} fulfills, the new state of the document is captured.
891+
Then, when the promise returned by {{UpdateCallback|updateCallback}} fulfills,
892+
the new state of the document is captured
893+
and the transition is initiated.
891894

892-
{{UpdateCallback|updateCallback}} is *always* called, even if the transition cannot happen (e.g. due to duplicate `view-transition-name` values).
895+
Note that {{UpdateCallback|updateCallback}} is *always* called,
896+
even if the transition cannot happen
897+
(e.g. due to duplicate `view-transition-name` values).
893898
The transition is an enhancement around the state change, so a failure to create a transition never prevents the state change.
894899
See [[#transitions-as-enhancements]] for more details on this principle.
895900

896901
If the promise returned by {{UpdateCallback|updateCallback}} rejects, the transition is skipped.
897902
</dl>
898903

899-
### {{Document/startViewTransition()}} ### {#ViewTransition-prepare}
904+
### {{Document/startViewTransition()}} Method Steps ### {#ViewTransition-prepare}
900905

901906
<div algorithm>
902907
The [=method steps=] for <dfn method for=Document>startViewTransition(|updateCallback|)</dfn> are as follows:
@@ -908,16 +913,19 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
908913
1. Let |document| be [=this's=] [=relevant global object's=] [=associated document=].
909914

910915
1. If |document|'s [=active view transition=] is not null,
911-
then [=skip the view transition=] |document|'s [=active view transition=]
916+
then [=skip the view transition|skip that view transition=]
912917
with an "{{AbortError}}" {{DOMException}} in [=this's=] [=relevant Realm=].
913918

914-
Note: This can result in two asynchronous [=ViewTransition/update callbacks=] running concurrently.
915-
One for the |document|'s current [=active view transition=], and another for this |transition|.
919+
Note: This can result in two asynchronous [=ViewTransition/update callbacks=] running concurrently
920+
(and therefore possibly out of sequence):
921+
one for the |document|'s current [=active view transition=], and another for this |transition|.
916922
As per the [design of this feature](#transitions-as-enhancements), it's assumed that the developer is using another feature or framework to correctly schedule these DOM changes.
917923

918924
1. Set |document|'s [=active view transition=] to |transition|.
919925

920-
Note: The process continues in [=setup view transition=], via [=perform pending transition operations=], which is called in [[#monkey-patch-to-rendering-algorithm]].
926+
Note: The [=view transition=] process continues in [=setup view transition=],
927+
via [=perform pending transition operations=],
928+
which is called in [[#monkey-patch-to-rendering-algorithm]].
921929

922930
1. Return |transition|.
923931
</div>
@@ -934,15 +942,15 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
934942
};
935943
</xmp>
936944

937-
Note: The {{ViewTransition}} represents and controls a single same-document transition.
938-
That is, it controls a transition where the starting and ending document are the same,
945+
The {{ViewTransition}} interface represents and controls a single same-document [=view transition=],
946+
i.e. a transition where the starting and ending document are the same,
939947
possibly with changes to the document's DOM structure.
940948

941949
<dl class="domintro non-normative">
942950
: <code>{{ViewTransition|viewTransition}}.{{ViewTransition/updateCallbackDone}}</code>
943951
:: A promise that fulfills when the promise returned by {{UpdateCallback|updateCallback}} fulfills, or rejects when it rejects.
944952

945-
The View Transition API wraps a DOM change and creates a transition.
953+
Note: The View Transition API wraps a DOM change and creates a visual transition.
946954
However, sometimes you don't care about the success/failure of the transition animation,
947955
you just want to know if and when the DOM change happens.
948956
{{ViewTransition/updateCallbackDone}} is for that use-case.
@@ -955,22 +963,27 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
955963
This can be due to misconfiguration, such as duplicate 'view-transition-name's,
956964
or if {{ViewTransition/updateCallbackDone}} returns a rejected promise.
957965

958-
The point that {{ViewTransition/ready}} fulfills is the ideal opportunity to animate the view transition pseudo-elements with the [[web-animations-1#extensions-to-the-element-interface|web animation API]].
966+
The point that {{ViewTransition/ready}} fulfills
967+
is the ideal opportunity to animate the [=view transition pseudo-elements=]
968+
with the [[web-animations-1#extensions-to-the-element-interface|Web Animation API]].
959969

960970
: <code>{{ViewTransition|viewTransition}}.{{ViewTransition/finished}}</code>
961971
:: A promise that fulfills once the end state is fully visible and interactive to the user.
962972

963973
It only rejects if {{UpdateCallback|updateCallback}} returns a rejected promise,
964974
as this indicates the end state wasn't created.
965975

966-
Otherwise, if a transition fails to begin, or is skipped (from skipTransition()), the end state is still reached,
976+
Otherwise, if a transition fails to begin,
977+
or is skipped (by {{ViewTransition/skipTransition()}}),
978+
the end state is still reached,
967979
so {{ViewTransition/finished}} fulfills.
968980

969981
: <code>{{ViewTransition|viewTransition}}.{{ViewTransition/skipTransition}}()</code>
970982
:: Immediately finish the transition, or prevent it starting.
971983

972984
This never prevents {{UpdateCallback|updateCallback}} being called,
973-
as the DOM change is separate to the transition. See [[#transitions-as-enhancements]] for more details on this principle.
985+
as the DOM change is independent of the transition.
986+
See [[#transitions-as-enhancements]] for more details on this principle.
974987

975988
If this is called before {{ViewTransition/ready}} resolves, {{ViewTransition/ready}} will reject.
976989

@@ -1038,7 +1051,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
10381051

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

1041-
### {{ViewTransition/skipTransition()}} ### {#ViewTransition-skipTransition}
1054+
### {{ViewTransition/skipTransition()}} Method Steps ### {#ViewTransition-skipTransition}
10421055

10431056
<div algorithm>
10441057
The [=method steps=] for <dfn method for="ViewTransition">skipTransition()</dfn> are:

0 commit comments

Comments
 (0)