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

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

Issue 583833007: Revert of Fix update of validity cache value, so that it reflects the correct state of any ... (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « Source/core/html/HTMLFormControlElement.h ('k') | Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormControlElement.cpp
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
index 3ad09c1b9ffe14b63973f60877eb318aad4bf0be..7d15a19bcb726573a988af020ccc734aca3fa127 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -58,7 +58,6 @@
, m_willValidateInitialized(false)
, m_willValidate(true)
, m_isValid(true)
- , m_validityIsDirty(true)
, m_wasChangedSinceLastFormControlChangeEvent(false)
, m_wasFocusedByMouse(false)
{
@@ -474,24 +473,20 @@
bool HTMLFormControlElement::isValidFormControlElement()
{
- if (m_validityIsDirty) {
- m_isValid = valid();
- m_validityIsDirty = false;
- } else {
- // If the following assertion fails, setNeedsValidityCheck() is not called
- // correctly when something which changes validity is updated.
- ASSERT(m_isValid == valid());
- }
+ // If the following assertion fails, setNeedsValidityCheck() is not called
+ // correctly when something which changes validity is updated.
+ ASSERT(m_isValid == valid());
return m_isValid;
}
void HTMLFormControlElement::setNeedsValidityCheck()
{
- if (!m_validityIsDirty && willValidate()) {
+ bool newIsValid = valid();
+ if (willValidate() && newIsValid != m_isValid) {
// Update style for pseudo classes such as :valid :invalid.
setNeedsStyleRecalc(SubtreeStyleChange);
- m_validityIsDirty = true;
- }
+ }
+ m_isValid = newIsValid;
// Updates only if this control already has a validation message.
if (isValidationMessageVisible()) {
« no previous file with comments | « Source/core/html/HTMLFormControlElement.h ('k') | Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698