[csswg-drafts] [css-view-transitions-1] Calling of the update callback has multiple issues. (#11986)

Psychpsyo has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-view-transitions-1] Calling of the update callback has multiple issues. ==
Hello, I'm currently implementing this in the [Ladybird browser](https://github.com/LadybirdBrowser/ladybird) and:

1. [Flush the update callback queue](https://drafts.csswg.org/css-view-transitions-1/#flush-the-update-callback-queue) takes a document, but is never called with a document.
2. [Schedule the update callback](https://drafts.csswg.org/css-view-transitions-1/#schedule-the-update-callback) refers to "transition’s relevant settings object’s update callback queue".
The other specs are a bit hard to follow here, but it seems to me like an environment settings object is a different thing from a document, which is where the update callback queue lives.
If they are the same thing, this point can be ignored.
3. You have an assertion failure, here's the call stack:
[Step 18](https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model%3Aperform-pending-transition-operations) of **update the rendering** calls
[perform pending transition operations](https://drafts.csswg.org/css-view-transitions-1/#perform-pending-transition-operations), which calls
[setup view transition](https://drafts.csswg.org/css-view-transitions-1/#setup-view-transition), which, in step 2, calls
[flush the update callback queue](https://drafts.csswg.org/css-view-transitions-1/#flush-the-update-callback-queue), which calls
[call the update callback](https://drafts.csswg.org/css-view-transitions-1/#call-the-update-callback), which, in step 8,
[reacts to a promise](https://webidl.spec.whatwg.org/#dfn-perform-steps-once-promise-is-settled), which, in step 7, performs
[PerformPromiseThen](https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-performpromisethen), which, in step 4.a, calls
[HostMakeJobCallback](https://whatpr.org/html/9893/webappapis.html#hostmakejobcallback), which then accesses the
[incumbent realm](https://whatpr.org/html/9893/webappapis.html#concept-incumbent-realm), which fails the assertion in step 2.1.
This is because, as the comment there says, the incumbent realm concept can only be used from inside algorithms that were triggered by [calling scripts](https://whatpr.org/html/9893/webappapis.html#calling-scripts) or by Web IDL [invoking](https://webidl.spec.whatwg.org/#invoke-a-callback-function) a callback.
[Update the rendering](https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering) is neither. It is run as a global task on the rendering task source.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11986 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 22 March 2025 14:54:08 UTC