Simplify 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. 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= Review URL: https://codereview.chromium.org/943303002 git-svn-id: svn://svn.chromium.org/blink/trunk@190723 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment