Closed Bug 1541959 Opened 5 years ago Closed 5 years ago

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

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

Attachments

(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.)

[1] https://drafts.csswg.org/css-text/#text-transform-property

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 jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6791dc830ee3
Allow full-width and/or full-size-kana values of text-transform to be combined with a case transformation. r=emilio
https://hg.mozilla.org/integration/autoland/rev/b7de63e1f333
Fix WPT parsing tests for text-transform to reflect proper serialization of multiple values. r=emilio
https://hg.mozilla.org/integration/autoland/rev/5e8efe9fed4c
Add a WPT reftest for rendering of text-transform with combinations of values. r=emilio
Assignee: nobody → jfkthame
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16520 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: