Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / LabelableElement.h
index 259285c..2819a31 100644 (file)
 
 #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&);
 
@@ -50,12 +54,13 @@ private:
     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