Skip to content

Commit

Permalink
bug 774560 pt 2 - implement text-transform:full-width. r=smontagu
Browse files Browse the repository at this point in the history
  • Loading branch information
jfkthame committed Nov 9, 2012
1 parent 0f9e3ea commit d553b2d
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 1 deletion.
1 change: 1 addition & 0 deletions layout/base/nsStyleConsts.h
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
#define NS_STYLE_TEXT_TRANSFORM_CAPITALIZE 1
#define NS_STYLE_TEXT_TRANSFORM_LOWERCASE 2
#define NS_STYLE_TEXT_TRANSFORM_UPPERCASE 3
#define NS_STYLE_TEXT_TRANSFORM_FULLWIDTH 4

// See nsStyleDisplay
#define NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE 0
Expand Down
4 changes: 4 additions & 0 deletions layout/generic/nsTextRunTransformations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,10 @@ nsCaseTransformTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun,
}
break;

case NS_STYLE_TEXT_TRANSFORM_FULLWIDTH:
ch = mozilla::unicode::GetFullWidth(ch);
break;

default:
break;
}
Expand Down
9 changes: 9 additions & 0 deletions layout/reftests/text-transform/fullwidth-1-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
</head>
<body>
<span>&#xff46;&#xff55;&#xff4c;&#xff4c;&#x3000;&#xff57;&#xff49;&#xff44;&#xff54;&#xff48;&#x3000;&#xffe5;&#xff11;&#xff10;</span>
</body>
</html>
9 changes: 9 additions & 0 deletions layout/reftests/text-transform/fullwidth-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
</head>
<body>
<span style="text-transform: full-width;">full width &#xa5;10</span>
</body>
</html>
9 changes: 9 additions & 0 deletions layout/reftests/text-transform/fullwidth-2-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
</head>
<body>
<span style="text-transform: full-width;">&#xff71;&#xff72;&#xff73;&#x3099;</span>
</body>
</html>
9 changes: 9 additions & 0 deletions layout/reftests/text-transform/fullwidth-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
</head>
<body>
<span style="text-transform: full-width;">&#xff71;&#xff72;&#xff73;&#xff9e;</span>
</body>
</html>
2 changes: 2 additions & 0 deletions layout/reftests/text-transform/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ HTTP(..) != small-caps-turkish-1.html small-caps-turkish-1-notref.html
== greek-uppercase-1.html greek-uppercase-1-ref.html
== greek-uppercase-2.html greek-uppercase-2-ref.html
== greek-small-caps-1.html greek-small-caps-1-ref.html
== fullwidth-1.html fullwidth-1-ref.html
== fullwidth-2.html fullwidth-2-ref.html
1 change: 1 addition & 0 deletions layout/style/nsCSSKeywordList.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ CSS_KEY(flex, flex)
CSS_KEY(flex-end, flex_end)
CSS_KEY(flex-start, flex_start)
CSS_KEY(forwards, forwards)
CSS_KEY(full-width, full_width)
CSS_KEY(georgian, georgian)
CSS_KEY(grad, grad)
CSS_KEY(graytext, graytext)
Expand Down
1 change: 1 addition & 0 deletions layout/style/nsCSSProps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,7 @@ const int32_t nsCSSProps::kTextTransformKTable[] = {
eCSSKeyword_capitalize, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE,
eCSSKeyword_lowercase, NS_STYLE_TEXT_TRANSFORM_LOWERCASE,
eCSSKeyword_uppercase, NS_STYLE_TEXT_TRANSFORM_UPPERCASE,
eCSSKeyword_full_width, NS_STYLE_TEXT_TRANSFORM_FULLWIDTH,
eCSSKeyword_UNKNOWN,-1
};

Expand Down
2 changes: 1 addition & 1 deletion layout/style/test/property_database.js
Original file line number Diff line number Diff line change
Expand Up @@ -3172,7 +3172,7 @@ var gCSSProperties = {
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
other_values: [ "capitalize", "uppercase", "lowercase" ],
other_values: [ "capitalize", "uppercase", "lowercase", "full-width" ],
invalid_values: []
},
"top": {
Expand Down

0 comments on commit d553b2d

Please sign in to comment.