diff options
Diffstat (limited to 'components/script_traits/script_msg.rs')
-rw-r--r-- | components/script_traits/script_msg.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 48862e8378f..fe620247b0d 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -5,7 +5,6 @@ use crate::AnimationState; use crate::AuxiliaryBrowsingContextLoadInfo; use crate::DocumentState; -use crate::IFrameLoadInfo; use crate::IFrameLoadInfoWithData; use crate::LayoutControlMsg; use crate::LoadData; @@ -97,6 +96,15 @@ 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 { @@ -145,7 +153,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, bool), + LoadUrl(LoadData, HistoryEntryReplacement), /// Abort loading after sending a LoadUrl message. AbortLoadUrl, /// Post a message to the currently active window of a given browsing context. @@ -160,7 +168,7 @@ pub enum ScriptMsg { data: Vec<u8>, }, /// Inform the constellation that a fragment was navigated to and whether or not it was a replacement navigation. - NavigatedToFragment(ServoUrl, bool), + NavigatedToFragment(ServoUrl, HistoryEntryReplacement), /// HTMLIFrameElement Forward or Back traversal. TraverseHistory(TraversalDirection), /// Inform the constellation of a pushed history state. @@ -177,7 +185,7 @@ pub enum ScriptMsg { /// A load has been requested in an IFrame. ScriptLoadedURLInIFrame(IFrameLoadInfoWithData), /// A load of the initial `about:blank` has been completed in an IFrame. - ScriptNewIFrame(IFrameLoadInfo, IpcSender<LayoutControlMsg>), + ScriptNewIFrame(IFrameLoadInfoWithData, IpcSender<LayoutControlMsg>), /// Script has opened a new auxiliary browsing context. ScriptNewAuxiliary( AuxiliaryBrowsingContextLoadInfo, |