-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web contentC-has-patch
Description
servo/components/script/dom/window.rs
Lines 2951 to 2974 in af8cc59
| // Step 11. If historyHandling is "auto", then: | |
| let resolved_history_handling = if history_handling == NavigationHistoryBehavior::Auto { | |
| // Step 11.1. If url equals navigable's active document's URL, and | |
| // initiatorOriginSnapshot is same origin with targetNavigable's active document's | |
| // origin, then set historyHandling to "replace". | |
| // Note: `targetNavigable` is not actually defined in the spec, "active document" is | |
| // assumed to be the correct reference based on WPT results | |
| if let LoadOrigin::Script(initiator_origin) = initiator_origin_snapshot { | |
| if load_data.url == doc.url() && initiator_origin.same_origin(doc.origin()) { | |
| NavigationHistoryBehavior::Replace | |
| } else { | |
| NavigationHistoryBehavior::Push | |
| } | |
| } else { | |
| // Step 11.2. Otherwise, set historyHandling to "push". | |
| NavigationHistoryBehavior::Push | |
| } | |
| // Step 12. If the navigation must be a replace given url and navigable's active | |
| // document, then set historyHandling to "replace". | |
| } else if load_data.url.scheme() == "javascript" || doc.is_initial_about_blank() { | |
| NavigationHistoryBehavior::Replace | |
| } else { | |
| NavigationHistoryBehavior::Push | |
| }; |
Step 12 of https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate doesn't agree with the logic implemented there. This makes code like location.replace(..) use push instead of replace, which looks like it makes /html/browsers/browsing-the-web/history-traversal/document-state.https.html behave incorrectly in #39545.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web contentC-has-patch