Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. |
| 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
| 6 * Copyright (C) 2010 Daniel Bates (dbates@intudata.com) | 6 * Copyright (C) 2010 Daniel Bates (dbates@intudata.com) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 static const UChar georgianOnes[9] = { | 310 static const UChar georgianOnes[9] = { |
| 311 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10F1, 0x10 D7 | 311 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10F1, 0x10 D7 |
| 312 }; | 312 }; |
| 313 letters[length++] = georgianOnes[ones - 1]; | 313 letters[length++] = georgianOnes[ones - 1]; |
| 314 } | 314 } |
| 315 | 315 |
| 316 ASSERT(length <= lettersSize); | 316 ASSERT(length <= lettersSize); |
| 317 return String(letters, length); | 317 return String(letters, length); |
| 318 } | 318 } |
| 319 | 319 |
| 320 enum CJKLang { | |
| 321 Chinese = 1, | |
| 322 Korean, | |
| 323 Japanese | |
| 324 }; | |
| 325 | |
| 326 enum CJKStyle { | |
| 327 Formal, | |
| 328 Informal | |
| 329 }; | |
| 330 | |
| 320 // The table uses the order from the CSS3 specification: | 331 // The table uses the order from the CSS3 specification: |
| 321 // first 3 group markers, then 3 digit markers, then ten digits, then negative s ymbols. | 332 // first 3 group markers, then 3 digit markers, then ten digits, then negative s ymbols. |
| 322 static String toCJKIdeographic(int number, const UChar table[23]) | 333 static String toCJKIdeographic(int number, const UChar table[26], CJKStyle cjkSt yle) |
| 323 { | 334 { |
| 324 enum AbstractCJKChar { | 335 enum AbstractCJKChar { |
| 325 NoChar = 0, | 336 NoChar = 0, |
| 326 Lang = 0, | 337 Lang = 0, |
| 327 SecondGroupMarker, ThirdGroupMarker, FourthGroupMarker, | 338 SecondGroupMarker = 1, ThirdGroupMarker = 3, FourthGroupMarker = 5, |
|
tkent
2015/06/22 01:14:14
Please add a comment about 2, 4, and 6.
| |
| 328 SecondDigitMarker, ThirdDigitMarker, FourthDigitMarker, | 339 SecondDigitMarker = 7, ThirdDigitMarker, FourthDigitMarker, |
| 329 Digit0, Digit1, Digit2, Digit3, Digit4, | 340 Digit0, Digit1, Digit2, Digit3, Digit4, |
| 330 Digit5, Digit6, Digit7, Digit8, Digit9, | 341 Digit5, Digit6, Digit7, Digit8, Digit9, |
| 331 Neg1, Neg2, Neg3, Neg4, Neg5 | 342 Neg1, Neg2, Neg3, Neg4, Neg5 |
| 332 }; | 343 }; |
| 333 | 344 |
| 334 enum CJKLang { | |
| 335 Chinese = 1, | |
| 336 Korean, | |
| 337 Japanese | |
| 338 }; | |
| 339 | |
| 340 if (number == 0) | 345 if (number == 0) |
| 341 return String(&table[Digit0], 1); | 346 return String(&table[Digit0], 1); |
| 342 | 347 |
| 343 const bool negative = number < 0; | 348 const bool negative = number < 0; |
| 344 if (negative) | 349 if (negative) |
| 345 number = -number; | 350 number = -number; |
| 346 | 351 |
| 347 const int groupLength = 8; // 4 digits, 3 digit markers, and a group marker | 352 const int groupLength = 9; // 4 digits, 3 digit markers, and a group marker |
|
tkent
2015/06/22 01:14:14
Please update the comment
| |
| 348 const int bufferLength = 4 * groupLength; | 353 const int bufferLength = 4 * groupLength; |
| 349 AbstractCJKChar buffer[bufferLength] = { NoChar }; | 354 AbstractCJKChar buffer[bufferLength] = { NoChar }; |
| 350 | 355 |
| 351 for (int i = 0; i < 4; ++i) { | 356 for (int i = 0; i < 4; ++i) { |
| 352 int groupValue = number % 10000; | 357 int groupValue = number % 10000; |
| 353 number /= 10000; | 358 number /= 10000; |
| 354 | 359 |
| 355 // Process least-significant group first, but put it in the buffer last. | 360 // Process least-significant group first, but put it in the buffer last. |
| 356 AbstractCJKChar* group = &buffer[(3 - i) * groupLength]; | 361 AbstractCJKChar* group = &buffer[(3 - i) * groupLength]; |
| 357 | 362 |
| 358 if (groupValue && i) | 363 if (groupValue && i) { |
| 364 group[8] = static_cast<AbstractCJKChar>(SecondGroupMarker + i); | |
| 359 group[7] = static_cast<AbstractCJKChar>(SecondGroupMarker - 1 + i); | 365 group[7] = static_cast<AbstractCJKChar>(SecondGroupMarker - 1 + i); |
| 366 } | |
| 360 | 367 |
| 361 // Put in the four digits and digit markers for any non-zero digits. | 368 // Put in the four digits and digit markers for any non-zero digits. |
| 362 int digitValue = (groupValue % 10); | 369 int digitValue = (groupValue % 10); |
| 363 bool trailingZero = table[Lang] == Chinese && !digitValue; | 370 bool trailingZero = table[Lang] == Chinese && !digitValue; |
| 364 if (digitValue) | 371 if (digitValue) |
| 365 group[6] = static_cast<AbstractCJKChar>(Digit0 + (groupValue % 10)); | 372 group[6] = static_cast<AbstractCJKChar>(Digit0 + (groupValue % 10)); |
| 366 if (number != 0 || groupValue > 9) { | 373 if (number != 0 || groupValue > 9) { |
| 367 digitValue = ((groupValue / 10) % 10); | 374 digitValue = ((groupValue / 10) % 10); |
| 368 if (digitValue || !trailingZero) | 375 if (digitValue || !trailingZero) |
| 369 group[4] = static_cast<AbstractCJKChar>(Digit0 + digitValue); | 376 group[4] = static_cast<AbstractCJKChar>(Digit0 + digitValue); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 382 if (number != 0 || groupValue > 999) { | 389 if (number != 0 || groupValue > 999) { |
| 383 digitValue = groupValue / 1000; | 390 digitValue = groupValue / 1000; |
| 384 if (digitValue || !trailingZero) | 391 if (digitValue || !trailingZero) |
| 385 group[0] = static_cast<AbstractCJKChar>(Digit0 + digitValue); | 392 group[0] = static_cast<AbstractCJKChar>(Digit0 + digitValue); |
| 386 if (digitValue) | 393 if (digitValue) |
| 387 group[1] = FourthDigitMarker; | 394 group[1] = FourthDigitMarker; |
| 388 } | 395 } |
| 389 | 396 |
| 390 if (trailingZero && i > 0) { | 397 if (trailingZero && i > 0) { |
| 391 group[6] = group[7]; | 398 group[6] = group[7]; |
| 392 group[7] = Digit0; | 399 group[7] = group[8]; |
| 400 group[8] = Digit0; | |
| 393 } | 401 } |
| 394 | 402 |
| 395 // Remove the tens digit, but leave the marker, for any group that has | 403 // Remove the tens digit, but leave the marker, for any group that has |
| 396 // a value of less than 20. | 404 // a value of less than 20. |
| 397 if (table[Lang] == Chinese && groupValue < 20) { | 405 if (table[Lang] == Chinese && cjkStyle == Informal && groupValue < 20) { |
| 398 ASSERT(group[4] == NoChar || group[4] == Digit0 || group[4] == Digit 1); | 406 ASSERT(group[4] == NoChar || group[4] == Digit0 || group[4] == Digit 1); |
| 399 group[4] = NoChar; | 407 group[4] = NoChar; |
| 400 } | 408 } |
| 401 | 409 |
| 402 if (number == 0) | 410 if (number == 0) |
| 403 break; | 411 break; |
| 404 } | 412 } |
| 405 | 413 |
| 406 // Convert into characters, omitting consecutive runs of Digit0 and | 414 // Convert into characters, omitting consecutive runs of Digit0 and |
| 407 // any trailing Digit0. | 415 // any trailing Digit0. |
| 408 int length = 0; | 416 int length = 0; |
| 409 const int maxLengthForNegativeSymbols = 5; | 417 const int maxLengthForNegativeSymbols = 5; |
| 410 UChar characters[bufferLength + maxLengthForNegativeSymbols]; | 418 UChar characters[bufferLength + maxLengthForNegativeSymbols]; |
| 411 AbstractCJKChar last = NoChar; | 419 AbstractCJKChar last = NoChar; |
| 412 if (negative) { | 420 if (negative) { |
| 413 while (UChar a = table[Neg1 + length]) | 421 while (UChar a = table[Neg1 + length]) |
| 414 characters[length++] = a; | 422 characters[length++] = a; |
| 415 } | 423 } |
| 416 for (int i = 0; i < bufferLength; ++i) { | 424 for (int i = 0; i < bufferLength; ++i) { |
| 417 AbstractCJKChar a = buffer[i]; | 425 AbstractCJKChar a = buffer[i]; |
| 418 if (a != NoChar) { | 426 if (a != NoChar) { |
| 419 if (a != Digit0 || (table[Lang] == Chinese && last != Digit0)) { | 427 if (a != Digit0 || (table[Lang] == Chinese && last != Digit0)) { |
| 420 characters[length++] = table[a]; | 428 UChar newChar = table[a]; |
| 421 if (table[Lang] == Korean && a >= SecondGroupMarker && a <= Four thGroupMarker) | 429 if (newChar != NoChar) { |
| 422 characters[length++] = ' '; | 430 characters[length++] = table[a]; |
| 431 if (table[Lang] == Korean && (a == SecondGroupMarker || a == ThirdGroupMarker || a == FourthGroupMarker)) | |
| 432 characters[length++] = ' '; | |
| 433 } | |
| 423 } | 434 } |
| 424 last = a; | 435 last = a; |
| 425 } | 436 } |
| 426 } | 437 } |
| 427 if ((table[Lang] == Chinese && last == Digit0) || characters[length - 1] == ' ') | 438 if ((table[Lang] == Chinese && last == Digit0) || characters[length - 1] == ' ') |
| 428 --length; | 439 --length; |
| 429 | 440 |
| 430 return String(characters, length); | 441 return String(characters, length); |
| 431 } | 442 } |
| 432 | 443 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 454 case NoneListStyle: | 465 case NoneListStyle: |
| 455 case Oriya: | 466 case Oriya: |
| 456 case Persian: | 467 case Persian: |
| 457 case Square: | 468 case Square: |
| 458 case Telugu: | 469 case Telugu: |
| 459 case Thai: | 470 case Thai: |
| 460 case Tibetan: | 471 case Tibetan: |
| 461 case Urdu: | 472 case Urdu: |
| 462 case KoreanHangulFormal: | 473 case KoreanHangulFormal: |
| 463 case CJKIdeographic: | 474 case CJKIdeographic: |
| 475 case SimpChineseFormal: | |
| 476 case SimpChineseInformal: | |
| 477 case TradChineseFormal: | |
| 478 case TradChineseInformal: | |
| 464 return type; // Can represent all ordinals. | 479 return type; // Can represent all ordinals. |
| 465 case Armenian: | 480 case Armenian: |
| 466 return (value < 1 || value > 99999999) ? DecimalListStyle : type; | 481 return (value < 1 || value > 99999999) ? DecimalListStyle : type; |
| 467 case Georgian: | 482 case Georgian: |
| 468 return (value < 1 || value > 19999) ? DecimalListStyle : type; | 483 return (value < 1 || value > 19999) ? DecimalListStyle : type; |
| 469 case Hebrew: | 484 case Hebrew: |
| 470 return (value < 0 || value > 999999) ? DecimalListStyle : type; | 485 return (value < 0 || value > 999999) ? DecimalListStyle : type; |
| 471 case LowerRoman: | 486 case LowerRoman: |
| 472 case UpperRoman: | 487 case UpperRoman: |
| 473 return (value < 1 || value > 3999) ? DecimalListStyle : type; | 488 return (value < 1 || value > 3999) ? DecimalListStyle : type; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 551 case Persian: | 566 case Persian: |
| 552 case Telugu: | 567 case Telugu: |
| 553 case Thai: | 568 case Thai: |
| 554 case Tibetan: | 569 case Tibetan: |
| 555 case UpperAlpha: | 570 case UpperAlpha: |
| 556 case UpperArmenian: | 571 case UpperArmenian: |
| 557 case UpperLatin: | 572 case UpperLatin: |
| 558 case UpperRoman: | 573 case UpperRoman: |
| 559 case Urdu: | 574 case Urdu: |
| 560 return '.'; | 575 return '.'; |
| 576 case SimpChineseFormal: | |
| 577 case SimpChineseInformal: | |
| 578 case TradChineseFormal: | |
| 579 case TradChineseInformal: | |
| 561 case KoreanHangulFormal: | 580 case KoreanHangulFormal: |
| 562 return ','; | 581 return 0x3001; |
| 563 } | 582 } |
| 564 | 583 |
| 565 ASSERT_NOT_REACHED(); | 584 ASSERT_NOT_REACHED(); |
| 566 return '.'; | 585 return '.'; |
| 567 } | 586 } |
| 568 | 587 |
| 569 String listMarkerText(EListStyleType type, int value) | 588 String listMarkerText(EListStyleType type, int value) |
| 570 { | 589 { |
| 571 // If the list-style-type, say hebrew, cannot represent |value| because it's outside | 590 // If the list-style-type, say hebrew, cannot represent |value| because it's outside |
| 572 // its ordinal range then we fallback to some list style that can represent |value|. | 591 // its ordinal range then we fallback to some list style that can represent |value|. |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 828 case EthiopicHalehameTiEt: { | 847 case EthiopicHalehameTiEt: { |
| 829 static const UChar ethiopicHalehameTiEtAlphabet[34] = { | 848 static const UChar ethiopicHalehameTiEtAlphabet[34] = { |
| 830 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x12 40, | 849 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x12 40, |
| 831 0x1250, 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12 A8, | 850 0x1250, 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12 A8, |
| 832 0x12B8, 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x13 08, | 851 0x12B8, 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x13 08, |
| 833 0x1320, 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 | 852 0x1320, 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 |
| 834 }; | 853 }; |
| 835 return toAlphabetic(value, ethiopicHalehameTiEtAlphabet); | 854 return toAlphabetic(value, ethiopicHalehameTiEtAlphabet); |
| 836 } | 855 } |
| 837 case KoreanHangulFormal: { | 856 case KoreanHangulFormal: { |
| 838 static const UChar koreanHangulFormalTable[23] = { | 857 static const UChar koreanHangulFormalTable[26] = { |
| 839 0x2, | 858 Korean, |
| 840 0xB9CC, 0xC5B5, 0xC870, | 859 0xB9CC, 0x0000, 0xC5B5, 0x0000, 0xC870, 0x0000, |
| 841 0xC2ED, 0xBC31, 0xCC9C, | 860 0xC2ED, 0xBC31, 0xCC9C, |
| 842 0xC601, 0xC77C, 0xC774, 0xC0BC, 0xC0AC, | 861 0xC601, 0xC77C, 0xC774, 0xC0BC, 0xC0AC, |
| 843 0xC624, 0xC721, 0xCE60, 0xD314, 0xAD6C, | 862 0xC624, 0xC721, 0xCE60, 0xD314, 0xAD6C, |
| 844 0xB9C8, 0xC774, 0xB108, 0xC2A4, 0x0020, 0x0000 | 863 0xB9C8, 0xC774, 0xB108, 0xC2A4, 0x0020, 0x0000 |
| 845 }; | 864 }; |
| 846 return toCJKIdeographic(value, koreanHangulFormalTable); | 865 return toCJKIdeographic(value, koreanHangulFormalTable, Formal); |
| 847 } | 866 } |
| 848 case CJKIdeographic: { | 867 case CJKIdeographic: |
| 849 static const UChar traditionalChineseInformalTable[19] = { | 868 case TradChineseInformal: { |
| 850 0x1, | 869 static const UChar traditionalChineseInformalTable[22] = { |
| 851 0x842C, 0x5104, 0x5146, | 870 Chinese, |
| 871 0x842C, 0x0000, 0x5104, 0x0000, 0x5146, 0x0000, | |
| 852 0x5341, 0x767E, 0x5343, | 872 0x5341, 0x767E, 0x5343, |
| 853 0x96F6, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, | 873 0x96F6, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, |
| 854 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D, | 874 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D, |
| 855 0x8CA0, 0x0000 | 875 0x8CA0, 0x0000 |
| 856 }; | 876 }; |
| 857 return toCJKIdeographic(value, traditionalChineseInformalTable); | 877 return toCJKIdeographic(value, traditionalChineseInformalTable, Informal ); |
| 878 } | |
| 879 case SimpChineseInformal: { | |
| 880 static const UChar simpleChineseInformalTable[22] = { | |
| 881 Chinese, | |
| 882 0x4E07, 0x0000, 0x4EBF, 0x0000, 0x4E07, 0x4EBF, | |
| 883 0x5341, 0x767E, 0x5343, | |
| 884 0x96F6, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, | |
| 885 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D, | |
| 886 0x8D1F, 0x0000 | |
| 887 }; | |
| 888 return toCJKIdeographic(value, simpleChineseInformalTable, Informal); | |
| 889 } | |
| 890 case TradChineseFormal: { | |
| 891 static const UChar traditionalChineseFormalTable[22] = { | |
| 892 Chinese, | |
| 893 0x842C, 0x0000, 0x5104, 0x0000, 0x5146, 0x0000, | |
| 894 0x62FE, 0x4F70, 0x4EDF, | |
| 895 0x96F6, 0x58F9, 0x8CB3, 0x53C3, 0x8086, | |
| 896 0x4F0D, 0x9678, 0x67D2, 0x634C, 0x7396, | |
| 897 0x8CA0, 0x0000 | |
| 898 }; | |
| 899 return toCJKIdeographic(value, traditionalChineseFormalTable, Formal); | |
| 900 } | |
| 901 case SimpChineseFormal: { | |
| 902 static const UChar simpleChineseFormalTable[22] = { | |
| 903 Chinese, | |
| 904 0x4E07, 0x0000, 0x4EBF, 0x0000, 0x4E07, 0x4EBF, | |
| 905 0x62FE, 0x4F70, 0x4EDF, | |
| 906 0x96F6, 0x58F9, 0x8D30, 0x53C1, 0x8086, | |
| 907 0x4F0D, 0x9646, 0x67D2, 0x634C, 0x7396, | |
| 908 0x8D1F, 0x0000 | |
| 909 }; | |
| 910 return toCJKIdeographic(value, simpleChineseFormalTable, Formal); | |
| 858 } | 911 } |
| 859 | 912 |
| 860 case LowerRoman: | 913 case LowerRoman: |
| 861 return toRoman(value, false); | 914 return toRoman(value, false); |
| 862 case UpperRoman: | 915 case UpperRoman: |
| 863 return toRoman(value, true); | 916 return toRoman(value, true); |
| 864 | 917 |
| 865 case Armenian: | 918 case Armenian: |
| 866 case UpperArmenian: | 919 case UpperArmenian: |
| 867 // CSS3 says "armenian" means "lower-armenian". | 920 // CSS3 says "armenian" means "lower-armenian". |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1062 case LowerAlpha: | 1115 case LowerAlpha: |
| 1063 case LowerArmenian: | 1116 case LowerArmenian: |
| 1064 case LowerGreek: | 1117 case LowerGreek: |
| 1065 case LowerLatin: | 1118 case LowerLatin: |
| 1066 case LowerRoman: | 1119 case LowerRoman: |
| 1067 case Malayalam: | 1120 case Malayalam: |
| 1068 case Mongolian: | 1121 case Mongolian: |
| 1069 case Myanmar: | 1122 case Myanmar: |
| 1070 case Oriya: | 1123 case Oriya: |
| 1071 case Persian: | 1124 case Persian: |
| 1125 case SimpChineseFormal: | |
| 1126 case SimpChineseInformal: | |
| 1072 case Telugu: | 1127 case Telugu: |
| 1073 case Thai: | 1128 case Thai: |
| 1074 case Tibetan: | 1129 case Tibetan: |
| 1130 case TradChineseFormal: | |
| 1131 case TradChineseInformal: | |
| 1075 case UpperAlpha: | 1132 case UpperAlpha: |
| 1076 case UpperArmenian: | 1133 case UpperArmenian: |
| 1077 case UpperLatin: | 1134 case UpperLatin: |
| 1078 case UpperRoman: | 1135 case UpperRoman: |
| 1079 case Urdu: | 1136 case Urdu: |
| 1080 m_text = listMarkerText(type, m_listItem->value()); | 1137 m_text = listMarkerText(type, m_listItem->value()); |
| 1081 break; | 1138 break; |
| 1082 } | 1139 } |
| 1083 } | 1140 } |
| 1084 | 1141 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1138 case LowerAlpha: | 1195 case LowerAlpha: |
| 1139 case LowerArmenian: | 1196 case LowerArmenian: |
| 1140 case LowerGreek: | 1197 case LowerGreek: |
| 1141 case LowerLatin: | 1198 case LowerLatin: |
| 1142 case LowerRoman: | 1199 case LowerRoman: |
| 1143 case Malayalam: | 1200 case Malayalam: |
| 1144 case Mongolian: | 1201 case Mongolian: |
| 1145 case Myanmar: | 1202 case Myanmar: |
| 1146 case Oriya: | 1203 case Oriya: |
| 1147 case Persian: | 1204 case Persian: |
| 1205 case SimpChineseFormal: | |
| 1206 case SimpChineseInformal: | |
| 1148 case Telugu: | 1207 case Telugu: |
| 1149 case Thai: | 1208 case Thai: |
| 1150 case Tibetan: | 1209 case Tibetan: |
| 1210 case TradChineseFormal: | |
| 1211 case TradChineseInformal: | |
| 1151 case UpperAlpha: | 1212 case UpperAlpha: |
| 1152 case UpperArmenian: | 1213 case UpperArmenian: |
| 1153 case UpperLatin: | 1214 case UpperLatin: |
| 1154 case UpperRoman: | 1215 case UpperRoman: |
| 1155 case Urdu: | 1216 case Urdu: |
| 1156 if (m_text.isEmpty()) { | 1217 if (m_text.isEmpty()) { |
| 1157 logicalWidth = 0; | 1218 logicalWidth = 0; |
| 1158 } else { | 1219 } else { |
| 1159 LayoutUnit itemWidth = font.width(m_text); | 1220 LayoutUnit itemWidth = font.width(m_text); |
| 1160 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()) , ' ' }; | 1221 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()) , ' ' }; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1310 case LowerAlpha: | 1371 case LowerAlpha: |
| 1311 case LowerArmenian: | 1372 case LowerArmenian: |
| 1312 case LowerGreek: | 1373 case LowerGreek: |
| 1313 case LowerLatin: | 1374 case LowerLatin: |
| 1314 case LowerRoman: | 1375 case LowerRoman: |
| 1315 case Malayalam: | 1376 case Malayalam: |
| 1316 case Mongolian: | 1377 case Mongolian: |
| 1317 case Myanmar: | 1378 case Myanmar: |
| 1318 case Oriya: | 1379 case Oriya: |
| 1319 case Persian: | 1380 case Persian: |
| 1381 case SimpChineseFormal: | |
| 1382 case SimpChineseInformal: | |
| 1320 case Telugu: | 1383 case Telugu: |
| 1321 case Thai: | 1384 case Thai: |
| 1322 case Tibetan: | 1385 case Tibetan: |
| 1386 case TradChineseFormal: | |
| 1387 case TradChineseInformal: | |
| 1323 case UpperAlpha: | 1388 case UpperAlpha: |
| 1324 case UpperArmenian: | 1389 case UpperArmenian: |
| 1325 case UpperLatin: | 1390 case UpperLatin: |
| 1326 case UpperRoman: | 1391 case UpperRoman: |
| 1327 case Urdu: | 1392 case Urdu: |
| 1328 if (m_text.isEmpty()) | 1393 if (m_text.isEmpty()) |
| 1329 return IntRect(); | 1394 return IntRect(); |
| 1330 const Font& font = style()->font(); | 1395 const Font& font = style()->font(); |
| 1331 int itemWidth = font.width(m_text); | 1396 int itemWidth = font.width(m_text); |
| 1332 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' }; | 1397 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' }; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1376 if (style()) { | 1441 if (style()) { |
| 1377 // Reuse the current margins. Otherwise resetting the margins to initial values | 1442 // Reuse the current margins. Otherwise resetting the margins to initial values |
| 1378 // would trigger unnecessary layout. | 1443 // would trigger unnecessary layout. |
| 1379 newStyle->setMarginStart(style()->marginStart()); | 1444 newStyle->setMarginStart(style()->marginStart()); |
| 1380 newStyle->setMarginEnd(style()->marginRight()); | 1445 newStyle->setMarginEnd(style()->marginRight()); |
| 1381 } | 1446 } |
| 1382 setStyle(newStyle.release()); | 1447 setStyle(newStyle.release()); |
| 1383 } | 1448 } |
| 1384 | 1449 |
| 1385 } // namespace blink | 1450 } // namespace blink |
| OLD | NEW |