| 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, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 HTMLFormElement* form() const { return FormAssociatedElement::form(); } | 46 HTMLFormElement* form() const { return FormAssociatedElement::form(); } |
| 47 | 47 |
| 48 String formEnctype() const; | 48 String formEnctype() const; |
| 49 void setFormEnctype(const String&); | 49 void setFormEnctype(const String&); |
| 50 String formMethod() const; | 50 String formMethod() const; |
| 51 void setFormMethod(const String&); | 51 void setFormMethod(const String&); |
| 52 bool formNoValidate() const; | 52 bool formNoValidate() const; |
| 53 | 53 |
| 54 void ancestorDisabledStateWasChanged(); | 54 void ancestorDisabledStateWasChanged(); |
| 55 | 55 |
| 56 virtual void reset() { } | 56 void reset(); |
| 57 | 57 |
| 58 virtual bool formControlValueMatchesRenderer() const { return m_valueMatches
Renderer; } | 58 virtual bool formControlValueMatchesRenderer() const { return m_valueMatches
Renderer; } |
| 59 virtual void setFormControlValueMatchesRenderer(bool b) { m_valueMatchesRend
erer = b; } | 59 virtual void setFormControlValueMatchesRenderer(bool b) { m_valueMatchesRend
erer = b; } |
| 60 | 60 |
| 61 virtual bool wasChangedSinceLastFormControlChangeEvent() const; | 61 virtual bool wasChangedSinceLastFormControlChangeEvent() const; |
| 62 virtual void setChangedSinceLastFormControlChangeEvent(bool); | 62 virtual void setChangedSinceLastFormControlChangeEvent(bool); |
| 63 | 63 |
| 64 virtual void dispatchFormControlChangeEvent(); | 64 virtual void dispatchFormControlChangeEvent(); |
| 65 virtual void dispatchFormControlInputEvent(); | 65 virtual void dispatchFormControlInputEvent(); |
| 66 | 66 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 94 void setNeedsValidityCheck(); | 94 void setNeedsValidityCheck(); |
| 95 virtual void setCustomValidity(const String&) OVERRIDE; | 95 virtual void setCustomValidity(const String&) OVERRIDE; |
| 96 | 96 |
| 97 bool isReadOnly() const { return m_isReadOnly; } | 97 bool isReadOnly() const { return m_isReadOnly; } |
| 98 bool isDisabledOrReadOnly() const { return isDisabledFormControl() || m_isRe
adOnly; } | 98 bool isDisabledOrReadOnly() const { return isDisabledFormControl() || m_isRe
adOnly; } |
| 99 | 99 |
| 100 bool hasAutofocused() const { return m_hasAutofocused; } | 100 bool hasAutofocused() const { return m_hasAutofocused; } |
| 101 void setAutofocused() { m_hasAutofocused = true; } | 101 void setAutofocused() { m_hasAutofocused = true; } |
| 102 bool isAutofocusable() const; | 102 bool isAutofocusable() const; |
| 103 | 103 |
| 104 bool isAutofilled() const { return m_isAutofilled; } |
| 105 void setAutofilled(bool = true); |
| 106 |
| 104 static HTMLFormControlElement* enclosingFormControlElement(Node*); | 107 static HTMLFormControlElement* enclosingFormControlElement(Node*); |
| 105 | 108 |
| 106 using Node::ref; | 109 using Node::ref; |
| 107 using Node::deref; | 110 using Node::deref; |
| 108 | 111 |
| 109 protected: | 112 protected: |
| 110 HTMLFormControlElement(const QualifiedName& tagName, Document&, HTMLFormElem
ent*); | 113 HTMLFormControlElement(const QualifiedName& tagName, Document&, HTMLFormElem
ent*); |
| 111 | 114 |
| 112 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 115 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
| 113 virtual void requiredAttributeChanged(); | 116 virtual void requiredAttributeChanged(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 124 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusDirection)
OVERRIDE; | 127 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusDirection)
OVERRIDE; |
| 125 virtual void dispatchBlurEvent(Element* newFocusedElement) OVERRIDE; | 128 virtual void dispatchBlurEvent(Element* newFocusedElement) OVERRIDE; |
| 126 virtual void willCallDefaultEventHandler(const Event&) OVERRIDE; | 129 virtual void willCallDefaultEventHandler(const Event&) OVERRIDE; |
| 127 | 130 |
| 128 virtual void didRecalcStyle(StyleRecalcChange) OVERRIDE; | 131 virtual void didRecalcStyle(StyleRecalcChange) OVERRIDE; |
| 129 | 132 |
| 130 // This must be called any time the result of willValidate() has changed. | 133 // This must be called any time the result of willValidate() has changed. |
| 131 void setNeedsWillValidateCheck(); | 134 void setNeedsWillValidateCheck(); |
| 132 virtual bool recalcWillValidate() const; | 135 virtual bool recalcWillValidate() const; |
| 133 | 136 |
| 137 virtual void resetImpl() { } |
| 138 |
| 134 private: | 139 private: |
| 135 virtual void refFormAssociatedElement() { ref(); } | 140 virtual void refFormAssociatedElement() { ref(); } |
| 136 virtual void derefFormAssociatedElement() { deref(); } | 141 virtual void derefFormAssociatedElement() { deref(); } |
| 137 | 142 |
| 138 virtual bool isFormControlElement() const { return true; } | 143 virtual bool isFormControlElement() const { return true; } |
| 139 virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE { return true;
} | 144 virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE { return true;
} |
| 140 | 145 |
| 141 virtual short tabIndex() const; | 146 virtual short tabIndex() const; |
| 142 | 147 |
| 143 virtual HTMLFormElement* virtualForm() const; | 148 virtual HTMLFormElement* virtualForm() const; |
| 144 virtual bool isDefaultButtonForForm() const; | 149 virtual bool isDefaultButtonForForm() const; |
| 145 virtual bool isValidFormControlElement(); | 150 virtual bool isValidFormControlElement(); |
| 146 void updateAncestorDisabledState() const; | 151 void updateAncestorDisabledState() const; |
| 147 | 152 |
| 148 OwnPtr<ValidationMessage> m_validationMessage; | 153 OwnPtr<ValidationMessage> m_validationMessage; |
| 149 bool m_disabled : 1; | 154 bool m_disabled : 1; |
| 155 bool m_isAutofilled : 1; |
| 150 bool m_isReadOnly : 1; | 156 bool m_isReadOnly : 1; |
| 151 bool m_isRequired : 1; | 157 bool m_isRequired : 1; |
| 152 bool m_valueMatchesRenderer : 1; | 158 bool m_valueMatchesRenderer : 1; |
| 153 | 159 |
| 154 enum AncestorDisabledState { AncestorDisabledStateUnknown, AncestorDisabledS
tateEnabled, AncestorDisabledStateDisabled }; | 160 enum AncestorDisabledState { AncestorDisabledStateUnknown, AncestorDisabledS
tateEnabled, AncestorDisabledStateDisabled }; |
| 155 mutable AncestorDisabledState m_ancestorDisabledState; | 161 mutable AncestorDisabledState m_ancestorDisabledState; |
| 156 enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList }; | 162 enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList }; |
| 157 mutable enum DataListAncestorState m_dataListAncestorState; | 163 mutable enum DataListAncestorState m_dataListAncestorState; |
| 158 | 164 |
| 159 // The initial value of m_willValidate depends on the derived class. We can'
t | 165 // The initial value of m_willValidate depends on the derived class. We can'
t |
| (...skipping 25 matching lines...) Expand all Loading... |
| 185 | 191 |
| 186 inline const HTMLFormControlElement* toHTMLFormControlElement(const FormAssociat
edElement* control) | 192 inline const HTMLFormControlElement* toHTMLFormControlElement(const FormAssociat
edElement* control) |
| 187 { | 193 { |
| 188 ASSERT_WITH_SECURITY_IMPLICATION(!control || control->isFormControlElement()
); | 194 ASSERT_WITH_SECURITY_IMPLICATION(!control || control->isFormControlElement()
); |
| 189 return static_cast<const HTMLFormControlElement*>(control); | 195 return static_cast<const HTMLFormControlElement*>(control); |
| 190 } | 196 } |
| 191 | 197 |
| 192 } // namespace | 198 } // namespace |
| 193 | 199 |
| 194 #endif | 200 #endif |
| OLD | NEW |