Index: Source/core/layout/LayoutListMarker.cpp |
diff --git a/Source/core/rendering/RenderListMarker.cpp b/Source/core/layout/LayoutListMarker.cpp |
similarity index 48% |
rename from Source/core/rendering/RenderListMarker.cpp |
rename to Source/core/layout/LayoutListMarker.cpp |
index 67c7f0e5132f66c330d55e0c63fa0136fa046fde..8e9e6a09e7e7f7e328480697674247bc160ce6dd 100644 |
--- a/Source/core/rendering/RenderListMarker.cpp |
+++ b/Source/core/layout/LayoutListMarker.cpp |
@@ -23,13 +23,13 @@ |
*/ |
#include "config.h" |
-#include "core/rendering/RenderListMarker.h" |
+#include "core/layout/LayoutListMarker.h" |
#include "core/fetch/ImageResource.h" |
#include "core/layout/Layer.h" |
+#include "core/layout/LayoutListItem.h" |
#include "core/layout/TextRunConstructor.h" |
#include "core/paint/ListMarkerPainter.h" |
-#include "core/rendering/RenderListItem.h" |
#include "platform/fonts/Font.h" |
#include "wtf/text/StringBuilder.h" |
@@ -205,9 +205,9 @@ static String toHebrew(int number) |
UChar letters[lettersSize]; |
int length; |
- if (number < 1000) |
+ if (number < 1000) { |
length = 0; |
- else { |
+ } else { |
length = toHebrewUnder1000(number / 1000, letters); |
letters[length++] = '\''; |
number = number % 1000; |
@@ -323,19 +323,19 @@ static String toCJKIdeographic(int number, const UChar table[16]) |
ASSERT(number >= 0); |
enum AbstractCJKChar { |
- noChar, |
- secondGroupMarker, thirdGroupMarker, fourthGroupMarker, |
- secondDigitMarker, thirdDigitMarker, fourthDigitMarker, |
- digit0, digit1, digit2, digit3, digit4, |
- digit5, digit6, digit7, digit8, digit9 |
+ NoChar, |
+ SecondGroupMarker, ThirdGroupMarker, FourthGroupMarker, |
+ SecondDigitMarker, ThirdDigitMarker, FourthDigitMarker, |
+ Digit0, Digit1, Digit2, Digit3, Digit4, |
+ Digit5, Digit6, Digit7, Digit8, Digit9 |
}; |
if (number == 0) |
- return String(&table[digit0 - 1], 1); |
+ return String(&table[Digit0 - 1], 1); |
const int groupLength = 8; // 4 digits, 3 digit markers, and a group marker |
const int bufferLength = 4 * groupLength; |
- AbstractCJKChar buffer[bufferLength] = { noChar }; |
+ AbstractCJKChar buffer[bufferLength] = { NoChar }; |
for (int i = 0; i < 4; ++i) { |
int groupValue = number % 10000; |
@@ -345,54 +345,54 @@ static String toCJKIdeographic(int number, const UChar table[16]) |
AbstractCJKChar* group = &buffer[(3 - i) * groupLength]; |
if (groupValue && i) |
- group[7] = static_cast<AbstractCJKChar>(secondGroupMarker - 1 + i); |
+ group[7] = static_cast<AbstractCJKChar>(SecondGroupMarker - 1 + i); |
// Put in the four digits and digit markers for any non-zero digits. |
- group[6] = static_cast<AbstractCJKChar>(digit0 + (groupValue % 10)); |
+ group[6] = static_cast<AbstractCJKChar>(Digit0 + (groupValue % 10)); |
if (number != 0 || groupValue > 9) { |
int digitValue = ((groupValue / 10) % 10); |
- group[4] = static_cast<AbstractCJKChar>(digit0 + digitValue); |
+ group[4] = static_cast<AbstractCJKChar>(Digit0 + digitValue); |
if (digitValue) |
- group[5] = secondDigitMarker; |
+ group[5] = SecondDigitMarker; |
} |
if (number != 0 || groupValue > 99) { |
int digitValue = ((groupValue / 100) % 10); |
- group[2] = static_cast<AbstractCJKChar>(digit0 + digitValue); |
+ group[2] = static_cast<AbstractCJKChar>(Digit0 + digitValue); |
if (digitValue) |
- group[3] = thirdDigitMarker; |
+ group[3] = ThirdDigitMarker; |
} |
if (number != 0 || groupValue > 999) { |
int digitValue = groupValue / 1000; |
- group[0] = static_cast<AbstractCJKChar>(digit0 + digitValue); |
+ group[0] = static_cast<AbstractCJKChar>(Digit0 + digitValue); |
if (digitValue) |
- group[1] = fourthDigitMarker; |
+ group[1] = FourthDigitMarker; |
} |
// Remove the tens digit, but leave the marker, for any group that has |
// a value of less than 20. |
if (groupValue < 20) { |
- ASSERT(group[4] == noChar || group[4] == digit0 || group[4] == digit1); |
- group[4] = noChar; |
+ ASSERT(group[4] == NoChar || group[4] == Digit0 || group[4] == Digit1); |
+ group[4] = NoChar; |
} |
if (number == 0) |
break; |
} |
- // Convert into characters, omitting consecutive runs of digit0 and |
- // any trailing digit0. |
+ // Convert into characters, omitting consecutive runs of Digit0 and |
+ // any trailing Digit0. |
int length = 0; |
UChar characters[bufferLength]; |
- AbstractCJKChar last = noChar; |
+ AbstractCJKChar last = NoChar; |
for (int i = 0; i < bufferLength; ++i) { |
AbstractCJKChar a = buffer[i]; |
- if (a != noChar) { |
- if (a != digit0 || last != digit0) |
+ if (a != NoChar) { |
+ if (a != Digit0 || last != Digit0) |
characters[length++] = table[a - 1]; |
last = a; |
} |
} |
- if (last == digit0) |
+ if (last == Digit0) |
--length; |
return String(characters, length); |
@@ -497,7 +497,7 @@ static EListStyleType effectiveListMarkerType(EListStyleType type, int value) |
return type; |
} |
-UChar RenderListMarker::listMarkerSuffix(EListStyleType type, int value) |
+UChar LayoutListMarker::listMarkerSuffix(EListStyleType type, int value) |
{ |
// If the list-style-type cannot represent |value| because it's outside its |
// ordinal range then we fall back to some list style that can represent |value|. |
@@ -601,481 +601,481 @@ String listMarkerText(EListStyleType type, int value) |
// If the list-style-type, say hebrew, cannot represent |value| because it's outside |
// its ordinal range then we fallback to some list style that can represent |value|. |
switch (effectiveListMarkerType(type, value)) { |
- case NoneListStyle: |
- return ""; |
- |
- case Asterisks: { |
- static const LChar asterisksSymbols[1] = { |
- 0x2A |
- }; |
- return toSymbolic(value, asterisksSymbols); |
- } |
- // We use the same characters for text security. |
- // See RenderText::setInternalString. |
- case Circle: |
- return String(&whiteBullet, 1); |
- case Disc: |
- return String(&bullet, 1); |
- case Footnotes: { |
- static const UChar footnotesSymbols[4] = { |
- 0x002A, 0x2051, 0x2020, 0x2021 |
- }; |
- return toSymbolic(value, footnotesSymbols); |
- } |
- case Square: |
- // The CSS 2.1 test suite uses U+25EE BLACK MEDIUM SMALL SQUARE |
- // instead, but I think this looks better. |
- return String(&blackSquare, 1); |
+ case NoneListStyle: |
+ return ""; |
+ |
+ case Asterisks: { |
+ static const LChar asterisksSymbols[1] = { |
+ 0x2A |
+ }; |
+ return toSymbolic(value, asterisksSymbols); |
+ } |
+ // We use the same characters for text security. |
+ // See RenderText::setInternalString. |
+ case Circle: |
+ return String(&whiteBullet, 1); |
+ case Disc: |
+ return String(&bullet, 1); |
+ case Footnotes: { |
+ static const UChar footnotesSymbols[4] = { |
+ 0x002A, 0x2051, 0x2020, 0x2021 |
+ }; |
+ return toSymbolic(value, footnotesSymbols); |
+ } |
+ case Square: |
+ // The CSS 2.1 test suite uses U+25EE BLACK MEDIUM SMALL SQUARE |
+ // instead, but I think this looks better. |
+ return String(&blackSquare, 1); |
- case DecimalListStyle: |
+ case DecimalListStyle: |
+ return String::number(value); |
+ case DecimalLeadingZero: |
+ if (value < -9 || value > 9) |
return String::number(value); |
- case DecimalLeadingZero: |
- if (value < -9 || value > 9) |
- return String::number(value); |
- if (value < 0) |
- return "-0" + String::number(-value); // -01 to -09 |
- return "0" + String::number(value); // 00 to 09 |
- |
- case ArabicIndic: { |
- static const UChar arabicIndicNumerals[10] = { |
- 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667, 0x0668, 0x0669 |
- }; |
- return toNumeric(value, arabicIndicNumerals); |
- } |
- case BinaryListStyle: { |
- static const LChar binaryNumerals[2] = { |
- '0', '1' |
- }; |
- return toNumeric(value, binaryNumerals); |
- } |
- case Bengali: { |
- static const UChar bengaliNumerals[10] = { |
- 0x09E6, 0x09E7, 0x09E8, 0x09E9, 0x09EA, 0x09EB, 0x09EC, 0x09ED, 0x09EE, 0x09EF |
- }; |
- return toNumeric(value, bengaliNumerals); |
- } |
- case Cambodian: |
- case Khmer: { |
- static const UChar khmerNumerals[10] = { |
- 0x17E0, 0x17E1, 0x17E2, 0x17E3, 0x17E4, 0x17E5, 0x17E6, 0x17E7, 0x17E8, 0x17E9 |
- }; |
- return toNumeric(value, khmerNumerals); |
- } |
- case Devanagari: { |
- static const UChar devanagariNumerals[10] = { |
- 0x0966, 0x0967, 0x0968, 0x0969, 0x096A, 0x096B, 0x096C, 0x096D, 0x096E, 0x096F |
- }; |
- return toNumeric(value, devanagariNumerals); |
- } |
- case Gujarati: { |
- static const UChar gujaratiNumerals[10] = { |
- 0x0AE6, 0x0AE7, 0x0AE8, 0x0AE9, 0x0AEA, 0x0AEB, 0x0AEC, 0x0AED, 0x0AEE, 0x0AEF |
- }; |
- return toNumeric(value, gujaratiNumerals); |
- } |
- case Gurmukhi: { |
- static const UChar gurmukhiNumerals[10] = { |
- 0x0A66, 0x0A67, 0x0A68, 0x0A69, 0x0A6A, 0x0A6B, 0x0A6C, 0x0A6D, 0x0A6E, 0x0A6F |
- }; |
- return toNumeric(value, gurmukhiNumerals); |
- } |
- case Kannada: { |
- static const UChar kannadaNumerals[10] = { |
- 0x0CE6, 0x0CE7, 0x0CE8, 0x0CE9, 0x0CEA, 0x0CEB, 0x0CEC, 0x0CED, 0x0CEE, 0x0CEF |
- }; |
- return toNumeric(value, kannadaNumerals); |
- } |
- case LowerHexadecimal: { |
- static const LChar lowerHexadecimalNumerals[16] = { |
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' |
- }; |
- return toNumeric(value, lowerHexadecimalNumerals); |
- } |
- case Lao: { |
- static const UChar laoNumerals[10] = { |
- 0x0ED0, 0x0ED1, 0x0ED2, 0x0ED3, 0x0ED4, 0x0ED5, 0x0ED6, 0x0ED7, 0x0ED8, 0x0ED9 |
- }; |
- return toNumeric(value, laoNumerals); |
- } |
- case Malayalam: { |
- static const UChar malayalamNumerals[10] = { |
- 0x0D66, 0x0D67, 0x0D68, 0x0D69, 0x0D6A, 0x0D6B, 0x0D6C, 0x0D6D, 0x0D6E, 0x0D6F |
- }; |
- return toNumeric(value, malayalamNumerals); |
- } |
- case Mongolian: { |
- static const UChar mongolianNumerals[10] = { |
- 0x1810, 0x1811, 0x1812, 0x1813, 0x1814, 0x1815, 0x1816, 0x1817, 0x1818, 0x1819 |
- }; |
- return toNumeric(value, mongolianNumerals); |
- } |
- case Myanmar: { |
- static const UChar myanmarNumerals[10] = { |
- 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, 0x1048, 0x1049 |
- }; |
- return toNumeric(value, myanmarNumerals); |
- } |
- case Octal: { |
- static const LChar octalNumerals[8] = { |
- '0', '1', '2', '3', '4', '5', '6', '7' |
- }; |
- return toNumeric(value, octalNumerals); |
- } |
- case Oriya: { |
- static const UChar oriyaNumerals[10] = { |
- 0x0B66, 0x0B67, 0x0B68, 0x0B69, 0x0B6A, 0x0B6B, 0x0B6C, 0x0B6D, 0x0B6E, 0x0B6F |
- }; |
- return toNumeric(value, oriyaNumerals); |
- } |
- case Persian: |
- case Urdu: { |
- static const UChar urduNumerals[10] = { |
- 0x06F0, 0x06F1, 0x06F2, 0x06F3, 0x06F4, 0x06F5, 0x06F6, 0x06F7, 0x06F8, 0x06F9 |
- }; |
- return toNumeric(value, urduNumerals); |
- } |
- case Telugu: { |
- static const UChar teluguNumerals[10] = { |
- 0x0C66, 0x0C67, 0x0C68, 0x0C69, 0x0C6A, 0x0C6B, 0x0C6C, 0x0C6D, 0x0C6E, 0x0C6F |
- }; |
- return toNumeric(value, teluguNumerals); |
- } |
- case Tibetan: { |
- static const UChar tibetanNumerals[10] = { |
- 0x0F20, 0x0F21, 0x0F22, 0x0F23, 0x0F24, 0x0F25, 0x0F26, 0x0F27, 0x0F28, 0x0F29 |
- }; |
- return toNumeric(value, tibetanNumerals); |
- } |
- case Thai: { |
- static const UChar thaiNumerals[10] = { |
- 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 0x0E58, 0x0E59 |
- }; |
- return toNumeric(value, thaiNumerals); |
- } |
- case UpperHexadecimal: { |
- static const LChar upperHexadecimalNumerals[16] = { |
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' |
- }; |
- return toNumeric(value, upperHexadecimalNumerals); |
- } |
+ if (value < 0) |
+ return "-0" + String::number(-value); // -01 to -09 |
+ return "0" + String::number(value); // 00 to 09 |
- case LowerAlpha: |
- case LowerLatin: { |
- static const LChar lowerLatinAlphabet[26] = { |
- 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', |
- 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' |
- }; |
- return toAlphabetic(value, lowerLatinAlphabet); |
- } |
- case UpperAlpha: |
- case UpperLatin: { |
- static const LChar upperLatinAlphabet[26] = { |
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', |
- 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' |
- }; |
- return toAlphabetic(value, upperLatinAlphabet); |
- } |
- case LowerGreek: { |
- static const UChar lowerGreekAlphabet[24] = { |
- 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, |
- 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, |
- 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9 |
- }; |
- return toAlphabetic(value, lowerGreekAlphabet); |
- } |
+ case ArabicIndic: { |
+ static const UChar arabicIndicNumerals[10] = { |
+ 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667, 0x0668, 0x0669 |
+ }; |
+ return toNumeric(value, arabicIndicNumerals); |
+ } |
+ case BinaryListStyle: { |
+ static const LChar binaryNumerals[2] = { |
+ '0', '1' |
+ }; |
+ return toNumeric(value, binaryNumerals); |
+ } |
+ case Bengali: { |
+ static const UChar bengaliNumerals[10] = { |
+ 0x09E6, 0x09E7, 0x09E8, 0x09E9, 0x09EA, 0x09EB, 0x09EC, 0x09ED, 0x09EE, 0x09EF |
+ }; |
+ return toNumeric(value, bengaliNumerals); |
+ } |
+ case Cambodian: |
+ case Khmer: { |
+ static const UChar khmerNumerals[10] = { |
+ 0x17E0, 0x17E1, 0x17E2, 0x17E3, 0x17E4, 0x17E5, 0x17E6, 0x17E7, 0x17E8, 0x17E9 |
+ }; |
+ return toNumeric(value, khmerNumerals); |
+ } |
+ case Devanagari: { |
+ static const UChar devanagariNumerals[10] = { |
+ 0x0966, 0x0967, 0x0968, 0x0969, 0x096A, 0x096B, 0x096C, 0x096D, 0x096E, 0x096F |
+ }; |
+ return toNumeric(value, devanagariNumerals); |
+ } |
+ case Gujarati: { |
+ static const UChar gujaratiNumerals[10] = { |
+ 0x0AE6, 0x0AE7, 0x0AE8, 0x0AE9, 0x0AEA, 0x0AEB, 0x0AEC, 0x0AED, 0x0AEE, 0x0AEF |
+ }; |
+ return toNumeric(value, gujaratiNumerals); |
+ } |
+ case Gurmukhi: { |
+ static const UChar gurmukhiNumerals[10] = { |
+ 0x0A66, 0x0A67, 0x0A68, 0x0A69, 0x0A6A, 0x0A6B, 0x0A6C, 0x0A6D, 0x0A6E, 0x0A6F |
+ }; |
+ return toNumeric(value, gurmukhiNumerals); |
+ } |
+ case Kannada: { |
+ static const UChar kannadaNumerals[10] = { |
+ 0x0CE6, 0x0CE7, 0x0CE8, 0x0CE9, 0x0CEA, 0x0CEB, 0x0CEC, 0x0CED, 0x0CEE, 0x0CEF |
+ }; |
+ return toNumeric(value, kannadaNumerals); |
+ } |
+ case LowerHexadecimal: { |
+ static const LChar lowerHexadecimalNumerals[16] = { |
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' |
+ }; |
+ return toNumeric(value, lowerHexadecimalNumerals); |
+ } |
+ case Lao: { |
+ static const UChar laoNumerals[10] = { |
+ 0x0ED0, 0x0ED1, 0x0ED2, 0x0ED3, 0x0ED4, 0x0ED5, 0x0ED6, 0x0ED7, 0x0ED8, 0x0ED9 |
+ }; |
+ return toNumeric(value, laoNumerals); |
+ } |
+ case Malayalam: { |
+ static const UChar malayalamNumerals[10] = { |
+ 0x0D66, 0x0D67, 0x0D68, 0x0D69, 0x0D6A, 0x0D6B, 0x0D6C, 0x0D6D, 0x0D6E, 0x0D6F |
+ }; |
+ return toNumeric(value, malayalamNumerals); |
+ } |
+ case Mongolian: { |
+ static const UChar mongolianNumerals[10] = { |
+ 0x1810, 0x1811, 0x1812, 0x1813, 0x1814, 0x1815, 0x1816, 0x1817, 0x1818, 0x1819 |
+ }; |
+ return toNumeric(value, mongolianNumerals); |
+ } |
+ case Myanmar: { |
+ static const UChar myanmarNumerals[10] = { |
+ 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, 0x1048, 0x1049 |
+ }; |
+ return toNumeric(value, myanmarNumerals); |
+ } |
+ case Octal: { |
+ static const LChar octalNumerals[8] = { |
+ '0', '1', '2', '3', '4', '5', '6', '7' |
+ }; |
+ return toNumeric(value, octalNumerals); |
+ } |
+ case Oriya: { |
+ static const UChar oriyaNumerals[10] = { |
+ 0x0B66, 0x0B67, 0x0B68, 0x0B69, 0x0B6A, 0x0B6B, 0x0B6C, 0x0B6D, 0x0B6E, 0x0B6F |
+ }; |
+ return toNumeric(value, oriyaNumerals); |
+ } |
+ case Persian: |
+ case Urdu: { |
+ static const UChar urduNumerals[10] = { |
+ 0x06F0, 0x06F1, 0x06F2, 0x06F3, 0x06F4, 0x06F5, 0x06F6, 0x06F7, 0x06F8, 0x06F9 |
+ }; |
+ return toNumeric(value, urduNumerals); |
+ } |
+ case Telugu: { |
+ static const UChar teluguNumerals[10] = { |
+ 0x0C66, 0x0C67, 0x0C68, 0x0C69, 0x0C6A, 0x0C6B, 0x0C6C, 0x0C6D, 0x0C6E, 0x0C6F |
+ }; |
+ return toNumeric(value, teluguNumerals); |
+ } |
+ case Tibetan: { |
+ static const UChar tibetanNumerals[10] = { |
+ 0x0F20, 0x0F21, 0x0F22, 0x0F23, 0x0F24, 0x0F25, 0x0F26, 0x0F27, 0x0F28, 0x0F29 |
+ }; |
+ return toNumeric(value, tibetanNumerals); |
+ } |
+ case Thai: { |
+ static const UChar thaiNumerals[10] = { |
+ 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 0x0E58, 0x0E59 |
+ }; |
+ return toNumeric(value, thaiNumerals); |
+ } |
+ case UpperHexadecimal: { |
+ static const LChar upperHexadecimalNumerals[16] = { |
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' |
+ }; |
+ return toNumeric(value, upperHexadecimalNumerals); |
+ } |
- case Hiragana: { |
- // FIXME: This table comes from the CSS3 draft, and is probably |
- // incorrect, given the comments in that draft. |
- static const UChar hiraganaAlphabet[48] = { |
- 0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, |
- 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, |
- 0x3061, 0x3064, 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, |
- 0x306E, 0x306F, 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, |
- 0x3080, 0x3081, 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, |
- 0x308B, 0x308C, 0x308D, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093 |
- }; |
- return toAlphabetic(value, hiraganaAlphabet); |
- } |
- case HiraganaIroha: { |
- // FIXME: This table comes from the CSS3 draft, and is probably |
- // incorrect, given the comments in that draft. |
- static const UChar hiraganaIrohaAlphabet[47] = { |
- 0x3044, 0x308D, 0x306F, 0x306B, 0x307B, 0x3078, 0x3068, 0x3061, |
- 0x308A, 0x306C, 0x308B, 0x3092, 0x308F, 0x304B, 0x3088, 0x305F, |
- 0x308C, 0x305D, 0x3064, 0x306D, 0x306A, 0x3089, 0x3080, 0x3046, |
- 0x3090, 0x306E, 0x304A, 0x304F, 0x3084, 0x307E, 0x3051, 0x3075, |
- 0x3053, 0x3048, 0x3066, 0x3042, 0x3055, 0x304D, 0x3086, 0x3081, |
- 0x307F, 0x3057, 0x3091, 0x3072, 0x3082, 0x305B, 0x3059 |
- }; |
- return toAlphabetic(value, hiraganaIrohaAlphabet); |
- } |
- case Katakana: { |
- // FIXME: This table comes from the CSS3 draft, and is probably |
- // incorrect, given the comments in that draft. |
- static const UChar katakanaAlphabet[48] = { |
- 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, |
- 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, |
- 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, |
- 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF, |
- 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, |
- 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3 |
- }; |
- return toAlphabetic(value, katakanaAlphabet); |
- } |
- case KatakanaIroha: { |
- // FIXME: This table comes from the CSS3 draft, and is probably |
- // incorrect, given the comments in that draft. |
- static const UChar katakanaIrohaAlphabet[47] = { |
- 0x30A4, 0x30ED, 0x30CF, 0x30CB, 0x30DB, 0x30D8, 0x30C8, 0x30C1, |
- 0x30EA, 0x30CC, 0x30EB, 0x30F2, 0x30EF, 0x30AB, 0x30E8, 0x30BF, |
- 0x30EC, 0x30BD, 0x30C4, 0x30CD, 0x30CA, 0x30E9, 0x30E0, 0x30A6, |
- 0x30F0, 0x30CE, 0x30AA, 0x30AF, 0x30E4, 0x30DE, 0x30B1, 0x30D5, |
- 0x30B3, 0x30A8, 0x30C6, 0x30A2, 0x30B5, 0x30AD, 0x30E6, 0x30E1, |
- 0x30DF, 0x30B7, 0x30F1, 0x30D2, 0x30E2, 0x30BB, 0x30B9 |
- }; |
- return toAlphabetic(value, katakanaIrohaAlphabet); |
- } |
+ case LowerAlpha: |
+ case LowerLatin: { |
+ static const LChar lowerLatinAlphabet[26] = { |
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', |
+ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' |
+ }; |
+ return toAlphabetic(value, lowerLatinAlphabet); |
+ } |
+ case UpperAlpha: |
+ case UpperLatin: { |
+ static const LChar upperLatinAlphabet[26] = { |
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', |
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' |
+ }; |
+ return toAlphabetic(value, upperLatinAlphabet); |
+ } |
+ case LowerGreek: { |
+ static const UChar lowerGreekAlphabet[24] = { |
+ 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, |
+ 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, |
+ 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9 |
+ }; |
+ return toAlphabetic(value, lowerGreekAlphabet); |
+ } |
- case Afar: |
- case EthiopicHalehameAaEt: |
- case EthiopicHalehameAaEr: { |
- static const UChar ethiopicHalehameAaErAlphabet[18] = { |
- 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1260, 0x1270, 0x1290, |
- 0x12A0, 0x12A8, 0x12C8, 0x12D0, 0x12E8, 0x12F0, 0x1308, 0x1338, 0x1348 |
- }; |
- return toAlphabetic(value, ethiopicHalehameAaErAlphabet); |
- } |
- case Amharic: |
- case EthiopicHalehameAmEt: { |
- static const UChar ethiopicHalehameAmEtAlphabet[33] = { |
- 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x1240, |
- 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12B8, |
- 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x1308, 0x1320, |
- 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 |
- }; |
- return toAlphabetic(value, ethiopicHalehameAmEtAlphabet); |
- } |
- case AmharicAbegede: |
- case EthiopicAbegedeAmEt: { |
- static const UChar ethiopicAbegedeAmEtAlphabet[33] = { |
- 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1300, 0x1200, 0x12C8, 0x12D8, 0x12E0, |
- 0x1210, 0x1320, 0x1328, 0x12E8, 0x12A8, 0x12B8, 0x1208, 0x1218, 0x1290, |
- 0x1298, 0x1220, 0x12D0, 0x1348, 0x1338, 0x1240, 0x1228, 0x1230, 0x1238, |
- 0x1270, 0x1278, 0x1280, 0x1340, 0x1330, 0x1350 |
- }; |
- return toAlphabetic(value, ethiopicAbegedeAmEtAlphabet); |
- } |
- case CjkEarthlyBranch: { |
- static const UChar cjkEarthlyBranchAlphabet[12] = { |
- 0x5B50, 0x4E11, 0x5BC5, 0x536F, 0x8FB0, 0x5DF3, 0x5348, 0x672A, 0x7533, |
- 0x9149, 0x620C, 0x4EA5 |
- }; |
- return toAlphabetic(value, cjkEarthlyBranchAlphabet); |
- } |
- case CjkHeavenlyStem: { |
- static const UChar cjkHeavenlyStemAlphabet[10] = { |
- 0x7532, 0x4E59, 0x4E19, 0x4E01, 0x620A, 0x5DF1, 0x5E9A, 0x8F9B, 0x58EC, |
- 0x7678 |
- }; |
- return toAlphabetic(value, cjkHeavenlyStemAlphabet); |
- } |
- case Ethiopic: |
- case EthiopicHalehameGez: { |
- static const UChar ethiopicHalehameGezAlphabet[26] = { |
- 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1240, 0x1260, |
- 0x1270, 0x1280, 0x1290, 0x12A0, 0x12A8, 0x12C8, 0x12D0, 0x12D8, 0x12E8, |
- 0x12F0, 0x1308, 0x1320, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 |
- }; |
- return toAlphabetic(value, ethiopicHalehameGezAlphabet); |
- } |
- case EthiopicAbegede: |
- case EthiopicAbegedeGez: { |
- static const UChar ethiopicAbegedeGezAlphabet[26] = { |
- 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1200, 0x12C8, 0x12D8, 0x1210, 0x1320, |
- 0x12E8, 0x12A8, 0x1208, 0x1218, 0x1290, 0x1220, 0x12D0, 0x1348, 0x1338, |
- 0x1240, 0x1228, 0x1230, 0x1270, 0x1280, 0x1340, 0x1330, 0x1350 |
- }; |
- return toAlphabetic(value, ethiopicAbegedeGezAlphabet); |
- } |
- case HangulConsonant: { |
- static const UChar hangulConsonantAlphabet[14] = { |
- 0x3131, 0x3134, 0x3137, 0x3139, 0x3141, 0x3142, 0x3145, 0x3147, 0x3148, |
- 0x314A, 0x314B, 0x314C, 0x314D, 0x314E |
- }; |
- return toAlphabetic(value, hangulConsonantAlphabet); |
- } |
- case Hangul: { |
- static const UChar hangulAlphabet[14] = { |
- 0xAC00, 0xB098, 0xB2E4, 0xB77C, 0xB9C8, 0xBC14, 0xC0AC, 0xC544, 0xC790, |
- 0xCC28, 0xCE74, 0xD0C0, 0xD30C, 0xD558 |
- }; |
- return toAlphabetic(value, hangulAlphabet); |
- } |
- case Oromo: |
- case EthiopicHalehameOmEt: { |
- static const UChar ethiopicHalehameOmEtAlphabet[25] = { |
- 0x1200, 0x1208, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1260, 0x1270, |
- 0x1278, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12C8, 0x12E8, 0x12F0, 0x12F8, |
- 0x1300, 0x1308, 0x1320, 0x1328, 0x1338, 0x1330, 0x1348 |
- }; |
- return toAlphabetic(value, ethiopicHalehameOmEtAlphabet); |
- } |
- case Sidama: |
- case EthiopicHalehameSidEt: { |
- static const UChar ethiopicHalehameSidEtAlphabet[26] = { |
- 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1260, |
- 0x1270, 0x1278, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12C8, 0x12E8, 0x12F0, |
- 0x12F8, 0x1300, 0x1308, 0x1320, 0x1328, 0x1338, 0x1330, 0x1348 |
- }; |
- return toAlphabetic(value, ethiopicHalehameSidEtAlphabet); |
- } |
- case Somali: |
- case EthiopicHalehameSoEt: { |
- static const UChar ethiopicHalehameSoEtAlphabet[22] = { |
- 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1260, |
- 0x1270, 0x1290, 0x12A0, 0x12A8, 0x12B8, 0x12C8, 0x12D0, 0x12E8, 0x12F0, |
- 0x1300, 0x1308, 0x1338, 0x1348 |
- }; |
- return toAlphabetic(value, ethiopicHalehameSoEtAlphabet); |
- } |
- case Tigre: |
- case EthiopicHalehameTig: { |
- static const UChar ethiopicHalehameTigAlphabet[27] = { |
- 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1260, |
- 0x1270, 0x1278, 0x1290, 0x12A0, 0x12A8, 0x12C8, 0x12D0, 0x12D8, 0x12E8, |
- 0x12F0, 0x1300, 0x1308, 0x1320, 0x1328, 0x1338, 0x1330, 0x1348, 0x1350 |
- }; |
- return toAlphabetic(value, ethiopicHalehameTigAlphabet); |
- } |
- case TigrinyaEr: |
- case EthiopicHalehameTiEr: { |
- static const UChar ethiopicHalehameTiErAlphabet[31] = { |
- 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1250, |
- 0x1260, 0x1270, 0x1278, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12B8, 0x12C8, |
- 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x1308, 0x1320, 0x1328, |
- 0x1330, 0x1338, 0x1348, 0x1350 |
- }; |
- return toAlphabetic(value, ethiopicHalehameTiErAlphabet); |
- } |
- case TigrinyaErAbegede: |
- case EthiopicAbegedeTiEr: { |
- static const UChar ethiopicAbegedeTiErAlphabet[31] = { |
- 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1300, 0x1200, 0x12C8, 0x12D8, 0x12E0, |
- 0x1210, 0x1320, 0x1328, 0x12E8, 0x12A8, 0x12B8, 0x1208, 0x1218, 0x1290, |
- 0x1298, 0x12D0, 0x1348, 0x1338, 0x1240, 0x1250, 0x1228, 0x1230, 0x1238, |
- 0x1270, 0x1278, 0x1330, 0x1350 |
- }; |
- return toAlphabetic(value, ethiopicAbegedeTiErAlphabet); |
- } |
- case TigrinyaEt: |
- case EthiopicHalehameTiEt: { |
- static const UChar ethiopicHalehameTiEtAlphabet[34] = { |
- 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x1240, |
- 0x1250, 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12A8, |
- 0x12B8, 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x1308, |
- 0x1320, 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 |
- }; |
- return toAlphabetic(value, ethiopicHalehameTiEtAlphabet); |
- } |
- case TigrinyaEtAbegede: |
- case EthiopicAbegedeTiEt: { |
- static const UChar ethiopicAbegedeTiEtAlphabet[34] = { |
- 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1300, 0x1200, 0x12C8, 0x12D8, 0x12E0, |
- 0x1210, 0x1320, 0x1328, 0x12E8, 0x12A8, 0x12B8, 0x1208, 0x1218, 0x1290, |
- 0x1298, 0x1220, 0x12D0, 0x1348, 0x1338, 0x1240, 0x1250, 0x1228, 0x1230, |
- 0x1238, 0x1270, 0x1278, 0x1280, 0x1340, 0x1330, 0x1350 |
- }; |
- return toAlphabetic(value, ethiopicAbegedeTiEtAlphabet); |
- } |
- case UpperGreek: { |
- static const UChar upperGreekAlphabet[24] = { |
- 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, |
- 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1, 0x03A3, |
- 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9 |
- }; |
- return toAlphabetic(value, upperGreekAlphabet); |
- } |
- case LowerNorwegian: { |
- static const LChar lowerNorwegianAlphabet[29] = { |
- 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, |
- 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, |
- 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0xE6, |
- 0xF8, 0xE5 |
- }; |
- return toAlphabetic(value, lowerNorwegianAlphabet); |
- } |
- case UpperNorwegian: { |
- static const LChar upperNorwegianAlphabet[29] = { |
- 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, |
- 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, |
- 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0xC6, |
- 0xD8, 0xC5 |
- }; |
- return toAlphabetic(value, upperNorwegianAlphabet); |
- } |
- case CJKIdeographic: { |
- static const UChar traditionalChineseInformalTable[16] = { |
- 0x842C, 0x5104, 0x5146, |
- 0x5341, 0x767E, 0x5343, |
- 0x96F6, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, |
- 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D |
- }; |
- return toCJKIdeographic(value, traditionalChineseInformalTable); |
- } |
+ case Hiragana: { |
+ // FIXME: This table comes from the CSS3 draft, and is probably |
+ // incorrect, given the comments in that draft. |
+ static const UChar hiraganaAlphabet[48] = { |
+ 0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, |
+ 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, |
+ 0x3061, 0x3064, 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, |
+ 0x306E, 0x306F, 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, |
+ 0x3080, 0x3081, 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, |
+ 0x308B, 0x308C, 0x308D, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093 |
+ }; |
+ return toAlphabetic(value, hiraganaAlphabet); |
+ } |
+ case HiraganaIroha: { |
+ // FIXME: This table comes from the CSS3 draft, and is probably |
+ // incorrect, given the comments in that draft. |
+ static const UChar hiraganaIrohaAlphabet[47] = { |
+ 0x3044, 0x308D, 0x306F, 0x306B, 0x307B, 0x3078, 0x3068, 0x3061, |
+ 0x308A, 0x306C, 0x308B, 0x3092, 0x308F, 0x304B, 0x3088, 0x305F, |
+ 0x308C, 0x305D, 0x3064, 0x306D, 0x306A, 0x3089, 0x3080, 0x3046, |
+ 0x3090, 0x306E, 0x304A, 0x304F, 0x3084, 0x307E, 0x3051, 0x3075, |
+ 0x3053, 0x3048, 0x3066, 0x3042, 0x3055, 0x304D, 0x3086, 0x3081, |
+ 0x307F, 0x3057, 0x3091, 0x3072, 0x3082, 0x305B, 0x3059 |
+ }; |
+ return toAlphabetic(value, hiraganaIrohaAlphabet); |
+ } |
+ case Katakana: { |
+ // FIXME: This table comes from the CSS3 draft, and is probably |
+ // incorrect, given the comments in that draft. |
+ static const UChar katakanaAlphabet[48] = { |
+ 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, |
+ 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, |
+ 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, |
+ 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF, |
+ 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, |
+ 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3 |
+ }; |
+ return toAlphabetic(value, katakanaAlphabet); |
+ } |
+ case KatakanaIroha: { |
+ // FIXME: This table comes from the CSS3 draft, and is probably |
+ // incorrect, given the comments in that draft. |
+ static const UChar katakanaIrohaAlphabet[47] = { |
+ 0x30A4, 0x30ED, 0x30CF, 0x30CB, 0x30DB, 0x30D8, 0x30C8, 0x30C1, |
+ 0x30EA, 0x30CC, 0x30EB, 0x30F2, 0x30EF, 0x30AB, 0x30E8, 0x30BF, |
+ 0x30EC, 0x30BD, 0x30C4, 0x30CD, 0x30CA, 0x30E9, 0x30E0, 0x30A6, |
+ 0x30F0, 0x30CE, 0x30AA, 0x30AF, 0x30E4, 0x30DE, 0x30B1, 0x30D5, |
+ 0x30B3, 0x30A8, 0x30C6, 0x30A2, 0x30B5, 0x30AD, 0x30E6, 0x30E1, |
+ 0x30DF, 0x30B7, 0x30F1, 0x30D2, 0x30E2, 0x30BB, 0x30B9 |
+ }; |
+ return toAlphabetic(value, katakanaIrohaAlphabet); |
+ } |
+ |
+ case Afar: |
+ case EthiopicHalehameAaEt: |
+ case EthiopicHalehameAaEr: { |
+ static const UChar ethiopicHalehameAaErAlphabet[18] = { |
+ 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1260, 0x1270, 0x1290, |
+ 0x12A0, 0x12A8, 0x12C8, 0x12D0, 0x12E8, 0x12F0, 0x1308, 0x1338, 0x1348 |
+ }; |
+ return toAlphabetic(value, ethiopicHalehameAaErAlphabet); |
+ } |
+ case Amharic: |
+ case EthiopicHalehameAmEt: { |
+ static const UChar ethiopicHalehameAmEtAlphabet[33] = { |
+ 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x1240, |
+ 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12B8, |
+ 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x1308, 0x1320, |
+ 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 |
+ }; |
+ return toAlphabetic(value, ethiopicHalehameAmEtAlphabet); |
+ } |
+ case AmharicAbegede: |
+ case EthiopicAbegedeAmEt: { |
+ static const UChar ethiopicAbegedeAmEtAlphabet[33] = { |
+ 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1300, 0x1200, 0x12C8, 0x12D8, 0x12E0, |
+ 0x1210, 0x1320, 0x1328, 0x12E8, 0x12A8, 0x12B8, 0x1208, 0x1218, 0x1290, |
+ 0x1298, 0x1220, 0x12D0, 0x1348, 0x1338, 0x1240, 0x1228, 0x1230, 0x1238, |
+ 0x1270, 0x1278, 0x1280, 0x1340, 0x1330, 0x1350 |
+ }; |
+ return toAlphabetic(value, ethiopicAbegedeAmEtAlphabet); |
+ } |
+ case CjkEarthlyBranch: { |
+ static const UChar cjkEarthlyBranchAlphabet[12] = { |
+ 0x5B50, 0x4E11, 0x5BC5, 0x536F, 0x8FB0, 0x5DF3, 0x5348, 0x672A, 0x7533, |
+ 0x9149, 0x620C, 0x4EA5 |
+ }; |
+ return toAlphabetic(value, cjkEarthlyBranchAlphabet); |
+ } |
+ case CjkHeavenlyStem: { |
+ static const UChar cjkHeavenlyStemAlphabet[10] = { |
+ 0x7532, 0x4E59, 0x4E19, 0x4E01, 0x620A, 0x5DF1, 0x5E9A, 0x8F9B, 0x58EC, |
+ 0x7678 |
+ }; |
+ return toAlphabetic(value, cjkHeavenlyStemAlphabet); |
+ } |
+ case Ethiopic: |
+ case EthiopicHalehameGez: { |
+ static const UChar ethiopicHalehameGezAlphabet[26] = { |
+ 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1240, 0x1260, |
+ 0x1270, 0x1280, 0x1290, 0x12A0, 0x12A8, 0x12C8, 0x12D0, 0x12D8, 0x12E8, |
+ 0x12F0, 0x1308, 0x1320, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 |
+ }; |
+ return toAlphabetic(value, ethiopicHalehameGezAlphabet); |
+ } |
+ case EthiopicAbegede: |
+ case EthiopicAbegedeGez: { |
+ static const UChar ethiopicAbegedeGezAlphabet[26] = { |
+ 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1200, 0x12C8, 0x12D8, 0x1210, 0x1320, |
+ 0x12E8, 0x12A8, 0x1208, 0x1218, 0x1290, 0x1220, 0x12D0, 0x1348, 0x1338, |
+ 0x1240, 0x1228, 0x1230, 0x1270, 0x1280, 0x1340, 0x1330, 0x1350 |
+ }; |
+ return toAlphabetic(value, ethiopicAbegedeGezAlphabet); |
+ } |
+ case HangulConsonant: { |
+ static const UChar hangulConsonantAlphabet[14] = { |
+ 0x3131, 0x3134, 0x3137, 0x3139, 0x3141, 0x3142, 0x3145, 0x3147, 0x3148, |
+ 0x314A, 0x314B, 0x314C, 0x314D, 0x314E |
+ }; |
+ return toAlphabetic(value, hangulConsonantAlphabet); |
+ } |
+ case Hangul: { |
+ static const UChar hangulAlphabet[14] = { |
+ 0xAC00, 0xB098, 0xB2E4, 0xB77C, 0xB9C8, 0xBC14, 0xC0AC, 0xC544, 0xC790, |
+ 0xCC28, 0xCE74, 0xD0C0, 0xD30C, 0xD558 |
+ }; |
+ return toAlphabetic(value, hangulAlphabet); |
+ } |
+ case Oromo: |
+ case EthiopicHalehameOmEt: { |
+ static const UChar ethiopicHalehameOmEtAlphabet[25] = { |
+ 0x1200, 0x1208, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1260, 0x1270, |
+ 0x1278, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12C8, 0x12E8, 0x12F0, 0x12F8, |
+ 0x1300, 0x1308, 0x1320, 0x1328, 0x1338, 0x1330, 0x1348 |
+ }; |
+ return toAlphabetic(value, ethiopicHalehameOmEtAlphabet); |
+ } |
+ case Sidama: |
+ case EthiopicHalehameSidEt: { |
+ static const UChar ethiopicHalehameSidEtAlphabet[26] = { |
+ 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1260, |
+ 0x1270, 0x1278, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12C8, 0x12E8, 0x12F0, |
+ 0x12F8, 0x1300, 0x1308, 0x1320, 0x1328, 0x1338, 0x1330, 0x1348 |
+ }; |
+ return toAlphabetic(value, ethiopicHalehameSidEtAlphabet); |
+ } |
+ case Somali: |
+ case EthiopicHalehameSoEt: { |
+ static const UChar ethiopicHalehameSoEtAlphabet[22] = { |
+ 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1260, |
+ 0x1270, 0x1290, 0x12A0, 0x12A8, 0x12B8, 0x12C8, 0x12D0, 0x12E8, 0x12F0, |
+ 0x1300, 0x1308, 0x1338, 0x1348 |
+ }; |
+ return toAlphabetic(value, ethiopicHalehameSoEtAlphabet); |
+ } |
+ case Tigre: |
+ case EthiopicHalehameTig: { |
+ static const UChar ethiopicHalehameTigAlphabet[27] = { |
+ 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1260, |
+ 0x1270, 0x1278, 0x1290, 0x12A0, 0x12A8, 0x12C8, 0x12D0, 0x12D8, 0x12E8, |
+ 0x12F0, 0x1300, 0x1308, 0x1320, 0x1328, 0x1338, 0x1330, 0x1348, 0x1350 |
+ }; |
+ return toAlphabetic(value, ethiopicHalehameTigAlphabet); |
+ } |
+ case TigrinyaEr: |
+ case EthiopicHalehameTiEr: { |
+ static const UChar ethiopicHalehameTiErAlphabet[31] = { |
+ 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1250, |
+ 0x1260, 0x1270, 0x1278, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12B8, 0x12C8, |
+ 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x1308, 0x1320, 0x1328, |
+ 0x1330, 0x1338, 0x1348, 0x1350 |
+ }; |
+ return toAlphabetic(value, ethiopicHalehameTiErAlphabet); |
+ } |
+ case TigrinyaErAbegede: |
+ case EthiopicAbegedeTiEr: { |
+ static const UChar ethiopicAbegedeTiErAlphabet[31] = { |
+ 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1300, 0x1200, 0x12C8, 0x12D8, 0x12E0, |
+ 0x1210, 0x1320, 0x1328, 0x12E8, 0x12A8, 0x12B8, 0x1208, 0x1218, 0x1290, |
+ 0x1298, 0x12D0, 0x1348, 0x1338, 0x1240, 0x1250, 0x1228, 0x1230, 0x1238, |
+ 0x1270, 0x1278, 0x1330, 0x1350 |
+ }; |
+ return toAlphabetic(value, ethiopicAbegedeTiErAlphabet); |
+ } |
+ case TigrinyaEt: |
+ case EthiopicHalehameTiEt: { |
+ static const UChar ethiopicHalehameTiEtAlphabet[34] = { |
+ 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x1240, |
+ 0x1250, 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12A8, |
+ 0x12B8, 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x1308, |
+ 0x1320, 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 |
+ }; |
+ return toAlphabetic(value, ethiopicHalehameTiEtAlphabet); |
+ } |
+ case TigrinyaEtAbegede: |
+ case EthiopicAbegedeTiEt: { |
+ static const UChar ethiopicAbegedeTiEtAlphabet[34] = { |
+ 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1300, 0x1200, 0x12C8, 0x12D8, 0x12E0, |
+ 0x1210, 0x1320, 0x1328, 0x12E8, 0x12A8, 0x12B8, 0x1208, 0x1218, 0x1290, |
+ 0x1298, 0x1220, 0x12D0, 0x1348, 0x1338, 0x1240, 0x1250, 0x1228, 0x1230, |
+ 0x1238, 0x1270, 0x1278, 0x1280, 0x1340, 0x1330, 0x1350 |
+ }; |
+ return toAlphabetic(value, ethiopicAbegedeTiEtAlphabet); |
+ } |
+ case UpperGreek: { |
+ static const UChar upperGreekAlphabet[24] = { |
+ 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, |
+ 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1, 0x03A3, |
+ 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9 |
+ }; |
+ return toAlphabetic(value, upperGreekAlphabet); |
+ } |
+ case LowerNorwegian: { |
+ static const LChar lowerNorwegianAlphabet[29] = { |
+ 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, |
+ 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, |
+ 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0xE6, |
+ 0xF8, 0xE5 |
+ }; |
+ return toAlphabetic(value, lowerNorwegianAlphabet); |
+ } |
+ case UpperNorwegian: { |
+ static const LChar upperNorwegianAlphabet[29] = { |
+ 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, |
+ 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, |
+ 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0xC6, |
+ 0xD8, 0xC5 |
+ }; |
+ return toAlphabetic(value, upperNorwegianAlphabet); |
+ } |
+ case CJKIdeographic: { |
+ static const UChar traditionalChineseInformalTable[16] = { |
+ 0x842C, 0x5104, 0x5146, |
+ 0x5341, 0x767E, 0x5343, |
+ 0x96F6, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, |
+ 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D |
+ }; |
+ return toCJKIdeographic(value, traditionalChineseInformalTable); |
+ } |
- case LowerRoman: |
- return toRoman(value, false); |
- case UpperRoman: |
- return toRoman(value, true); |
- |
- case Armenian: |
- case UpperArmenian: |
- // CSS3 says "armenian" means "lower-armenian". |
- // But the CSS2.1 test suite contains uppercase test results for "armenian", |
- // so we'll match the test suite. |
- return toArmenian(value, true); |
- case LowerArmenian: |
- return toArmenian(value, false); |
- case Georgian: |
- return toGeorgian(value); |
- case Hebrew: |
- return toHebrew(value); |
+ case LowerRoman: |
+ return toRoman(value, false); |
+ case UpperRoman: |
+ return toRoman(value, true); |
+ |
+ case Armenian: |
+ case UpperArmenian: |
+ // CSS3 says "armenian" means "lower-armenian". |
+ // But the CSS2.1 test suite contains uppercase test results for "armenian", |
+ // so we'll match the test suite. |
+ return toArmenian(value, true); |
+ case LowerArmenian: |
+ return toArmenian(value, false); |
+ case Georgian: |
+ return toGeorgian(value); |
+ case Hebrew: |
+ return toHebrew(value); |
} |
ASSERT_NOT_REACHED(); |
return ""; |
} |
-RenderListMarker::RenderListMarker(RenderListItem* item) |
+LayoutListMarker::LayoutListMarker(LayoutListItem* item) |
: RenderBox(0) |
, m_listItem(item) |
{ |
// init LayoutObject attributes |
- setInline(true); // our object is Inline |
+ setInline(true); // our object is Inline |
setReplaced(true); // pretend to be replaced |
} |
-RenderListMarker::~RenderListMarker() |
+LayoutListMarker::~LayoutListMarker() |
{ |
} |
-void RenderListMarker::destroy() |
+void LayoutListMarker::destroy() |
{ |
if (m_image) |
m_image->removeClient(this); |
RenderBox::destroy(); |
} |
-RenderListMarker* RenderListMarker::createAnonymous(RenderListItem* item) |
+LayoutListMarker* LayoutListMarker::createAnonymous(LayoutListItem* item) |
{ |
Document& document = item->document(); |
- RenderListMarker* renderer = new RenderListMarker(item); |
+ LayoutListMarker* renderer = new LayoutListMarker(item); |
renderer->setDocumentForAnonymous(&document); |
return renderer; |
} |
-void RenderListMarker::styleWillChange(StyleDifference diff, const LayoutStyle& newStyle) |
+void LayoutListMarker::styleWillChange(StyleDifference diff, const LayoutStyle& newStyle) |
{ |
if (style() && (newStyle.listStylePosition() != style()->listStylePosition() || newStyle.listStyleType() != style()->listStyleType())) |
setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); |
@@ -1083,7 +1083,7 @@ void RenderListMarker::styleWillChange(StyleDifference diff, const LayoutStyle& |
RenderBox::styleWillChange(diff, newStyle); |
} |
-void RenderListMarker::styleDidChange(StyleDifference diff, const LayoutStyle* oldStyle) |
+void LayoutListMarker::styleDidChange(StyleDifference diff, const LayoutStyle* oldStyle) |
{ |
RenderBox::styleDidChange(diff, oldStyle); |
@@ -1096,19 +1096,19 @@ void RenderListMarker::styleDidChange(StyleDifference diff, const LayoutStyle* o |
} |
} |
-InlineBox* RenderListMarker::createInlineBox() |
+InlineBox* LayoutListMarker::createInlineBox() |
{ |
InlineBox* result = RenderBox::createInlineBox(); |
result->setIsText(isText()); |
return result; |
} |
-bool RenderListMarker::isImage() const |
+bool LayoutListMarker::isImage() const |
{ |
return m_image && !m_image->errorOccurred(); |
} |
-LayoutRect RenderListMarker::localSelectionRect() |
+LayoutRect LayoutListMarker::localSelectionRect() |
{ |
InlineBox* box = inlineBoxWrapper(); |
if (!box) |
@@ -1120,12 +1120,12 @@ LayoutRect RenderListMarker::localSelectionRect() |
return LayoutRect(newLogicalTop, 0, root.selectionHeight(), size().height()); |
} |
-void RenderListMarker::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
+void LayoutListMarker::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
{ |
ListMarkerPainter(*this).paint(paintInfo, paintOffset); |
} |
-void RenderListMarker::layout() |
+void LayoutListMarker::layout() |
{ |
ASSERT(needsLayout()); |
@@ -1151,7 +1151,7 @@ void RenderListMarker::layout() |
clearNeedsLayout(); |
} |
-void RenderListMarker::imageChanged(WrappedImagePtr o, const IntRect*) |
+void LayoutListMarker::imageChanged(WrappedImagePtr o, const IntRect*) |
{ |
// A list marker can't have a background or border image, so no need to call the base class method. |
if (o != m_image->data()) |
@@ -1163,13 +1163,13 @@ void RenderListMarker::imageChanged(WrappedImagePtr o, const IntRect*) |
setShouldDoFullPaintInvalidation(); |
} |
-void RenderListMarker::updateMarginsAndContent() |
+void LayoutListMarker::updateMarginsAndContent() |
{ |
updateContent(); |
updateMargins(); |
} |
-void RenderListMarker::updateContent() |
+void LayoutListMarker::updateContent() |
{ |
// FIXME: This if-statement is just a performance optimization, but it's messy to use the preferredLogicalWidths dirty bit for this. |
// It's unclear if this is a premature optimization. |
@@ -1279,7 +1279,7 @@ void RenderListMarker::updateContent() |
} |
} |
-void RenderListMarker::computePreferredLogicalWidths() |
+void LayoutListMarker::computePreferredLogicalWidths() |
{ |
ASSERT(preferredLogicalWidthsDirty()); |
updateContent(); |
@@ -1297,101 +1297,101 @@ void RenderListMarker::computePreferredLogicalWidths() |
LayoutUnit logicalWidth = 0; |
EListStyleType type = style()->listStyleType(); |
switch (type) { |
- case NoneListStyle: |
- break; |
- case Asterisks: |
- case Footnotes: |
- logicalWidth = font.width(m_text); // no suffix for these types |
- break; |
- case Circle: |
- case Disc: |
- case Square: |
- logicalWidth = (font.fontMetrics().ascent() * 2 / 3 + 1) / 2 + 2; |
- break; |
- case Afar: |
- case Amharic: |
- case AmharicAbegede: |
- case ArabicIndic: |
- case Armenian: |
- case BinaryListStyle: |
- case Bengali: |
- case Cambodian: |
- case CJKIdeographic: |
- case CjkEarthlyBranch: |
- case CjkHeavenlyStem: |
- case DecimalLeadingZero: |
- case DecimalListStyle: |
- case Devanagari: |
- case Ethiopic: |
- case EthiopicAbegede: |
- case EthiopicAbegedeAmEt: |
- case EthiopicAbegedeGez: |
- case EthiopicAbegedeTiEr: |
- case EthiopicAbegedeTiEt: |
- case EthiopicHalehameAaEr: |
- case EthiopicHalehameAaEt: |
- case EthiopicHalehameAmEt: |
- case EthiopicHalehameGez: |
- case EthiopicHalehameOmEt: |
- case EthiopicHalehameSidEt: |
- case EthiopicHalehameSoEt: |
- case EthiopicHalehameTiEr: |
- case EthiopicHalehameTiEt: |
- case EthiopicHalehameTig: |
- case Georgian: |
- case Gujarati: |
- case Gurmukhi: |
- case Hangul: |
- case HangulConsonant: |
- case Hebrew: |
- case Hiragana: |
- case HiraganaIroha: |
- case Kannada: |
- case Katakana: |
- case KatakanaIroha: |
- case Khmer: |
- case Lao: |
- case LowerAlpha: |
- case LowerArmenian: |
- case LowerGreek: |
- case LowerHexadecimal: |
- case LowerLatin: |
- case LowerNorwegian: |
- case LowerRoman: |
- case Malayalam: |
- case Mongolian: |
- case Myanmar: |
- case Octal: |
- case Oriya: |
- case Oromo: |
- case Persian: |
- case Sidama: |
- case Somali: |
- case Telugu: |
- case Thai: |
- case Tibetan: |
- case Tigre: |
- case TigrinyaEr: |
- case TigrinyaErAbegede: |
- case TigrinyaEt: |
- case TigrinyaEtAbegede: |
- case UpperAlpha: |
- case UpperArmenian: |
- case UpperGreek: |
- case UpperHexadecimal: |
- case UpperLatin: |
- case UpperNorwegian: |
- case UpperRoman: |
- case Urdu: |
- if (m_text.isEmpty()) |
- logicalWidth = 0; |
- else { |
- LayoutUnit itemWidth = font.width(m_text); |
- UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' }; |
- LayoutUnit suffixSpaceWidth = font.width(constructTextRun(this, font, suffixSpace, 2, styleRef(), style()->direction())); |
- logicalWidth = itemWidth + suffixSpaceWidth; |
- } |
- break; |
+ case NoneListStyle: |
+ break; |
+ case Asterisks: |
+ case Footnotes: |
+ logicalWidth = font.width(m_text); // no suffix for these types |
+ break; |
+ case Circle: |
+ case Disc: |
+ case Square: |
+ logicalWidth = (font.fontMetrics().ascent() * 2 / 3 + 1) / 2 + 2; |
+ break; |
+ case Afar: |
+ case Amharic: |
+ case AmharicAbegede: |
+ case ArabicIndic: |
+ case Armenian: |
+ case BinaryListStyle: |
+ case Bengali: |
+ case Cambodian: |
+ case CJKIdeographic: |
+ case CjkEarthlyBranch: |
+ case CjkHeavenlyStem: |
+ case DecimalLeadingZero: |
+ case DecimalListStyle: |
+ case Devanagari: |
+ case Ethiopic: |
+ case EthiopicAbegede: |
+ case EthiopicAbegedeAmEt: |
+ case EthiopicAbegedeGez: |
+ case EthiopicAbegedeTiEr: |
+ case EthiopicAbegedeTiEt: |
+ case EthiopicHalehameAaEr: |
+ case EthiopicHalehameAaEt: |
+ case EthiopicHalehameAmEt: |
+ case EthiopicHalehameGez: |
+ case EthiopicHalehameOmEt: |
+ case EthiopicHalehameSidEt: |
+ case EthiopicHalehameSoEt: |
+ case EthiopicHalehameTiEr: |
+ case EthiopicHalehameTiEt: |
+ case EthiopicHalehameTig: |
+ case Georgian: |
+ case Gujarati: |
+ case Gurmukhi: |
+ case Hangul: |
+ case HangulConsonant: |
+ case Hebrew: |
+ case Hiragana: |
+ case HiraganaIroha: |
+ case Kannada: |
+ case Katakana: |
+ case KatakanaIroha: |
+ case Khmer: |
+ case Lao: |
+ case LowerAlpha: |
+ case LowerArmenian: |
+ case LowerGreek: |
+ case LowerHexadecimal: |
+ case LowerLatin: |
+ case LowerNorwegian: |
+ case LowerRoman: |
+ case Malayalam: |
+ case Mongolian: |
+ case Myanmar: |
+ case Octal: |
+ case Oriya: |
+ case Oromo: |
+ case Persian: |
+ case Sidama: |
+ case Somali: |
+ case Telugu: |
+ case Thai: |
+ case Tibetan: |
+ case Tigre: |
+ case TigrinyaEr: |
+ case TigrinyaErAbegede: |
+ case TigrinyaEt: |
+ case TigrinyaEtAbegede: |
+ case UpperAlpha: |
+ case UpperArmenian: |
+ case UpperGreek: |
+ case UpperHexadecimal: |
+ case UpperLatin: |
+ case UpperNorwegian: |
+ case UpperRoman: |
+ case Urdu: |
+ if (m_text.isEmpty()) { |
+ logicalWidth = 0; |
+ } else { |
+ LayoutUnit itemWidth = font.width(m_text); |
+ UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' }; |
+ LayoutUnit suffixSpaceWidth = font.width(constructTextRun(this, font, suffixSpace, 2, styleRef(), style()->direction())); |
+ logicalWidth = itemWidth + suffixSpaceWidth; |
+ } |
+ break; |
} |
m_minPreferredLogicalWidth = logicalWidth; |
@@ -1402,7 +1402,7 @@ void RenderListMarker::computePreferredLogicalWidths() |
updateMargins(); |
} |
-void RenderListMarker::updateMargins() |
+void LayoutListMarker::updateMargins() |
{ |
const FontMetrics& fontMetrics = style()->fontMetrics(); |
@@ -1410,9 +1410,10 @@ void RenderListMarker::updateMargins() |
LayoutUnit marginEnd = 0; |
if (isInside()) { |
- if (isImage()) |
+ if (isImage()) { |
marginEnd = cMarkerPadding; |
- else switch (style()->listStyleType()) { |
+ } else { |
+ switch (style()->listStyleType()) { |
case Disc: |
case Circle: |
case Square: |
@@ -1421,41 +1422,42 @@ void RenderListMarker::updateMargins() |
break; |
default: |
break; |
+ } |
} |
} else { |
if (style()->isLeftToRightDirection()) { |
- if (isImage()) |
+ if (isImage()) { |
marginStart = -minPreferredLogicalWidth() - cMarkerPadding; |
- else { |
+ } else { |
int offset = fontMetrics.ascent() * 2 / 3; |
switch (style()->listStyleType()) { |
- case Disc: |
- case Circle: |
- case Square: |
- marginStart = -offset - cMarkerPadding - 1; |
- break; |
- case NoneListStyle: |
- break; |
- default: |
- marginStart = m_text.isEmpty() ? LayoutUnit() : -minPreferredLogicalWidth() - offset / 2; |
+ case Disc: |
+ case Circle: |
+ case Square: |
+ marginStart = -offset - cMarkerPadding - 1; |
+ break; |
+ case NoneListStyle: |
+ break; |
+ default: |
+ marginStart = m_text.isEmpty() ? LayoutUnit() : -minPreferredLogicalWidth() - offset / 2; |
} |
} |
marginEnd = -marginStart - minPreferredLogicalWidth(); |
} else { |
- if (isImage()) |
+ if (isImage()) { |
marginEnd = cMarkerPadding; |
- else { |
+ } else { |
int offset = fontMetrics.ascent() * 2 / 3; |
switch (style()->listStyleType()) { |
- case Disc: |
- case Circle: |
- case Square: |
- marginEnd = offset + cMarkerPadding + 1 - minPreferredLogicalWidth(); |
- break; |
- case NoneListStyle: |
- break; |
- default: |
- marginEnd = m_text.isEmpty() ? 0 : offset / 2; |
+ case Disc: |
+ case Circle: |
+ case Square: |
+ marginEnd = offset + cMarkerPadding + 1 - minPreferredLogicalWidth(); |
+ break; |
+ case NoneListStyle: |
+ break; |
+ default: |
+ marginEnd = m_text.isEmpty() ? 0 : offset / 2; |
} |
} |
marginStart = -marginEnd - minPreferredLogicalWidth(); |
@@ -1467,14 +1469,14 @@ void RenderListMarker::updateMargins() |
style()->setMarginEnd(Length(marginEnd, Fixed)); |
} |
-LayoutUnit RenderListMarker::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const |
+LayoutUnit LayoutListMarker::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const |
{ |
if (!isImage()) |
return m_listItem->lineHeight(firstLine, direction, PositionOfInteriorLineBoxes); |
return RenderBox::lineHeight(firstLine, direction, linePositionMode); |
} |
-int RenderListMarker::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const |
+int LayoutListMarker::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const |
{ |
ASSERT(linePositionMode == PositionOnContainingLine); |
if (!isImage()) |
@@ -1482,12 +1484,12 @@ int RenderListMarker::baselinePosition(FontBaseline baselineType, bool firstLine |
return RenderBox::baselinePosition(baselineType, firstLine, direction, linePositionMode); |
} |
-bool RenderListMarker::isInside() const |
+bool LayoutListMarker::isInside() const |
{ |
return m_listItem->notInList() || style()->listStylePosition() == INSIDE; |
} |
-IntRect RenderListMarker::getRelativeMarkerRect() |
+IntRect LayoutListMarker::getRelativeMarkerRect() |
{ |
if (isImage()) |
return IntRect(0, 0, m_image->imageSize(this, style()->effectiveZoom()).width(), m_image->imageSize(this, style()->effectiveZoom()).height()); |
@@ -1495,106 +1497,106 @@ IntRect RenderListMarker::getRelativeMarkerRect() |
IntRect relativeRect; |
EListStyleType type = style()->listStyleType(); |
switch (type) { |
- case Asterisks: |
- case Footnotes: { |
- const Font& font = style()->font(); |
- relativeRect = IntRect(0, 0, font.width(m_text), font.fontMetrics().height()); |
- break; |
- } |
- case Disc: |
- case Circle: |
- case Square: { |
- // FIXME: Are these particular rounding rules necessary? |
- const FontMetrics& fontMetrics = style()->fontMetrics(); |
- int ascent = fontMetrics.ascent(); |
- int bulletWidth = (ascent * 2 / 3 + 1) / 2; |
- relativeRect = IntRect(1, 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth, bulletWidth); |
- break; |
- } |
- case NoneListStyle: |
+ case Asterisks: |
+ case Footnotes: { |
+ const Font& font = style()->font(); |
+ relativeRect = IntRect(0, 0, font.width(m_text), font.fontMetrics().height()); |
+ break; |
+ } |
+ case Disc: |
+ case Circle: |
+ case Square: { |
+ // FIXME: Are these particular rounding rules necessary? |
+ const FontMetrics& fontMetrics = style()->fontMetrics(); |
+ int ascent = fontMetrics.ascent(); |
+ int bulletWidth = (ascent * 2 / 3 + 1) / 2; |
+ relativeRect = IntRect(1, 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth, bulletWidth); |
+ break; |
+ } |
+ case NoneListStyle: |
+ return IntRect(); |
+ case Afar: |
+ case Amharic: |
+ case AmharicAbegede: |
+ case ArabicIndic: |
+ case Armenian: |
+ case BinaryListStyle: |
+ case Bengali: |
+ case Cambodian: |
+ case CJKIdeographic: |
+ case CjkEarthlyBranch: |
+ case CjkHeavenlyStem: |
+ case DecimalLeadingZero: |
+ case DecimalListStyle: |
+ case Devanagari: |
+ case Ethiopic: |
+ case EthiopicAbegede: |
+ case EthiopicAbegedeAmEt: |
+ case EthiopicAbegedeGez: |
+ case EthiopicAbegedeTiEr: |
+ case EthiopicAbegedeTiEt: |
+ case EthiopicHalehameAaEr: |
+ case EthiopicHalehameAaEt: |
+ case EthiopicHalehameAmEt: |
+ case EthiopicHalehameGez: |
+ case EthiopicHalehameOmEt: |
+ case EthiopicHalehameSidEt: |
+ case EthiopicHalehameSoEt: |
+ case EthiopicHalehameTiEr: |
+ case EthiopicHalehameTiEt: |
+ case EthiopicHalehameTig: |
+ case Georgian: |
+ case Gujarati: |
+ case Gurmukhi: |
+ case Hangul: |
+ case HangulConsonant: |
+ case Hebrew: |
+ case Hiragana: |
+ case HiraganaIroha: |
+ case Kannada: |
+ case Katakana: |
+ case KatakanaIroha: |
+ case Khmer: |
+ case Lao: |
+ case LowerAlpha: |
+ case LowerArmenian: |
+ case LowerGreek: |
+ case LowerHexadecimal: |
+ case LowerLatin: |
+ case LowerNorwegian: |
+ case LowerRoman: |
+ case Malayalam: |
+ case Mongolian: |
+ case Myanmar: |
+ case Octal: |
+ case Oriya: |
+ case Oromo: |
+ case Persian: |
+ case Sidama: |
+ case Somali: |
+ case Telugu: |
+ case Thai: |
+ case Tibetan: |
+ case Tigre: |
+ case TigrinyaEr: |
+ case TigrinyaErAbegede: |
+ case TigrinyaEt: |
+ case TigrinyaEtAbegede: |
+ case UpperAlpha: |
+ case UpperArmenian: |
+ case UpperGreek: |
+ case UpperHexadecimal: |
+ case UpperLatin: |
+ case UpperNorwegian: |
+ case UpperRoman: |
+ case Urdu: |
+ if (m_text.isEmpty()) |
return IntRect(); |
- case Afar: |
- case Amharic: |
- case AmharicAbegede: |
- case ArabicIndic: |
- case Armenian: |
- case BinaryListStyle: |
- case Bengali: |
- case Cambodian: |
- case CJKIdeographic: |
- case CjkEarthlyBranch: |
- case CjkHeavenlyStem: |
- case DecimalLeadingZero: |
- case DecimalListStyle: |
- case Devanagari: |
- case Ethiopic: |
- case EthiopicAbegede: |
- case EthiopicAbegedeAmEt: |
- case EthiopicAbegedeGez: |
- case EthiopicAbegedeTiEr: |
- case EthiopicAbegedeTiEt: |
- case EthiopicHalehameAaEr: |
- case EthiopicHalehameAaEt: |
- case EthiopicHalehameAmEt: |
- case EthiopicHalehameGez: |
- case EthiopicHalehameOmEt: |
- case EthiopicHalehameSidEt: |
- case EthiopicHalehameSoEt: |
- case EthiopicHalehameTiEr: |
- case EthiopicHalehameTiEt: |
- case EthiopicHalehameTig: |
- case Georgian: |
- case Gujarati: |
- case Gurmukhi: |
- case Hangul: |
- case HangulConsonant: |
- case Hebrew: |
- case Hiragana: |
- case HiraganaIroha: |
- case Kannada: |
- case Katakana: |
- case KatakanaIroha: |
- case Khmer: |
- case Lao: |
- case LowerAlpha: |
- case LowerArmenian: |
- case LowerGreek: |
- case LowerHexadecimal: |
- case LowerLatin: |
- case LowerNorwegian: |
- case LowerRoman: |
- case Malayalam: |
- case Mongolian: |
- case Myanmar: |
- case Octal: |
- case Oriya: |
- case Oromo: |
- case Persian: |
- case Sidama: |
- case Somali: |
- case Telugu: |
- case Thai: |
- case Tibetan: |
- case Tigre: |
- case TigrinyaEr: |
- case TigrinyaErAbegede: |
- case TigrinyaEt: |
- case TigrinyaEtAbegede: |
- case UpperAlpha: |
- case UpperArmenian: |
- case UpperGreek: |
- case UpperHexadecimal: |
- case UpperLatin: |
- case UpperNorwegian: |
- case UpperRoman: |
- case Urdu: |
- if (m_text.isEmpty()) |
- return IntRect(); |
- const Font& font = style()->font(); |
- int itemWidth = font.width(m_text); |
- UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' }; |
- int suffixSpaceWidth = font.width(constructTextRun(this, font, suffixSpace, 2, styleRef(), style()->direction())); |
- relativeRect = IntRect(0, 0, itemWidth + suffixSpaceWidth, font.fontMetrics().height()); |
+ const Font& font = style()->font(); |
+ int itemWidth = font.width(m_text); |
+ UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' }; |
+ int suffixSpaceWidth = font.width(constructTextRun(this, font, suffixSpace, 2, styleRef(), style()->direction())); |
+ relativeRect = IntRect(0, 0, itemWidth + suffixSpaceWidth, font.fontMetrics().height()); |
} |
if (!style()->isHorizontalWritingMode()) { |
@@ -1605,7 +1607,7 @@ IntRect RenderListMarker::getRelativeMarkerRect() |
return relativeRect; |
} |
-void RenderListMarker::setSelectionState(SelectionState state) |
+void LayoutListMarker::setSelectionState(SelectionState state) |
{ |
// The selection state for our containing block hierarchy is updated by the base class call. |
RenderBox::setSelectionState(state); |
@@ -1614,7 +1616,7 @@ void RenderListMarker::setSelectionState(SelectionState state) |
inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone); |
} |
-LayoutRect RenderListMarker::selectionRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer) const |
+LayoutRect LayoutListMarker::selectionRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer) const |
{ |
ASSERT(!needsLayout()); |
@@ -1630,7 +1632,7 @@ LayoutRect RenderListMarker::selectionRectForPaintInvalidation(const LayoutBoxMo |
return rect; |
} |
-void RenderListMarker::listItemStyleDidChange() |
+void LayoutListMarker::listItemStyleDidChange() |
{ |
RefPtr<LayoutStyle> newStyle = LayoutStyle::create(); |
// The marker always inherits from the list item, regardless of where it might end |