Re: [csswg-drafts] [css-text] Add new CSS text-transform values for math (#3745)

> I think this is a good idea. In addition to their use in math typesetting, these characters have gained some notoriety as faux-fonts & it would be nice to have a way to use them without destroying the meaning of the text content.
> 
> (It wouldn't get rid of the underlying reason they became popular: social media that supports full Unicode but not rich text formatting. _But_, it would mean that a conscientious web developer working an a CSS environment could recreate that visual effect in an accessible way.)

Thanks for the feedback!

About keeping the meaning of the text content, from the math point of view, a A with fraktur style should have the same meaning as the transformed character MATHEMATICAL FRAKTUR CAPITAL A' (U+1D504).  Or at least a11y tools should find some way to indicate that it is a fraktur A and not a normal A. Not sure if that's the case currently for text-transform, see for example https://groups.google.com/a/chromium.org/forum/#!msg/chromium-accessibility/enk1PBjEfRc/InWurOYUg0EJ

> I agree with Brian about using keywords instead of a function notation, since the `math()` function in the proposal seems to be merely a namespacing technique, and doesn't imply an operation

Yes, sorry that was a misunderstanding on my side. I thought the CSS WG had requested to change my initial proposal to use `math( )` but that was just some random idea from @rego. I'm happy with any solution that makes implementation easy.

>     1. Can the `auto` value be handled by user agent stylesheets? We don't really have a pseudoclass for "has no element children", but that seems to be all you want: `math|mi:no-children { text-transform: math-italic }`

AFAIK not with current CSS capability. It's not "mi with no children" but "mi with a unique text node which itself has a single character" (e.g. `<mi>x</mi>` is italic but `<mi>sin</mi>` is not). Gecko handles that outside the CSS engine (which does not know about the DOM) by adding some special flag on the text node.

>     3. Should there be any Unicode normalization happening before the transformation? E.g., to decompose é into e +´ so that the letter can be transformed to a math formatting character and then the accent combined with the replacement?

I personally don't know math use cases for that. At least for MathML, accents (https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Math_mode) are generally placed in a separate `<mo>` elements.

>     4. Based on the grammar, `text-transform: capitalize math-fraktur` would be allowed. It should probably be clear what the order of operations is, because there are a few case conversions that switch letters in/out of the ASCII range and therefore affect whether there are formatting conversions available.
> 
>     5. I think the grammar Brian posted should be modified to include square brackets around `full-width || full-size-kana`, otherwise it also allows `text-transform: full-width math-fraktur`. I don't think full-width variants of the math characters exist, at least not as dedicated Unicode points.

I think Brian's grammar does not allow mixing math-* values with others (if I understand correctly https://drafts.csswg.org/css-values-4/#component-combinators). That was the initial intention since I'm not sure there is a clear use case for that (again from the math point of view).

However, I agree that mixing math-* values with capitalize, uppercase or lowercase has obvious interpretation and could be acceptable, at least for latin letters. If so, I believe the grammar should be something like

`none | [capitalize | uppercase | lowercase ] || full-width || full-size-kana | [capitalize | uppercase | lowercase ] || [ math-auto | math-bold | math-italic | math-bold-italic | math-double-struck | math-bold-fraktur | math-script | math-bold-script | math-fraktur | math-sans-serif | math-bold-sans-serif | math-sans-serif-italic | math-sans-serif-bold-italic | math-monospace | math-initial | math-tailed | math-looped | math-stretched ]`

But maybe we just want to allow to mix everything and ignore transforms that don't make sense, so that the grammar is just

`none | [capitalize | uppercase | lowercase ] || full-width || full-size-kana || [ math-auto | math-bold | math-italic | math-bold-italic | math-double-struck | math-bold-fraktur | math-script | math-bold-script | math-fraktur | math-sans-serif | math-bold-sans-serif | math-sans-serif-italic | math-sans-serif-bold-italic | math-monospace | math-initial | math-tailed | math-looped | math-stretched ]`

-- 
GitHub Notification of comment by fred-wang
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3745#issuecomment-474921036 using your GitHub account

Received on Wednesday, 20 March 2019 16:39:50 UTC