LibWeb: Set inertness of HTMLElement when inert attribute is changed

This commit is contained in:
Tim Ledbetter 2025-02-05 23:24:47 +00:00 committed by Sam Atkins
commit a9ffc6359a
Notes: github-actions[bot] 2025-02-21 12:43:40 +00:00
4 changed files with 49 additions and 0 deletions

View file

@ -2110,6 +2110,17 @@ bool Node::is_default_namespace(Optional<String> namespace_) const
return default_namespace == namespace_;
}
bool Node::is_inert() const
{
if (auto* html_element = as_if<HTML::HTMLElement>(*this))
return html_element->is_inert();
if (auto* enclosing_html_element = this->enclosing_html_element())
return enclosing_html_element->is_inert();
return false;
}
// https://dom.spec.whatwg.org/#in-a-document-tree
bool Node::in_a_document_tree() const
{