aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2015-12-15 14:08:01 -0500
committerJosh Matthews <josh@joshmatthews.net>2016-02-11 14:48:48 -0500
commita1f0b39340039adf66f0cf2295b3602e29586df4 (patch)
tree4d3dd6a074785b43cf5a47a4fc3abe46ea9d40e5 /components/script/script_thread.rs
parente6d906dbbfd7f0dc12b0fb714acbc56543aca653 (diff)
downloadservo-a1f0b39340039adf66f0cf2295b3602e29586df4.tar.gz
servo-a1f0b39340039adf66f0cf2295b3602e29586df4.zip
Notify devtools about new script globals sooner.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 67b862ed3f3..2230f254320 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -1841,6 +1841,9 @@ impl ScriptThread {
let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(ConstellationMsg::ActivateDocument(incomplete.pipeline_id)).unwrap();
+ // Notify devtools that a new script global exists.
+ self.notify_devtools(document.Title(), final_url.clone(), (page.pipeline(), None));
+
let is_javascript = incomplete.url.scheme == "javascript";
let parse_input = if is_javascript {
use url::percent_encoding::percent_decode_to;
@@ -2200,11 +2203,6 @@ impl ScriptThread {
document.process_deferred_scripts();
window.set_fragment_name(final_url.fragment.clone());
-
- // Notify devtools that a new script global exists.
- //TODO: should this happen as soon as the global is created, or at least once the first
- // script runs?
- self.notify_devtools(document.Title(), (*final_url).clone(), (id, None));
}
fn handle_css_error_reporting(&self, pipeline_id: PipelineId, filename: String,