aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlbodyelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmlbodyelement.rs')
-rw-r--r--components/script/dom/htmlbodyelement.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs
index 5bb650973c7..0b749b779a5 100644
--- a/components/script/dom/htmlbodyelement.rs
+++ b/components/script/dom/htmlbodyelement.rs
@@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-use std::time::Duration;
-
use dom_struct::dom_struct;
use embedder_traits::EmbedderMsg;
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
@@ -26,9 +24,6 @@ use crate::dom::node::{document_from_node, window_from_node, BindContext, Node};
use crate::dom::virtualmethods::VirtualMethods;
use crate::script_runtime::CanGc;
-/// How long we should wait before performing the initial reflow after `<body>` is parsed.
-const INITIAL_REFLOW_DELAY: Duration = Duration::from_millis(200);
-
#[dom_struct]
pub struct HTMLBodyElement {
htmlelement: HTMLElement,
@@ -158,11 +153,9 @@ impl VirtualMethods for HTMLBodyElement {
}
let window = window_from_node(self);
- let document = window.Document();
- document.set_reflow_timeout(INITIAL_REFLOW_DELAY);
+ window.prevent_layout_until_load_event();
if window.is_top_level() {
- let msg = EmbedderMsg::HeadParsed;
- window.send_to_embedder(msg);
+ window.send_to_embedder(EmbedderMsg::HeadParsed);
}
}