summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/LabelableElement.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/html/LabelableElement.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/html/LabelableElement.h')
-rw-r--r--Source/WebCore/html/LabelableElement.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/Source/WebCore/html/LabelableElement.h b/Source/WebCore/html/LabelableElement.h
index 014f11127..5e42ba4e7 100644
--- a/Source/WebCore/html/LabelableElement.h
+++ b/Source/WebCore/html/LabelableElement.h
@@ -28,8 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LabelableElement_h
-#define LabelableElement_h
+#pragma once
#include "HTMLElement.h"
@@ -40,23 +39,19 @@ class LabelableElement : public HTMLElement {
public:
virtual ~LabelableElement();
- PassRefPtr<NodeList> labels();
+ WEBCORE_EXPORT RefPtr<NodeList> labels();
virtual bool supportLabels() const { return false; }
protected:
LabelableElement(const QualifiedName& tagName, Document&);
private:
- virtual bool isLabelable() const override final { return true; }
+ bool isLabelable() const final { return true; }
};
-void isLabelableElement(const LabelableElement&); // Catch unnecessary runtime check of type known at compile time.
-inline bool isLabelableElement(const HTMLElement& element) { return element.isLabelable(); }
-inline bool isLabelableElement(const Node& node) { return node.isHTMLElement() && toHTMLElement(node).isLabelable(); }
-template <> inline bool isElementOfType<const LabelableElement>(const Element& element) { return isLabelableElement(element); }
-
-NODE_TYPE_CASTS(LabelableElement)
-
} // namespace WebCore
-#endif
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::LabelableElement)
+ static bool isType(const WebCore::HTMLElement& element) { return element.isLabelable(); }
+ static bool isType(const WebCore::Node& node) { return is<WebCore::HTMLElement>(node) && isType(downcast<WebCore::HTMLElement>(node)); }
+SPECIALIZE_TYPE_TRAITS_END()