diff --git a/components/atoms/static_atoms.txt b/components/atoms/static_atoms.txt index e72e1e07b194..3554a2e7a3b0 100644 --- a/components/atoms/static_atoms.txt +++ b/components/atoms/static_atoms.txt @@ -52,6 +52,7 @@ password pause play playing +popstate print progress radio diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 016762b4b166..620e4b614601 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -111,7 +111,7 @@ use ipc_channel::ipc::{self, IpcSender, IpcReceiver}; use ipc_channel::router::ROUTER; use layout_traits::LayoutThreadFactory; use log::{Log, Level, LevelFilter, Metadata, Record}; -use msg::constellation_msg::{BrowsingContextId, TopLevelBrowsingContextId, PipelineId}; +use msg::constellation_msg::{BrowsingContextId, PipelineId, HistoryStateId, TopLevelBrowsingContextId}; use msg::constellation_msg::{Key, KeyModifiers, KeyState}; use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, TraversalDirection}; use net_traits::{self, IpcSend, FetchResponseMsg, ResourceThreads}; @@ -1073,6 +1073,15 @@ impl Constellation debug!("constellation got traverse history message from script"); self.handle_traverse_history_msg(source_top_ctx_id, direction); } + // Handle a push history state request. + FromScriptMsg::PushHistoryState(history_state_id) => { + debug!("constellation got push history state message from script"); + self.handle_push_history_state_msg(source_pipeline_id, history_state_id); + } + FromScriptMsg::ReplaceHistoryState(history_state_id) => { + debug!("constellation got replace history state message from script"); + self.handle_replace_history_state_msg(source_pipeline_id, history_state_id); + } // Handle a joint session history length request. FromScriptMsg::JointSessionHistoryLength(sender) => { debug!("constellation got joint session history length message from script"); @@ -1929,6 +1938,7 @@ impl Constellation direction: TraversalDirection) { let mut browsing_context_changes = HashMap::::new(); + let mut pipeline_changes = HashMap::>::new(); { let session_history = self.joint_session_histories .entry(top_level_browsing_context_id).or_insert(JointSessionHistory::new()); @@ -1945,7 +1955,14 @@ impl Constellation match diff { SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, ref new_reloader, .. } => { browsing_context_changes.insert(browsing_context_id, new_reloader.clone()); - } + }, + SessionHistoryDiff::PipelineDiff { ref pipeline_reloader, new_history_state_id, .. } => { + // TODO(cbrewster): Handle the case where the pipeline needs to be reloaded. + // We should use the history state URL to change the URL that is reloaded. + if let NeedsToReload::No(pipeline_id) = *pipeline_reloader { + pipeline_changes.insert(pipeline_id, Some(new_history_state_id)); + } + }, } session_history.past.push(diff); } @@ -1961,7 +1978,14 @@ impl Constellation match diff { SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, ref old_reloader, .. } => { browsing_context_changes.insert(browsing_context_id, old_reloader.clone()); - } + }, + SessionHistoryDiff::PipelineDiff { ref pipeline_reloader, old_history_state_id, .. } => { + // TODO(cbrewster): Handle the case where the pipeline needs to be reloaded. + // We should use the history state URL to change the URL that is reloaded. + if let NeedsToReload::No(pipeline_id) = *pipeline_reloader { + pipeline_changes.insert(pipeline_id, old_history_state_id); + } + }, } session_history.future.push(diff); } @@ -1973,6 +1997,10 @@ impl Constellation self.update_browsing_context(browsing_context_id, pipeline_id); } + for (pipeline_id, history_state_id) in pipeline_changes.drain() { + self.update_pipeline(pipeline_id, history_state_id); + } + self.notify_history_changed(top_level_browsing_context_id); self.trim_history(top_level_browsing_context_id); @@ -2048,6 +2076,20 @@ impl Constellation } } + fn update_pipeline(&mut self, pipeline_id: PipelineId, history_state_id: Option) { + let result = match self.pipelines.get_mut(&pipeline_id) { + None => return warn!("Pipeline {} history state updated after closure", pipeline_id), + Some(pipeline) => { + let msg = ConstellationControlMsg::UpdateHistoryStateId(pipeline_id, history_state_id); + pipeline.history_state_id = history_state_id; + pipeline.event_loop.send(msg) + }, + }; + if let Err(e) = result { + self.handle_send_error(pipeline_id, e); + } + } + fn handle_joint_session_history_length(&self, top_level_browsing_context_id: TopLevelBrowsingContextId, sender: IpcSender) @@ -2058,6 +2100,35 @@ impl Constellation let _ = sender.send(length as u32); } + fn handle_push_history_state_msg(&mut self, pipeline_id: PipelineId, history_state_id: HistoryStateId) { + let (top_level_browsing_context_id, old_state_id) = match self.pipelines.get_mut(&pipeline_id) { + Some(pipeline) => { + let old_history_state_id = pipeline.history_state_id; + pipeline.history_state_id = Some(history_state_id); + pipeline.history_states.insert(history_state_id); + (pipeline.top_level_browsing_context_id, old_history_state_id) + } + None => return warn!("Push history state {} for closed pipeline {}", history_state_id, pipeline_id), + }; + + let session_history = self.get_joint_session_history(top_level_browsing_context_id); + let diff = SessionHistoryDiff::PipelineDiff { + pipeline_reloader: NeedsToReload::No(pipeline_id), + new_history_state_id: history_state_id, + old_history_state_id: old_state_id, + }; + session_history.push_diff(diff); + } + + fn handle_replace_history_state_msg(&mut self, pipeline_id: PipelineId, history_state_id: HistoryStateId) { + match self.pipelines.get_mut(&pipeline_id) { + Some(pipeline) => { + pipeline.history_state_id = Some(history_state_id); + } + None => return warn!("Replace history state {} for closed pipeline {}", history_state_id, pipeline_id), + } + } + fn handle_key_msg(&mut self, ch: Option, key: Key, state: KeyState, mods: KeyModifiers) { // Send to the explicitly focused pipeline. If it doesn't exist, fall back to sending to // the compositor. @@ -2311,38 +2382,44 @@ impl Constellation // If LoadData was ignored, use the LoadData of the previous SessionHistoryEntry, which // is the LoadData of the parent browsing context. let resolve_load_data_future = |previous_load_data: &mut LoadData, diff: &SessionHistoryDiff| { - let SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, ref new_reloader, .. } = *diff; - - if browsing_context_id == top_level_browsing_context_id { - let load_data = match *new_reloader { - NeedsToReload::No(pipeline_id) => match self.pipelines.get(&pipeline_id) { - Some(pipeline) => pipeline.load_data.clone(), - None => previous_load_data.clone(), - }, - NeedsToReload::Yes(_, ref load_data) => load_data.clone(), - }; - *previous_load_data = load_data.clone(); - Some(load_data) - } else { - Some(previous_load_data.clone()) + match *diff { + SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, ref new_reloader, .. } => { + if browsing_context_id == top_level_browsing_context_id { + let load_data = match *new_reloader { + NeedsToReload::No(pipeline_id) => match self.pipelines.get(&pipeline_id) { + Some(pipeline) => pipeline.load_data.clone(), + None => previous_load_data.clone(), + }, + NeedsToReload::Yes(_, ref load_data) => load_data.clone(), + }; + *previous_load_data = load_data.clone(); + Some(load_data) + } else { + Some(previous_load_data.clone()) + } + }, + SessionHistoryDiff::PipelineDiff { .. } => Some(previous_load_data.clone()), } }; let resolve_load_data_past = |previous_load_data: &mut LoadData, diff: &SessionHistoryDiff| { - let SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, ref old_reloader, .. } = *diff; - - if browsing_context_id == top_level_browsing_context_id { - let load_data = match *old_reloader { - NeedsToReload::No(pipeline_id) => match self.pipelines.get(&pipeline_id) { - Some(pipeline) => pipeline.load_data.clone(), - None => previous_load_data.clone(), - }, - NeedsToReload::Yes(_, ref load_data) => load_data.clone(), - }; - *previous_load_data = load_data.clone(); - Some(load_data) - } else { - Some(previous_load_data.clone()) + match *diff { + SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, ref old_reloader, .. } => { + if browsing_context_id == top_level_browsing_context_id { + let load_data = match *old_reloader { + NeedsToReload::No(pipeline_id) => match self.pipelines.get(&pipeline_id) { + Some(pipeline) => pipeline.load_data.clone(), + None => previous_load_data.clone(), + }, + NeedsToReload::Yes(_, ref load_data) => load_data.clone(), + }; + *previous_load_data = load_data.clone(); + Some(load_data) + } else { + Some(previous_load_data.clone()) + } + }, + SessionHistoryDiff::PipelineDiff { .. } => Some(previous_load_data.clone()), } }; @@ -2433,7 +2510,10 @@ impl Constellation }; session_history.push_diff(diff).into_iter() - .map(|SessionHistoryDiff::BrowsingContextDiff { new_reloader, .. }| new_reloader) + .filter_map(|diff| match diff { + SessionHistoryDiff::BrowsingContextDiff { new_reloader, .. } => Some(new_reloader), + SessionHistoryDiff::PipelineDiff { .. } => None, + }) .filter_map(|pipeline_id| pipeline_id.alive_pipeline_id()) .collect::>() }; diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 0e54e6649ba1..548ef249cdc6 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -16,7 +16,8 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; use layout_traits::LayoutThreadFactory; use metrics::PaintTimeMetrics; -use msg::constellation_msg::{BrowsingContextId, TopLevelBrowsingContextId, PipelineId, PipelineNamespaceId}; +use msg::constellation_msg::{BrowsingContextId, HistoryStateId, PipelineId, PipelineNamespaceId}; +use msg::constellation_msg::TopLevelBrowsingContextId; use net::image_cache::ImageCacheImpl; use net_traits::{IpcSend, ResourceThreads}; use net_traits::image_cache::ImageCache; @@ -30,7 +31,7 @@ use script_traits::{ScriptThreadFactory, TimerSchedulerMsg, WindowSizeData}; use servo_config::opts::{self, Opts}; use servo_config::prefs::{PREFS, Pref}; use servo_url::ServoUrl; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; #[cfg(not(windows))] use std::env; use std::ffi::OsStr; @@ -92,6 +93,12 @@ pub struct Pipeline { /// The Load Data used to create this pipeline. pub load_data: LoadData, + + /// The active history state for this pipeline. + pub history_state_id: Option, + + /// The history states owned by this pipeline. + pub history_states: HashSet, } /// Initial setup data needed to construct a pipeline. @@ -157,7 +164,6 @@ pub struct InitialPipelineState { /// Information about the page to load. pub load_data: LoadData, - /// The ID of the pipeline namespace for this script thread. pub pipeline_namespace_id: PipelineNamespaceId, @@ -333,6 +339,8 @@ impl Pipeline { visible: visible, is_private: is_private, load_data: load_data, + history_state_id: None, + history_states: HashSet::new(), }; pipeline.notify_visibility(); diff --git a/components/constellation/session_history.rs b/components/constellation/session_history.rs index e297acd1c211..44112ffe6c69 100644 --- a/components/constellation/session_history.rs +++ b/components/constellation/session_history.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId}; +use msg::constellation_msg::{BrowsingContextId, HistoryStateId, PipelineId, TopLevelBrowsingContextId}; use script_traits::LoadData; use std::{fmt, mem}; use std::cmp::PartialEq; @@ -44,11 +44,21 @@ impl JointSessionHistory { } pub fn remove_entries_for_browsing_context(&mut self, context_id: BrowsingContextId) { - self.past.retain(|&SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, .. }| { - browsing_context_id != context_id + self.past.retain(|diff| { + match diff { + SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, .. } => { + *browsing_context_id != context_id + }, + SessionHistoryDiff::PipelineDiff { .. } => true, + } }); - self.future.retain(|&SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, .. }| { - browsing_context_id != context_id + self.future.retain(|diff| { + match diff { + SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, .. } => { + *browsing_context_id != context_id + }, + SessionHistoryDiff::PipelineDiff { .. } => true, + } }); } } @@ -130,6 +140,15 @@ pub enum SessionHistoryDiff { /// The next pipeline (used when traversing into the future) new_reloader: NeedsToReload, }, + /// Represents a diff where the active state of a pipeline changed. + PipelineDiff { + /// The pipeline whose history state changed. + pipeline_reloader: NeedsToReload, + /// The old history state id. + old_history_state_id: Option, + /// The new history state id. + new_history_state_id: HistoryStateId, + }, } impl SessionHistoryDiff { @@ -141,7 +160,8 @@ impl SessionHistoryDiff { NeedsToReload::No(pipeline_id) => Some(pipeline_id), NeedsToReload::Yes(..) => None, } - } + }, + SessionHistoryDiff::PipelineDiff { .. } => None, } } @@ -153,7 +173,8 @@ impl SessionHistoryDiff { NeedsToReload::No(pipeline_id) => Some(pipeline_id), NeedsToReload::Yes(..) => None, } - } + }, + SessionHistoryDiff::PipelineDiff { .. } => None, } } @@ -168,6 +189,11 @@ impl SessionHistoryDiff { *new_reloader = reloader.clone(); } } + SessionHistoryDiff::PipelineDiff { ref mut pipeline_reloader, .. } => { + if *pipeline_reloader == *replaced_reloader { + *pipeline_reloader = reloader.clone(); + } + } } } } diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index 0bc884350725..f7dab637298a 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -213,6 +213,13 @@ impl PipelineNamespace { index: BrowsingContextIndex(self.next_index()), } } + + fn next_history_state_id(&mut self) -> HistoryStateId { + HistoryStateId { + namespace_id: self.id, + index: HistoryStateIndex(self.next_index()), + } + } } thread_local!(pub static PIPELINE_NAMESPACE: Cell> = Cell::new(None)); @@ -351,6 +358,35 @@ impl PartialEq for TopLevelBrowsingContextId { } } +#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] +pub struct HistoryStateIndex(pub NonZeroU32); +malloc_size_of_is_0!(HistoryStateIndex); + +#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd, Serialize)] +pub struct HistoryStateId { + pub namespace_id: PipelineNamespaceId, + pub index: HistoryStateIndex, +} + +impl HistoryStateId { + pub fn new() -> HistoryStateId { + PIPELINE_NAMESPACE.with(|tls| { + let mut namespace = tls.get().expect("No namespace set for this thread!"); + let next_history_state_id = namespace.next_history_state_id(); + tls.set(Some(namespace)); + next_history_state_id + }) + } +} + +impl fmt::Display for HistoryStateId { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + let PipelineNamespaceId(namespace_id) = self.namespace_id; + let HistoryStateIndex(index) = self.index; + write!(fmt, "({},{})", namespace_id, index.get()) + } +} + // We provide ids just for unit testing. pub const TEST_NAMESPACE: PipelineNamespaceId = PipelineNamespaceId(1234); #[allow(unsafe_code)] diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index f1d18bda464d..a8efbc4d2977 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -32,7 +32,7 @@ use hyper::status::StatusCode; use hyper_openssl::OpensslClient; use hyper_serde::Serde; use log; -use msg::constellation_msg::PipelineId; +use msg::constellation_msg::{HistoryStateId, PipelineId}; use net_traits::{CookieSource, FetchMetadata, NetworkError, ReferrerPolicy}; use net_traits::request::{CacheMode, CredentialsMode, Destination, Origin}; use net_traits::request::{RedirectMode, Referrer, Request, RequestMode}; @@ -40,7 +40,7 @@ use net_traits::request::{ResponseTainting, ServiceWorkersMode}; use net_traits::response::{HttpsState, Response, ResponseBody, ResponseType}; use resource_thread::AuthCache; use servo_url::{ImmutableOrigin, ServoUrl}; -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; use std::error::Error; use std::io::{self, Read, Write}; use std::iter::FromIterator; @@ -73,6 +73,7 @@ pub struct HttpState { pub cookie_jar: RwLock, pub http_cache: RwLock, pub auth_cache: RwLock, + pub history_states: RwLock>>, pub ssl_client: OpensslClient, pub connector: Pool, } @@ -83,6 +84,7 @@ impl HttpState { hsts_list: RwLock::new(HstsList::new()), cookie_jar: RwLock::new(CookieStorage::new(150)), auth_cache: RwLock::new(AuthCache::new()), + history_states: RwLock::new(HashMap::new()), http_cache: RwLock::new(HttpCache::new()), ssl_client: ssl_client.clone(), connector: create_http_connector(ssl_client), diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs index 8060b811beda..f070f58235d5 100644 --- a/components/net/resource_thread.rs +++ b/components/net/resource_thread.rs @@ -131,6 +131,7 @@ fn create_http_states(config_dir: Option<&Path>) -> (Arc, Arc { + let history_states = http_state.history_states.read().unwrap(); + consumer.send(history_states.get(&history_state_id).cloned()).unwrap(); + } + CoreResourceMsg::SetHistoryState(history_state_id, history_state) => { + let mut history_states = http_state.history_states.write().unwrap(); + history_states.insert(history_state_id, history_state); + } CoreResourceMsg::Synchronize(sender) => { let _ = sender.send(()); } diff --git a/components/net_traits/lib.rs b/components/net_traits/lib.rs index 4fb8d28115f4..e831892e144a 100644 --- a/components/net_traits/lib.rs +++ b/components/net_traits/lib.rs @@ -34,6 +34,7 @@ use hyper_serde::Serde; use ipc_channel::Error as IpcError; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::router::ROUTER; +use msg::constellation_msg::HistoryStateId; use request::{Request, RequestInit}; use response::{HttpsState, Response, ResponseInit}; use servo_url::ServoUrl; @@ -363,6 +364,10 @@ pub enum CoreResourceMsg { GetCookiesForUrl(ServoUrl, IpcSender>, CookieSource), /// Get a cookie by name for a given originating URL GetCookiesDataForUrl(ServoUrl, IpcSender>>>, CookieSource), + /// Get a history state by a given history state id + GetHistoryState(HistoryStateId, IpcSender>>), + /// Set a history state for a given history state id + SetHistoryState(HistoryStateId, Vec), /// Synchronization message solely for knowing the state of the ResourceChannelManager loop Synchronize(IpcSender<()>), /// Send the network sender in constellation to CoreResourceThread diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 44369fef756f..a12d9f5140af 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -65,7 +65,7 @@ use js::rust::{GCMethods, Handle, Runtime}; use js::typedarray::TypedArray; use js::typedarray::TypedArrayElement; use metrics::{InteractiveMetrics, InteractiveWindow}; -use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId}; +use msg::constellation_msg::{BrowsingContextId, HistoryStateId, PipelineId, TopLevelBrowsingContextId}; use net_traits::{Metadata, NetworkError, ReferrerPolicy, ResourceThreads}; use net_traits::filemanager_thread::RelativePos; use net_traits::image::base::{Image, ImageMetadata}; @@ -356,7 +356,7 @@ unsafe_no_jsmanaged_fields!(PropertyDeclarationBlock); // These three are interdependent, if you plan to put jsmanaged data // in one of these make sure it is propagated properly to containing structs unsafe_no_jsmanaged_fields!(DocumentActivity, WindowSizeData, WindowSizeType); -unsafe_no_jsmanaged_fields!(BrowsingContextId, PipelineId, TopLevelBrowsingContextId); +unsafe_no_jsmanaged_fields!(BrowsingContextId, HistoryStateId, PipelineId, TopLevelBrowsingContextId); unsafe_no_jsmanaged_fields!(TimerEventId, TimerSource); unsafe_no_jsmanaged_fields!(TimelineMarkerType); unsafe_no_jsmanaged_fields!(WorkerId); diff --git a/components/script/dom/history.rs b/components/script/dom/history.rs index 4b296fb236fb..b158a9d44fd7 100644 --- a/components/script/dom/history.rs +++ b/components/script/dom/history.rs @@ -12,15 +12,20 @@ use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object}; use dom::bindings::root::{Dom, DomRoot}; use dom::bindings::str::{DOMString, USVString}; use dom::bindings::structuredclone::StructuredCloneData; +use dom::eventtarget::EventTarget; use dom::globalscope::GlobalScope; +use dom::popstateevent::PopStateEvent; use dom::window::Window; use dom_struct::dom_struct; use js::jsapi::{Heap, JSContext}; use js::jsval::{JSVal, NullValue, UndefinedValue}; use js::rust::HandleValue; -use msg::constellation_msg::TraversalDirection; +use msg::constellation_msg::{HistoryStateId, TraversalDirection}; +use net_traits::{CoreResourceMsg, IpcSend}; +use profile_traits::ipc; use profile_traits::ipc::channel; use script_traits::ScriptMsg; +use std::cell::Cell; enum PushOrReplace { Push, @@ -33,6 +38,7 @@ pub struct History { reflector_: Reflector, window: Dom, state: Heap, + state_id: Cell>, } impl History { @@ -43,6 +49,7 @@ impl History { reflector_: Reflector::new(), window: Dom::from_ref(&window), state: state, + state_id: Cell::new(None), } } @@ -63,6 +70,38 @@ impl History { Ok(()) } + #[allow(unsafe_code)] + pub fn activate_state(&self, state_id: Option) { + self.state_id.set(state_id); + let serialized_data = match state_id { + Some(state_id) => { + let (tx, rx) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap(); + let _ = self.window + .upcast::() + .resource_threads() + .send(CoreResourceMsg::GetHistoryState(state_id, tx)); + rx.recv().unwrap() + }, + None => None, + }; + + match serialized_data { + Some(serialized_data) => { + let global_scope = self.window.upcast::(); + rooted!(in(global_scope.get_cx()) let mut state = UndefinedValue()); + StructuredCloneData::Vector(serialized_data).read(&global_scope, state.handle_mut()); + self.state.set(state.get()); + }, + None => { + self.state.set(NullValue()); + } + } + + unsafe { + PopStateEvent::dispatch_jsval(self.window.upcast::(), &*self.window, self.state.handle()); + } + } + // https://html.spec.whatwg.org/multipage/#dom-history-pushstate // https://html.spec.whatwg.org/multipage/#dom-history-replacestate fn push_or_replace_state(&self, @@ -70,7 +109,7 @@ impl History { data: HandleValue, _title: DOMString, _url: Option, - _push_or_replace: PushOrReplace) -> ErrorResult { + push_or_replace: PushOrReplace) -> ErrorResult { // Step 1 let document = self.window.Document(); @@ -85,13 +124,40 @@ impl History { // TODO: Step 4 // Step 5 - let serialized_data = StructuredCloneData::write(cx, data)?; + let serialized_data = StructuredCloneData::write(cx, data)?.move_to_arraybuffer(); // TODO: Steps 6-7 Url Handling // https://github.com/servo/servo/issues/19157 - // TODO: Step 8 Push/Replace session history entry - // https://github.com/servo/servo/issues/19156 + // Step 8 + let state_id = match push_or_replace { + PushOrReplace::Push => { + let state_id = HistoryStateId::new(); + self.state_id.set(Some(state_id)); + let msg = ScriptMsg::PushHistoryState(state_id); + let _ = self.window.upcast::().script_to_constellation_chan().send(msg); + state_id + }, + PushOrReplace::Replace => { + let state_id = match self.state_id.get() { + Some(state_id) => state_id, + None => { + let state_id = HistoryStateId::new(); + self.state_id.set(Some(state_id)); + state_id + }, + }; + let msg = ScriptMsg::ReplaceHistoryState(state_id); + let _ = self.window.upcast::().script_to_constellation_chan().send(msg); + state_id + }, + }; + + let _ = self.window + .upcast::() + .resource_threads() + .send(CoreResourceMsg::SetHistoryState(state_id, serialized_data.clone())); + // TODO: Step 9 Update current entry to represent a GET request // https://github.com/servo/servo/issues/19156 @@ -102,7 +168,7 @@ impl History { // Step 11 let global_scope = self.window.upcast::(); rooted!(in(cx) let mut state = UndefinedValue()); - serialized_data.read(&global_scope, state.handle_mut()); + StructuredCloneData::Vector(serialized_data).read(&global_scope, state.handle_mut()); // Step 12 self.state.set(state.get()); diff --git a/components/script/dom/popstateevent.rs b/components/script/dom/popstateevent.rs index e483a9a55a51..a10d19e30021 100644 --- a/components/script/dom/popstateevent.rs +++ b/components/script/dom/popstateevent.rs @@ -12,6 +12,7 @@ use dom::bindings::root::DomRoot; use dom::bindings::str::DOMString; use dom::bindings::trace::RootedTraceableBox; use dom::event::Event; +use dom::eventtarget::EventTarget; use dom::window::Window; use dom_struct::dom_struct; use js::jsapi::{Heap, JSContext}; @@ -66,6 +67,13 @@ impl PopStateEvent { init.parent.cancelable, init.state.handle())) } + + pub fn dispatch_jsval(target: &EventTarget, + window: &Window, + state: HandleValue) { + let event = PopStateEvent::new(window, atom!("popstate"), true, false, state); + event.upcast::().fire(target); + } } impl PopStateEventMethods for PopStateEvent { diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 6244228dc99f..c188caed3532 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -76,7 +76,8 @@ use js::jsapi::{JSTracer, SetWindowProxyClass}; use js::jsval::UndefinedValue; use metrics::{MAX_TASK_NS, PaintTimeMetrics}; use microtask::{MicrotaskQueue, Microtask}; -use msg::constellation_msg::{BrowsingContextId, PipelineId, PipelineNamespace, TopLevelBrowsingContextId}; +use msg::constellation_msg::{BrowsingContextId, HistoryStateId, PipelineId}; +use msg::constellation_msg::{PipelineNamespace, TopLevelBrowsingContextId}; use net_traits::{FetchMetadata, FetchResponseListener, FetchResponseMsg}; use net_traits::{Metadata, NetworkError, ReferrerPolicy, ResourceThreads}; use net_traits::image_cache::{ImageCache, PendingImageResponse}; @@ -1168,6 +1169,7 @@ impl ScriptThread { Navigate(id, ..) => Some(id), PostMessage(id, ..) => Some(id), UpdatePipelineId(_, _, id, _) => Some(id), + UpdateHistoryStateId(id, ..) => Some(id), FocusIFrame(id, ..) => Some(id), WebDriverScriptCommand(id, ..) => Some(id), TickAllAnimations(id) => Some(id), @@ -1294,6 +1296,8 @@ impl ScriptThread { browsing_context_id, new_pipeline_id, reason), + ConstellationControlMsg::UpdateHistoryStateId(pipeline_id, history_state_id) => + self.handle_update_history_state_id_msg(pipeline_id, history_state_id), ConstellationControlMsg::FocusIFrame(parent_pipeline_id, frame_id) => self.handle_focus_iframe_msg(parent_pipeline_id, frame_id), ConstellationControlMsg::WebDriverScriptCommand(pipeline_id, msg) => @@ -1672,6 +1676,13 @@ impl ScriptThread { } } + fn handle_update_history_state_id_msg(&self, pipeline_id: PipelineId, history_state_id: Option) { + match { self.documents.borrow().find_window(pipeline_id) } { + None => return warn!("update history state after pipeline {} closed.", pipeline_id), + Some(window) => window.History().r().activate_state(history_state_id), + } + } + /// Window was resized, but this script was not active, so don't reflow yet fn handle_resize_inactive_msg(&self, id: PipelineId, new_size: WindowSizeData) { let window = self.documents.borrow().find_window(id) diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index c65ad10be4b1..d270d87a50c1 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -48,8 +48,8 @@ use hyper::method::Method; use ipc_channel::{Error as IpcError}; use ipc_channel::ipc::{IpcReceiver, IpcSender}; use libc::c_void; -use msg::constellation_msg::{BrowsingContextId, TopLevelBrowsingContextId, Key, KeyModifiers, KeyState}; -use msg::constellation_msg::{PipelineId, PipelineNamespaceId, TraversalDirection}; +use msg::constellation_msg::{BrowsingContextId, HistoryStateId, Key, KeyModifiers, KeyState, PipelineId}; +use msg::constellation_msg::{PipelineNamespaceId, TraversalDirection, TopLevelBrowsingContextId}; use net_traits::{FetchResponseMsg, ReferrerPolicy, ResourceThreads}; use net_traits::image::base::Image; use net_traits::image::base::PixelFormat; @@ -289,6 +289,8 @@ pub enum ConstellationControlMsg { /// Updates the current pipeline ID of a given iframe. /// First PipelineId is for the parent, second is the new PipelineId for the frame. UpdatePipelineId(PipelineId, BrowsingContextId, PipelineId, UpdatePipelineIdReason), + /// Updates the history state of a given pipeline. + UpdateHistoryStateId(PipelineId, Option), /// Set an iframe to be focused. Used when an element in an iframe gains focus. /// PipelineId is for the parent, BrowsingContextId is for the nested browsing context FocusIFrame(PipelineId, BrowsingContextId), @@ -343,6 +345,7 @@ impl fmt::Debug for ConstellationControlMsg { Navigate(..) => "Navigate", PostMessage(..) => "PostMessage", UpdatePipelineId(..) => "UpdatePipelineId", + UpdateHistoryStateId(..) => "UpdateHistoryStateId", FocusIFrame(..) => "FocusIFrame", WebDriverScriptCommand(..) => "WebDriverScriptCommand", TickAllAnimations(..) => "TickAllAnimations", diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 9c53052fa580..43812ad097a2 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -16,7 +16,7 @@ use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId}; use euclid::{Size2D, TypedSize2D}; use gfx_traits::Epoch; use ipc_channel::ipc::{IpcReceiver, IpcSender}; -use msg::constellation_msg::{BrowsingContextId, PipelineId, TraversalDirection}; +use msg::constellation_msg::{BrowsingContextId, HistoryStateId, PipelineId, TraversalDirection}; use msg::constellation_msg::{Key, KeyModifiers, KeyState}; use net_traits::CoreResourceMsg; use net_traits::request::RequestInit; @@ -104,6 +104,10 @@ pub enum ScriptMsg { PostMessage(BrowsingContextId, Option, Vec), /// HTMLIFrameElement Forward or Back traversal. TraverseHistory(TraversalDirection), + /// Inform the constellation of a pushed history state. + PushHistoryState(HistoryStateId), + /// Inform the constellation of a replaced history state. + ReplaceHistoryState(HistoryStateId), /// Gets the length of the joint session history from the constellation. JointSessionHistoryLength(IpcSender), /// Favicon detected diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/popstate_event.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/popstate_event.html.ini deleted file mode 100644 index 73a5f1622547..000000000000 --- a/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/popstate_event.html.ini +++ /dev/null @@ -1,7 +0,0 @@ -[popstate_event.html] - type: testharness - expected: TIMEOUT - bug: https://github.com/servo/servo/issues/19905 - [Queue a task to fire popstate event] - expected: TIMEOUT - diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html.ini index 78879bad5f14..5b38c37b0866 100644 --- a/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html.ini +++ b/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html.ini @@ -1,5 +1,4 @@ [javascript-url-abort-return-value-undefined.tentative.html] - expected: TIMEOUT [Not aborting fetch for javascript:undefined navigation] - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/001.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/001.html.ini index 86c15b26af03..1c088011cf93 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/001.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/001.html.ini @@ -4,99 +4,3 @@ [history.length should update when setting location.hash] expected: FAIL - [history.pushState must exist] - expected: FAIL - - [history.pushState must exist within iframes] - expected: FAIL - - [initial history.state should be null] - expected: FAIL - - [history.length should update when pushing a state] - expected: FAIL - - [history.state should update after a state is pushed] - expected: FAIL - - [traversing history must traverse pushed states] - expected: FAIL - - [pushState must not be allowed to create invalid URLs] - expected: FAIL - - [pushState must not be allowed to create cross-origin URLs] - expected: FAIL - - [pushState must not be allowed to create cross-origin URLs (about:blank)] - expected: FAIL - - [pushState must not be allowed to create cross-origin URLs (data:URI)] - expected: FAIL - - [pushState should not actually load the new URL] - expected: FAIL - - [security errors are expected to be thrown in the context of the document that owns the history object] - expected: FAIL - - [location.hash must be allowed to change (part 1)] - expected: FAIL - - [location.hash must be allowed to change (part 2)] - expected: FAIL - - [pushState must not alter location.hash when no URL is provided] - expected: FAIL - - [pushState must remove all history after the current state] - expected: FAIL - - [pushState must be able to set location.hash] - expected: FAIL - - [pushState must remove any tasks queued by the history traversal task source] - expected: FAIL - - [pushState must be able to set location.pathname] - expected: FAIL - - [pushState must be able to set absolute URLs to the same host] - expected: FAIL - - [pushState must not be able to use a function as data] - expected: FAIL - - [pushState must not be able to use a DOM node as data] - expected: FAIL - - [pushState must not be able to use an error object as data] - expected: FAIL - - [security errors are expected to be thrown in the context of the document that owns the history object (2)] - expected: FAIL - - [pushState must be able to make structured clones of complex objects] - expected: FAIL - - [history.state should also reference a clone of the original object] - expected: FAIL - - [popstate event should fire when navigation occurs] - expected: FAIL - - [popstate event should pass the state data] - expected: FAIL - - [state data should cope with circular object references] - expected: FAIL - - [state data should be a clone of the original object, not a reference to it] - expected: FAIL - - [history.state should also reference a clone of the original object (2)] - expected: FAIL - - [history.state should be a separate clone of the object, not a reference to the object passed to the event handler] - expected: FAIL - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/002.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/002.html.ini index c8350da8e2eb..ef724fdd03dd 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/002.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/002.html.ini @@ -4,96 +4,3 @@ [history.length should update when setting location.hash] expected: FAIL - [history.replaceState must exist] - expected: FAIL - - [history.replaceState must exist within iframes] - expected: FAIL - - [initial history.state should be null] - expected: FAIL - - [history.length should not update when replacing a state with no URL] - expected: FAIL - - [history.state should update after a state is pushed] - expected: FAIL - - [hash should not change when replaceState is called without a URL] - expected: FAIL - - [history.length should not update when replacing a state with a URL] - expected: FAIL - - [hash should change when replaceState is called with a URL] - expected: FAIL - - [replaceState must replace the existing state without altering the forward history] - expected: FAIL - - [replaceState must not be allowed to create invalid URLs] - expected: FAIL - - [replaceState must not be allowed to create cross-origin URLs] - expected: FAIL - - [replaceState must not be allowed to create cross-origin URLs (about:blank)] - expected: FAIL - - [replaceState must not be allowed to create cross-origin URLs (data:URI)] - expected: FAIL - - [security errors are expected to be thrown in the context of the document that owns the history object] - expected: FAIL - - [replaceState must be able to set location.pathname] - expected: FAIL - - [replaceState must be able to set absolute URLs to the same host] - expected: FAIL - - [replaceState must not remove any tasks queued by the history traversal task source] - expected: FAIL - - [.go must queue a task with the history traversal task source (run asynchronously)] - expected: FAIL - - [replaceState must not be able to use a function as data] - expected: FAIL - - [replaceState must not be able to use a DOM node as data] - expected: FAIL - - [replaceState must not be able to use an error object as data] - expected: FAIL - - [replaceState should not actually load the new URL] - expected: FAIL - - [security errors are expected to be thrown in the context of the document that owns the history object (2)] - expected: FAIL - - [replaceState must be able to make structured clones of complex objects] - expected: FAIL - - [history.state should also reference a clone of the original object] - expected: FAIL - - [popstate event should fire when navigation occurs] - expected: FAIL - - [popstate event should pass the state data] - expected: FAIL - - [state data should cope with circular object references] - expected: FAIL - - [state data should be a clone of the original object, not a reference to it] - expected: FAIL - - [history.state should also reference a clone of the original object (2)] - expected: FAIL - - [history.state should be a separate clone of the object, not a reference to the object passed to the event handler] - expected: FAIL - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/004.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/004.html.ini index 278160ab559f..cb0147ab4bf9 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/004.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/004.html.ini @@ -1,5 +1,4 @@ [004.html] - type: testharness [browser needs to support hashchange events for this testcase] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/005.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/005.html.ini deleted file mode 100644 index 230bbac6edb5..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/005.html.ini +++ /dev/null @@ -1,8 +0,0 @@ -[005.html] - type: testharness - [ should register a listener for the popstate event] - expected: FAIL - - [window.onpopstate should register a listener for the popstate event] - expected: FAIL - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/007.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/007.html.ini deleted file mode 100644 index b50f240fd735..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/007.html.ini +++ /dev/null @@ -1,14 +0,0 @@ -[007.html] - type: testharness - [popstate event should fire before onload fires] - expected: FAIL - - [the correct state should be restored when navigating during initial load] - expected: FAIL - - [history.state should reflect the navigated state onload] - expected: FAIL - - [history.state should reflect the navigated state after onload] - expected: FAIL - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/008.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/008.html.ini index 5af01f618f1d..d02f10bf16ba 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/008.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/008.html.ini @@ -1,5 +1,4 @@ [008.html] - type: testharness [history.pushState URL resolving should be done relative to the document, not the script] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/009.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/009.html.ini index 775bd6adf7d8..6c2ee1ac71c5 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/009.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/009.html.ini @@ -1,5 +1,4 @@ [009.html] - type: testharness [HTTP Referer should use the pushed state] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/010.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/010.html.ini index cd895f71c05b..27117024d9c7 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/010.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/010.html.ini @@ -1,5 +1,4 @@ [010.html] - type: testharness [HTTP Referer should use the pushed state (before onload)] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/011.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/011.html.ini index 70ac6b2b4221..371120da5101 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/011.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/011.html.ini @@ -1,5 +1,4 @@ [011.html] - type: testharness [pushed location should be reflected immediately] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/012.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/012.html.ini index 6d4c74df6ee9..2169780fb92e 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/012.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/012.html.ini @@ -1,5 +1,4 @@ [012.html] - type: testharness [replaced location should be reflected immediately] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_002.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_002.html.ini deleted file mode 100644 index b298a5d7c07c..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_002.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[combination_history_002.html] - type: testharness - [After calling of pushState method, check length] - expected: FAIL - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_003.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_003.html.ini deleted file mode 100644 index 0329eef96dec..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_003.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[combination_history_003.html] - type: testharness - [After calling of pushState and replaceState methods, check length] - expected: FAIL - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_004.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_004.html.ini deleted file mode 100644 index 51df5f939451..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_004.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[combination_history_004.html] - type: testharness - expected: TIMEOUT - [After calling of back method, check length] - expected: TIMEOUT - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_005.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_005.html.ini deleted file mode 100644 index 07e75fb2f317..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_005.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[combination_history_005.html] - type: testharness - expected: TIMEOUT - [After calling of forward method, check length] - expected: TIMEOUT - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_006.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_006.html.ini deleted file mode 100644 index 74fbd2092384..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_006.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[combination_history_006.html] - type: testharness - expected: TIMEOUT - [After calling of go method, check length] - expected: TIMEOUT - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_007.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_007.html.ini deleted file mode 100644 index 3d6c729c91e2..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_007.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[combination_history_007.html] - type: testharness - expected: TIMEOUT - [After calling of back and pushState method, check length] - expected: TIMEOUT - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_back.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_back.html.ini deleted file mode 100644 index 900199284958..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_back.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[history_back.html] - type: testharness - expected: TIMEOUT - [history back] - expected: TIMEOUT - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_back_1.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_back_1.html.ini index 35fac2b2d04c..374935b8230b 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_back_1.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_back_1.html.ini @@ -1,5 +1,4 @@ [history_back_1.html] - type: testharness [history.back() with session history] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_forward.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_forward.html.ini deleted file mode 100644 index ea54a7fdf970..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_forward.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[history_forward.html] - type: testharness - expected: TIMEOUT - [history forward] - expected: TIMEOUT - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_forward_1.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_forward_1.html.ini index e327761c345a..1296fcfa7650 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_forward_1.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_forward_1.html.ini @@ -1,5 +1,4 @@ [history_forward_1.html] - type: testharness [history.forward() with session history] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_minus.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_minus.html.ini deleted file mode 100644 index ef94a41258ba..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_minus.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[history_go_minus.html] - type: testharness - expected: TIMEOUT - [history go minus] - expected: TIMEOUT - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_no_argument.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_no_argument.html.ini index 06cda352aca0..93b88710b8f1 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_no_argument.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_no_argument.html.ini @@ -1,5 +1,4 @@ [history_go_no_argument.html] - type: testharness [history.go()] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_plus.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_plus.html.ini deleted file mode 100644 index b95882d3dcdb..000000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_plus.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[history_go_plus.html] - type: testharness - expected: TIMEOUT - [history go plus] - expected: TIMEOUT - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_to_uri.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_to_uri.html.ini index 5b21d4db949f..d4dc04751d27 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_to_uri.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_to_uri.html.ini @@ -1,5 +1,4 @@ [history_go_to_uri.html] - type: testharness [history.go() negative tests] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_undefined.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_undefined.html.ini index fdada5164ea4..3d3420e02c67 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_undefined.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_undefined.html.ini @@ -1,5 +1,4 @@ [history_go_undefined.html] - type: testharness [history.forward() with session history] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_zero.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_zero.html.ini index f5d4546b1c6c..2b0ff4704cff 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_zero.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_go_zero.html.ini @@ -1,5 +1,4 @@ [history_go_zero.html] - type: testharness [history.go(0)] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_properties_only_fully_active.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_properties_only_fully_active.html.ini index d4e7acd28784..7d38690839fe 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_properties_only_fully_active.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_properties_only_fully_active.html.ini @@ -1,5 +1,4 @@ [history_properties_only_fully_active.html] - type: testharness [history properties should throw SecurityError when not in a fully active Document] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_pushstate_err.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_pushstate_err.html.ini index 5a4e399ac99d..07540a9e8e0f 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_pushstate_err.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_pushstate_err.html.ini @@ -1,5 +1,4 @@ [history_pushstate_err.html] - type: testharness [history pushState SECURITY_ERR] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_replacestate_err.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_replacestate_err.html.ini index 316097c5b4d1..8ee22ab224e7 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/history_replacestate_err.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/history_replacestate_err.html.ini @@ -1,5 +1,4 @@ [history_replacestate_err.html] - type: testharness [history replaceState SECURITY_ERR] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini index 10190c72bb4f..87b07c3e6704 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini @@ -1,5 +1,4 @@ [traverse_the_history_1.html] - type: testharness [Multiple history traversals from the same task] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini index ed5fa09b091b..75d75b4cda2e 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_2.html.ini @@ -1,5 +1,4 @@ [traverse_the_history_2.html] - type: testharness [Multiple history traversals, last would be aborted] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_3.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_3.html.ini index a7756d149a01..51f8272a6def 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_3.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_3.html.ini @@ -1,5 +1,4 @@ [traverse_the_history_3.html] - type: testharness [Multiple history traversals, last would be aborted] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini index db91b39cbbb2..385376c7321e 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini @@ -1,5 +1,4 @@ [traverse_the_history_4.html] - type: testharness [Multiple history traversals, last would be aborted] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini index 5235ab0c61bf..dc2e45516deb 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini @@ -1,5 +1,4 @@ [traverse_the_history_5.html] - type: testharness [Multiple history traversals, last would be aborted] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html.ini index 636f222b5e7e..42886146b6ce 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html.ini @@ -1,5 +1,4 @@ [traverse_the_history_unload_1.html] - type: testharness [Traversing the history, unload event is fired on doucment] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html.ini index 5584b477abc5..d45557366ace 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html.ini @@ -1,5 +1,4 @@ [traverse_the_history_write_after_load_1.html] - type: testharness [Traverse the history after document.write after the load event] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html.ini index 41eb9bd0f1eb..07f625686be9 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html.ini @@ -1,5 +1,4 @@ [traverse_the_history_write_after_load_2.html] - type: testharness [Traverse the history back and forward when a history entry is written after the load event] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html.ini index 516f5cc63b4b..1778e5a7aac4 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html.ini @@ -1,5 +1,4 @@ [traverse_the_history_write_onload_1.html] - type: testharness [Traverse the history when a history entry is written in the load event] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html.ini index 74579d4e3626..771592ec7764 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html.ini @@ -1,5 +1,4 @@ [traverse_the_history_write_onload_2.html] - type: testharness [Traverse the history back and forward when a history entry is written in the load event] expected: FAIL