-
Notifications
You must be signed in to change notification settings - Fork 14
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
Trimming of whitespace in attribute #165
Comments
Regarding the "separating part of value", I guess we should rely on definitions from https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#space-separated-tokens (see w3c/mathml#104 for menclose, which I think is the only one in mathml core?). These definitions explicitly says they may have leading or trailing ASCII whitespace. https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#comma-separated-tokens also has "optionally surrounded by ASCII whitespace". |
We currently have a few attributes implemented in the UA stylesheet: (From our experience in Chromium implementation, most of the rules can probably be moved to the C++ code, except maybe the one about accentunder="true" for math-script-level ?) I don't see anything in https://drafts.csswg.org/selectors-4/#attribute-selectors that would allow trailing/leading whitespace. Note: the "i" makes values case insensitive https://drafts.csswg.org/selectors-4/#attribute-case |
So my proposal for now is to modify https://mathml-refresh.github.io/mathml-core/#types-for-mathml-attribute-values to be explicit that "length-percentage" and "color" attributes accept optional ASCII whitespace (https://infra.spec.whatwg.org/#ascii-whitespace) at the start/end. This matches the RelaxNG MathML3 schema as well as Gecko/WebKit/Blink implementations. For other attributes the situation is a bit more inconsistent, so let's wait a bit before making the syntax less strict. |
Attributes that can't handle whitespace trimming: mathml-core/user-agent-stylesheet$ grep '=' * |
@davidcarlisle I believe this one should still be transferred to mathml-core. |
This was mentioned in w3c/mathml#63
From https://w3c.github.io/mathml/#syntax-notation-used-in-the-mathml-specification :
"Since some applications are inconsistent about normalization of whitespace, for maximum interoperability it is advisable to use only a single whitespace character for separating parts of a value. Moreover, leading and trailing whitespace in attribute values should be avoided."
Currently MathML Core does not say anything about leading/trailing whitespace in attributes. I think we should be explicit about this. Do we allow them or not?
The non-normative RelaxNG schema is inconsistent ( https://github.com/mathml-refresh/mathml-schema/tree/master/rnc ), sometimes they are allowed, sometimes they are not.
Reminder: In w3c/mathml#21 we agree to align definition on HTML5/CSS.
The text was updated successfully, but these errors were encountered: