aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlbodyelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmlbodyelement.rs')
-rw-r--r--components/script/dom/htmlbodyelement.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs
index c3ac339e33c..51ed2fcd0ea 100644
--- a/components/script/dom/htmlbodyelement.rs
+++ b/components/script/dom/htmlbodyelement.rs
@@ -12,13 +12,12 @@ use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
use dom::eventtarget::EventTarget;
-use dom::globalscope::GlobalScope;
use dom::htmlelement::HTMLElement;
use dom::node::{Node, document_from_node, window_from_node};
use dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
+use embedder_traits::EmbedderMsg;
use html5ever::{LocalName, Prefix};
-use script_traits::ScriptMsg;
use servo_url::ServoUrl;
use style::attr::AttrValue;
use time;
@@ -151,8 +150,11 @@ impl VirtualMethods for HTMLBodyElement {
let window = window_from_node(self);
let document = window.Document();
document.set_reflow_timeout(time::precise_time_ns() + INITIAL_REFLOW_DELAY);
- let event = ScriptMsg::HeadParsed;
- window.upcast::<GlobalScope>().script_to_constellation_chan().send(event).unwrap();
+ if window.is_top_level() {
+ let top_level_browsing_context_id = window.top_level_browsing_context_id();
+ let msg = EmbedderMsg::HeadParsed(top_level_browsing_context_id);
+ window.send_to_embedder(msg);
+ }
}
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {