Skip to content

[css-view-transitions] State management seems broken in the spec #10822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
emilio opened this issue Sep 2, 2024 · 4 comments · Fixed by #10826
Closed

[css-view-transitions] State management seems broken in the spec #10822

emilio opened this issue Sep 2, 2024 · 4 comments · Fixed by #10826
Labels
css-view-transitions-1 View Transitions; Bugs only

Comments

@emilio
Copy link
Collaborator

emilio commented Sep 2, 2024

Per spec, this snippet calls the transition callback twice:

document.startViewTransition(async function() {
  console.log("cb");
  document.startViewTransition(() => {});
});

This is in fact what happens in Safari TP, and in my experimental Firefox implementation.

This is because call the update callback says:

  • Otherwise, set callbackPromise to the result of invoking transition’s update callback.
  • If transition’s phase is not "done", then set transition’s phase to "update-callback-called".

But that's already too late, because if something (like startViewTransition) skips the transition, the state is not "update-callback-called".

It seems for this specific case, just swapping those two steps should work. But might be worth looking at similar things in the spec.

cc @khushalsagar @vmpstr @mattwoodrow @nt1m

@emilio emilio added css-view-transitions-1 View Transitions; Bugs only Agenda+ labels Sep 2, 2024
@emilio
Copy link
Collaborator Author

emilio commented Sep 2, 2024

cc @noamr too.

@noamr
Copy link
Collaborator

noamr commented Sep 3, 2024

Good catch, I think swapping them should be sufficient, as the previous steps in call the update callback are just setup and don't have any effect.

@emilio
Copy link
Collaborator Author

emilio commented Sep 3, 2024

Yeah at first I was more concerned about this being a general problem, but this is the only place where I found the issue so far.

noamr added a commit to noamr/csswg-drafts that referenced this issue Sep 3, 2024
… calling the update callback.

This fixes an issue where skipping the transition from within
thet update callback would call the update callback twice.

Closes w3c#10822
nt1m added a commit to nt1m/WebKit that referenced this issue Sep 3, 2024
https://bugs.webkit.org/show_bug.cgi?id=279087
rdar://135226640

Reviewed by NOBODY (OOPS!).

This is currently a spec bug, see:
- w3c/csswg-drafts#10826
- w3c/csswg-drafts#10822

* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once-expected.xht: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once.html: Added.
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::callUpdateCallback):
@nt1m
Copy link
Member

nt1m commented Sep 3, 2024

I'm fixing this in WebKit with a WPT: WebKit/WebKit#33091

I'm not sure the exact wording of the current spec PR is right though (I commented there already)

nt1m added a commit to nt1m/WebKit that referenced this issue Sep 3, 2024
… times

https://bugs.webkit.org/show_bug.cgi?id=279087
rdar://135226640

Reviewed by NOBODY (OOPS!).

This is currently a spec bug, see:
- w3c/csswg-drafts#10826
- w3c/csswg-drafts#10822

* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once-expected.xht: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once.html: Added.
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::callUpdateCallback):
nt1m added a commit to nt1m/WebKit that referenced this issue Sep 4, 2024
… times

https://bugs.webkit.org/show_bug.cgi?id=279087
rdar://135226640

Reviewed by NOBODY (OOPS!).

This is currently a spec bug, see:
- w3c/csswg-drafts#10826
- w3c/csswg-drafts#10822

* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once-expected.xht: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once.html: Added.
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::callUpdateCallback):
Mossop pushed a commit to Mossop/gecko-unified that referenced this issue Sep 4, 2024
…s. r=boris,webidl,smaug

This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
w3c/csswg-drafts#10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
nt1m added a commit to nt1m/WebKit that referenced this issue Sep 4, 2024
… times

https://bugs.webkit.org/show_bug.cgi?id=279087
rdar://135226640

Reviewed by NOBODY (OOPS!).

This is currently a spec bug, see:
- w3c/csswg-drafts#10826
- w3c/csswg-drafts#10822

* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once-expected.xht: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once.html: Added.
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::callUpdateCallback):
nt1m added a commit to nt1m/WebKit that referenced this issue Sep 4, 2024
… times

https://bugs.webkit.org/show_bug.cgi?id=279087
rdar://135226640

Reviewed by NOBODY (OOPS!).

This is currently a spec bug, see:
- w3c/csswg-drafts#10826
- w3c/csswg-drafts#10822

* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once-expected.xht: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once.html: Added.
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::callUpdateCallback):
webkit-commit-queue pushed a commit to nt1m/WebKit that referenced this issue Sep 4, 2024
… times

https://bugs.webkit.org/show_bug.cgi?id=279087
rdar://135226640

Reviewed by Matt Woodrow.

This is currently a spec bug, see:
- w3c/csswg-drafts#10826
- w3c/csswg-drafts#10822

* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once-expected.xht: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-view-transitions/update-callback-called-once.html: Added.
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::callUpdateCallback):

Canonical link: https://commits.webkit.org/283167@main
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Sep 5, 2024
…s. r=boris,webidl,smaug

This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
w3c/csswg-drafts#10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
@noamr noamr closed this as completed in 86f20cc Sep 5, 2024
aosmond pushed a commit to aosmond/gecko that referenced this issue Sep 5, 2024
…s. r=boris,webidl,smaug

This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
w3c/csswg-drafts#10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
aosmond pushed a commit to aosmond/gecko that referenced this issue Sep 5, 2024
…s. r=boris,webidl,smaug

This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
w3c/csswg-drafts#10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Sep 6, 2024
…s. r=boris,webidl,smaug

This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
w3c/csswg-drafts#10822

Differential Revision: https://phabricator.services.mozilla.com/D220843

UltraBlame original commit: cadf4f0266df277312b21c23e63fef2366d0518e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Sep 6, 2024
…s. r=boris,webidl,smaug

This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
w3c/csswg-drafts#10822

Differential Revision: https://phabricator.services.mozilla.com/D220843

UltraBlame original commit: 43db974152a67814878f0814e7f6c5949dd907b7
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Sep 6, 2024
…s. r=boris,webidl,smaug

This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
w3c/csswg-drafts#10822

Differential Revision: https://phabricator.services.mozilla.com/D220843

UltraBlame original commit: cadf4f0266df277312b21c23e63fef2366d0518e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Sep 6, 2024
…s. r=boris,webidl,smaug

This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
w3c/csswg-drafts#10822

Differential Revision: https://phabricator.services.mozilla.com/D220843

UltraBlame original commit: 43db974152a67814878f0814e7f6c5949dd907b7
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Sep 7, 2024
…s. r=boris,webidl,smaug

This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
w3c/csswg-drafts#10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Sep 7, 2024
…s. r=boris,webidl,smaug

This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
w3c/csswg-drafts#10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
@astearns astearns moved this to TPAC/FTF agenda items in CSSWG Agenda TPAC 2024 Sep 13, 2024
@astearns astearns moved this from TPAC/FTF agenda items to Regular agenda items in CSSWG Agenda TPAC 2024 Sep 13, 2024
@astearns astearns moved this from Regular agenda items to Friday afternoon in CSSWG Agenda TPAC 2024 Sep 16, 2024
@noamr noamr removed the Agenda+ label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-view-transitions-1 View Transitions; Bugs only
Projects
None yet
3 participants