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/html/hubbub_html_parser.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/html/hubbub_html_parser.rs')
-rw-r--r-- | components/script/html/hubbub_html_parser.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/components/script/html/hubbub_html_parser.rs b/components/script/html/hubbub_html_parser.rs index 5bef4c917ed..4b943a4409a 100644 --- a/components/script/html/hubbub_html_parser.rs +++ b/components/script/html/hubbub_html_parser.rs @@ -25,6 +25,7 @@ use encoding::types::{Encoding, DecodeReplace}; use hubbub::hubbub; use hubbub::hubbub::{NullNs, HtmlNs, MathMlNs, SvgNs, XLinkNs, XmlNs, XmlNsNs}; use servo_net::resource_task::{Load, LoadData, Payload, Done, ResourceTask, load_whole_resource}; +use servo_msg::constellation_msg::LoadData as MsgLoadData; use servo_util::str::DOMString; use servo_util::task::spawn_named; use std::ascii::StrAsciiExt; @@ -283,10 +284,12 @@ pub fn build_element_from_tag(tag: DOMString, ns: Namespace, prefix: Option<DOMS return ElementCast::from_temporary(HTMLUnknownElement::new(tag, prefix, document)); } +// The url from msg_load_data is ignored here pub fn parse_html(page: &Page, document: JSRef<Document>, input: HTMLInput, - resource_task: ResourceTask) + resource_task: ResourceTask, + msg_load_data: Option<MsgLoadData>) -> HtmlParserResult { debug!("Hubbub: parsing {:?}", input); @@ -303,7 +306,14 @@ pub fn parse_html(page: &Page, InputUrl(ref url) => { // Wait for the LoadResponse so that the parser knows the final URL. let (input_chan, input_port) = channel(); - resource_task.send(Load(LoadData::new(url.clone()), input_chan)); + let mut load_data = LoadData::new(url.clone()); + msg_load_data.map(|m| { + load_data.headers = m.headers; + load_data.method = m.method; + load_data.data = m.data; + }); + resource_task.send(Load(load_data, input_chan)); + let load_response = input_port.recv(); debug!("Fetched page; metadata is {:?}", load_response.metadata); |