-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make MathML attributes ASCII case-insensitive #178
Comments
I did a quick check and for the MathML-specific definitions, I only see case-insensitive against strings with ASCII letters and dashes. So the only difference would be for "LATIN SMALL LETTER LONG S", "KELVIN SIGN" and maybe a few "LATIN SMALL LIGATURE" (e.g. |
That's a good catch. I'm pretty sure we all agree that we only mean ASCII case-insensitivity. I suggest we add the following to the spec, which is a slight rewording from the HTML spec:
I suggest this goes into Appendix G.1: Document Conventions. |
I would prefer to be explicit everywhere and use "ASCII case-insensitive" with a link to https://infra.spec.whatwg.org/#ascii-case-insensitive ; this seems to be what the HTML and CSS specifications do (or how they would be fixed it e.g. w3c/csswg-drafts#4599 (comment)). I'm sure if we just keep case-insensitive as it is now, people will easily not read the appendix. We should also avoid duplicating definition from HTML5 as it was mentioned in another issue. |
Consensus from 2019/12/16: Move to ASCII case-insensitiveness |
The mathsize and dir attributes are defined modulo ASCII case-insensitive equivalence and are mapped to CSS font-size and direction properties [1] [2]. Since the CSS keywords are themselves defined modulo ASCII case-insensitive equivalence [3], there is not need to filter out other (Unicode) case-insensitive equivalent keywords (e.g. "ſmall") in the MathML Code, they will be rejected by the CSS parser. This CL replaces DeprecatedEqualIgnoringCase with EqualIgnoringASCIICase and adds tests to ensure that (Unicode) case-insensitive equivalent strings remain disallowed. [1] https://mathml-refresh.github.io/mathml-core/#global-attributes [2] w3c/mathml#178 [3] https://www.w3.org/TR/css-values-4/#keywords Bug: 6606 Bug: 627682 Change-Id: Ice84368c8cc7e8fff9faccb454c23fad87b99d59
These are the attributes, with the behavior changes that will require tests:
Other attributes rely on CSS ( https://mathml-refresh.github.io/mathml-core/#types-for-mathml-attribute-values ) so nothing is changed here (although tests can always be added). |
…20807) The mathsize and dir attributes are defined modulo ASCII case-insensitive equivalence and are mapped to CSS font-size and direction properties [1] [2]. Since the CSS keywords are themselves defined modulo ASCII case-insensitive equivalence [3], there is not need to filter out other (Unicode) case-insensitive equivalent keywords (e.g. "ſmall") in the MathML Code, they will be rejected by the CSS parser. This CL replaces DeprecatedEqualIgnoringCase with EqualIgnoringASCIICase and adds tests to ensure that (Unicode) case-insensitive equivalent strings remain disallowed. [1] https://mathml-refresh.github.io/mathml-core/#global-attributes [2] w3c/mathml#178 [3] https://www.w3.org/TR/css-values-4/#keywords Bug: 6606 Bug: 627682 Change-Id: Ice84368c8cc7e8fff9faccb454c23fad87b99d59
The mathsize and dir attributes are defined modulo ASCII case-insensitive equivalence and are mapped to CSS font-size and direction properties [1] [2]. Since the CSS keywords are themselves defined modulo ASCII case-insensitive equivalence [3], there is not need to filter out other (Unicode) case-insensitive equivalent keywords (e.g. "ſmall") in the MathML Code, they will be rejected by the CSS parser. This CL replaces DeprecatedEqualIgnoringCase with EqualIgnoringASCIICase and adds tests to ensure that (Unicode) case-insensitive equivalent strings remain disallowed. [1] https://mathml-refresh.github.io/mathml-core/#global-attributes [2] w3c/mathml#178 [3] https://www.w3.org/TR/css-values-4/#keywords Bug: 6606 Bug: 627682 Change-Id: Ice84368c8cc7e8fff9faccb454c23fad87b99d59 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1970615 Reviewed-by: Kent Tamura <tkent@chromium.org> Commit-Queue: Frédéric Wang <fwang@igalia.com> Cr-Commit-Position: refs/heads/master@{#725481}
If we want to keep the relax schema there are two choices either we could say in words that values should be ascii-lowercased before validation or we could make the schema do the case insensitive match. That would mean for example changing
to
which works but isn't very human readable or informative. Since we already need some pre-processing described in words to allow data-foo attributes (or onfoo attributes to be ignored, I'm tempted to suggest we keep the existing string match but could be persuaded otherwise.... |
I think this was already the case since #22 ; not sure how important it is for legacy XML applications. I wonder what is done for HTML5 ? |
On Tue, 17 Dec 2019 at 13:07, Frédéric Wang ***@***.***> wrote:
I think this was already the case since #22
<#22> ; not sure how
important it is for legacy XML applications. I wonder what is done for
HTML5 ?
The validator.nu html5 validator has a relaxng schema at its core but
heavily preprocesses the document with custom code before validating it, so
I think pre-processing is fine (and makes the schema a lot easier to read)
|
…to validate mathsize and dir, a=testonly Automatic update from web-platform-tests [mathml] Use ASCII case-insensitiveness to validate mathsize and dir (#20807) The mathsize and dir attributes are defined modulo ASCII case-insensitive equivalence and are mapped to CSS font-size and direction properties [1] [2]. Since the CSS keywords are themselves defined modulo ASCII case-insensitive equivalence [3], there is not need to filter out other (Unicode) case-insensitive equivalent keywords (e.g. "ſmall") in the MathML Code, they will be rejected by the CSS parser. This CL replaces DeprecatedEqualIgnoringCase with EqualIgnoringASCIICase and adds tests to ensure that (Unicode) case-insensitive equivalent strings remain disallowed. [1] https://mathml-refresh.github.io/mathml-core/#global-attributes [2] w3c/mathml#178 [3] https://www.w3.org/TR/css-values-4/#keywords Bug: 6606 Bug: 627682 Change-Id: Ice84368c8cc7e8fff9faccb454c23fad87b99d59 -- wpt-commits: 0cc6eb16b46a76070b11ce771e4026da2e328a6d wpt-pr: 20807
…to validate mathsize and dir, a=testonly Automatic update from web-platform-tests [mathml] Use ASCII case-insensitiveness to validate mathsize and dir (#20807) The mathsize and dir attributes are defined modulo ASCII case-insensitive equivalence and are mapped to CSS font-size and direction properties [1] [2]. Since the CSS keywords are themselves defined modulo ASCII case-insensitive equivalence [3], there is not need to filter out other (Unicode) case-insensitive equivalent keywords (e.g. "ſmall") in the MathML Code, they will be rejected by the CSS parser. This CL replaces DeprecatedEqualIgnoringCase with EqualIgnoringASCIICase and adds tests to ensure that (Unicode) case-insensitive equivalent strings remain disallowed. [1] https://mathml-refresh.github.io/mathml-core/#global-attributes [2] w3c/mathml#178 [3] https://www.w3.org/TR/css-values-4/#keywords Bug: 6606 Bug: 627682 Change-Id: Ice84368c8cc7e8fff9faccb454c23fad87b99d59 -- wpt-commits: 0cc6eb16b46a76070b11ce771e4026da2e328a6d wpt-pr: 20807
Could you, please, define this term, @fred-wang? I don't know which XML applications are legacy and which aren't. |
I believe I was talking about XML-based MathML3 implementations. |
Removing "tests" label, we have tests for mathsize and dir. It's not exhaustive, but HTML or CSS don't test exhaustively either... Also removing core label since the only remaining changes are in mathml full |
This is a follow-up of #22 ; we decided to follow HTML/CSS which treat things as ASCII case-insensitive. Concretely, ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt has this line:
which means that
falſe
is case-insensitively equal tofalse
. However, it is not ASCII case-insensitively equal tofalse
(only a-z <-> A-Z equivalence are considered in that case).Currently, the MathML Core spec just says "case-insensitive".
Note: for CSS colors, I reported w3c/csswg-drafts#4599
The text was updated successfully, but these errors were encountered: