Skip to content

Commit

Permalink
view-transition: Fix bugs with pre-render integration.
Browse files Browse the repository at this point in the history
This change fixes the following issues for ViewTransition + pre-render:

1. Explicitly track when we're running commit deferring conditions for
a pre-render. This is to allow using the tentative origin for
same-origin checks.

2. If the pre-render is cancelled after running commit deferring
conditions, disable ViewTransition for this navigation.

Finally add an assert to ensure that if we're sending the ViewTransition
state, the navigation *must* be same-origin.

Fixed: 326265171
Change-Id: I8b0e901318426f3e696e9f43a14921e985fe1cca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5329047
Commit-Queue: Khushal Sagar <[email protected]>
Auto-Submit: Khushal Sagar <[email protected]>
Reviewed-by: David Bokan <[email protected]>
Reviewed-by: Rakina Zata Amni <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1266420}
  • Loading branch information
khushalsagar authored and chromium-wpt-export-bot committed Feb 28, 2024
1 parent 8cefd14 commit b207ae4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions speculation-rules/prerender/resources/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function startPrerendering(url, rule_extras = {}) {
script.text = JSON.stringify(
{prerender: [{source: 'list', urls: [url], ...rule_extras}]});
document.head.appendChild(script);
return script;
}

class PrerenderChannel extends EventTarget {
Expand Down

0 comments on commit b207ae4

Please sign in to comment.