Chromium Code Reviews| Index: Source/core/html/HTMLObjectElement.h |
| diff --git a/Source/core/html/HTMLObjectElement.h b/Source/core/html/HTMLObjectElement.h |
| index 347ed7993f84c2d830523921f786417f11f132d6..1ca9fd85774ebaeb8114eb16a953b7eed6f4fd53 100644 |
| --- a/Source/core/html/HTMLObjectElement.h |
| +++ b/Source/core/html/HTMLObjectElement.h |
| @@ -111,9 +111,13 @@ private: |
| bool m_useFallbackContent : 1; |
| }; |
| -DEFINE_NODE_TYPE_CASTS(HTMLObjectElement, hasTagName(HTMLNames::objectTag)); |
| +// Intentionally left unimplemented, template specialization needs to be provided for specific |
| +// return types. |
| +template<typename T> inline const T& toElement(const FormAssociatedElement&); |
|
Inactive
2014/02/23 18:27:33
I made toHTMLObjectElement() accept a FormAssociat
|
| +template<typename T> inline const T* toElement(const FormAssociatedElement*); |
| -inline const HTMLObjectElement* toHTMLObjectElement(const FormAssociatedElement* element) |
| +// Make toHTMLObjectElement() accept a FormAssociatedElement as input instead of a Node. |
| +template<> inline const HTMLObjectElement* toElement<HTMLObjectElement>(const FormAssociatedElement* element) |
| { |
| ASSERT_WITH_SECURITY_IMPLICATION(!element || !element->isFormControlElement()); |
| const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement*>(element); |
| @@ -123,7 +127,7 @@ inline const HTMLObjectElement* toHTMLObjectElement(const FormAssociatedElement* |
| return objectElement; |
| } |
| -inline const HTMLObjectElement& toHTMLObjectElement(const FormAssociatedElement& element) |
| +template<> inline const HTMLObjectElement& toElement<HTMLObjectElement>(const FormAssociatedElement& element) |
| { |
| ASSERT_WITH_SECURITY_IMPLICATION(!element.isFormControlElement()); |
| const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement&>(element); |