-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UseCounter for incompatible
pattern
attribute values
A proposed change to the HTML pattern attribute [1] swaps the `u` RegExp flag for the new `v` flag [2], resulting in some potential incompatibility. Some previously valid patterns are now errors, specifically those with a character class including either an unescaped special character or a double punctuator: pattern="[(]" pattern="[)]" pattern="[[]" pattern="[{]" pattern="[}]" pattern="[/]" pattern="[-]" pattern="[|]" pattern="[&&]" pattern="[!!]" pattern="[##]" pattern="[$$]" pattern="[%%]" pattern="[**]" pattern="[++]" pattern="[,,]" pattern="[..]" pattern="[::]" pattern="[;;]" pattern="[<<]" pattern="[==]" pattern="[>>]" pattern="[??]" pattern="[@@]" pattern="[``]" pattern="[~~]" pattern="[_^^]" We don’t expect such patterns to be very common. This UseCounter aims to validate that assumption. Note that throwing patterns result in `inputElement.validity.valid === true` for any input value, so the only compatibility risk is that some value/pattern combinations that would previously result in `inputElement.validity.valid === false` now result in `inputElement.validity.valid === true`. [1]: whatwg/html#7908 [2]: https://v8.dev/features/regexp-v-flag Bug: chromium:1412729 Change-Id: Ifa8bcc27dbf6e8a2a7098643dbb27a7633bb97de Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4249120 Reviewed-by: Mason Freed <[email protected]> Commit-Queue: Mathias Bynens <[email protected]> Reviewed-by: Alexei Svitkine <[email protected]> Cr-Commit-Position: refs/heads/main@{#1105129}
- Loading branch information
1 parent
675e1b5
commit 100082a
Showing
5 changed files
with
33 additions
and
7 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
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
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
2 changes: 2 additions & 0 deletions
2
third_party/blink/web_tests/fast/forms/ValidityState-patternMismatch-expected.txt
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
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