From e5612ba99fda73afa679327a6c6c5900b7d30bb8 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 18 Apr 2024 09:47:54 +0100 Subject: [PATCH 1/4] Wrap "activate view transition" with script prepare/clean up This ensures that we perform a microtask checkpoint (and set the incumbent script) right after resolving/rejecting the `ViewTransition` promises. It's necessary as those promises need to be resolved before the other rendering operations, mainly style/layout. --- source | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source b/source index 68971fdbade..a551be23c1e 100644 --- a/source +++ b/source @@ -102972,8 +102972,15 @@ location.href = '#foo'; data-x="dom-PageRevealEvent-viewTransition">viewTransition set to transition.

-
  • If transition is not null, then activate transition.

  • +
  • +

    If transition is not null, then:

    + +
      +
    1. Prepare to run a callback given document.

    2. +
    3. Activate transition.

    4. +
    5. Clean up after running a callback given document.

    6. +
    +
  • Though pagereveal is guaranteed to be fired From 9d0e2f8a031723768e9602532f5c81cc33f92b62 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 18 Apr 2024 09:59:24 +0100 Subject: [PATCH 2/4] Finish comment --- source | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source b/source index a551be23c1e..ad321d2fe83 100644 --- a/source +++ b/source @@ -102980,6 +102980,10 @@ location.href = '#foo';

  • Activate transition.

  • Clean up after running a callback given document.

  • + +

    Activating a view transition might resolve/reject promises, so by wrapping the + activation with prepare/cleanup we ensure those promises are handled before the next rendering + step.

    From 246ee546194d7d854e76ff05fbc1dc2ea0b2453b Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Fri, 19 Apr 2024 09:20:43 +0100 Subject: [PATCH 3/4] Use correct prepare/cleanup --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index ad321d2fe83..665f12aefbd 100644 --- a/source +++ b/source @@ -102976,9 +102976,9 @@ location.href = '#foo';

    If transition is not null, then:

      -
    1. Prepare to run a callback given document.

    2. +
    3. Prepare to run script given document.

    4. Activate transition.

    5. -
    6. Clean up after running a callback given document.

    7. +
    8. Clean up after running script given document.

    Activating a view transition might resolve/reject promises, so by wrapping the From b0d1bcb032b24a7fc8fbebaab624d0e442c336a7 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 11 Jul 2024 09:54:07 +0100 Subject: [PATCH 4/4] nits --- source | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source b/source index 665f12aefbd..9f61e58aa16 100644 --- a/source +++ b/source @@ -102977,11 +102977,13 @@ location.href = '#foo';

    1. Prepare to run script given document.

    2. +
    3. Activate transition.

    4. +
    5. Clean up after running script given document.

    -

    Activating a view transition might resolve/reject promises, so by wrapping the +

    Activating a view transition might resolve/reject promises, so by wrapping the activation with prepare/cleanup we ensure those promises are handled before the next rendering step.