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

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

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: Change bool into enum for dispatching invalid event on checkValidity 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.h
diff --git a/Source/core/html/HTMLFormControlElement.h b/Source/core/html/HTMLFormControlElement.h
index 4904ed4277696ea1cf8d3a5303831c933a472a73..58dea85192b0ed484ff1c79c1b759a8b701eae99 100644
--- a/Source/core/html/HTMLFormControlElement.h
+++ b/Source/core/html/HTMLFormControlElement.h
@@ -85,11 +85,11 @@ public:
virtual void setActivatedSubmit(bool) { }
virtual bool willValidate() const override;
- virtual bool matchesValidityPseudoClasses() const override;
void updateVisibleValidationMessage();
void hideVisibleValidationMessage();
- bool checkValidity(WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls = 0);
+ enum DispatchInvalidEvent { DispatchInvalidEventUnknown, DispatchInvalidEventEnabled, DispatchInvalidEventDisabled };
keishi 2014/10/17 05:46:12 We're not switching a enabled/disabled state so I
Bartek Nowierski 2014/10/17 06:17:59 Your suggestion created a clash with DispatcNoEven
+ bool checkValidity(WillBeHeapVector<RefPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls = 0, DispatchInvalidEvent = DispatchInvalidEventEnabled);
// This must be called when a validation constraint or control value is changed.
void setNeedsValidityCheck();
virtual void setCustomValidity(const String&) override final;
@@ -157,6 +157,7 @@ private:
virtual bool isDefaultButtonForForm() const override final;
virtual bool isValidElement() override final;
+ virtual bool matchesValidityPseudoClasses() const override final;
void updateAncestorDisabledState() const;
bool isValidationMessageVisible() const;
« no previous file with comments | « LayoutTests/fast/forms/form-pseudo-valid-style-expected.txt ('k') | Source/core/html/HTMLFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698