Index: Source/core/html/HTMLFormElement.cpp |
diff --git a/Source/core/html/HTMLFormElement.cpp b/Source/core/html/HTMLFormElement.cpp |
index 880b9adeb8a9de71c2e87bc0b52c31361df87af0..b5d42ff1b8d9d4469f3d482e7333f7ed3cff574f 100644 |
--- a/Source/core/html/HTMLFormElement.cpp |
+++ b/Source/core/html/HTMLFormElement.cpp |
@@ -116,7 +116,7 @@ bool HTMLFormElement::matchesValidityPseudoClasses() const |
bool HTMLFormElement::isValidElement() |
{ |
- return checkValidity(); |
+ return !checkInvalidControlsAndCollectUnhandled(0, HTMLFormControlElement::DispatchInvalidEventDisabled); |
} |
bool HTMLFormElement::rendererIsNeeded(const RenderStyle& style) |
@@ -290,7 +290,7 @@ bool HTMLFormElement::validateInteractively(Event* event) |
} |
WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> > unhandledInvalidControls; |
- if (!checkInvalidControlsAndCollectUnhandled(&unhandledInvalidControls)) |
+ if (!checkInvalidControlsAndCollectUnhandled(&unhandledInvalidControls, HTMLFormControlElement::DispatchInvalidEventEnabled)) |
return true; |
// Because the form has invalid controls, we abort the form submission and |
// show a validation message on a focusable form control. |
@@ -733,10 +733,10 @@ void HTMLFormElement::setNeedsValidityCheck() |
bool HTMLFormElement::checkValidity() |
{ |
- return !checkInvalidControlsAndCollectUnhandled(0); |
+ return !checkInvalidControlsAndCollectUnhandled(0, HTMLFormControlElement::DispatchInvalidEventEnabled); |
} |
-bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls) |
+bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls, HTMLFormControlElement::DispatchInvalidEvent dispatchInvalidEvent) |
{ |
RefPtrWillBeRawPtr<HTMLFormElement> protector(this); |
// Copy associatedElements because event handlers called from |
@@ -750,7 +750,7 @@ bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<R |
for (unsigned i = 0; i < elements.size(); ++i) { |
if (elements[i]->form() == this && elements[i]->isFormControlElement()) { |
HTMLFormControlElement* control = toHTMLFormControlElement(elements[i].get()); |
- if (!control->checkValidity(unhandledInvalidControls) && control->formOwner() == this) |
+ if (!control->checkValidity(unhandledInvalidControls, dispatchInvalidEvent) && control->formOwner() == this) |
hasInvalidControls = true; |
} |
} |