New issue
Advanced search Search tips

Issue 633794 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

FIELDSET element should not check inner controls in checkValidity()

Project Member Reported by tkent@chromium.org, Aug 3 2016

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

 

Comment 1 by tkent@chromium.org, Aug 3 2016

Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, 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

Comment 3 by tkent@chromium.org, Aug 3 2016

Labels: M-54
Status: Fixed (was: Started)

Sign in to add a comment