mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 01:08:48 +00:00
LibHTML: Templatize Node::first_child_of_type<T>()
This is a lot nicer than first_child_with_tag_name(...). The is<T>(Node) functions are obviously unoptimized at the moment, and this is about establishing pleasant patterns right now. :^)
This commit is contained in:
parent
f52f2736e1
commit
3bee9d3d3c
Notes:
sideshowbarker
2024-07-19 11:46:33 +09:00
Author: https://github.com/awesomekling
Commit: 3bee9d3d3c
5 changed files with 48 additions and 12 deletions
|
@ -7,3 +7,9 @@ public:
|
|||
HTMLTitleElement(Document&, const String& tag_name);
|
||||
virtual ~HTMLTitleElement() override;
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool is<HTMLTitleElement>(const Node& node)
|
||||
{
|
||||
return is<Element>(node) && to<Element>(node).tag_name().to_lowercase() == "title";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue