diff options
Diffstat (limited to 'Source/WebCore/html/LabelableElement.h')
-rw-r--r-- | Source/WebCore/html/LabelableElement.h | 19 |
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() |