commit | e8aaff57eaa130b2a7cdc1ce68328ad113a9e261 | [log] [tgz] |
---|---|---|
author | Kent Tamura <tkent@chromium.org> | Wed Dec 05 03:18:54 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Dec 05 03:18:54 2018 |
tree | 94eb15382a8c2c98dda0ccd589833cc2f306ddcd | |
parent | 098ef8ec87b7f01f7b31846b0303d49fa49735ee [diff] |
Form-associated custom elements: Implement form-validation This CL adds the followings to ElementInternals: - validationMessage attribute - validity attribute - willValidate attribute - checkValidity() operation - reportValidity() operation - setValidity() operation The first five are same as existing IDL attributes/operations of form control elements though they have additional form-associated custom elements checks. setValidity() makes it possible to change validity state of a form-associated custom element. This CL also enables :valid :invalid CSS selectors for form-associated custom elements, and FORM/FIELDSET ancestors take into account of form-associated custom elements. * Implementation - New attributes/operations of ElementInternals use ListedElement methods. - As for setValidity(), an ElementInternals keeps a ValidityStateFlags instance. - ElementInternals overrides callbacks for ValidityState. - HTMLFieldSetElmeent and HTMLFormElement: we need to update code so that it supports form-associated custom elements as well as HTMLFormControlElement. - HTMLElement overrides MatchesValidityPseudoClasses() and IsValidElement() to support :valid :invalid selectors. Bug: 905922 Bug: https://github.com/w3c/webcomponents/issues/187 Change-Id: I0c7e27c9c02286c455a4c63348462794ea5d7b39 Reviewed-on: https://chromium-review.googlesource.com/c/1358320 Commit-Queue: Kent Tamura <tkent@chromium.org> Reviewed-by: Hayato Ito <hayato@chromium.org> Cr-Commit-Position: refs/heads/master@{#613843}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .