layout: Implement text-transform.

The Unicode awareness of `text-transform` is implemented as well as
possible given the Rust standard library's Unicode support. In
particular, the notion of an alphabetic character is used instead of a
letter.

Gecko has a subclass of text run to handle text transforms, but I
implemented this in a simpler way.
This commit is contained in:
Patrick Walton 2014-12-09 19:04:37 -08:00
parent ba06d50e3a
commit 877f02f1d1
11 changed files with 132 additions and 2 deletions

View file

@ -187,3 +187,7 @@ fragment=top != ../html/acid2.html acid2_ref.html
== incremental_float_a.html incremental_float_ref.html
== opacity_simple_a.html opacity_simple_ref.html
== opacity_stacking_context_a.html opacity_stacking_context_ref.html
== text_transform_none_a.html text_transform_none_ref.html
== text_transform_uppercase_a.html text_transform_uppercase_ref.html
== text_transform_lowercase_a.html text_transform_lowercase_ref.html
== text_transform_capitalize_a.html text_transform_capitalize_ref.html

View file

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<!-- Tests that `text-transform: capitalize` works. -->
<body>
<h1 style='text-transform: capitalize; font-family: Hiragino Maru Gothic Pro'>ュゥゥゥゥ can do ányThing at ゾムボ.cOm</h1>
</body>
</html>

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<!-- Tests that `text-transform: capitalize` works. -->
<body>
<h1 style='font-family: Hiragino Maru Gothic Pro'>ュゥゥゥゥ Can Do ÁnyThing At ゾムボ.cOm</h1>
</body>
</html>

View file

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<!-- Tests that `text-transform: lowercase` works. -->
<body>
<h1 style='text-transform: lowercase; font-family: Hiragino Maru Gothic Pro'>YoU CaN dO ÁnYtHiNg At ゾムボ.cOm</h1>
</body>
</html>

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<!-- Tests that `text-transform: lowercase` works. -->
<body>
<h1 style='font-family: Hiragino Maru Gothic Pro'>you can do ánything at ゾムボ.com</h1>
</body>
</html>

View file

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<!-- Tests that `text-transform: none` works. -->
<body>
<h1 style='text-transform: none; font-family: Hiragino Maru Gothic Pro'>You can do anything at ゾムボ.com</h1>
</body>
</html>

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<!-- Tests that `text-transform: none` works. -->
<body>
<h1 style='font-family: Hiragino Maru Gothic Pro'>You can do anything at ゾムボ.com</h1>
</body>
</html>

View file

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<!-- Tests that `text-transform: uppercase` works. -->
<body>
<h1 style='text-transform: uppercase; font-family: Hiragino Maru Gothic Pro'>You çan do anything at ゾムボ.com</h1>
</body>
</html>

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<!-- Tests that `text-transform: uppercase` works. -->
<body>
<h1 style='font-family: Hiragino Maru Gothic Pro'>YOU ÇAN DO ANYTHING AT ゾムボ.COM</h1>
</body>
</html>