-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change minlength/maxlength behavior around linebreaks
As discussed in #1467, the current situation around these attributes is not very interoperable. Some browsers count line breaks as two characters (per the spec before this change), others as one character. Per discussions, this updates minlength and maxlength to count line breaks as one character. We believe this is the most developer-friendly approach, as evidenced in part by repeated complaints against Chromium for its behavior following the previous standard. While here, updated the textLength property to return the code-point length of the element's API value, instead of the element's value, since as per http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4304 that is what browsers actually do. Similarly, updated the conformance requirement on the text content of the textarea element to match maxlength's actually-implemented behavior. Fixes part of #1467, but the debate remains about code-unit length vs. code-point length vs. number of grapheme clusters.
- Loading branch information
Showing
1 changed file
with
58 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters