Index: Source/WebCore/html/HTMLFormControlElement.cpp |
=================================================================== |
--- Source/WebCore/html/HTMLFormControlElement.cpp (revision 111481) |
+++ Source/WebCore/html/HTMLFormControlElement.cpp (working copy) |
@@ -122,21 +122,15 @@ |
} else if (attr->name() == requiredAttr) { |
bool oldRequired = m_required; |
m_required = !attr->isNull(); |
- if (oldRequired != m_required) |
- requiredAttributeChanged(); |
+ if (oldRequired != m_required) { |
+ setNeedsValidityCheck(); |
+ setNeedsStyleRecalc(); // Updates for :required :optional classes. |
+ } |
} else |
HTMLElement::parseMappedAttribute(attr); |
setNeedsWillValidateCheck(); |
} |
-void HTMLFormControlElement::requiredAttributeChanged() |
-{ |
- setNeedsValidityCheck(); |
- // Style recalculation is needed because style selectors may include |
- // :required and :optional pseudo-classes. |
- setNeedsStyleRecalc(); |
-} |
- |
static bool shouldAutofocus(HTMLFormControlElement* element) |
{ |
if (!element->autofocus()) |