| 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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 template<typename T> inline const T& toElement(const Node& node) | 756 template<typename T> inline const T& toElement(const Node& node) |
| 757 { | 757 { |
| 758 ASSERT_WITH_SECURITY_IMPLICATION(isElementOfType<const T>(node)); | 758 ASSERT_WITH_SECURITY_IMPLICATION(isElementOfType<const T>(node)); |
| 759 return static_cast<const T&>(node); | 759 return static_cast<const T&>(node); |
| 760 } | 760 } |
| 761 template<typename T> inline const T* toElement(const Node* node) | 761 template<typename T> inline const T* toElement(const Node* node) |
| 762 { | 762 { |
| 763 ASSERT_WITH_SECURITY_IMPLICATION(!node || isElementOfType<const T>(*node)); | 763 ASSERT_WITH_SECURITY_IMPLICATION(!node || isElementOfType<const T>(*node)); |
| 764 return static_cast<const T*>(node); | 764 return static_cast<const T*>(node); |
| 765 } | 765 } |
| 766 template<typename T, typename U> inline T* toElement(const RefPtr<U>& node) { re
turn toElement<T>(node.get()); } | |
| 767 | 766 |
| 768 inline bool isDisabledFormControl(const Node* node) | 767 inline bool isDisabledFormControl(const Node* node) |
| 769 { | 768 { |
| 770 return node->isElementNode() && toElement(node)->isDisabledFormControl(); | 769 return node->isElementNode() && toElement(node)->isDisabledFormControl(); |
| 771 } | 770 } |
| 772 | 771 |
| 773 inline Element* Node::parentElement() const | 772 inline Element* Node::parentElement() const |
| 774 { | 773 { |
| 775 ContainerNode* parent = parentNode(); | 774 ContainerNode* parent = parentNode(); |
| 776 return parent && parent->isElementNode() ? toElement(parent) : nullptr; | 775 return parent && parent->isElementNode() ? toElement(parent) : nullptr; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 static T* create(const QualifiedName&, Document&) | 972 static T* create(const QualifiedName&, Document&) |
| 974 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ | 973 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ |
| 975 T* T::create(const QualifiedName& tagName, Document& document) \ | 974 T* T::create(const QualifiedName& tagName, Document& document) \ |
| 976 { \ | 975 { \ |
| 977 return new T(tagName, document); \ | 976 return new T(tagName, document); \ |
| 978 } | 977 } |
| 979 | 978 |
| 980 } // namespace blink | 979 } // namespace blink |
| 981 | 980 |
| 982 #endif // Element_h | 981 #endif // Element_h |
| OLD | NEW |