| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 : Element(tagName, &document, type) | 49 : Element(tagName, &document, type) |
| 50 { | 50 { |
| 51 ASSERT(!tagName.localName().isNull()); | 51 ASSERT(!tagName.localName().isNull()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 // This requires isHTML*Element(const Element&) and isHTML*Element(const HTMLEle
ment&). | 54 // This requires isHTML*Element(const Element&) and isHTML*Element(const HTMLEle
ment&). |
| 55 // When the input element is an HTMLElement, we don't need to check the namespac
e URI, just the local name. | 55 // When the input element is an HTMLElement, we don't need to check the namespac
e URI, just the local name. |
| 56 #define DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ | 56 #define DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ |
| 57 inline bool is##thisType(const thisType* element); \ | 57 inline bool is##thisType(const thisType* element); \ |
| 58 inline bool is##thisType(const thisType& element); \ | 58 inline bool is##thisType(const thisType& element); \ |
| 59 inline bool is##thisType(const HTMLElement* element) { return element && is#
#thisType(*element); } \ | 59 inline bool is##thisType(const Node& node) { return node.isElementNode() ? i
s##thisType(toElement(node)) : false; } \ |
| 60 inline bool is##thisType(const Node& node) { return node.isHTMLElement() ? i
s##thisType(toHTMLElement(node)) : false; } \ | |
| 61 inline bool is##thisType(const Node* node) { return node && is##thisType(*no
de); } \ | 60 inline bool is##thisType(const Node* node) { return node && is##thisType(*no
de); } \ |
| 62 inline bool is##thisType(const Element* element) { return element && is##thi
sType(*element); } \ | 61 inline bool is##thisType(const Element* element) { return element && is##thi
sType(*element); } \ |
| 63 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r
eturn is##thisType(node.get()); } \ | 62 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r
eturn is##thisType(node.get()); } \ |
| 64 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur
n is##thisType(node.get()); } \ | 63 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur
n is##thisType(node.get()); } \ |
| 65 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e
lement) { return is##thisType(element); } \ | 64 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e
lement) { return is##thisType(element); } \ |
| 66 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) | 65 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) |
| 67 | 66 |
| 68 } // namespace blink | 67 } // namespace blink |
| 69 | 68 |
| 70 #include "gen/sky/core/HTMLElementTypeHelpers.h" | 69 #include "gen/sky/core/HTMLElementTypeHelpers.h" |
| 71 | 70 |
| 72 #endif // SKY_ENGINE_CORE_HTML_HTMLELEMENT_H_ | 71 #endif // SKY_ENGINE_CORE_HTML_HTMLELEMENT_H_ |
| OLD | NEW |