Description
The spec reacts to promises in multiple places that I don't think it can do that in.
This is because
reacting to a promise performs
PerformPromiseThen, which, in step 4.a, calls
HostMakeJobCallback, which then accesses the
incumbent realm, which then fails an assertion in step 2.1.
As the comment there says, the incumbent realm concept can only be used from inside algorithms that were triggered by calling scripts or by Web IDL invoking a callback.
But the promise reactions here ultimately come from updating the rendering and from updating the visibility state in the HTML spec.
Neither of those are scripts or a WebIDL callback.
Both the reaction in skip the view transition, step 8 and the one in call the update callback, also step 8, managed to run into this in my testing.
Note that the latter only ran into this before I implemented the update callback queue, which I'm still a bit confused by.
Found while implementing this in the Ladybird browser.