| 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 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved. | 6 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 ASSERT_WITH_SECURITY_IMPLICATION(!node || isElementOfType<const T>(*node)); | 680 ASSERT_WITH_SECURITY_IMPLICATION(!node || isElementOfType<const T>(*node)); |
| 681 return static_cast<const T*>(node); | 681 return static_cast<const T*>(node); |
| 682 } | 682 } |
| 683 template<typename T, typename U> inline T* toElement(const RefPtr<U>& node) { re
turn toElement<T>(node.get()); } | 683 template<typename T, typename U> inline T* toElement(const RefPtr<U>& node) { re
turn toElement<T>(node.get()); } |
| 684 | 684 |
| 685 inline bool isDisabledFormControl(const Node* node) | 685 inline bool isDisabledFormControl(const Node* node) |
| 686 { | 686 { |
| 687 return node->isElementNode() && toElement(node)->isDisabledFormControl(); | 687 return node->isElementNode() && toElement(node)->isDisabledFormControl(); |
| 688 } | 688 } |
| 689 | 689 |
| 690 inline bool Node::hasTagName(const QualifiedName& name) const | |
| 691 { | |
| 692 return isElementNode() && toElement(this)->hasTagName(name); | |
| 693 } | |
| 694 | |
| 695 inline Element* Node::parentElement() const | 690 inline Element* Node::parentElement() const |
| 696 { | 691 { |
| 697 ContainerNode* parent = parentNode(); | 692 ContainerNode* parent = parentNode(); |
| 698 return parent && parent->isElementNode() ? toElement(parent) : 0; | 693 return parent && parent->isElementNode() ? toElement(parent) : 0; |
| 699 } | 694 } |
| 700 | 695 |
| 701 inline bool Element::fastHasAttribute(const QualifiedName& name) const | 696 inline bool Element::fastHasAttribute(const QualifiedName& name) const |
| 702 { | 697 { |
| 703 ASSERT(fastAttributeLookupAllowed(name)); | 698 ASSERT(fastAttributeLookupAllowed(name)); |
| 704 return elementData() && attributes().findIndex(name) != kNotFound; | 699 return elementData() && attributes().findIndex(name) != kNotFound; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) | 866 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) |
| 872 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ | 867 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ |
| 873 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document&
document) \ | 868 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document&
document) \ |
| 874 { \ | 869 { \ |
| 875 return adoptRefWillBeNoop(new T(tagName, document)); \ | 870 return adoptRefWillBeNoop(new T(tagName, document)); \ |
| 876 } | 871 } |
| 877 | 872 |
| 878 } // namespace | 873 } // namespace |
| 879 | 874 |
| 880 #endif | 875 #endif |
| OLD | NEW |