mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
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:
commit
d484e66c45
1 changed files with 10 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue