diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Node.cpp | 7 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Node.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 099fe11e66..8ec7179a40 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -637,4 +637,11 @@ void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) c } } +// https://html.spec.whatwg.org/multipage/webappapis.html#concept-n-noscript +bool Node::is_scripting_disabled() const +{ + // FIXME: or when scripting is disabled for its relevant settings object. + return !document().browsing_context(); +} + } diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h index 06c1e59b1c..63d9b122b6 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.h +++ b/Userland/Libraries/LibWeb/DOM/Node.h @@ -163,6 +163,8 @@ public: bool is_host_including_inclusive_ancestor_of(const Node&) const; + bool is_scripting_disabled() const; + // Used for dumping the DOM Tree void serialize_tree_as_json(JsonObjectSerializer<StringBuilder>&) const; |