DescriptionSimplify form validation handling
This CL contains some part of https://codereview.chromium.org/460343004/ by
sudarshan.p, which was reverted by a performance regression.
This CL simplifies form validation state handling code by
- lazy update of m_isValid
setNeedsValidityCheck just makes m_isValid dirty.
- m_isValid takes care of willValidate state too.
m_isValid = !willValidate() || valid()
We switched to invalidation sets for :valid and :invalid by Blink
r184392. Calling pseudoStateChanged() for unchanged validity state won't have so
bad performance. So, we can evaluate m_isValid lazily.
This CL fixes a SELECT default selection bug, crbug.com/461586, because
We don't call HTMLSelectElement::selectedIndex() during SELECT children
parsing.
We need to change the meaning of m_isValid slightly so that it takes care of
willValidate(). This is necessary to clean m_validityIsDirty of associated
controls in HTMLFormElement::checkInvalidControlsAndCollectUnhandled.
Without this change, there would be a case where willValidate state
change won't invalidate :valid :invalid style of <form>.
This CL will have a few percent regression on blink_perf.dom:textarea-edit.
A fix for the performance regression will be landed soon.
BUG=461586
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=190795
Patch Set 1 : #Patch Set 2 : add a test #
Messages
Total messages: 14 (5 generated)
|