Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(778)

Unified Diff: Source/core/html/HTMLFormControlElement.cpp

Issue 658063002: Fix the issue where checking a form for :valid/:invalid would trigger invalid events for its elemen… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLFormControlElement.cpp
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
index 3526e51947edbc61ba26f5b8826b2fe9d2bd844c..28556642d17e564d061ab45d10520ef15939d8a0 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -486,10 +486,12 @@ ValidationMessageClient* HTMLFormControlElement::validationMessageClient() const
return &page->validationMessageClient();
}
-bool HTMLFormControlElement::checkValidity(WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls)
+bool HTMLFormControlElement::checkValidity(WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls, bool fireInvalidEvent)
{
if (!willValidate() || isValidElement())
return true;
+ if (!fireInvalidEvent)
+ return false;
// An event handler can deref this object.
RefPtrWillBeRawPtr<HTMLFormControlElement> protector(this);
RefPtrWillBeRawPtr<Document> originalDocument(document());

Powered by Google App Engine
This is Rietveld 408576698