OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2009, 2014 Apple Inc. All rights reserved. | 4 * Copyright (C) 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 DEFINE_ELEMENT_TYPE_CASTS(SVGElement, isSVGElement()); | 264 DEFINE_ELEMENT_TYPE_CASTS(SVGElement, isSVGElement()); |
265 | 265 |
266 template <typename T> bool isElementOfType(const SVGElement&); | 266 template <typename T> bool isElementOfType(const SVGElement&); |
267 template <> inline bool isElementOfType<const SVGElement>(const SVGElement&) { r
eturn true; } | 267 template <> inline bool isElementOfType<const SVGElement>(const SVGElement&) { r
eturn true; } |
268 | 268 |
269 inline bool Node::hasTagName(const SVGQualifiedName& name) const | 269 inline bool Node::hasTagName(const SVGQualifiedName& name) const |
270 { | 270 { |
271 return isSVGElement() && toSVGElement(*this).hasTagName(name); | 271 return isSVGElement() && toSVGElement(*this).hasTagName(name); |
272 } | 272 } |
273 | 273 |
| 274 // This requires isSVG*Element(const SVGElement&). |
| 275 #define DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ |
| 276 inline bool is##thisType(const thisType* element); \ |
| 277 inline bool is##thisType(const thisType& element); \ |
| 278 inline bool is##thisType(const SVGElement* element) { return element && is##
thisType(*element); } \ |
| 279 inline bool is##thisType(const Node& node) { return node.isSVGElement() ? is
##thisType(toSVGElement(node)) : false; } \ |
| 280 inline bool is##thisType(const Node* node) { return node && is##thisType(*no
de); } \ |
| 281 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r
eturn is##thisType(node.get()); } \ |
| 282 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur
n is##thisType(node.get()); } \ |
| 283 template <> inline bool isElementOfType<const thisType>(const SVGElement& el
ement) { return is##thisType(element); } \ |
| 284 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) |
| 285 |
274 } | 286 } |
275 | 287 |
276 #include "core/SVGElementTypeHelpers.h" | 288 #include "core/SVGElementTypeHelpers.h" |
277 | 289 |
278 #endif | 290 #endif |
OLD | NEW |