mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:28:11 +00:00
LibWeb: Add Element::is_document_element() helper
This is *not* the same as `Node::is_document()`, just to be confusing. It basically means it's the root element.
This commit is contained in:
parent
7690f76f92
commit
9f83c0f0da
2 changed files with 7 additions and 0 deletions
|
@ -639,6 +639,12 @@ bool Element::is_target() const
|
|||
return document().target_element() == this;
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#document-element
|
||||
bool Element::is_document_element() const
|
||||
{
|
||||
return document().document_element() == this;
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<HTMLCollection> Element::get_elements_by_class_name(DeprecatedFlyString const& class_names)
|
||||
{
|
||||
Vector<FlyString> list_of_class_names;
|
||||
|
|
|
@ -169,6 +169,7 @@ public:
|
|||
bool is_focused() const;
|
||||
bool is_active() const;
|
||||
bool is_target() const;
|
||||
bool is_document_element() const;
|
||||
|
||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_class_name(DeprecatedFlyString const&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue