diff options
author | bors-servo <metajack+bors@gmail.com> | 2014-10-09 16:00:34 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2014-10-09 16:00:34 -0600 |
commit | 2f9808e1306a6468dea0de8657a4fa5868e1a126 (patch) | |
tree | 60883e7d7b84378c36294d55c135ed1060938ada /components/script/script_task.rs | |
parent | 85b277655f07db1cb99c4d3dee93804735ed0470 (diff) | |
parent | ad16c52a6b9b29867518beea161a5bb876086df5 (diff) | |
download | servo-2f9808e1306a6468dea0de8657a4fa5868e1a126.tar.gz servo-2f9808e1306a6468dea0de8657a4fa5868e1a126.zip |
auto merge of #3626 : Manishearth/servo/form-prep, r=jdm
Framework for form submission
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index e01a8caff39..29e1fec40ba 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -45,7 +45,7 @@ use script_traits::ReflowCompleteMsg; use servo_msg::compositor_msg::{FinishedLoading, LayerId, Loading}; use servo_msg::compositor_msg::{ScriptListener}; use servo_msg::constellation_msg::{ConstellationChan, LoadCompleteMsg, LoadUrlMsg, NavigationDirection}; -use servo_msg::constellation_msg::{PipelineId, Failure, FailureMsg, WindowSizeData}; +use servo_msg::constellation_msg::{LoadData, PipelineId, Failure, FailureMsg, WindowSizeData}; use servo_msg::constellation_msg; use servo_net::image_cache_task::ImageCacheTask; use servo_net::resource_task::ResourceTask; @@ -493,7 +493,7 @@ impl ScriptTask { match msg { // TODO(tkuehn) need to handle auxiliary layouts for iframes FromConstellation(AttachLayoutMsg(_)) => fail!("should have handled AttachLayoutMsg already"), - FromConstellation(LoadMsg(id, url)) => self.load(id, url), + FromConstellation(LoadMsg(id, load_data)) => self.load(id, load_data), FromScript(TriggerLoadMsg(id, url)) => self.trigger_load(id, url), FromScript(TriggerFragmentMsg(id, url)) => self.trigger_fragment(id, url), FromConstellation(SendEventMsg(id, event)) => self.handle_event(id, event), @@ -711,7 +711,8 @@ impl ScriptTask { /// The entry point to document loading. Defines bindings, sets up the window and document /// objects, parses HTML and CSS, and kicks off initial layout. - fn load(&self, pipeline_id: PipelineId, url: Url) { + fn load(&self, pipeline_id: PipelineId, load_data: LoadData) { + let url = load_data.url.clone(); debug!("ScriptTask: loading {} on page {:?}", url, pipeline_id); let mut page = self.page.borrow_mut(); @@ -762,7 +763,7 @@ impl ScriptTask { let parser_input = if !is_javascript { InputUrl(url.clone()) } else { - let evalstr = url.non_relative_scheme_data().unwrap(); + let evalstr = load_data.url.non_relative_scheme_data().unwrap(); let jsval = window.evaluate_js_with_result(evalstr); let strval = FromJSValConvertible::from_jsval(self.get_cx(), jsval, Empty); InputString(strval.unwrap_or("".to_string())) @@ -775,7 +776,8 @@ impl ScriptTask { hubbub_html_parser::parse_html(&*page, *document, parser_input, - self.resource_task.clone()); + self.resource_task.clone(), + Some(load_data)); let HtmlParserResult { discovery_port @@ -1067,7 +1069,7 @@ impl ScriptTask { /// for the given pipeline. fn trigger_load(&self, pipeline_id: PipelineId, url: Url) { let ConstellationChan(ref const_chan) = self.constellation_chan; - const_chan.send(LoadUrlMsg(pipeline_id, url)); + const_chan.send(LoadUrlMsg(pipeline_id, LoadData::new(url))); } /// The entry point for content to notify that a fragment url has been requested |