mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibJS+LibWeb: Add Object::fast_is<Element>()
This commit is contained in:
parent
88d8380920
commit
e07bb32455
Notes:
github-actions[bot]
2025-09-26 15:26:48 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: e07bb32455
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6304
2 changed files with 6 additions and 0 deletions
|
|
@ -206,6 +206,7 @@ public:
|
|||
void define_native_accessor(Realm&, PropertyKey const&, ESCAPING Function<ThrowCompletionOr<Value>(VM&)> getter, ESCAPING Function<ThrowCompletionOr<Value>(VM&)> setter, PropertyAttributes attributes);
|
||||
|
||||
virtual bool is_dom_node() const { return false; }
|
||||
virtual bool is_dom_element() const { return false; }
|
||||
virtual bool is_dom_event() const { return false; }
|
||||
virtual bool is_html_window() const { return false; }
|
||||
virtual bool is_html_window_proxy() const { return false; }
|
||||
|
|
|
|||
|
|
@ -113,6 +113,8 @@ class WEB_API Element
|
|||
public:
|
||||
virtual ~Element() override;
|
||||
|
||||
virtual bool is_dom_element() const final { return true; }
|
||||
|
||||
FlyString const& qualified_name() const { return m_qualified_name.as_string(); }
|
||||
FlyString const& html_uppercased_qualified_name() const;
|
||||
|
||||
|
|
@ -710,3 +712,6 @@ enum class ValidationContext {
|
|||
WebIDL::ExceptionOr<QualifiedName> validate_and_extract(JS::Realm&, Optional<FlyString> namespace_, FlyString const& qualified_name, ValidationContext context);
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
inline bool JS::Object::fast_is<Web::DOM::Element>() const { return is_dom_element(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue