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.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 02bdd343d89..1e2a3747751 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -1108,6 +1108,12 @@ impl Document {
self.scripting_enabled
}
+ /// Return whether scripting is enabled or not
+ /// <https://html.spec.whatwg.org/multipage/#concept-n-noscript>
+ pub(crate) fn scripting_enabled(&self) -> bool {
+ self.has_browsing_context()
+ }
+
/// Return the element that currently has focus.
// https://w3c.github.io/uievents/#events-focusevent-doc-focus
pub(crate) fn get_focused_element(&self) -> Option<DomRoot<Element>> {