| 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 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 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 12 matching lines...) Expand all Loading... |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #include "config.h" | 25 #include "config.h" |
| 26 #include "HTMLFormControlElement.h" | 26 #include "HTMLFormControlElement.h" |
| 27 | 27 |
| 28 #include "Attribute.h" | 28 #include "Attribute.h" |
| 29 #include "ElementShadow.h" | 29 #include "ElementShadow.h" |
| 30 #include "Event.h" | 30 #include "Event.h" |
| 31 #include "EventHandler.h" | 31 #include "EventHandler.h" |
| 32 #include "EventNames.h" | 32 #include "EventNames.h" |
| 33 #include "FeatureObserver.h" | 33 #include "UseCounter.h" |
| 34 #include "Frame.h" | 34 #include "Frame.h" |
| 35 #include "HTMLFieldSetElement.h" | 35 #include "HTMLFieldSetElement.h" |
| 36 #include "HTMLFormElement.h" | 36 #include "HTMLFormElement.h" |
| 37 #include "HTMLInputElement.h" | 37 #include "HTMLInputElement.h" |
| 38 #include "HTMLLegendElement.h" | 38 #include "HTMLLegendElement.h" |
| 39 #include "RenderBox.h" | 39 #include "RenderBox.h" |
| 40 #include "RenderTheme.h" | 40 #include "RenderTheme.h" |
| 41 #include "ScriptEventListener.h" | 41 #include "ScriptEventListener.h" |
| 42 #include "ValidationMessage.h" | 42 #include "ValidationMessage.h" |
| 43 #include "ValidityState.h" | 43 #include "ValidityState.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 void HTMLFormControlElement::ancestorDisabledStateWasChanged() | 119 void HTMLFormControlElement::ancestorDisabledStateWasChanged() |
| 120 { | 120 { |
| 121 m_ancestorDisabledState = AncestorDisabledStateUnknown; | 121 m_ancestorDisabledState = AncestorDisabledStateUnknown; |
| 122 disabledAttributeChanged(); | 122 disabledAttributeChanged(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void HTMLFormControlElement::parseAttribute(const QualifiedName& name, const Ato
micString& value) | 125 void HTMLFormControlElement::parseAttribute(const QualifiedName& name, const Ato
micString& value) |
| 126 { | 126 { |
| 127 if (name == formAttr) { | 127 if (name == formAttr) { |
| 128 formAttributeChanged(); | 128 formAttributeChanged(); |
| 129 FeatureObserver::observe(document(), FeatureObserver::FormAttribute); | 129 UseCounter::observe(document(), UseCounter::FormAttribute); |
| 130 } else if (name == disabledAttr) { | 130 } else if (name == disabledAttr) { |
| 131 bool oldDisabled = m_disabled; | 131 bool oldDisabled = m_disabled; |
| 132 m_disabled = !value.isNull(); | 132 m_disabled = !value.isNull(); |
| 133 if (oldDisabled != m_disabled) | 133 if (oldDisabled != m_disabled) |
| 134 disabledAttributeChanged(); | 134 disabledAttributeChanged(); |
| 135 } else if (name == readonlyAttr) { | 135 } else if (name == readonlyAttr) { |
| 136 bool wasReadOnly = m_isReadOnly; | 136 bool wasReadOnly = m_isReadOnly; |
| 137 m_isReadOnly = !value.isNull(); | 137 m_isReadOnly = !value.isNull(); |
| 138 if (wasReadOnly != m_isReadOnly) { | 138 if (wasReadOnly != m_isReadOnly) { |
| 139 setNeedsWillValidateCheck(); | 139 setNeedsWillValidateCheck(); |
| 140 setNeedsStyleRecalc(); | 140 setNeedsStyleRecalc(); |
| 141 if (renderer() && renderer()->style()->hasAppearance()) | 141 if (renderer() && renderer()->style()->hasAppearance()) |
| 142 renderer()->theme()->stateChanged(renderer(), ReadOnlyState); | 142 renderer()->theme()->stateChanged(renderer(), ReadOnlyState); |
| 143 } | 143 } |
| 144 } else if (name == requiredAttr) { | 144 } else if (name == requiredAttr) { |
| 145 bool wasRequired = m_isRequired; | 145 bool wasRequired = m_isRequired; |
| 146 m_isRequired = !value.isNull(); | 146 m_isRequired = !value.isNull(); |
| 147 if (wasRequired != m_isRequired) | 147 if (wasRequired != m_isRequired) |
| 148 requiredAttributeChanged(); | 148 requiredAttributeChanged(); |
| 149 FeatureObserver::observe(document(), FeatureObserver::RequiredAttribute)
; | 149 UseCounter::observe(document(), UseCounter::RequiredAttribute); |
| 150 } else if (name == autofocusAttr) { | 150 } else if (name == autofocusAttr) { |
| 151 HTMLElement::parseAttribute(name, value); | 151 HTMLElement::parseAttribute(name, value); |
| 152 FeatureObserver::observe(document(), FeatureObserver::AutoFocusAttribute
); | 152 UseCounter::observe(document(), UseCounter::AutoFocusAttribute); |
| 153 } else | 153 } else |
| 154 HTMLElement::parseAttribute(name, value); | 154 HTMLElement::parseAttribute(name, value); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void HTMLFormControlElement::disabledAttributeChanged() | 157 void HTMLFormControlElement::disabledAttributeChanged() |
| 158 { | 158 { |
| 159 setNeedsWillValidateCheck(); | 159 setNeedsWillValidateCheck(); |
| 160 didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled); | 160 didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled); |
| 161 if (renderer() && renderer()->style()->hasAppearance()) | 161 if (renderer() && renderer()->style()->hasAppearance()) |
| 162 renderer()->theme()->stateChanged(renderer(), EnabledState); | 162 renderer()->theme()->stateChanged(renderer(), EnabledState); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 } | 483 } |
| 484 | 484 |
| 485 void HTMLFormControlElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInf
o) const | 485 void HTMLFormControlElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInf
o) const |
| 486 { | 486 { |
| 487 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); | 487 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); |
| 488 LabelableElement::reportMemoryUsage(memoryObjectInfo); | 488 LabelableElement::reportMemoryUsage(memoryObjectInfo); |
| 489 info.addMember(m_validationMessage, "validationMessage"); | 489 info.addMember(m_validationMessage, "validationMessage"); |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace Webcore | 492 } // namespace Webcore |
| OLD | NEW |