Closed Bug 1541959 Opened 2 years ago Closed 2 years ago

The text-transform property should support `full-width` and/or `full-size-kana` in combination with one of the case transforms


(Core :: CSS Parsing and Computation, defect, P3)




Tracking Status
firefox68 --- fixed


(Reporter: jfkthame, Assigned: jfkthame, Mentored)


(Blocks 1 open bug)


(Keywords: dev-doc-needed)


(3 files)

Our parsing and implementation of text-transform is incorrect. The spec[1] says:

Value: none | [capitalize | uppercase | lowercase ] || full-width || full-size-kana

which means it should be possible to use both the full-width and full-size-kana transforms together, not only individually, and either or both of them can be combined with one of the letter-case transforms.

So things like text-transform: uppercase full-width should work. But currently, we accept only a single keyword, so this is a parse error.

(Fixing this will require some changes to the implementation of the transforms, as well as to the CSS parsing and computation, as the code currently assumes that only a single value will be in effect.)


The style system changes for this are not hard. If somebody is interested in hacking on this I'm happy to mentor.

We probably want to make the text-transform specified and computed value a bitfield to represent all the combinations that we need, or maybe a struct with both the case transform an the other transforms.

Mentor: emilio

I figured looking at this might be a good way for me to learn a bit, so I've taken a stab at it, and have a patch that seems to work so far. There are probably better ways to do things, so suggestions/corrections/advice will be very welcome - thanks!

Pushed by
Allow full-width and/or full-size-kana values of text-transform to be combined with a case transformation. r=emilio
Fix WPT parsing tests for text-transform to reflect proper serialization of multiple values. r=emilio
Add a WPT reftest for rendering of text-transform with combinations of values. r=emilio
Assignee: nobody → jfkthame
Created web-platform-tests PR for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.