diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-12-09 15:14:58 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-12-09 15:14:59 +0100 |
commit | 64b0a6b0b411cf278a42babb7a4f7b9b8763ceee (patch) | |
tree | fd7deac0c5a48c822a42815c60bf5f317b962b3e /components/script/script_task.rs | |
parent | 795327d5c4984957af7720a91159f91f9162be62 (diff) | |
download | servo-64b0a6b0b411cf278a42babb7a4f7b9b8763ceee.tar.gz servo-64b0a6b0b411cf278a42babb7a4f7b9b8763ceee.zip |
Reuse the final_url in ScriptTask::load.
In both the javascript and non-javascript url cases, final_url is set to the
same url as is stored by the Page.
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index c778d2792fc..f41558b598c 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -690,7 +690,7 @@ 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, load_data: LoadData) { - let mut url = load_data.url.clone(); + let url = load_data.url.clone(); debug!("ScriptTask: loading {} on page {}", url, pipeline_id); let page = self.page.borrow_mut(); @@ -782,19 +782,18 @@ impl ScriptTask { }; parse_html(*document, parser_input, &final_url); - url = page.get_url().clone(); document.set_ready_state(DocumentReadyStateValues::Interactive); // Kick off the initial reflow of the page. - debug!("kicking off initial reflow of {}", url); + debug!("kicking off initial reflow of {}", final_url); document.content_changed(NodeCast::from_ref(*document)); window.flush_layout(); { // No more reflow required let mut page_url = page.mut_url(); - *page_url = Some((url.clone(), false)); + *page_url = Some((final_url.clone(), false)); } // https://html.spec.whatwg.org/multipage/#the-end step 4 @@ -814,7 +813,7 @@ impl ScriptTask { let wintarget: JSRef<EventTarget> = EventTargetCast::from_ref(*window); let _ = wintarget.dispatch_event_with_target(Some(doctarget), *event); - *page.fragment_name.borrow_mut() = url.fragment; + *page.fragment_name.borrow_mut() = final_url.fragment; let ConstellationChan(ref chan) = self.constellation_chan; chan.send(LoadCompleteMsg); |