Bug 1385478 - Part 1: Use IsRequired/Required() to get the current required state. r=bz
IsRequired() helper function returns the current 'required' state of the element, that is, whether its required attribute is set or not. This will be used only for input elements that @required applies.
This commit is contained in:
@@ -958,7 +958,7 @@ HTMLTextAreaElement::IntrinsicState() const
|
||||
{
|
||||
EventStates state = nsGenericHTMLFormElementWithState::IntrinsicState();
|
||||
|
||||
if (HasAttr(kNameSpaceID_None, nsGkAtoms::required)) {
|
||||
if (Required()) {
|
||||
state |= NS_EVENT_STATE_REQUIRED;
|
||||
} else {
|
||||
state |= NS_EVENT_STATE_OPTIONAL;
|
||||
@@ -1218,7 +1218,7 @@ HTMLTextAreaElement::IsTooShort()
|
||||
bool
|
||||
HTMLTextAreaElement::IsValueMissing() const
|
||||
{
|
||||
if (!HasAttr(kNameSpaceID_None, nsGkAtoms::required) || !IsMutable()) {
|
||||
if (!Required() || !IsMutable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user