mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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.
|
// Step 4.1.
|
||||||
let window = self.window();
|
let window = self.window();
|
||||||
|
let document = Trusted::new(self);
|
||||||
window
|
window
|
||||||
.task_manager()
|
.task_manager()
|
||||||
.dom_manipulation_task_source()
|
.dom_manipulation_task_source()
|
||||||
.queue_event(
|
.queue(
|
||||||
self.upcast(),
|
task!(fire_dom_content_loaded_event: move || {
|
||||||
atom!("DOMContentLoaded"),
|
let document = document.root();
|
||||||
EventBubbles::Bubbles,
|
document.upcast::<EventTarget>().fire_bubbling_event(atom!("DOMContentLoaded"));
|
||||||
EventCancelable::NotCancelable,
|
update_with_current_time_ms(&document.dom_content_loaded_event_end);
|
||||||
window,
|
}),
|
||||||
);
|
window.upcast(),
|
||||||
|
)
|
||||||
update_with_current_time_ms(&self.dom_content_loaded_event_end);
|
.unwrap();
|
||||||
|
|
||||||
// html parsing has finished - set dom content loaded
|
// html parsing has finished - set dom content loaded
|
||||||
self.interactive_time
|
self.interactive_time
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue