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

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

Issue 703473003: Fix bug where form/fieldset :valid/:invalid won't be recalculated upon control's willValidate change (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 33f94439400cef0307050237ae35b88e057cfdb1..cb0719be95c643bc972fa6624ec6d9c0d157e9db 100644
--- a/Source/core/html/HTMLFormControlElement.h
+++ b/Source/core/html/HTMLFormControlElement.h
@@ -34,6 +34,7 @@ class HTMLFormElement;
class ValidationMessageClient;
enum CheckValidityEventBehavior { CheckValidityDispatchNoEvent, CheckValidityDispatchInvalidEvent };
+enum ValidityRecalcReason { ElementAddition, ElementRemoval, ElementModification };
// HTMLFormControlElement is the default implementation of FormAssociatedElement,
// and form-associated element implementations should use HTMLFormControlElement
@@ -142,7 +143,7 @@ protected:
virtual void didRecalcStyle(StyleRecalcChange) override final;
// This must be called any time the result of willValidate() has changed.
- void setNeedsWillValidateCheck();
+ void setNeedsWillValidateCheck(bool = true);
tkent 2014/11/06 04:44:57 I couldn't find setNeedsWillValidateCheck callsite
Bartek Nowierski 2014/11/06 07:15:44 Good catch! In one place where I'm calling with tr
tkent 2014/11/07 00:15:19 I see. nit: Because we don't like bool arguments (
Bartek Nowierski 2014/11/12 22:23:56 We don't like bool arguments more than we don't li
tkent 2014/11/13 01:15:02 I meant something like: void setNeedsWillValidate
Bartek Nowierski 2014/11/13 01:38:52 Oh. But then we'll lose the m_willValidate check a
virtual bool recalcWillValidate() const;
virtual void resetImpl() { }
@@ -168,7 +169,9 @@ private:
ValidationMessageClient* validationMessageClient() const;
// Requests validity recalc for the form owner, if one exists.
- void formOwnerSetNeedsValidityCheck();
+ // In case of removal, isValid specifies element validity upon removal.
+ // In case of addition and modification, it specified new validity.
+ void formOwnerSetNeedsValidityCheck(ValidityRecalcReason, bool isValid);
// Requests validity recalc for all ancestor fieldsets, if exist.
void fieldSetAncestorsSetNeedsValidityCheck(Node*);
« 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