Auto merge of #23085 - hundredeir:dom_content_loaded#22994, r=jdm

Defer update of dom_content_loaded_event_end

Set it's value only after the "DOMContentLoaded" event is really fired

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #22994

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23085)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-03-26 11:06:49 -04:00 committed by GitHub
commit d484e66c45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2184,18 +2184,19 @@ impl Document {
// Step 4.1.
let window = self.window();
let document = Trusted::new(self);
window
.task_manager()
.dom_manipulation_task_source()
.queue_event(
self.upcast(),
atom!("DOMContentLoaded"),
EventBubbles::Bubbles,
EventCancelable::NotCancelable,
window,
);
update_with_current_time_ms(&self.dom_content_loaded_event_end);
.queue(
task!(fire_dom_content_loaded_event: move || {
let document = document.root();
document.upcast::<EventTarget>().fire_bubbling_event(atom!("DOMContentLoaded"));
update_with_current_time_ms(&document.dom_content_loaded_event_end);
}),
window.upcast(),
)
.unwrap();
// html parsing has finished - set dom content loaded
self.interactive_time