diff --git a/source b/source index 0fd5aee694c..ecce5858cd9 100644 --- a/source +++ b/source @@ -4024,10 +4024,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • rendering suppression for view transitions
  • activate view transition
  • ViewTransition
  • -
  • resolving cross-document view-transition
  • +
  • resolving inbound cross-document view-transition
  • setting up a cross-document view-transition
  • can navigation trigger a cross-document view-transition? -
  • resolve @view-transition rule

    The term Document {

    A Document has a document unload timing info previous document unload timing.

    -

    A Document has a boolean was created via cross-origin redirects, +

    A Document has a boolean was created via cross-origin redirects, initially false.

    The document load timing info struct has the following

    source policy container
    a policy container
    - -
    view transition opt-in -
    a boolean

    To snapshot source snapshot params @@ -98248,11 +98244,6 @@ location.href = '#foo';

    source policy container
    sourceDocument's policy container
    - -
    view transition opt-in
    -
    false if the result of calling resolve @view-transition rule given - sourceDocument returns "skip transition"; otherwise true

    @@ -101905,166 +101896,13 @@ location.href = '#foo';
  • Otherwise:

    -

    This is a cross-document navigation: we check if the navigation can trigger a - view transition, unload the old document, and then proceed.

    -
      -
    1. Let potentiallyTriggerViewTransition be false.

    2. - -
    3. Let isBrowserUINavigation be true if - userInvolvementForNavigateEvent is "browser UI"; otherwise true.

    4. - -
    5. If sourceSnapshotParams is not null and sourceSnapshotParams's - view transition opt-in is - true, then set potentiallyTriggerViewTransition to the result of calling - can navigation trigger a cross-document view-transition? given - displayedDocument's origin, - targetEntry's document's origin, targetEntry's document's was created via cross-origin redirects, - navigationType, and isBrowserUINavigation. - -

    6. -

      Let firePageSwap be the following steps given a - ViewTransition-or-null viewTransition:

      - -
        -
      1. Assert: this is running as part of a task queued on displayedDocument's - relevant agent's event loop.

      2. - -
      3. Let navigation be displayedDocument's - relevant global object's navigation API.

      4. - -
      5. Let activation be null. - -

      6. -

        If targetEntry's document's origin is same origin with - displayedDocument's origin, then: - -

          -
        1. -

          Let destinationEntry be determined by switching on - navigationType:

          - -
          -
          "reload"
          -

          The current entry of - navigation

          - -
          "traverse"
          -

          The NavigationHistoryEntry in navigation's entry list whose session history entry is targetEntry

          - -
          "push"
          -
          "replace"
          -

          A new NavigationHistoryEntry in displayedDocument's relevant realm with its session history entry set to targetEntry.

          -
          -
        2. -
        3. -

          Set activation to a new NavigationActivation - created in displayedDocument's relevant - realm, with

          - -
          -
          old entry
          -
          the current entry of - navigation
          - -
          new entry
          -
          destinationEntry
          - -
          navigation type
          -
          navigationType
          -
          -
        4. -
        -
      7. - -
      8. Fire an event named - pageswap at document's - relevant global object, using PageSwapEvent with its activation set to activation, - and its viewTransition set to - viewTransition.

      9. -
      -
    7. - -
    8. -

      Let unloadSteps be the following steps given a boolean - shouldFirePageSwapBeforeUnload:

      - -
        -
      1. -

        Set the ongoing navigation for navigable to null.

        - -

        This allows new navigations of - navigable to start, whereas during the traversal they were blocked.

        -
      2. -
      3. Let firePageSwapStep be an algorithm that does nothing.

      4. - -
      5. If shouldFirePageSwapBeforeUnload is true, then set - firePageSwapStep to the following step: run - firePageSwap given null.

      6. - -
      7. Unload a document and its descendants given - displayedDocument, targetEntry's document, afterPotentialUnloads, and - firePageSwapStep.

        -
      -
    9. - -
    10. If potentiallyTriggerViewTransition is false, then run - unloadSteps given true.

    11. - -
    12. -

      Otherwise, queue a global task on the - navigation and traversal task source given navigable's active window to run the steps:

      - -
        -
      1. -

        Let proceedWithNavigationAfterViewTransitionCapture be the following - step:

        - -
          -
        1. -

          Append the - following step to traversable:

          - -
            -
          1. Run unloadSteps given false.

          2. -
          -
        2. -
        -
      2. - -
      3. Let viewTransition be the result of - setting up a cross-document view-transition given - displayedDocument, targetEntry's document, navigationType, and - proceedWithNavigationAfterViewTransitionCapture.

      4. - -
      5. Run firePageSwap given - viewTransition.

      6. - -
      7. -

        If viewTransition is null, then run - proceedWithNavigationAfterViewTransitionCapture.

        +
      8. Assert: navigationType is not null.

      9. -

        In the case where a view transition started, the view transitions - algorithms are responsible for calling - proceedWithNavigationAfterViewTransitionCapture.

        - -
      -
    13. +
    14. Deactivate + displayedDocument, given userNavigationInvolvement, + targetEntry, navigationType, and + afterPotentialUnloads.

  • @@ -102142,6 +101980,182 @@ location.href = '#foo';
  • Return "applied".

  • +

    To deactivate a document for a cross-document navigation given a + Document displayedDocument, a user navigation involvement + userNavigationInvolvement, a session history entry targetEntry, + a NavigationType navigationType, and afterPotentialUnloads, + which is an algorithm that receives no arguments:

    + +
      +
    1. Let navigable be displayedDocument's + node navigable.

    2. + +
    3. Let potentiallyTriggerViewTransition be false.

    4. + +
    5. Let isBrowserUINavigation be true if + userNavigationInvolvement is "browser UI"; otherwise false.

    6. + +
    7. Set potentiallyTriggerViewTransition to the result of calling + can navigation trigger a cross-document view-transition? given + displayedDocument, targetEntry's document, navigationType, and + isBrowserUINavigation.

    8. + +
    9. +

      If potentiallyTriggerViewTransition is false, then:

      + +
        +
      1. +

        Let firePageSwapBeforeUnload be the following step:

        + +
          +
        1. Fire the pageswap event given + displayedDocument, targetEntry, navigationType, and + null.

        2. +
        +
      2. + +
      3. +

        Set the ongoing navigation for navigable to null.

        + +

        This allows new navigations of + navigable to start, whereas during the traversal they were blocked.

        +
      4. + +
      5. Unload a document and its descendants given + displayedDocument, targetEntry's document, afterPotentialUnloads, and + firePageSwapBeforeUnload.

      6. +
      +
    10. + +
    11. +

      Otherwise, queue a global task on the + navigation and traversal task source given navigable's active window to run the steps:

      + +
        +
      1. +

        Let proceedWithNavigationAfterViewTransitionCapture be the following + step:

        + +
          +
        1. +

          Append the following session + history traversal steps to navigable's traversable navigable:

          + +
            +
          1. +

            Set the ongoing navigation for navigable to null.

            + +

            This allows new navigations of + navigable to start, whereas during the traversal they were blocked.

            +
          2. + +
          3. Unload a document and its descendants given + displayedDocument, targetEntry's document, and afterPotentialUnloads.

          4. +
          +
        2. +
        +
      2. + +
      3. Let viewTransition be the result of + setting up a cross-document view-transition given + displayedDocument, targetEntry's document, navigationType, and + proceedWithNavigationAfterViewTransitionCapture.

      4. + +
      5. Fire the pageswap event given + displayedDocument, targetEntry, navigationType, and + viewTransition.

        + +
      6. +

        If viewTransition is null, then run + proceedWithNavigationAfterViewTransitionCapture.

        + +

        In the case where a view transition started, the view transitions + algorithms are responsible for calling + proceedWithNavigationAfterViewTransitionCapture.

        +
      7. +
      +
    12. +
    + +

    To fire the pageswap event given a + Document displayedDocument, a session history entry + targetEntry, a NavigationType navigationType, and a + ViewTransition-or-null viewTransition:

    + +
      +
    1. Assert: this is running as part of a task queued on displayedDocument's + relevant agent's event loop.

    2. + +
    3. Let navigation be displayedDocument's + relevant global object's navigation API.

    4. + +
    5. Let activation be null.

    6. + +
    7. +

      If targetEntry's document's origin is same origin with + displayedDocument's origin, then: + +

        +
      1. +

        Let destinationEntry be determined by switching on + navigationType:

        + +
        +
        "reload"
        +

        The current entry of + navigation

        + +
        "traverse"
        +

        The NavigationHistoryEntry in navigation's entry list whose session history entry is targetEntry

        + +
        "push"
        +
        "replace"
        +

        A new NavigationHistoryEntry in displayedDocument's relevant realm with its session history entry set to targetEntry.

        +
        +
      2. +
      3. +

        Set activation to a new NavigationActivation + created in displayedDocument's relevant + realm, with

        + +
        +
        old entry
        +
        the current entry of + navigation
        + +
        new entry
        +
        destinationEntry
        + +
        navigation type
        +
        navigationType
        +
        +
      4. +
      +
    8. + +
    9. Fire an event named + pageswap at displayedDocument's + relevant global object, using PageSwapEvent with its activation set to activation, + and its viewTransition set to + viewTransition.

    10. +
    +

    To activate history entry session history entry entry for navigable navigable:

    @@ -102866,7 +102880,7 @@ location.href = '#foo';
  • Set document's has been revealed to true.

  • Let transition be the result of - resolving cross-document view-transition for document.

  • + resolving inbound cross-document view-transition for document.

  • Fire an event named pagereveal at document's