aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/document.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r--components/script/dom/document.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 4f4b43437e7..d60545e159b 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -289,6 +289,7 @@ pub trait DocumentHelpers<'a> {
fn load_async(self, load: LoadType, listener: AsyncResponseTarget);
fn load_sync(self, load: LoadType) -> Result<(Metadata, Vec<u8>), String>;
fn finish_load(self, load: LoadType);
+ fn notify_constellation_load(self);
fn set_current_parser(self, script: Option<&ServoHTMLParser>);
fn get_current_parser(self) -> Option<Root<ServoHTMLParser>>;
fn find_iframe(self, subpage_id: SubpageId) -> Option<Root<HTMLIFrameElement>>;
@@ -956,9 +957,10 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
let window = window.r();
let performance = window.Performance();
let performance = performance.r();
+ let timing = performance.Now();
for (_, callback) in animation_frame_list {
- callback(*performance.Now());
+ callback(*timing);
}
window.reflow(ReflowGoal::ForDisplay,
@@ -986,6 +988,15 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
loader.finish_load(load);
}
+ fn notify_constellation_load(self) {
+ let window = self.window.root();
+ let pipeline_id = window.r().pipeline();
+ let ConstellationChan(ref chan) = window.r().constellation_chan();
+ let event = ConstellationMsg::DOMLoad(pipeline_id);
+ chan.send(event).unwrap();
+
+ }
+
fn set_current_parser(self, script: Option<&ServoHTMLParser>) {
self.current_parser.set(script.map(JS::from_ref));
}
@@ -1904,6 +1915,8 @@ impl DocumentProgressHandler {
event.r().fire(target);
});
+ document.r().notify_constellation_load();
+
// https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserloadend
document.r().trigger_mozbrowser_event(MozBrowserEvent::LoadEnd);