diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-03-22 21:36:51 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-03-22 21:36:51 -0600 |
commit | 1f682d878db99651bfd26b8a28b57895f2238f87 (patch) | |
tree | c74936efd24415d3603b9658b21f4aee44c68a9b /components/script/dom/document.rs | |
parent | dfb8929b001c8d0fb6d5e63f5a9d6dcc17cb388a (diff) | |
parent | bf9b8f705019e8d0bb2ff9ff18846b3e81d4b26f (diff) | |
download | servo-1f682d878db99651bfd26b8a28b57895f2238f87.tar.gz servo-1f682d878db99651bfd26b8a28b57895f2238f87.zip |
auto merge of #5281 : glennw/servo/mozbrowser, r=jdm
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index d6e5f49b433..c11c22b67b6 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -60,13 +60,14 @@ use dom::window::{Window, WindowHelpers, ReflowReason}; use layout_interface::{HitTestResponse, MouseOverResponse}; use msg::compositor_msg::ScriptListener; -use msg::constellation_msg::{Key, KeyState, KeyModifiers}; +use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::{ConstellationChan, Key, KeyState, KeyModifiers}; use msg::constellation_msg::{SUPER, ALT, SHIFT, CONTROL}; use net::resource_task::ControlMsg::{SetCookiesForUrl, GetCookiesForUrl}; use net::cookie_storage::CookieSource::NonHTTP; use script_task::Runnable; use script_traits::UntrustedNodeAddress; -use util::namespace; +use util::{opts, namespace}; use util::str::{DOMString, split_html_space_chars}; use layout_interface::{ReflowGoal, ReflowQueryType}; @@ -1450,7 +1451,23 @@ impl DocumentProgressHandler { event.r().fire(target); }); - window_ref.reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery, ReflowReason::DocumentLoaded); + if opts::experimental_enabled() { + // If this is a child frame, and experimental mode is enabled, + // send the mozbrowserloadend event. For details, see + // https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserloadend + if let Some((containing_pipeline_id, subpage_id)) = window_ref.parent_info() { + let ConstellationChan(ref chan) = window_ref.constellation_chan(); + let event = ConstellationMsg::MozBrowserEvent(containing_pipeline_id, + subpage_id, + "mozbrowserloadend".to_owned(), + None); + chan.send(event); + } + } + + window_ref.reflow(ReflowGoal::ForDisplay, + ReflowQueryType::NoQuery, + ReflowReason::DocumentLoaded); } } |