DescriptionIntroduce a Blink API for checking whether a certain locale could be valid.
Both the Web Notification API and the Media Source Extensions API
define algorithms which validate BCP 47 language tags. Chromium has
a function to check if a string is plausibly could be a syntactically-
valid locale string that we can use for this purpose.
We do not check whether the BCP 47 tag *actually* is valid, but rather
if the syntax of the tag could be valid. Additional checks can be added
later, but this at least makes sure that there won't be completely
random data in the fields.
This CL is part of a three-sided patch:
[1] This CL.
[2] https://codereview.chromium.org/1110233002/
[3] https://codereview.chromium.org/1110223002/
BUG=442137
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|