mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Add String variants of get_element_by_{} in ParentNode
These are required for porting over Document from DeprecatedString to String. We unfortunately can't port this completely over yet as ParentNode is included by the Element IDL interface, which has not yet been ported over from DeprecatedString.
This commit is contained in:
parent
81f5b3e66d
commit
9d88e14f20
Notes:
sideshowbarker
2024-07-17 03:00:02 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/9d88e14f20 Pull-request: https://github.com/SerenityOS/serenity/pull/21088 Reviewed-by: https://github.com/awesomekling
2 changed files with 16 additions and 0 deletions
|
@ -120,6 +120,19 @@ JS::NonnullGCPtr<HTMLCollection> ParentNode::children()
|
||||||
return *m_children;
|
return *m_children;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JS::NonnullGCPtr<HTMLCollection> ParentNode::get_elements_by_tag_name(FlyString const& qualified_name)
|
||||||
|
{
|
||||||
|
return get_elements_by_tag_name(qualified_name.to_deprecated_fly_string());
|
||||||
|
}
|
||||||
|
|
||||||
|
JS::NonnullGCPtr<HTMLCollection> ParentNode::get_elements_by_tag_name_ns(Optional<String> const& nullable_namespace, FlyString const& local_name)
|
||||||
|
{
|
||||||
|
DeprecatedFlyString deprecated_nullable_namespace;
|
||||||
|
if (nullable_namespace.has_value())
|
||||||
|
deprecated_nullable_namespace = nullable_namespace->to_deprecated_string();
|
||||||
|
return get_elements_by_tag_name_ns(deprecated_nullable_namespace, local_name.to_deprecated_fly_string());
|
||||||
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#concept-getelementsbytagname
|
// https://dom.spec.whatwg.org/#concept-getelementsbytagname
|
||||||
// NOTE: This method is only exposed on Document and Element, but is in ParentNode to prevent code duplication.
|
// NOTE: This method is only exposed on Document and Element, but is in ParentNode to prevent code duplication.
|
||||||
JS::NonnullGCPtr<HTMLCollection> ParentNode::get_elements_by_tag_name(DeprecatedFlyString const& qualified_name)
|
JS::NonnullGCPtr<HTMLCollection> ParentNode::get_elements_by_tag_name(DeprecatedFlyString const& qualified_name)
|
||||||
|
|
|
@ -28,6 +28,9 @@ public:
|
||||||
|
|
||||||
JS::NonnullGCPtr<HTMLCollection> children();
|
JS::NonnullGCPtr<HTMLCollection> children();
|
||||||
|
|
||||||
|
JS::NonnullGCPtr<HTMLCollection> get_elements_by_tag_name(FlyString const&);
|
||||||
|
JS::NonnullGCPtr<HTMLCollection> get_elements_by_tag_name_ns(Optional<String> const&, FlyString const&);
|
||||||
|
|
||||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_tag_name(DeprecatedFlyString const&);
|
JS::NonnullGCPtr<HTMLCollection> get_elements_by_tag_name(DeprecatedFlyString const&);
|
||||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_tag_name_ns(DeprecatedFlyString const&, DeprecatedFlyString const&);
|
JS::NonnullGCPtr<HTMLCollection> get_elements_by_tag_name_ns(DeprecatedFlyString const&, DeprecatedFlyString const&);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue