ladybird/Libraries/LibHTML/DOM/HTMLAnchorElement.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

17 lines
418 B
C++

#pragma once
#include <LibHTML/DOM/HTMLElement.h>
class HTMLAnchorElement : public HTMLElement {
public:
HTMLAnchorElement(Document&, const String& tag_name);
virtual ~HTMLAnchorElement() override;
String href() const { return attribute("href"); }
};
template<>
inline bool is<HTMLAnchorElement>(const Node& node)
{
return is<Element>(node) && to<Element>(node).tag_name().to_lowercase() == "a";
}