diff options
author | Paul Rouget <me@paulrouget.com> | 2016-02-24 18:45:07 +0100 |
---|---|---|
committer | Paul Rouget <me@paulrouget.com> | 2016-02-24 18:45:07 +0100 |
commit | 3ecc90776771e2268d11b3c85fd68af4e71b7530 (patch) | |
tree | 55bcf6bc31dff7ed02a1f19aa024e880eede15c1 /components/script/dom/document.rs | |
parent | 33f0040496bde88683cfadb4068183f7d08a5f1c (diff) | |
download | servo-3ecc90776771e2268d11b3c85fd68af4e71b7530.tar.gz servo-3ecc90776771e2268d11b3c85fd68af4e71b7530.zip |
Support Browser API event mozbrowserconnected
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 7a1ce36e5e4..5ef2442e4e8 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -584,9 +584,17 @@ impl Document { // https://html.spec.whatwg.org/multipage/#current-document-readiness pub fn set_ready_state(&self, state: DocumentReadyState) { match state { - DocumentReadyState::Loading => update_with_current_time(&self.dom_loading), + DocumentReadyState::Loading => { + // https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserconnected + self.trigger_mozbrowser_event(MozBrowserEvent::Connected); + update_with_current_time(&self.dom_loading); + }, + DocumentReadyState::Complete => { + // https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserloadend + self.trigger_mozbrowser_event(MozBrowserEvent::LoadEnd); + update_with_current_time(&self.dom_complete); + }, DocumentReadyState::Interactive => update_with_current_time(&self.dom_interactive), - DocumentReadyState::Complete => update_with_current_time(&self.dom_complete), }; self.ready_state.set(state); @@ -2589,9 +2597,6 @@ impl DocumentProgressHandler { document.notify_constellation_load(); - // https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserloadend - document.trigger_mozbrowser_event(MozBrowserEvent::LoadEnd); - window.reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery, ReflowReason::DocumentLoaded); |