#include "core/html/HTMLElement.h"
-namespace WebCore {
+namespace blink {
+
+class LabelsNodeList;
// LabelableElement represents "labelable element" defined in the HTML
// specification, and provides the implementation of the "labels" attribute.
class LabelableElement : public HTMLElement {
public:
virtual ~LabelableElement();
- PassRefPtr<NodeList> labels();
+ PassRefPtrWillBeRawPtr<LabelsNodeList> labels();
virtual bool supportLabels() const { return false; }
+ virtual void trace(Visitor*) OVERRIDE;
+
protected:
LabelableElement(const QualifiedName& tagName, Document&);
virtual bool isLabelable() const OVERRIDE FINAL { return true; }
};
-inline LabelableElement* toLabelableElement(Node* node)
+inline bool isLabelableElement(const HTMLElement& element)
{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || (node->isHTMLElement() && toHTMLElement(node)->isLabelable()));
- return static_cast<LabelableElement*>(node);
+ return element.isLabelable();
}
-} // namespace WebCore
+DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(LabelableElement);
+
+} // namespace blink
#endif