OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * Copyright (C) 2004-2007, 2009, 2014 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004-2007, 2009, 2014 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 // This requires isHTML*Element(const Element&) and isHTML*Element(const HTMLEle
ment&). | 180 // This requires isHTML*Element(const Element&) and isHTML*Element(const HTMLEle
ment&). |
181 // When the input element is an HTMLElement, we don't need to check the namespac
e URI, just the local name. | 181 // When the input element is an HTMLElement, we don't need to check the namespac
e URI, just the local name. |
182 #define DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ | 182 #define DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ |
183 inline bool is##thisType(const thisType* element); \ | 183 inline bool is##thisType(const thisType* element); \ |
184 inline bool is##thisType(const thisType& element); \ | 184 inline bool is##thisType(const thisType& element); \ |
185 inline bool is##thisType(const HTMLElement* element) { return element && is#
#thisType(*element); } \ | 185 inline bool is##thisType(const HTMLElement* element) { return element && is#
#thisType(*element); } \ |
186 inline bool is##thisType(const Node& node) { return node.isHTMLElement() ? i
s##thisType(toHTMLElement(node)) : false; } \ | 186 inline bool is##thisType(const Node& node) { return node.isHTMLElement() ? i
s##thisType(toHTMLElement(node)) : false; } \ |
187 inline bool is##thisType(const Node* node) { return node && is##thisType(*no
de); } \ | 187 inline bool is##thisType(const Node* node) { return node && is##thisType(*no
de); } \ |
188 inline bool is##thisType(const Element* element) { return element && is##thi
sType(*element); } \ | 188 inline bool is##thisType(const Element* element) { return element && is##thi
sType(*element); } \ |
189 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r
eturn is##thisType(node.get()); } \ | |
190 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur
n is##thisType(node.get()); } \ | |
191 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e
lement) { return is##thisType(element); } \ | 189 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e
lement) { return is##thisType(element); } \ |
192 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) | 190 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) |
193 | 191 |
194 } // namespace blink | 192 } // namespace blink |
195 | 193 |
196 #include "core/HTMLElementTypeHelpers.h" | 194 #include "core/HTMLElementTypeHelpers.h" |
197 | 195 |
198 #endif // HTMLElement_h | 196 #endif // HTMLElement_h |
OLD | NEW |