Summary
Remove support for writing ASCII keywords using non-ASCII Case-insensitive equivalents, such as:
<link rel="ſtylesheet"> (LATIN SMALL LETTER LONG S)
window.getSelection().modify('extend', "bacKward", "character") (KELVIN SIGN)
Most web platform specifications rely on ASCII case-insensitiveness, that is two strings are equivalent if they are equal after lowercasing all the characters in the range A-Z [1]. Unicode extends this "A-Z downcasing" in different ways [2] so that e.g. "¡FRÉDÉRIC NO ES ESPAÑOL!" would be case-insensitively equal to "¡Frédéric no es Español!". This is used by some web platform specifications where it matters e.g. CSS font-families [3].
Since most web platform specifications use ASCII keywords (or even alphanumeric with a few special characters like dashes) it seems fine to restrict to ASCII case-insensitiveness. However, if you look carefully at [3], you'll find some mappings from non-ASCII to ASCII [4]. For simple mappings these are KELVIN SIGN (mapped to "k") and "LATIN SMALL LETTER LONG S" (mapped to "s").
[4] is the general chromium bug for moving to ASCII case-insensitiveness. From a quick look at DeprecatedEqualIgnoringCase [5], I see three different versions. IIUC, all these use "non-Turkic case folding". The first one use "full case folding" (which include more mapping to ASCII e.g. "LATIN SMALL LIGATURE ST" to "st") but the others just use "single case folding":
- Comparison between two strings with 16-bits chars (UTF-16)
- Comparison between two strings with 8-bits chars (Latin-1 block)
- Comparison between 8-bits and 16-bits versions.
This intent is about moving to ASCII case-insensitiveness for pre-defined ASCII keywords. In the Blink code, they are typically hardcoded 8-bits strings and use the "single case folding" so keywords containing "K" and "S" are the only ones affected. I already landed a patch for <link rel="stylesheet"> [7] so I felt I should bring this up to blink-dev.
[1] https://infra.spec.whatwg.org/#ascii-case-insensitive
[2] ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt
[3] https://drafts.csswg.org/css-fonts/#localized-name-matching
[4] https://github.com/w3c/csswg-drafts/issues/4599#issuecomment-565794132
[5] https://bugs.chromium.org/p/chromium/issues/detail?id=627682
[6] https://source.chromium.org/search?q=deprecatedEqualIgnoringCase%20filepath:third_party%2Fblink%2F
[7] https://chromium-review.googlesource.com/c/chromium/src/+/1963850
Motivation
- Follow web platform specifications (which use ASCII case insensitiveness).
- Align with what WebKit and Gecko implement.
- Make Chromium usage consistent (some features like CSS colors already use ASCII case insensitiveness).
Interoperability and Compatibility Risk
The interoperability risk seems low, HTML5 use ASCII case-insensitiveness and that's already the case for most CSS specifications too ( https://github.com/w3c/csswg-drafts/issues/4599#issuecomment-565816911 ). I haven’t checked status and position of other browsers but at least <link rel="ſtylesheet"> is not supported in WebKit or Gecko.
The compatibility risk seems low too as these are really edge cases. Regressions would happen only if someone uses the Kelvin sign or the long S to write “k” and “s” to write ASCII keywords which seems really unlikely.
Alternative implementation suggestion for web developers
Alternative is to use ASCII case-insensitive equivalents, which are actually easier to write.
Usage information from UseCounter
No
Entry on the feature dashboard
Not needed, it’s a very tiny change.
-- Frédéric Wang
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/d3f909b3-dc61-dcac-9488-ab490d444c4c%40igalia.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEi8pBTN-hLwU8jd6%3DGoRdN5f2cYNvAoCqJXffjNXgDnig%40mail.gmail.com.
-- Frédéric Wang
LGTM3 - good catch
Since WebKit and Blink differs, I guess they have already done
the change successfully, or this was introduced by accident.
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/708c2172-dcaa-7b5c-0ad6-34fbd3e79727%40igalia.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/e75e234c-70f7-1169-eb3f-8e84df9bddbe%40gmail.com.
-- Frédéric Wang
LGTM1 assuming you're also adding WPTs as part of the landing patches
@Yoav Just to clarify, I understand you mean adding WPT tests for
actual behavior changes? As Mike pointed out, there are a lot of
calls and while a search & replace is easy, writing tests will
be a bit more work. However, as I mentioned most of the keywords
don't contain any S or K so the change is not visible at all in
these cases. Other things that can be affected like
DOMSelection.modify
(https://developer.mozilla.org/en-US/docs/Web/API/Selection/modify)
don't seem to be part of any web standard, so I'm not sure we
should write WPT tests for them (although it's probably good to
write internal ones).
-- Frédéric Wang
On 16/12/2019 10:20, Yoav Weiss wrote:
LGTM1 assuming you're also adding WPTs as part of the landing patches
@Yoav Just to clarify, I understand you mean adding WPT tests for actual behavior changes? As Mike pointed out, there are a lot of calls and while a search & replace is easy, writing tests will be a bit more work. However, as I mentioned most of the keywords don't contain any S or K so the change is not visible at all in these cases.
Other things that can be affected like DOMSelection.modify (https://developer.mozilla.org/en-US/docs/Web/API/Selection/modify) don't seem to be part of any web standard, so I'm not sure we should write WPT tests for them (although it's probably good to write internal ones).
--
-- Frédéric Wang
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/5320f63c-8c8a-1874-66bf-6df472af4c91%40igalia.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEiF32zXVvjWghbY190ubp-kKhJO%3Dg0eGFTsb9MwHWvrMw%40mail.gmail.com.
Actually we let developers know about removals.
https://www.chromestatus.com/features#browsers.chrome.status%3A%22Deprecated%22
https://www.chromestatus.com/features#browsers.chrome.status%3A%22Removed%22
https://developers.google.com/web/updates/tags/deprecations
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY8rgK9bEf1Ag%3DWQSYS5PsSk4ha2JqiTAyUErXzUq0%3DmQQ%40mail.gmail.com.
"Entry on the feature dashboardNot needed, it’s a very tiny change."
Actually we let developers know about removals.
https://www.chromestatus.com/features#browsers.chrome.status%3A%22Deprecated%22
https://www.chromestatus.com/features#browsers.chrome.status%3A%22Removed%22
https://developers.google.com/web/updates/tags/deprecations
If an API's not documented it doesn't exist.
@Joe: I followed documentation here https://docs.google.com/document/d/1Z7bbuD5ZMzvvLcUs9kAgYzd65ld80d5-p4Cl2a04bV0/edit#
"The feature dashboard is used to keep track of web-facing changes in Blink (and V8) that matter to developers. Make sure your change has an entry if you think it merits outreach to developers (e.g inclusion in the Chromium Blog Beta posts). If there’s no entry, please explain why you think this change doesn’t need one (e.g. “small change”, “fits under an existing entry”). You may be asked to create one."As I explained, in practice I believed nobody writes ASCII keywords with non-ASCII characters + it's not supported by other browsers, so it does not seem important to inform users about this change.
However, I'm happy to create an entry if people feel it's needed.
-- Frédéric Wang
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/a121e645-ba32-31a2-e546-b4bf687fac8d%40igalia.com.
At least send me the tracking bug so I'll know when to list it.
If an API's not documented it doesn't exist.
There is a more general tracking bug that I mentioned in my initial email, for moving callers to EqualIgnoringASCIICase, LowerASCII, UpperASCII:
https://bugs.chromium.org/p/chromium/issues/detail?id=627682
Do you want me to create a separate tracking bug for the
particular web-exposed changes corresponding to this
intent-to-remove?
-- Frédéric Wang
On 9 January, Rick Byers wrote:So I'd be supportive of taking some risk and trying out a fairly mechanical replacement of DeprecatedEqualIgnoringCase (otherwise these sorts of things tend to just linger forever out of fear of fixing them). But if we hit a couple real-world cases of breakage then we may need to scale back to a subset and/or add some metrics to be more scientific about it.
I’ve been working on this intent with that approach in mind, so after my first couple of patches [1][2] I put together a breakdown of Blink’s deprecated string operations:
Hi Delan,
Thanks for the very detailed breakdown.
- 1 CSS syntax (needs further discussion)
- 4 Chrome extension API
- 1 Blink internal API
I guess these are a bit of the scope of this intent-to, you could
either send trivial replacements CL without tests or just mention
them in a summary comment on the broader tracking bug when you are
done with the rest of the replacement.
What are is the three-argument version of DeprecatedEqualIgnoringCase?
- 47 two arguments neither 8-bit literal
- ? one of which is ASCII constant
- 13 three arguments
I think this is the other way around, DeprecatedUpper was removed in https://codereview.chromium.org/2821633002
- 46 DeprecatedUpper
- ? result compared against ASCII constant
- 0 DeprecatedLower
-- Frédéric Wang
So I'd be supportive of taking some risk and trying out a fairly mechanical replacement of DeprecatedEqualIgnoringCase (otherwise these sorts of things tend to just linger forever out of fear of fixing them). But if we hit a couple real-world cases of breakage then we may need to scale back to a subset and/or add some metrics to be more scientific about it.
Thanks for the very detailed breakdown.
I guess these are a bit of the scope of this intent-to, you could either send trivial replacements CL without tests or just mention them in a summary comment on the broader tracking bug when you are done with the rest of the replacement.
What are is the three-argument version of DeprecatedEqualIgnoringCase?
I think this is the other way around, DeprecatedUpper was removed in https://codereview.chromium.org/2821633002
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/78c80564-fd1f-4667-ab3e-fd956c85da40%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJUhtG9kvoTa1Mxdv9MozNwrGyGEt6cBz2B05dg29aP5LJeEfw%40mail.gmail.com.
-- Frédéric Wang
Hi Joe,
Sure, I was waiting for https://groups.google.com/a/chromium.org/forum/#!topic/blink-api-owners-discuss/oJsHeahMUfw but it seems the discussion have stalled. I'll create an entry today anyway.
On 30/03/2020 20:21, 'Joe Medley' via blink-dev wrote:
Can someone please create a Chrome Status entry for this?
If an API's not documented it doesn't exist.
-- Frédéric Wang