
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. :^)
15 lines
363 B
C++
15 lines
363 B
C++
#pragma once
|
|
|
|
#include <LibHTML/DOM/HTMLElement.h>
|
|
|
|
class HTMLTitleElement : public HTMLElement {
|
|
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";
|
|
}
|