Replace HistoryEntryReplacement with NavigationHistoryBehavior from the navigation API (#34681)

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
This commit is contained in:
shanehandley 2024-12-18 23:47:20 +11:00 committed by GitHub
parent 3cbc8c2442
commit 3a4e5d4245
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 127 additions and 108 deletions

View file

@ -31,8 +31,8 @@ use js::JSCLASS_IS_GLOBAL;
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use net_traits::request::Referrer;
use script_traits::{
AuxiliaryBrowsingContextLoadInfo, HistoryEntryReplacement, LoadData, LoadOrigin, NewLayoutInfo,
ScriptMsg,
AuxiliaryBrowsingContextLoadInfo, LoadData, LoadOrigin, NavigationHistoryBehavior,
NewLayoutInfo, ScriptMsg,
};
use serde::{Deserialize, Serialize};
use servo_url::{ImmutableOrigin, ServoUrl};
@ -526,12 +526,13 @@ impl WindowProxy {
referrer_policy,
Some(secure),
);
let replacement_flag = if new {
HistoryEntryReplacement::Enabled
let history_handling = if new {
NavigationHistoryBehavior::Replace
} else {
HistoryEntryReplacement::Disabled
NavigationHistoryBehavior::Push
};
target_window.load_url(replacement_flag, false, load_data, can_gc);
target_window.load_url(history_handling, false, load_data, can_gc);
}
if noopener {
// Step 15 (Dis-owning has been done in create_auxiliary_browsing_context).