| 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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 void focus(const FocusParams&) override; | 65 void focus(const FocusParams&) override; |
| 66 | 66 |
| 67 // FormAssociatedElement methods | 67 // FormAssociatedElement methods |
| 68 bool isFormControlElement() const override { return false; } | 68 bool isFormControlElement() const override { return false; } |
| 69 bool isEnumeratable() const override { return false; } | 69 bool isEnumeratable() const override { return false; } |
| 70 bool isLabelElement() const override { return true; } | 70 bool isLabelElement() const override { return true; } |
| 71 | 71 |
| 72 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS
tring&) override; | 72 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS
tring&) override; |
| 73 | 73 |
| 74 void updateLabel(TreeScope&, const AtomicString& oldForAttributeValue, const
AtomicString& newForAttributeValue); | |
| 75 | |
| 76 bool m_processingClick; | 74 bool m_processingClick; |
| 77 }; | 75 }; |
| 78 | 76 |
| 79 | 77 |
| 80 template<typename T> inline const T& toElement(const FormAssociatedElement&); | 78 template<typename T> inline const T& toElement(const FormAssociatedElement&); |
| 81 template<typename T> inline const T* toElement(const FormAssociatedElement*); | 79 template<typename T> inline const T* toElement(const FormAssociatedElement*); |
| 82 // Make toHTMLLabelElement() accept a FormAssociatedElement as input instead of
a Node. | 80 // Make toHTMLLabelElement() accept a FormAssociatedElement as input instead of
a Node. |
| 83 template<> inline const HTMLLabelElement* toElement<HTMLLabelElement>(const Form
AssociatedElement* element) | 81 template<> inline const HTMLLabelElement* toElement<HTMLLabelElement>(const Form
AssociatedElement* element) |
| 84 { | 82 { |
| 85 const HTMLLabelElement* labelElement = static_cast<const HTMLLabelElement*>(
element); | 83 const HTMLLabelElement* labelElement = static_cast<const HTMLLabelElement*>(
element); |
| 86 // FormAssociatedElement doesn't have hasTagName, hence check for assert. | 84 // FormAssociatedElement doesn't have hasTagName, hence check for assert. |
| 87 ASSERT_WITH_SECURITY_IMPLICATION(!labelElement || labelElement->hasTagName(H
TMLNames::labelTag)); | 85 ASSERT_WITH_SECURITY_IMPLICATION(!labelElement || labelElement->hasTagName(H
TMLNames::labelTag)); |
| 88 return labelElement; | 86 return labelElement; |
| 89 } | 87 } |
| 90 | 88 |
| 91 template<> inline const HTMLLabelElement& toElement<HTMLLabelElement>(const Form
AssociatedElement& element) | 89 template<> inline const HTMLLabelElement& toElement<HTMLLabelElement>(const Form
AssociatedElement& element) |
| 92 { | 90 { |
| 93 const HTMLLabelElement& labelElement = static_cast<const HTMLLabelElement&>(
element); | 91 const HTMLLabelElement& labelElement = static_cast<const HTMLLabelElement&>(
element); |
| 94 // FormAssociatedElement doesn't have hasTagName, hence check for assert. | 92 // FormAssociatedElement doesn't have hasTagName, hence check for assert. |
| 95 ASSERT_WITH_SECURITY_IMPLICATION(labelElement.hasTagName(HTMLNames::labelTag
)); | 93 ASSERT_WITH_SECURITY_IMPLICATION(labelElement.hasTagName(HTMLNames::labelTag
)); |
| 96 return labelElement; | 94 return labelElement; |
| 97 } | 95 } |
| 98 | 96 |
| 99 } // namespace blink | 97 } // namespace blink |
| 100 | 98 |
| 101 #endif // HTMLLabelElement_h | 99 #endif // HTMLLabelElement_h |
| OLD | NEW |