bug 774560 pt 2 - implement text-transform:full-width. r=smontagu

This commit is contained in:
Jonathan Kew 2012-11-09 09:43:48 +00:00
parent f19b7d1e06
commit db6979f76c
10 changed files with 46 additions and 1 deletions

View File

@ -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

View File

@ -873,6 +873,10 @@ nsCaseTransformTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun,
}
break;
case NS_STYLE_TEXT_TRANSFORM_FULLWIDTH:
ch = mozilla::unicode::GetFullWidth(ch);
break;
default:
break;
}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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

View File

@ -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)

View File

@ -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
};

View File

@ -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": {