FIELDSET element should not check inner controls in checkValidity() |
||
Issue description
What steps will reproduce the problem?
(1) Open the following URL:
data:text/html;charset=utf-8,<fieldset><input required></fieldset><script>alert(document.querySelector('fieldset').checkValidity());</script>
(2) Observe
What is the expected output?
An alert dialog shows 'true'.
What do you see instead?
An alert dialog shows 'false'.
Please use labels and text to provide additional information.
https://html.spec.whatwg.org/multipage/forms.html#dom-cva-checkvalidity
,
Aug 3 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/52ccdca1f50ae313029eb6e996a3ef4288b3f638 commit 52ccdca1f50ae313029eb6e996a3ef4288b3f638 Author: tkent <tkent@chromium.org> Date: Wed Aug 03 13:22:52 2016 FIELDSET element should not check inner controls in checkValidity(). fieldset.checkValidity() referred to inner control validity state by accident. The common implmentatin of checkValidity() just calls isValidElement(), and FIELDSET's isValidElement() checks inner controls validity for :valid/:invalid. This CL adds willValidate check to the common checkValidity(). Also, it exposed an issue described in HTMLFormControlElement::setNeedsWillValidateCheck() because we used to clear m_validityIsDirty in checkValidity(). BUG= 633794 Review-Url: https://codereview.chromium.org/2201293002 Cr-Commit-Position: refs/heads/master@{#409500} [modify] https://crrev.com/52ccdca1f50ae313029eb6e996a3ef4288b3f638/third_party/WebKit/LayoutTests/fast/forms/checkValidity-001-expected.txt [modify] https://crrev.com/52ccdca1f50ae313029eb6e996a3ef4288b3f638/third_party/WebKit/LayoutTests/fast/forms/checkValidity-001.html [modify] https://crrev.com/52ccdca1f50ae313029eb6e996a3ef4288b3f638/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
,
Aug 3 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by tkent@chromium.org
, Aug 3 2016