| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 DEFINE_ELEMENT_TYPE_CASTS(HTMLElement, isHTMLElement()); | 63 DEFINE_ELEMENT_TYPE_CASTS(HTMLElement, isHTMLElement()); |
| 64 | 64 |
| 65 template <typename T> bool isElementOfType(const HTMLElement&); | 65 template <typename T> bool isElementOfType(const HTMLElement&); |
| 66 template <> inline bool isElementOfType<const HTMLElement>(const HTMLElement&) {
return true; } | 66 template <> inline bool isElementOfType<const HTMLElement>(const HTMLElement&) {
return true; } |
| 67 | 67 |
| 68 inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document& document
, ConstructionType type = CreateHTMLElement) | 68 inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document& document
, ConstructionType type = CreateHTMLElement) |
| 69 : Element(tagName, &document, type) | 69 : Element(tagName, &document, type) |
| 70 { | 70 { |
| 71 ASSERT(!tagName.localName().isNull()); | 71 ASSERT(!tagName.localName().isNull()); |
| 72 ScriptWrappable::init(this); | |
| 73 } | 72 } |
| 74 | 73 |
| 75 inline bool Node::hasTagName(const HTMLQualifiedName& name) const | 74 inline bool Node::hasTagName(const HTMLQualifiedName& name) const |
| 76 { | 75 { |
| 77 return isHTMLElement() && toHTMLElement(*this).hasTagName(name); | 76 return isHTMLElement() && toHTMLElement(*this).hasTagName(name); |
| 78 } | 77 } |
| 79 | 78 |
| 80 // Functor used to match HTMLElements with a specific HTML tag when using the El
ementTraversal API. | 79 // Functor used to match HTMLElements with a specific HTML tag when using the El
ementTraversal API. |
| 81 class HasHTMLTagName { | 80 class HasHTMLTagName { |
| 82 public: | 81 public: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 98 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r
eturn is##thisType(node.get()); } \ | 97 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r
eturn is##thisType(node.get()); } \ |
| 99 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur
n is##thisType(node.get()); } \ | 98 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur
n is##thisType(node.get()); } \ |
| 100 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e
lement) { return is##thisType(element); } \ | 99 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e
lement) { return is##thisType(element); } \ |
| 101 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) | 100 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) |
| 102 | 101 |
| 103 } // namespace blink | 102 } // namespace blink |
| 104 | 103 |
| 105 #include "core/HTMLElementTypeHelpers.h" | 104 #include "core/HTMLElementTypeHelpers.h" |
| 106 | 105 |
| 107 #endif // HTMLElement_h | 106 #endif // HTMLElement_h |
| OLD | NEW |