| 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, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 // Intentionally left unimplemented, template specialization needs to be provide
d for specific | 112 // Intentionally left unimplemented, template specialization needs to be provide
d for specific |
| 113 // return types. | 113 // return types. |
| 114 template<typename T> inline const T& toElement(const FormAssociatedElement&); | 114 template<typename T> inline const T& toElement(const FormAssociatedElement&); |
| 115 template<typename T> inline const T* toElement(const FormAssociatedElement*); | 115 template<typename T> inline const T* toElement(const FormAssociatedElement*); |
| 116 | 116 |
| 117 // Make toHTMLObjectElement() accept a FormAssociatedElement as input instead of
a Node. | 117 // Make toHTMLObjectElement() accept a FormAssociatedElement as input instead of
a Node. |
| 118 template<> inline const HTMLObjectElement* toElement<HTMLObjectElement>(const Fo
rmAssociatedElement* element) | 118 template<> inline const HTMLObjectElement* toElement<HTMLObjectElement>(const Fo
rmAssociatedElement* element) |
| 119 { | 119 { |
| 120 ASSERT_WITH_SECURITY_IMPLICATION(!element || !element->isFormControlElement(
)); | 120 SECURITY_DCHECK(!element || !element->isFormControlElement()); |
| 121 const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement
*>(element); | 121 const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement
*>(element); |
| 122 // We need to assert after the cast because FormAssociatedElement doesn't | 122 // We need to assert after the cast because FormAssociatedElement doesn't |
| 123 // have hasTagName. | 123 // have hasTagName. |
| 124 ASSERT_WITH_SECURITY_IMPLICATION(!objectElement || objectElement->hasTagName
(HTMLNames::objectTag)); | 124 SECURITY_DCHECK(!objectElement || objectElement->hasTagName(HTMLNames::objec
tTag)); |
| 125 return objectElement; | 125 return objectElement; |
| 126 } | 126 } |
| 127 | 127 |
| 128 template<> inline const HTMLObjectElement& toElement<HTMLObjectElement>(const Fo
rmAssociatedElement& element) | 128 template<> inline const HTMLObjectElement& toElement<HTMLObjectElement>(const Fo
rmAssociatedElement& element) |
| 129 { | 129 { |
| 130 ASSERT_WITH_SECURITY_IMPLICATION(!element.isFormControlElement()); | 130 SECURITY_DCHECK(!element.isFormControlElement()); |
| 131 const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement
&>(element); | 131 const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement
&>(element); |
| 132 // We need to assert after the cast because FormAssociatedElement doesn't | 132 // We need to assert after the cast because FormAssociatedElement doesn't |
| 133 // have hasTagName. | 133 // have hasTagName. |
| 134 ASSERT_WITH_SECURITY_IMPLICATION(objectElement.hasTagName(HTMLNames::objectT
ag)); | 134 SECURITY_DCHECK(objectElement.hasTagName(HTMLNames::objectTag)); |
| 135 return objectElement; | 135 return objectElement; |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace blink | 138 } // namespace blink |
| 139 | 139 |
| 140 #endif // HTMLObjectElement_h | 140 #endif // HTMLObjectElement_h |
| OLD | NEW |