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

Issue 943303002: Simplify form validation handling (Closed)

Created:
5 years, 10 months ago by tkent
Modified:
5 years, 10 months ago
Reviewers:
keishi
CC:
blink-reviews, dglazkov+blink, blink-reviews-html_chromium.org, spartha
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

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. 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -73 lines) Patch
M LayoutTests/fast/forms/ValidityState-valueMissing-001.html View 1 2 chunks +6 lines, -0 lines 0 comments Download
M LayoutTests/fast/forms/ValidityState-valueMissing-001-expected.txt View 1 1 chunk +3 lines, -1 line 0 comments Download
M Source/core/html/HTMLFieldSetElement.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLFieldSetElement.cpp View 1 1 chunk +0 lines, -9 lines 0 comments Download
M Source/core/html/HTMLFormControlElement.h View 1 3 chunks +2 lines, -5 lines 0 comments Download
M Source/core/html/HTMLFormControlElement.cpp View 1 4 chunks +24 lines, -18 lines 0 comments Download
M Source/core/html/HTMLFormElement.h View 2 chunks +0 lines, -6 lines 0 comments Download
M Source/core/html/HTMLFormElement.cpp View 4 chunks +4 lines, -32 lines 0 comments Download

Messages

Total messages: 14 (5 generated)
tkent
Keishi, would you review this please?
5 years, 10 months ago (2015-02-23 06:17:07 UTC) #3
tkent
+sudarshan.p
5 years, 10 months ago (2015-02-23 06:43:17 UTC) #4
keishi
lgtm
5 years, 10 months ago (2015-02-24 08:03:32 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/943303002/20001
5 years, 10 months ago (2015-02-24 08:11:32 UTC) #7
commit-bot: I haz the power
Committed patchset #1 (id:20001) as https://src.chromium.org/viewvc/blink?view=rev&revision=190723
5 years, 10 months ago (2015-02-24 08:28:29 UTC) #8
hiroshige
A revert of this CL (patchset #1 id:20001) has been created in https://codereview.chromium.org/948373002/ by hiroshige@chromium.org. ...
5 years, 10 months ago (2015-02-24 11:27:03 UTC) #9
tkent
On 2015/02/24 11:27:03, hiroshige wrote: > A revert of this CL (patchset #1 id:20001) has ...
5 years, 10 months ago (2015-02-24 23:38:00 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/943303002/40001
5 years, 10 months ago (2015-02-25 03:26:44 UTC) #13
commit-bot: I haz the power
5 years, 10 months ago (2015-02-25 03:29:41 UTC) #14
Message was sent while issue was closed.
Committed patchset #2 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=190795

Powered by Google App Engine
This is Rietveld 408576698