ladybird/Libraries/LibHTML/DOM/HTMLElement.h
Andreas Kling f52f2736e1 LibHTML: Add is<ElementType> and to<ElementType> helper functions
These will help us write node-type-aware template functions.
2019-10-06 20:38:26 +02:00

20 lines
413 B
C++

#pragma once
#include <LibHTML/DOM/Element.h>
class HTMLElement : public Element {
public:
HTMLElement(Document&, const String& tag_name);
virtual ~HTMLElement() override;
String title() const { return attribute("title"); }
private:
virtual bool is_html_element() const final { return true; }
};
template<>
inline bool is<HTMLElement>(const Node& node)
{
return node.is_html_element();
}