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

@ -28,8 +28,8 @@ use webgpu::{wgc, WebGPU, WebGPUResponse};
use crate::{
AnimationState, AuxiliaryBrowsingContextLoadInfo, BroadcastMsg, DocumentState,
IFrameLoadInfoWithData, LoadData, MessagePortMsg, PortMessageTask, StructuredSerializedData,
WindowSizeType, WorkerGlobalScopeInit, WorkerScriptLoadOrigin,
IFrameLoadInfoWithData, LoadData, MessagePortMsg, NavigationHistoryBehavior, PortMessageTask,
StructuredSerializedData, WindowSizeType, WorkerGlobalScopeInit, WorkerScriptLoadOrigin,
};
/// An iframe sizing operation.
@ -83,15 +83,6 @@ pub enum LogEntry {
Warn(String),
}
/// <https://html.spec.whatwg.org/multipage/#replacement-enabled>
#[derive(Debug, Deserialize, Serialize)]
pub enum HistoryEntryReplacement {
/// Traverse the history with replacement enabled.
Enabled,
/// Traverse the history with replacement disabled.
Disabled,
}
/// Messages from the script to the constellation.
#[derive(Deserialize, Serialize)]
pub enum ScriptMsg {
@ -181,7 +172,7 @@ pub enum ScriptMsg {
LoadComplete,
/// A new load has been requested, with an option to replace the current entry once loaded
/// instead of adding a new entry.
LoadUrl(LoadData, HistoryEntryReplacement),
LoadUrl(LoadData, NavigationHistoryBehavior),
/// Abort loading after sending a LoadUrl message.
AbortLoadUrl,
/// Post a message to the currently active window of a given browsing context.
@ -199,7 +190,7 @@ pub enum ScriptMsg {
data: StructuredSerializedData,
},
/// Inform the constellation that a fragment was navigated to and whether or not it was a replacement navigation.
NavigatedToFragment(ServoUrl, HistoryEntryReplacement),
NavigatedToFragment(ServoUrl, NavigationHistoryBehavior),
/// HTMLIFrameElement Forward or Back traversal.
TraverseHistory(TraversalDirection),
/// Inform the constellation of a pushed history state.