| 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 return String(characters, length); | 399 return String(characters, length); |
| 400 } | 400 } |
| 401 | 401 |
| 402 static EListStyleType effectiveListMarkerType(EListStyleType type, int value) | 402 static EListStyleType effectiveListMarkerType(EListStyleType type, int value) |
| 403 { | 403 { |
| 404 // Note, the following switch statement has been explicitly grouped | 404 // Note, the following switch statement has been explicitly grouped |
| 405 // by list-style-type ordinal range. | 405 // by list-style-type ordinal range. |
| 406 switch (type) { | 406 switch (type) { |
| 407 case ArabicIndic: | 407 case ArabicIndic: |
| 408 case Bengali: | 408 case Bengali: |
| 409 case BinaryListStyle: | |
| 410 case Cambodian: | 409 case Cambodian: |
| 411 case Circle: | 410 case Circle: |
| 412 case DecimalLeadingZero: | 411 case DecimalLeadingZero: |
| 413 case DecimalListStyle: | 412 case DecimalListStyle: |
| 414 case Devanagari: | 413 case Devanagari: |
| 415 case Disc: | 414 case Disc: |
| 416 case Gujarati: | 415 case Gujarati: |
| 417 case Gurmukhi: | 416 case Gurmukhi: |
| 418 case Kannada: | 417 case Kannada: |
| 419 case Khmer: | 418 case Khmer: |
| 420 case Lao: | 419 case Lao: |
| 421 case LowerHexadecimal: | |
| 422 case Malayalam: | 420 case Malayalam: |
| 423 case Mongolian: | 421 case Mongolian: |
| 424 case Myanmar: | 422 case Myanmar: |
| 425 case NoneListStyle: | 423 case NoneListStyle: |
| 426 case Octal: | |
| 427 case Oriya: | 424 case Oriya: |
| 428 case Persian: | 425 case Persian: |
| 429 case Square: | 426 case Square: |
| 430 case Telugu: | 427 case Telugu: |
| 431 case Thai: | 428 case Thai: |
| 432 case Tibetan: | 429 case Tibetan: |
| 433 case UpperHexadecimal: | |
| 434 case Urdu: | 430 case Urdu: |
| 435 return type; // Can represent all ordinals. | 431 return type; // Can represent all ordinals. |
| 436 case Armenian: | 432 case Armenian: |
| 437 return (value < 1 || value > 99999999) ? DecimalListStyle : type; | 433 return (value < 1 || value > 99999999) ? DecimalListStyle : type; |
| 438 case CJKIdeographic: | 434 case CJKIdeographic: |
| 439 return (value < 0) ? DecimalListStyle : type; | 435 return (value < 0) ? DecimalListStyle : type; |
| 440 case Georgian: | 436 case Georgian: |
| 441 return (value < 1 || value > 19999) ? DecimalListStyle : type; | 437 return (value < 1 || value > 19999) ? DecimalListStyle : type; |
| 442 case Hebrew: | 438 case Hebrew: |
| 443 return (value < 0 || value > 999999) ? DecimalListStyle : type; | 439 return (value < 0 || value > 999999) ? DecimalListStyle : type; |
| 444 case LowerRoman: | 440 case LowerRoman: |
| 445 case UpperRoman: | 441 case UpperRoman: |
| 446 return (value < 1 || value > 3999) ? DecimalListStyle : type; | 442 return (value < 1 || value > 3999) ? DecimalListStyle : type; |
| 447 case Afar: | |
| 448 case Amharic: | |
| 449 case AmharicAbegede: | |
| 450 case Asterisks: | |
| 451 case CjkEarthlyBranch: | 443 case CjkEarthlyBranch: |
| 452 case CjkHeavenlyStem: | 444 case CjkHeavenlyStem: |
| 453 case Ethiopic: | 445 case EthiopicHalehameAm: |
| 454 case EthiopicAbegede: | 446 case EthiopicHalehame: |
| 455 case EthiopicAbegedeAmEt: | |
| 456 case EthiopicAbegedeGez: | |
| 457 case EthiopicAbegedeTiEr: | |
| 458 case EthiopicAbegedeTiEt: | |
| 459 case EthiopicHalehameAaEr: | |
| 460 case EthiopicHalehameAaEt: | |
| 461 case EthiopicHalehameAmEt: | |
| 462 case EthiopicHalehameGez: | |
| 463 case EthiopicHalehameOmEt: | |
| 464 case EthiopicHalehameSidEt: | |
| 465 case EthiopicHalehameSoEt: | |
| 466 case EthiopicHalehameTiEr: | 447 case EthiopicHalehameTiEr: |
| 467 case EthiopicHalehameTiEt: | 448 case EthiopicHalehameTiEt: |
| 468 case EthiopicHalehameTig: | |
| 469 case Footnotes: | |
| 470 case Hangul: | 449 case Hangul: |
| 471 case HangulConsonant: | 450 case HangulConsonant: |
| 472 case Hiragana: | 451 case Hiragana: |
| 473 case HiraganaIroha: | 452 case HiraganaIroha: |
| 474 case Katakana: | 453 case Katakana: |
| 475 case KatakanaIroha: | 454 case KatakanaIroha: |
| 476 case LowerAlpha: | 455 case LowerAlpha: |
| 477 case LowerArmenian: | 456 case LowerArmenian: |
| 478 case LowerGreek: | 457 case LowerGreek: |
| 479 case LowerLatin: | 458 case LowerLatin: |
| 480 case LowerNorwegian: | |
| 481 case Oromo: | |
| 482 case Sidama: | |
| 483 case Somali: | |
| 484 case Tigre: | |
| 485 case TigrinyaEr: | |
| 486 case TigrinyaErAbegede: | |
| 487 case TigrinyaEt: | |
| 488 case TigrinyaEtAbegede: | |
| 489 case UpperAlpha: | 459 case UpperAlpha: |
| 490 case UpperArmenian: | 460 case UpperArmenian: |
| 491 case UpperGreek: | |
| 492 case UpperLatin: | 461 case UpperLatin: |
| 493 case UpperNorwegian: | |
| 494 return (value < 1) ? DecimalListStyle : type; | 462 return (value < 1) ? DecimalListStyle : type; |
| 495 } | 463 } |
| 496 | 464 |
| 497 ASSERT_NOT_REACHED(); | 465 ASSERT_NOT_REACHED(); |
| 498 return type; | 466 return type; |
| 499 } | 467 } |
| 500 | 468 |
| 501 UChar LayoutListMarker::listMarkerSuffix(EListStyleType type, int value) | 469 UChar LayoutListMarker::listMarkerSuffix(EListStyleType type, int value) |
| 502 { | 470 { |
| 503 // If the list-style-type cannot represent |value| because it's outside its | 471 // If the list-style-type cannot represent |value| because it's outside its |
| 504 // ordinal range then we fall back to some list style that can represent |va
lue|. | 472 // ordinal range then we fall back to some list style that can represent |va
lue|. |
| 505 EListStyleType effectiveType = effectiveListMarkerType(type, value); | 473 EListStyleType effectiveType = effectiveListMarkerType(type, value); |
| 506 | 474 |
| 507 // Note, the following switch statement has been explicitly | 475 // Note, the following switch statement has been explicitly |
| 508 // grouped by list-style-type suffix. | 476 // grouped by list-style-type suffix. |
| 509 switch (effectiveType) { | 477 switch (effectiveType) { |
| 510 case Asterisks: | |
| 511 case Circle: | 478 case Circle: |
| 512 case Disc: | 479 case Disc: |
| 513 case Footnotes: | |
| 514 case NoneListStyle: | 480 case NoneListStyle: |
| 515 case Square: | 481 case Square: |
| 516 return ' '; | 482 return ' '; |
| 517 case Afar: | 483 case EthiopicHalehame: |
| 518 case Amharic: | 484 case EthiopicHalehameAm: |
| 519 case AmharicAbegede: | |
| 520 case Ethiopic: | |
| 521 case EthiopicAbegede: | |
| 522 case EthiopicAbegedeAmEt: | |
| 523 case EthiopicAbegedeGez: | |
| 524 case EthiopicAbegedeTiEr: | |
| 525 case EthiopicAbegedeTiEt: | |
| 526 case EthiopicHalehameAaEr: | |
| 527 case EthiopicHalehameAaEt: | |
| 528 case EthiopicHalehameAmEt: | |
| 529 case EthiopicHalehameGez: | |
| 530 case EthiopicHalehameOmEt: | |
| 531 case EthiopicHalehameSidEt: | |
| 532 case EthiopicHalehameSoEt: | |
| 533 case EthiopicHalehameTiEr: | 485 case EthiopicHalehameTiEr: |
| 534 case EthiopicHalehameTiEt: | 486 case EthiopicHalehameTiEt: |
| 535 case EthiopicHalehameTig: | |
| 536 case Oromo: | |
| 537 case Sidama: | |
| 538 case Somali: | |
| 539 case Tigre: | |
| 540 case TigrinyaEr: | |
| 541 case TigrinyaErAbegede: | |
| 542 case TigrinyaEt: | |
| 543 case TigrinyaEtAbegede: | |
| 544 return ethiopicPrefaceColonCharacter; | 487 return ethiopicPrefaceColonCharacter; |
| 545 case Armenian: | 488 case Armenian: |
| 546 case ArabicIndic: | 489 case ArabicIndic: |
| 547 case Bengali: | 490 case Bengali: |
| 548 case BinaryListStyle: | |
| 549 case Cambodian: | 491 case Cambodian: |
| 550 case CJKIdeographic: | 492 case CJKIdeographic: |
| 551 case CjkEarthlyBranch: | 493 case CjkEarthlyBranch: |
| 552 case CjkHeavenlyStem: | 494 case CjkHeavenlyStem: |
| 553 case DecimalLeadingZero: | 495 case DecimalLeadingZero: |
| 554 case DecimalListStyle: | 496 case DecimalListStyle: |
| 555 case Devanagari: | 497 case Devanagari: |
| 556 case Georgian: | 498 case Georgian: |
| 557 case Gujarati: | 499 case Gujarati: |
| 558 case Gurmukhi: | 500 case Gurmukhi: |
| 559 case Hangul: | 501 case Hangul: |
| 560 case HangulConsonant: | 502 case HangulConsonant: |
| 561 case Hebrew: | 503 case Hebrew: |
| 562 case Hiragana: | 504 case Hiragana: |
| 563 case HiraganaIroha: | 505 case HiraganaIroha: |
| 564 case Kannada: | 506 case Kannada: |
| 565 case Katakana: | 507 case Katakana: |
| 566 case KatakanaIroha: | 508 case KatakanaIroha: |
| 567 case Khmer: | 509 case Khmer: |
| 568 case Lao: | 510 case Lao: |
| 569 case LowerAlpha: | 511 case LowerAlpha: |
| 570 case LowerArmenian: | 512 case LowerArmenian: |
| 571 case LowerGreek: | 513 case LowerGreek: |
| 572 case LowerHexadecimal: | |
| 573 case LowerLatin: | 514 case LowerLatin: |
| 574 case LowerNorwegian: | |
| 575 case LowerRoman: | 515 case LowerRoman: |
| 576 case Malayalam: | 516 case Malayalam: |
| 577 case Mongolian: | 517 case Mongolian: |
| 578 case Myanmar: | 518 case Myanmar: |
| 579 case Octal: | |
| 580 case Oriya: | 519 case Oriya: |
| 581 case Persian: | 520 case Persian: |
| 582 case Telugu: | 521 case Telugu: |
| 583 case Thai: | 522 case Thai: |
| 584 case Tibetan: | 523 case Tibetan: |
| 585 case UpperAlpha: | 524 case UpperAlpha: |
| 586 case UpperArmenian: | 525 case UpperArmenian: |
| 587 case UpperGreek: | |
| 588 case UpperHexadecimal: | |
| 589 case UpperLatin: | 526 case UpperLatin: |
| 590 case UpperNorwegian: | |
| 591 case UpperRoman: | 527 case UpperRoman: |
| 592 case Urdu: | 528 case Urdu: |
| 593 return '.'; | 529 return '.'; |
| 594 } | 530 } |
| 595 | 531 |
| 596 ASSERT_NOT_REACHED(); | 532 ASSERT_NOT_REACHED(); |
| 597 return '.'; | 533 return '.'; |
| 598 } | 534 } |
| 599 | 535 |
| 600 String listMarkerText(EListStyleType type, int value) | 536 String listMarkerText(EListStyleType type, int value) |
| 601 { | 537 { |
| 602 // If the list-style-type, say hebrew, cannot represent |value| because it's
outside | 538 // If the list-style-type, say hebrew, cannot represent |value| because it's
outside |
| 603 // its ordinal range then we fallback to some list style that can represent
|value|. | 539 // its ordinal range then we fallback to some list style that can represent
|value|. |
| 604 switch (effectiveListMarkerType(type, value)) { | 540 switch (effectiveListMarkerType(type, value)) { |
| 605 case NoneListStyle: | 541 case NoneListStyle: |
| 606 return ""; | 542 return ""; |
| 607 | 543 |
| 608 case Asterisks: { | |
| 609 static const LChar asterisksSymbols[1] = { | |
| 610 0x2A | |
| 611 }; | |
| 612 return toSymbolic(value, asterisksSymbols); | |
| 613 } | |
| 614 // We use the same characters for text security. | 544 // We use the same characters for text security. |
| 615 // See LayoutText::setInternalString. | 545 // See LayoutText::setInternalString. |
| 616 case Circle: | 546 case Circle: |
| 617 return String(&whiteBulletCharacter, 1); | 547 return String(&whiteBulletCharacter, 1); |
| 618 case Disc: | 548 case Disc: |
| 619 return String(&bulletCharacter, 1); | 549 return String(&bulletCharacter, 1); |
| 620 case Footnotes: { | |
| 621 static const UChar footnotesSymbols[4] = { | |
| 622 0x002A, 0x2051, 0x2020, 0x2021 | |
| 623 }; | |
| 624 return toSymbolic(value, footnotesSymbols); | |
| 625 } | |
| 626 case Square: | 550 case Square: |
| 627 // The CSS 2.1 test suite uses U+25EE BLACK MEDIUM SMALL SQUARE | 551 // The CSS 2.1 test suite uses U+25EE BLACK MEDIUM SMALL SQUARE |
| 628 // instead, but I think this looks better. | 552 // instead, but I think this looks better. |
| 629 return String(&blackSquareCharacter, 1); | 553 return String(&blackSquareCharacter, 1); |
| 630 | 554 |
| 631 case DecimalListStyle: | 555 case DecimalListStyle: |
| 632 return String::number(value); | 556 return String::number(value); |
| 633 case DecimalLeadingZero: | 557 case DecimalLeadingZero: |
| 634 if (value < -9 || value > 9) | 558 if (value < -9 || value > 9) |
| 635 return String::number(value); | 559 return String::number(value); |
| 636 if (value < 0) | 560 if (value < 0) |
| 637 return "-0" + String::number(-value); // -01 to -09 | 561 return "-0" + String::number(-value); // -01 to -09 |
| 638 return "0" + String::number(value); // 00 to 09 | 562 return "0" + String::number(value); // 00 to 09 |
| 639 | 563 |
| 640 case ArabicIndic: { | 564 case ArabicIndic: { |
| 641 static const UChar arabicIndicNumerals[10] = { | 565 static const UChar arabicIndicNumerals[10] = { |
| 642 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667, 0x06
68, 0x0669 | 566 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667, 0x06
68, 0x0669 |
| 643 }; | 567 }; |
| 644 return toNumeric(value, arabicIndicNumerals); | 568 return toNumeric(value, arabicIndicNumerals); |
| 645 } | 569 } |
| 646 case BinaryListStyle: { | |
| 647 static const LChar binaryNumerals[2] = { | |
| 648 '0', '1' | |
| 649 }; | |
| 650 return toNumeric(value, binaryNumerals); | |
| 651 } | |
| 652 case Bengali: { | 570 case Bengali: { |
| 653 static const UChar bengaliNumerals[10] = { | 571 static const UChar bengaliNumerals[10] = { |
| 654 0x09E6, 0x09E7, 0x09E8, 0x09E9, 0x09EA, 0x09EB, 0x09EC, 0x09ED, 0x09
EE, 0x09EF | 572 0x09E6, 0x09E7, 0x09E8, 0x09E9, 0x09EA, 0x09EB, 0x09EC, 0x09ED, 0x09
EE, 0x09EF |
| 655 }; | 573 }; |
| 656 return toNumeric(value, bengaliNumerals); | 574 return toNumeric(value, bengaliNumerals); |
| 657 } | 575 } |
| 658 case Cambodian: | 576 case Cambodian: |
| 659 case Khmer: { | 577 case Khmer: { |
| 660 static const UChar khmerNumerals[10] = { | 578 static const UChar khmerNumerals[10] = { |
| 661 0x17E0, 0x17E1, 0x17E2, 0x17E3, 0x17E4, 0x17E5, 0x17E6, 0x17E7, 0x17
E8, 0x17E9 | 579 0x17E0, 0x17E1, 0x17E2, 0x17E3, 0x17E4, 0x17E5, 0x17E6, 0x17E7, 0x17
E8, 0x17E9 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 679 0x0A66, 0x0A67, 0x0A68, 0x0A69, 0x0A6A, 0x0A6B, 0x0A6C, 0x0A6D, 0x0A
6E, 0x0A6F | 597 0x0A66, 0x0A67, 0x0A68, 0x0A69, 0x0A6A, 0x0A6B, 0x0A6C, 0x0A6D, 0x0A
6E, 0x0A6F |
| 680 }; | 598 }; |
| 681 return toNumeric(value, gurmukhiNumerals); | 599 return toNumeric(value, gurmukhiNumerals); |
| 682 } | 600 } |
| 683 case Kannada: { | 601 case Kannada: { |
| 684 static const UChar kannadaNumerals[10] = { | 602 static const UChar kannadaNumerals[10] = { |
| 685 0x0CE6, 0x0CE7, 0x0CE8, 0x0CE9, 0x0CEA, 0x0CEB, 0x0CEC, 0x0CED, 0x0C
EE, 0x0CEF | 603 0x0CE6, 0x0CE7, 0x0CE8, 0x0CE9, 0x0CEA, 0x0CEB, 0x0CEC, 0x0CED, 0x0C
EE, 0x0CEF |
| 686 }; | 604 }; |
| 687 return toNumeric(value, kannadaNumerals); | 605 return toNumeric(value, kannadaNumerals); |
| 688 } | 606 } |
| 689 case LowerHexadecimal: { | |
| 690 static const LChar lowerHexadecimalNumerals[16] = { | |
| 691 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd'
, 'e', 'f' | |
| 692 }; | |
| 693 return toNumeric(value, lowerHexadecimalNumerals); | |
| 694 } | |
| 695 case Lao: { | 607 case Lao: { |
| 696 static const UChar laoNumerals[10] = { | 608 static const UChar laoNumerals[10] = { |
| 697 0x0ED0, 0x0ED1, 0x0ED2, 0x0ED3, 0x0ED4, 0x0ED5, 0x0ED6, 0x0ED7, 0x0E
D8, 0x0ED9 | 609 0x0ED0, 0x0ED1, 0x0ED2, 0x0ED3, 0x0ED4, 0x0ED5, 0x0ED6, 0x0ED7, 0x0E
D8, 0x0ED9 |
| 698 }; | 610 }; |
| 699 return toNumeric(value, laoNumerals); | 611 return toNumeric(value, laoNumerals); |
| 700 } | 612 } |
| 701 case Malayalam: { | 613 case Malayalam: { |
| 702 static const UChar malayalamNumerals[10] = { | 614 static const UChar malayalamNumerals[10] = { |
| 703 0x0D66, 0x0D67, 0x0D68, 0x0D69, 0x0D6A, 0x0D6B, 0x0D6C, 0x0D6D, 0x0D
6E, 0x0D6F | 615 0x0D66, 0x0D67, 0x0D68, 0x0D69, 0x0D6A, 0x0D6B, 0x0D6C, 0x0D6D, 0x0D
6E, 0x0D6F |
| 704 }; | 616 }; |
| 705 return toNumeric(value, malayalamNumerals); | 617 return toNumeric(value, malayalamNumerals); |
| 706 } | 618 } |
| 707 case Mongolian: { | 619 case Mongolian: { |
| 708 static const UChar mongolianNumerals[10] = { | 620 static const UChar mongolianNumerals[10] = { |
| 709 0x1810, 0x1811, 0x1812, 0x1813, 0x1814, 0x1815, 0x1816, 0x1817, 0x18
18, 0x1819 | 621 0x1810, 0x1811, 0x1812, 0x1813, 0x1814, 0x1815, 0x1816, 0x1817, 0x18
18, 0x1819 |
| 710 }; | 622 }; |
| 711 return toNumeric(value, mongolianNumerals); | 623 return toNumeric(value, mongolianNumerals); |
| 712 } | 624 } |
| 713 case Myanmar: { | 625 case Myanmar: { |
| 714 static const UChar myanmarNumerals[10] = { | 626 static const UChar myanmarNumerals[10] = { |
| 715 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, 0x10
48, 0x1049 | 627 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, 0x10
48, 0x1049 |
| 716 }; | 628 }; |
| 717 return toNumeric(value, myanmarNumerals); | 629 return toNumeric(value, myanmarNumerals); |
| 718 } | 630 } |
| 719 case Octal: { | |
| 720 static const LChar octalNumerals[8] = { | |
| 721 '0', '1', '2', '3', '4', '5', '6', '7' | |
| 722 }; | |
| 723 return toNumeric(value, octalNumerals); | |
| 724 } | |
| 725 case Oriya: { | 631 case Oriya: { |
| 726 static const UChar oriyaNumerals[10] = { | 632 static const UChar oriyaNumerals[10] = { |
| 727 0x0B66, 0x0B67, 0x0B68, 0x0B69, 0x0B6A, 0x0B6B, 0x0B6C, 0x0B6D, 0x0B
6E, 0x0B6F | 633 0x0B66, 0x0B67, 0x0B68, 0x0B69, 0x0B6A, 0x0B6B, 0x0B6C, 0x0B6D, 0x0B
6E, 0x0B6F |
| 728 }; | 634 }; |
| 729 return toNumeric(value, oriyaNumerals); | 635 return toNumeric(value, oriyaNumerals); |
| 730 } | 636 } |
| 731 case Persian: | 637 case Persian: |
| 732 case Urdu: { | 638 case Urdu: { |
| 733 static const UChar urduNumerals[10] = { | 639 static const UChar urduNumerals[10] = { |
| 734 0x06F0, 0x06F1, 0x06F2, 0x06F3, 0x06F4, 0x06F5, 0x06F6, 0x06F7, 0x06
F8, 0x06F9 | 640 0x06F0, 0x06F1, 0x06F2, 0x06F3, 0x06F4, 0x06F5, 0x06F6, 0x06F7, 0x06
F8, 0x06F9 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 746 0x0F20, 0x0F21, 0x0F22, 0x0F23, 0x0F24, 0x0F25, 0x0F26, 0x0F27, 0x0F
28, 0x0F29 | 652 0x0F20, 0x0F21, 0x0F22, 0x0F23, 0x0F24, 0x0F25, 0x0F26, 0x0F27, 0x0F
28, 0x0F29 |
| 747 }; | 653 }; |
| 748 return toNumeric(value, tibetanNumerals); | 654 return toNumeric(value, tibetanNumerals); |
| 749 } | 655 } |
| 750 case Thai: { | 656 case Thai: { |
| 751 static const UChar thaiNumerals[10] = { | 657 static const UChar thaiNumerals[10] = { |
| 752 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 0x0E
58, 0x0E59 | 658 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 0x0E
58, 0x0E59 |
| 753 }; | 659 }; |
| 754 return toNumeric(value, thaiNumerals); | 660 return toNumeric(value, thaiNumerals); |
| 755 } | 661 } |
| 756 case UpperHexadecimal: { | |
| 757 static const LChar upperHexadecimalNumerals[16] = { | |
| 758 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D'
, 'E', 'F' | |
| 759 }; | |
| 760 return toNumeric(value, upperHexadecimalNumerals); | |
| 761 } | |
| 762 | 662 |
| 763 case LowerAlpha: | 663 case LowerAlpha: |
| 764 case LowerLatin: { | 664 case LowerLatin: { |
| 765 static const LChar lowerLatinAlphabet[26] = { | 665 static const LChar lowerLatinAlphabet[26] = { |
| 766 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', | 666 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', |
| 767 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' | 667 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' |
| 768 }; | 668 }; |
| 769 return toAlphabetic(value, lowerLatinAlphabet); | 669 return toAlphabetic(value, lowerLatinAlphabet); |
| 770 } | 670 } |
| 771 case UpperAlpha: | 671 case UpperAlpha: |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 0x30A4, 0x30ED, 0x30CF, 0x30CB, 0x30DB, 0x30D8, 0x30C8, 0x30C1, | 731 0x30A4, 0x30ED, 0x30CF, 0x30CB, 0x30DB, 0x30D8, 0x30C8, 0x30C1, |
| 832 0x30EA, 0x30CC, 0x30EB, 0x30F2, 0x30EF, 0x30AB, 0x30E8, 0x30BF, | 732 0x30EA, 0x30CC, 0x30EB, 0x30F2, 0x30EF, 0x30AB, 0x30E8, 0x30BF, |
| 833 0x30EC, 0x30BD, 0x30C4, 0x30CD, 0x30CA, 0x30E9, 0x30E0, 0x30A6, | 733 0x30EC, 0x30BD, 0x30C4, 0x30CD, 0x30CA, 0x30E9, 0x30E0, 0x30A6, |
| 834 0x30F0, 0x30CE, 0x30AA, 0x30AF, 0x30E4, 0x30DE, 0x30B1, 0x30D5, | 734 0x30F0, 0x30CE, 0x30AA, 0x30AF, 0x30E4, 0x30DE, 0x30B1, 0x30D5, |
| 835 0x30B3, 0x30A8, 0x30C6, 0x30A2, 0x30B5, 0x30AD, 0x30E6, 0x30E1, | 735 0x30B3, 0x30A8, 0x30C6, 0x30A2, 0x30B5, 0x30AD, 0x30E6, 0x30E1, |
| 836 0x30DF, 0x30B7, 0x30F1, 0x30D2, 0x30E2, 0x30BB, 0x30B9 | 736 0x30DF, 0x30B7, 0x30F1, 0x30D2, 0x30E2, 0x30BB, 0x30B9 |
| 837 }; | 737 }; |
| 838 return toAlphabetic(value, katakanaIrohaAlphabet); | 738 return toAlphabetic(value, katakanaIrohaAlphabet); |
| 839 } | 739 } |
| 840 | 740 |
| 841 case Afar: | |
| 842 case EthiopicHalehameAaEt: | |
| 843 case EthiopicHalehameAaEr: { | |
| 844 static const UChar ethiopicHalehameAaErAlphabet[18] = { | |
| 845 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1260, 0x1270, 0x12
90, | |
| 846 0x12A0, 0x12A8, 0x12C8, 0x12D0, 0x12E8, 0x12F0, 0x1308, 0x1338, 0x13
48 | |
| 847 }; | |
| 848 return toAlphabetic(value, ethiopicHalehameAaErAlphabet); | |
| 849 } | |
| 850 case Amharic: | |
| 851 case EthiopicHalehameAmEt: { | |
| 852 static const UChar ethiopicHalehameAmEtAlphabet[33] = { | |
| 853 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x12
40, | |
| 854 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12
B8, | |
| 855 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x1308, 0x13
20, | |
| 856 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 | |
| 857 }; | |
| 858 return toAlphabetic(value, ethiopicHalehameAmEtAlphabet); | |
| 859 } | |
| 860 case AmharicAbegede: | |
| 861 case EthiopicAbegedeAmEt: { | |
| 862 static const UChar ethiopicAbegedeAmEtAlphabet[33] = { | |
| 863 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1300, 0x1200, 0x12C8, 0x12D8, 0x12
E0, | |
| 864 0x1210, 0x1320, 0x1328, 0x12E8, 0x12A8, 0x12B8, 0x1208, 0x1218, 0x12
90, | |
| 865 0x1298, 0x1220, 0x12D0, 0x1348, 0x1338, 0x1240, 0x1228, 0x1230, 0x12
38, | |
| 866 0x1270, 0x1278, 0x1280, 0x1340, 0x1330, 0x1350 | |
| 867 }; | |
| 868 return toAlphabetic(value, ethiopicAbegedeAmEtAlphabet); | |
| 869 } | |
| 870 case CjkEarthlyBranch: { | 741 case CjkEarthlyBranch: { |
| 871 static const UChar cjkEarthlyBranchAlphabet[12] = { | 742 static const UChar cjkEarthlyBranchAlphabet[12] = { |
| 872 0x5B50, 0x4E11, 0x5BC5, 0x536F, 0x8FB0, 0x5DF3, 0x5348, 0x672A, 0x75
33, | 743 0x5B50, 0x4E11, 0x5BC5, 0x536F, 0x8FB0, 0x5DF3, 0x5348, 0x672A, 0x75
33, |
| 873 0x9149, 0x620C, 0x4EA5 | 744 0x9149, 0x620C, 0x4EA5 |
| 874 }; | 745 }; |
| 875 return toAlphabetic(value, cjkEarthlyBranchAlphabet); | 746 return toAlphabetic(value, cjkEarthlyBranchAlphabet); |
| 876 } | 747 } |
| 877 case CjkHeavenlyStem: { | 748 case CjkHeavenlyStem: { |
| 878 static const UChar cjkHeavenlyStemAlphabet[10] = { | 749 static const UChar cjkHeavenlyStemAlphabet[10] = { |
| 879 0x7532, 0x4E59, 0x4E19, 0x4E01, 0x620A, 0x5DF1, 0x5E9A, 0x8F9B, 0x58
EC, | 750 0x7532, 0x4E59, 0x4E19, 0x4E01, 0x620A, 0x5DF1, 0x5E9A, 0x8F9B, 0x58
EC, |
| 880 0x7678 | 751 0x7678 |
| 881 }; | 752 }; |
| 882 return toAlphabetic(value, cjkHeavenlyStemAlphabet); | 753 return toAlphabetic(value, cjkHeavenlyStemAlphabet); |
| 883 } | 754 } |
| 884 case Ethiopic: | |
| 885 case EthiopicHalehameGez: { | |
| 886 static const UChar ethiopicHalehameGezAlphabet[26] = { | |
| 887 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1240, 0x12
60, | |
| 888 0x1270, 0x1280, 0x1290, 0x12A0, 0x12A8, 0x12C8, 0x12D0, 0x12D8, 0x12
E8, | |
| 889 0x12F0, 0x1308, 0x1320, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 | |
| 890 }; | |
| 891 return toAlphabetic(value, ethiopicHalehameGezAlphabet); | |
| 892 } | |
| 893 case EthiopicAbegede: | |
| 894 case EthiopicAbegedeGez: { | |
| 895 static const UChar ethiopicAbegedeGezAlphabet[26] = { | |
| 896 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1200, 0x12C8, 0x12D8, 0x1210, 0x13
20, | |
| 897 0x12E8, 0x12A8, 0x1208, 0x1218, 0x1290, 0x1220, 0x12D0, 0x1348, 0x13
38, | |
| 898 0x1240, 0x1228, 0x1230, 0x1270, 0x1280, 0x1340, 0x1330, 0x1350 | |
| 899 }; | |
| 900 return toAlphabetic(value, ethiopicAbegedeGezAlphabet); | |
| 901 } | |
| 902 case HangulConsonant: { | 755 case HangulConsonant: { |
| 903 static const UChar hangulConsonantAlphabet[14] = { | 756 static const UChar hangulConsonantAlphabet[14] = { |
| 904 0x3131, 0x3134, 0x3137, 0x3139, 0x3141, 0x3142, 0x3145, 0x3147, 0x31
48, | 757 0x3131, 0x3134, 0x3137, 0x3139, 0x3141, 0x3142, 0x3145, 0x3147, 0x31
48, |
| 905 0x314A, 0x314B, 0x314C, 0x314D, 0x314E | 758 0x314A, 0x314B, 0x314C, 0x314D, 0x314E |
| 906 }; | 759 }; |
| 907 return toAlphabetic(value, hangulConsonantAlphabet); | 760 return toAlphabetic(value, hangulConsonantAlphabet); |
| 908 } | 761 } |
| 909 case Hangul: { | 762 case Hangul: { |
| 910 static const UChar hangulAlphabet[14] = { | 763 static const UChar hangulAlphabet[14] = { |
| 911 0xAC00, 0xB098, 0xB2E4, 0xB77C, 0xB9C8, 0xBC14, 0xC0AC, 0xC544, 0xC7
90, | 764 0xAC00, 0xB098, 0xB2E4, 0xB77C, 0xB9C8, 0xBC14, 0xC0AC, 0xC544, 0xC7
90, |
| 912 0xCC28, 0xCE74, 0xD0C0, 0xD30C, 0xD558 | 765 0xCC28, 0xCE74, 0xD0C0, 0xD30C, 0xD558 |
| 913 }; | 766 }; |
| 914 return toAlphabetic(value, hangulAlphabet); | 767 return toAlphabetic(value, hangulAlphabet); |
| 915 } | 768 } |
| 916 case Oromo: | 769 case EthiopicHalehame: { |
| 917 case EthiopicHalehameOmEt: { | 770 static const UChar ethiopicHalehameGezAlphabet[26] = { |
| 918 static const UChar ethiopicHalehameOmEtAlphabet[25] = { | 771 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1240, 0x12
60, |
| 919 0x1200, 0x1208, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x1260, 0x12
70, | 772 0x1270, 0x1280, 0x1290, 0x12A0, 0x12A8, 0x12C8, 0x12D0, 0x12D8, 0x12
E8, |
| 920 0x1278, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12C8, 0x12E8, 0x12F0, 0x12
F8, | 773 0x12F0, 0x1308, 0x1320, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 |
| 921 0x1300, 0x1308, 0x1320, 0x1328, 0x1338, 0x1330, 0x1348 | |
| 922 }; | 774 }; |
| 923 return toAlphabetic(value, ethiopicHalehameOmEtAlphabet); | 775 return toAlphabetic(value, ethiopicHalehameGezAlphabet); |
| 924 } | 776 } |
| 925 case Sidama: | 777 case EthiopicHalehameAm: { |
| 926 case EthiopicHalehameSidEt: { | 778 static const UChar ethiopicHalehameAmAlphabet[33] = { |
| 927 static const UChar ethiopicHalehameSidEtAlphabet[26] = { | 779 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x12
40, |
| 928 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x12
60, | 780 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12
B8, |
| 929 0x1270, 0x1278, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12C8, 0x12E8, 0x12
F0, | 781 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x1308, 0x13
20, |
| 930 0x12F8, 0x1300, 0x1308, 0x1320, 0x1328, 0x1338, 0x1330, 0x1348 | 782 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 |
| 931 }; | 783 }; |
| 932 return toAlphabetic(value, ethiopicHalehameSidEtAlphabet); | 784 return toAlphabetic(value, ethiopicHalehameAmAlphabet); |
| 933 } | 785 } |
| 934 case Somali: | |
| 935 case EthiopicHalehameSoEt: { | |
| 936 static const UChar ethiopicHalehameSoEtAlphabet[22] = { | |
| 937 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x12
60, | |
| 938 0x1270, 0x1290, 0x12A0, 0x12A8, 0x12B8, 0x12C8, 0x12D0, 0x12E8, 0x12
F0, | |
| 939 0x1300, 0x1308, 0x1338, 0x1348 | |
| 940 }; | |
| 941 return toAlphabetic(value, ethiopicHalehameSoEtAlphabet); | |
| 942 } | |
| 943 case Tigre: | |
| 944 case EthiopicHalehameTig: { | |
| 945 static const UChar ethiopicHalehameTigAlphabet[27] = { | |
| 946 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x12
60, | |
| 947 0x1270, 0x1278, 0x1290, 0x12A0, 0x12A8, 0x12C8, 0x12D0, 0x12D8, 0x12
E8, | |
| 948 0x12F0, 0x1300, 0x1308, 0x1320, 0x1328, 0x1338, 0x1330, 0x1348, 0x13
50 | |
| 949 }; | |
| 950 return toAlphabetic(value, ethiopicHalehameTigAlphabet); | |
| 951 } | |
| 952 case TigrinyaEr: | |
| 953 case EthiopicHalehameTiEr: { | 786 case EthiopicHalehameTiEr: { |
| 954 static const UChar ethiopicHalehameTiErAlphabet[31] = { | 787 static const UChar ethiopicHalehameTiErAlphabet[31] = { |
| 955 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x12
50, | 788 0x1200, 0x1208, 0x1210, 0x1218, 0x1228, 0x1230, 0x1238, 0x1240, 0x12
50, |
| 956 0x1260, 0x1270, 0x1278, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12B8, 0x12
C8, | 789 0x1260, 0x1270, 0x1278, 0x1290, 0x1298, 0x12A0, 0x12A8, 0x12B8, 0x12
C8, |
| 957 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x1308, 0x1320, 0x13
28, | 790 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x1308, 0x1320, 0x13
28, |
| 958 0x1330, 0x1338, 0x1348, 0x1350 | 791 0x1330, 0x1338, 0x1348, 0x1350 |
| 959 }; | 792 }; |
| 960 return toAlphabetic(value, ethiopicHalehameTiErAlphabet); | 793 return toAlphabetic(value, ethiopicHalehameTiErAlphabet); |
| 961 } | 794 } |
| 962 case TigrinyaErAbegede: | |
| 963 case EthiopicAbegedeTiEr: { | |
| 964 static const UChar ethiopicAbegedeTiErAlphabet[31] = { | |
| 965 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1300, 0x1200, 0x12C8, 0x12D8, 0x12
E0, | |
| 966 0x1210, 0x1320, 0x1328, 0x12E8, 0x12A8, 0x12B8, 0x1208, 0x1218, 0x12
90, | |
| 967 0x1298, 0x12D0, 0x1348, 0x1338, 0x1240, 0x1250, 0x1228, 0x1230, 0x12
38, | |
| 968 0x1270, 0x1278, 0x1330, 0x1350 | |
| 969 }; | |
| 970 return toAlphabetic(value, ethiopicAbegedeTiErAlphabet); | |
| 971 } | |
| 972 case TigrinyaEt: | |
| 973 case EthiopicHalehameTiEt: { | 795 case EthiopicHalehameTiEt: { |
| 974 static const UChar ethiopicHalehameTiEtAlphabet[34] = { | 796 static const UChar ethiopicHalehameTiEtAlphabet[34] = { |
| 975 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x12
40, | 797 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x12
40, |
| 976 0x1250, 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12
A8, | 798 0x1250, 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12
A8, |
| 977 0x12B8, 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x13
08, | 799 0x12B8, 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x13
08, |
| 978 0x1320, 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 | 800 0x1320, 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 |
| 979 }; | 801 }; |
| 980 return toAlphabetic(value, ethiopicHalehameTiEtAlphabet); | 802 return toAlphabetic(value, ethiopicHalehameTiEtAlphabet); |
| 981 } | 803 } |
| 982 case TigrinyaEtAbegede: | |
| 983 case EthiopicAbegedeTiEt: { | |
| 984 static const UChar ethiopicAbegedeTiEtAlphabet[34] = { | |
| 985 0x12A0, 0x1260, 0x1308, 0x12F0, 0x1300, 0x1200, 0x12C8, 0x12D8, 0x12
E0, | |
| 986 0x1210, 0x1320, 0x1328, 0x12E8, 0x12A8, 0x12B8, 0x1208, 0x1218, 0x12
90, | |
| 987 0x1298, 0x1220, 0x12D0, 0x1348, 0x1338, 0x1240, 0x1250, 0x1228, 0x12
30, | |
| 988 0x1238, 0x1270, 0x1278, 0x1280, 0x1340, 0x1330, 0x1350 | |
| 989 }; | |
| 990 return toAlphabetic(value, ethiopicAbegedeTiEtAlphabet); | |
| 991 } | |
| 992 case UpperGreek: { | |
| 993 static const UChar upperGreekAlphabet[24] = { | |
| 994 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x03
99, | |
| 995 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1, 0x03
A3, | |
| 996 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9 | |
| 997 }; | |
| 998 return toAlphabetic(value, upperGreekAlphabet); | |
| 999 } | |
| 1000 case LowerNorwegian: { | |
| 1001 static const LChar lowerNorwegianAlphabet[29] = { | |
| 1002 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, | |
| 1003 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, | |
| 1004 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0xE6, | |
| 1005 0xF8, 0xE5 | |
| 1006 }; | |
| 1007 return toAlphabetic(value, lowerNorwegianAlphabet); | |
| 1008 } | |
| 1009 case UpperNorwegian: { | |
| 1010 static const LChar upperNorwegianAlphabet[29] = { | |
| 1011 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, | |
| 1012 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, | |
| 1013 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0xC6, | |
| 1014 0xD8, 0xC5 | |
| 1015 }; | |
| 1016 return toAlphabetic(value, upperNorwegianAlphabet); | |
| 1017 } | |
| 1018 case CJKIdeographic: { | 804 case CJKIdeographic: { |
| 1019 static const UChar traditionalChineseInformalTable[16] = { | 805 static const UChar traditionalChineseInformalTable[16] = { |
| 1020 0x842C, 0x5104, 0x5146, | 806 0x842C, 0x5104, 0x5146, |
| 1021 0x5341, 0x767E, 0x5343, | 807 0x5341, 0x767E, 0x5343, |
| 1022 0x96F6, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, | 808 0x96F6, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, |
| 1023 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D | 809 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D |
| 1024 }; | 810 }; |
| 1025 return toCJKIdeographic(value, traditionalChineseInformalTable); | 811 return toCJKIdeographic(value, traditionalChineseInformalTable); |
| 1026 } | 812 } |
| 1027 | 813 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 | 978 |
| 1193 EListStyleType type = style()->listStyleType(); | 979 EListStyleType type = style()->listStyleType(); |
| 1194 switch (type) { | 980 switch (type) { |
| 1195 case NoneListStyle: | 981 case NoneListStyle: |
| 1196 break; | 982 break; |
| 1197 case Circle: | 983 case Circle: |
| 1198 case Disc: | 984 case Disc: |
| 1199 case Square: | 985 case Square: |
| 1200 m_text = listMarkerText(type, 0); // value is ignored for these types | 986 m_text = listMarkerText(type, 0); // value is ignored for these types |
| 1201 break; | 987 break; |
| 1202 case Asterisks: | |
| 1203 case Footnotes: | |
| 1204 case Afar: | |
| 1205 case Amharic: | |
| 1206 case AmharicAbegede: | |
| 1207 case ArabicIndic: | 988 case ArabicIndic: |
| 1208 case Armenian: | 989 case Armenian: |
| 1209 case BinaryListStyle: | |
| 1210 case Bengali: | 990 case Bengali: |
| 1211 case Cambodian: | 991 case Cambodian: |
| 1212 case CJKIdeographic: | 992 case CJKIdeographic: |
| 1213 case CjkEarthlyBranch: | 993 case CjkEarthlyBranch: |
| 1214 case CjkHeavenlyStem: | 994 case CjkHeavenlyStem: |
| 1215 case DecimalLeadingZero: | 995 case DecimalLeadingZero: |
| 1216 case DecimalListStyle: | 996 case DecimalListStyle: |
| 1217 case Devanagari: | 997 case Devanagari: |
| 1218 case Ethiopic: | 998 case EthiopicHalehame: |
| 1219 case EthiopicAbegede: | 999 case EthiopicHalehameAm: |
| 1220 case EthiopicAbegedeAmEt: | |
| 1221 case EthiopicAbegedeGez: | |
| 1222 case EthiopicAbegedeTiEr: | |
| 1223 case EthiopicAbegedeTiEt: | |
| 1224 case EthiopicHalehameAaEr: | |
| 1225 case EthiopicHalehameAaEt: | |
| 1226 case EthiopicHalehameAmEt: | |
| 1227 case EthiopicHalehameGez: | |
| 1228 case EthiopicHalehameOmEt: | |
| 1229 case EthiopicHalehameSidEt: | |
| 1230 case EthiopicHalehameSoEt: | |
| 1231 case EthiopicHalehameTiEr: | 1000 case EthiopicHalehameTiEr: |
| 1232 case EthiopicHalehameTiEt: | 1001 case EthiopicHalehameTiEt: |
| 1233 case EthiopicHalehameTig: | |
| 1234 case Georgian: | 1002 case Georgian: |
| 1235 case Gujarati: | 1003 case Gujarati: |
| 1236 case Gurmukhi: | 1004 case Gurmukhi: |
| 1237 case Hangul: | 1005 case Hangul: |
| 1238 case HangulConsonant: | 1006 case HangulConsonant: |
| 1239 case Hebrew: | 1007 case Hebrew: |
| 1240 case Hiragana: | 1008 case Hiragana: |
| 1241 case HiraganaIroha: | 1009 case HiraganaIroha: |
| 1242 case Kannada: | 1010 case Kannada: |
| 1243 case Katakana: | 1011 case Katakana: |
| 1244 case KatakanaIroha: | 1012 case KatakanaIroha: |
| 1245 case Khmer: | 1013 case Khmer: |
| 1246 case Lao: | 1014 case Lao: |
| 1247 case LowerAlpha: | 1015 case LowerAlpha: |
| 1248 case LowerArmenian: | 1016 case LowerArmenian: |
| 1249 case LowerGreek: | 1017 case LowerGreek: |
| 1250 case LowerHexadecimal: | |
| 1251 case LowerLatin: | 1018 case LowerLatin: |
| 1252 case LowerNorwegian: | |
| 1253 case LowerRoman: | 1019 case LowerRoman: |
| 1254 case Malayalam: | 1020 case Malayalam: |
| 1255 case Mongolian: | 1021 case Mongolian: |
| 1256 case Myanmar: | 1022 case Myanmar: |
| 1257 case Octal: | |
| 1258 case Oriya: | 1023 case Oriya: |
| 1259 case Oromo: | |
| 1260 case Persian: | 1024 case Persian: |
| 1261 case Sidama: | |
| 1262 case Somali: | |
| 1263 case Telugu: | 1025 case Telugu: |
| 1264 case Thai: | 1026 case Thai: |
| 1265 case Tibetan: | 1027 case Tibetan: |
| 1266 case Tigre: | |
| 1267 case TigrinyaEr: | |
| 1268 case TigrinyaErAbegede: | |
| 1269 case TigrinyaEt: | |
| 1270 case TigrinyaEtAbegede: | |
| 1271 case UpperAlpha: | 1028 case UpperAlpha: |
| 1272 case UpperArmenian: | 1029 case UpperArmenian: |
| 1273 case UpperGreek: | |
| 1274 case UpperHexadecimal: | |
| 1275 case UpperLatin: | 1030 case UpperLatin: |
| 1276 case UpperNorwegian: | |
| 1277 case UpperRoman: | 1031 case UpperRoman: |
| 1278 case Urdu: | 1032 case Urdu: |
| 1279 m_text = listMarkerText(type, m_listItem->value()); | 1033 m_text = listMarkerText(type, m_listItem->value()); |
| 1280 break; | 1034 break; |
| 1281 } | 1035 } |
| 1282 } | 1036 } |
| 1283 | 1037 |
| 1284 void LayoutListMarker::computePreferredLogicalWidths() | 1038 void LayoutListMarker::computePreferredLogicalWidths() |
| 1285 { | 1039 { |
| 1286 ASSERT(preferredLogicalWidthsDirty()); | 1040 ASSERT(preferredLogicalWidthsDirty()); |
| 1287 updateContent(); | 1041 updateContent(); |
| 1288 | 1042 |
| 1289 if (isImage()) { | 1043 if (isImage()) { |
| 1290 LayoutSize imageSize = m_image->imageSize(this, style()->effectiveZoom()
); | 1044 LayoutSize imageSize = m_image->imageSize(this, style()->effectiveZoom()
); |
| 1291 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = style()->isHor
izontalWritingMode() ? imageSize.width() : imageSize.height(); | 1045 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = style()->isHor
izontalWritingMode() ? imageSize.width() : imageSize.height(); |
| 1292 clearPreferredLogicalWidthsDirty(); | 1046 clearPreferredLogicalWidthsDirty(); |
| 1293 updateMargins(); | 1047 updateMargins(); |
| 1294 return; | 1048 return; |
| 1295 } | 1049 } |
| 1296 | 1050 |
| 1297 const Font& font = style()->font(); | 1051 const Font& font = style()->font(); |
| 1298 | 1052 |
| 1299 LayoutUnit logicalWidth = 0; | 1053 LayoutUnit logicalWidth = 0; |
| 1300 EListStyleType type = style()->listStyleType(); | 1054 EListStyleType type = style()->listStyleType(); |
| 1301 switch (type) { | 1055 switch (type) { |
| 1302 case NoneListStyle: | 1056 case NoneListStyle: |
| 1303 break; | 1057 break; |
| 1304 case Asterisks: | |
| 1305 case Footnotes: | |
| 1306 logicalWidth = font.width(m_text); // no suffix for these types | |
| 1307 break; | |
| 1308 case Circle: | 1058 case Circle: |
| 1309 case Disc: | 1059 case Disc: |
| 1310 case Square: | 1060 case Square: |
| 1311 logicalWidth = (font.fontMetrics().ascent() * 2 / 3 + 1) / 2 + 2; | 1061 logicalWidth = (font.fontMetrics().ascent() * 2 / 3 + 1) / 2 + 2; |
| 1312 break; | 1062 break; |
| 1313 case Afar: | |
| 1314 case Amharic: | |
| 1315 case AmharicAbegede: | |
| 1316 case ArabicIndic: | 1063 case ArabicIndic: |
| 1317 case Armenian: | 1064 case Armenian: |
| 1318 case BinaryListStyle: | |
| 1319 case Bengali: | 1065 case Bengali: |
| 1320 case Cambodian: | 1066 case Cambodian: |
| 1321 case CJKIdeographic: | 1067 case CJKIdeographic: |
| 1322 case CjkEarthlyBranch: | 1068 case CjkEarthlyBranch: |
| 1323 case CjkHeavenlyStem: | 1069 case CjkHeavenlyStem: |
| 1324 case DecimalLeadingZero: | 1070 case DecimalLeadingZero: |
| 1325 case DecimalListStyle: | 1071 case DecimalListStyle: |
| 1326 case Devanagari: | 1072 case Devanagari: |
| 1327 case Ethiopic: | 1073 case EthiopicHalehame: |
| 1328 case EthiopicAbegede: | 1074 case EthiopicHalehameAm: |
| 1329 case EthiopicAbegedeAmEt: | |
| 1330 case EthiopicAbegedeGez: | |
| 1331 case EthiopicAbegedeTiEr: | |
| 1332 case EthiopicAbegedeTiEt: | |
| 1333 case EthiopicHalehameAaEr: | |
| 1334 case EthiopicHalehameAaEt: | |
| 1335 case EthiopicHalehameAmEt: | |
| 1336 case EthiopicHalehameGez: | |
| 1337 case EthiopicHalehameOmEt: | |
| 1338 case EthiopicHalehameSidEt: | |
| 1339 case EthiopicHalehameSoEt: | |
| 1340 case EthiopicHalehameTiEr: | 1075 case EthiopicHalehameTiEr: |
| 1341 case EthiopicHalehameTiEt: | 1076 case EthiopicHalehameTiEt: |
| 1342 case EthiopicHalehameTig: | |
| 1343 case Georgian: | 1077 case Georgian: |
| 1344 case Gujarati: | 1078 case Gujarati: |
| 1345 case Gurmukhi: | 1079 case Gurmukhi: |
| 1346 case Hangul: | 1080 case Hangul: |
| 1347 case HangulConsonant: | 1081 case HangulConsonant: |
| 1348 case Hebrew: | 1082 case Hebrew: |
| 1349 case Hiragana: | 1083 case Hiragana: |
| 1350 case HiraganaIroha: | 1084 case HiraganaIroha: |
| 1351 case Kannada: | 1085 case Kannada: |
| 1352 case Katakana: | 1086 case Katakana: |
| 1353 case KatakanaIroha: | 1087 case KatakanaIroha: |
| 1354 case Khmer: | 1088 case Khmer: |
| 1355 case Lao: | 1089 case Lao: |
| 1356 case LowerAlpha: | 1090 case LowerAlpha: |
| 1357 case LowerArmenian: | 1091 case LowerArmenian: |
| 1358 case LowerGreek: | 1092 case LowerGreek: |
| 1359 case LowerHexadecimal: | |
| 1360 case LowerLatin: | 1093 case LowerLatin: |
| 1361 case LowerNorwegian: | |
| 1362 case LowerRoman: | 1094 case LowerRoman: |
| 1363 case Malayalam: | 1095 case Malayalam: |
| 1364 case Mongolian: | 1096 case Mongolian: |
| 1365 case Myanmar: | 1097 case Myanmar: |
| 1366 case Octal: | |
| 1367 case Oriya: | 1098 case Oriya: |
| 1368 case Oromo: | |
| 1369 case Persian: | 1099 case Persian: |
| 1370 case Sidama: | |
| 1371 case Somali: | |
| 1372 case Telugu: | 1100 case Telugu: |
| 1373 case Thai: | 1101 case Thai: |
| 1374 case Tibetan: | 1102 case Tibetan: |
| 1375 case Tigre: | |
| 1376 case TigrinyaEr: | |
| 1377 case TigrinyaErAbegede: | |
| 1378 case TigrinyaEt: | |
| 1379 case TigrinyaEtAbegede: | |
| 1380 case UpperAlpha: | 1103 case UpperAlpha: |
| 1381 case UpperArmenian: | 1104 case UpperArmenian: |
| 1382 case UpperGreek: | |
| 1383 case UpperHexadecimal: | |
| 1384 case UpperLatin: | 1105 case UpperLatin: |
| 1385 case UpperNorwegian: | |
| 1386 case UpperRoman: | 1106 case UpperRoman: |
| 1387 case Urdu: | 1107 case Urdu: |
| 1388 if (m_text.isEmpty()) { | 1108 if (m_text.isEmpty()) { |
| 1389 logicalWidth = 0; | 1109 logicalWidth = 0; |
| 1390 } else { | 1110 } else { |
| 1391 LayoutUnit itemWidth = font.width(m_text); | 1111 LayoutUnit itemWidth = font.width(m_text); |
| 1392 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value())
, ' ' }; | 1112 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value())
, ' ' }; |
| 1393 LayoutUnit suffixSpaceWidth = font.width(constructTextRun(this, font
, suffixSpace, 2, styleRef(), style()->direction())); | 1113 LayoutUnit suffixSpaceWidth = font.width(constructTextRun(this, font
, suffixSpace, 2, styleRef(), style()->direction())); |
| 1394 logicalWidth = itemWidth + suffixSpaceWidth; | 1114 logicalWidth = itemWidth + suffixSpaceWidth; |
| 1395 } | 1115 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1492 } | 1212 } |
| 1493 | 1213 |
| 1494 IntRect LayoutListMarker::getRelativeMarkerRect() | 1214 IntRect LayoutListMarker::getRelativeMarkerRect() |
| 1495 { | 1215 { |
| 1496 if (isImage()) | 1216 if (isImage()) |
| 1497 return IntRect(0, 0, m_image->imageSize(this, style()->effectiveZoom()).
width(), m_image->imageSize(this, style()->effectiveZoom()).height()); | 1217 return IntRect(0, 0, m_image->imageSize(this, style()->effectiveZoom()).
width(), m_image->imageSize(this, style()->effectiveZoom()).height()); |
| 1498 | 1218 |
| 1499 IntRect relativeRect; | 1219 IntRect relativeRect; |
| 1500 EListStyleType type = style()->listStyleType(); | 1220 EListStyleType type = style()->listStyleType(); |
| 1501 switch (type) { | 1221 switch (type) { |
| 1502 case Asterisks: | |
| 1503 case Footnotes: { | |
| 1504 const Font& font = style()->font(); | |
| 1505 relativeRect = IntRect(0, 0, font.width(m_text), font.fontMetrics().heig
ht()); | |
| 1506 break; | |
| 1507 } | |
| 1508 case Disc: | 1222 case Disc: |
| 1509 case Circle: | 1223 case Circle: |
| 1510 case Square: { | 1224 case Square: { |
| 1511 // FIXME: Are these particular rounding rules necessary? | 1225 // FIXME: Are these particular rounding rules necessary? |
| 1512 const FontMetrics& fontMetrics = style()->fontMetrics(); | 1226 const FontMetrics& fontMetrics = style()->fontMetrics(); |
| 1513 int ascent = fontMetrics.ascent(); | 1227 int ascent = fontMetrics.ascent(); |
| 1514 int bulletWidth = (ascent * 2 / 3 + 1) / 2; | 1228 int bulletWidth = (ascent * 2 / 3 + 1) / 2; |
| 1515 relativeRect = IntRect(1, 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth
, bulletWidth); | 1229 relativeRect = IntRect(1, 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth
, bulletWidth); |
| 1516 break; | 1230 break; |
| 1517 } | 1231 } |
| 1518 case NoneListStyle: | 1232 case NoneListStyle: |
| 1519 return IntRect(); | 1233 return IntRect(); |
| 1520 case Afar: | |
| 1521 case Amharic: | |
| 1522 case AmharicAbegede: | |
| 1523 case ArabicIndic: | 1234 case ArabicIndic: |
| 1524 case Armenian: | 1235 case Armenian: |
| 1525 case BinaryListStyle: | |
| 1526 case Bengali: | 1236 case Bengali: |
| 1527 case Cambodian: | 1237 case Cambodian: |
| 1528 case CJKIdeographic: | 1238 case CJKIdeographic: |
| 1529 case CjkEarthlyBranch: | 1239 case CjkEarthlyBranch: |
| 1530 case CjkHeavenlyStem: | 1240 case CjkHeavenlyStem: |
| 1531 case DecimalLeadingZero: | 1241 case DecimalLeadingZero: |
| 1532 case DecimalListStyle: | 1242 case DecimalListStyle: |
| 1533 case Devanagari: | 1243 case Devanagari: |
| 1534 case Ethiopic: | 1244 case EthiopicHalehame: |
| 1535 case EthiopicAbegede: | 1245 case EthiopicHalehameAm: |
| 1536 case EthiopicAbegedeAmEt: | |
| 1537 case EthiopicAbegedeGez: | |
| 1538 case EthiopicAbegedeTiEr: | |
| 1539 case EthiopicAbegedeTiEt: | |
| 1540 case EthiopicHalehameAaEr: | |
| 1541 case EthiopicHalehameAaEt: | |
| 1542 case EthiopicHalehameAmEt: | |
| 1543 case EthiopicHalehameGez: | |
| 1544 case EthiopicHalehameOmEt: | |
| 1545 case EthiopicHalehameSidEt: | |
| 1546 case EthiopicHalehameSoEt: | |
| 1547 case EthiopicHalehameTiEr: | 1246 case EthiopicHalehameTiEr: |
| 1548 case EthiopicHalehameTiEt: | 1247 case EthiopicHalehameTiEt: |
| 1549 case EthiopicHalehameTig: | |
| 1550 case Georgian: | 1248 case Georgian: |
| 1551 case Gujarati: | 1249 case Gujarati: |
| 1552 case Gurmukhi: | 1250 case Gurmukhi: |
| 1553 case Hangul: | 1251 case Hangul: |
| 1554 case HangulConsonant: | 1252 case HangulConsonant: |
| 1555 case Hebrew: | 1253 case Hebrew: |
| 1556 case Hiragana: | 1254 case Hiragana: |
| 1557 case HiraganaIroha: | 1255 case HiraganaIroha: |
| 1558 case Kannada: | 1256 case Kannada: |
| 1559 case Katakana: | 1257 case Katakana: |
| 1560 case KatakanaIroha: | 1258 case KatakanaIroha: |
| 1561 case Khmer: | 1259 case Khmer: |
| 1562 case Lao: | 1260 case Lao: |
| 1563 case LowerAlpha: | 1261 case LowerAlpha: |
| 1564 case LowerArmenian: | 1262 case LowerArmenian: |
| 1565 case LowerGreek: | 1263 case LowerGreek: |
| 1566 case LowerHexadecimal: | |
| 1567 case LowerLatin: | 1264 case LowerLatin: |
| 1568 case LowerNorwegian: | |
| 1569 case LowerRoman: | 1265 case LowerRoman: |
| 1570 case Malayalam: | 1266 case Malayalam: |
| 1571 case Mongolian: | 1267 case Mongolian: |
| 1572 case Myanmar: | 1268 case Myanmar: |
| 1573 case Octal: | |
| 1574 case Oriya: | 1269 case Oriya: |
| 1575 case Oromo: | |
| 1576 case Persian: | 1270 case Persian: |
| 1577 case Sidama: | |
| 1578 case Somali: | |
| 1579 case Telugu: | 1271 case Telugu: |
| 1580 case Thai: | 1272 case Thai: |
| 1581 case Tibetan: | 1273 case Tibetan: |
| 1582 case Tigre: | |
| 1583 case TigrinyaEr: | |
| 1584 case TigrinyaErAbegede: | |
| 1585 case TigrinyaEt: | |
| 1586 case TigrinyaEtAbegede: | |
| 1587 case UpperAlpha: | 1274 case UpperAlpha: |
| 1588 case UpperArmenian: | 1275 case UpperArmenian: |
| 1589 case UpperGreek: | |
| 1590 case UpperHexadecimal: | |
| 1591 case UpperLatin: | 1276 case UpperLatin: |
| 1592 case UpperNorwegian: | |
| 1593 case UpperRoman: | 1277 case UpperRoman: |
| 1594 case Urdu: | 1278 case Urdu: |
| 1595 if (m_text.isEmpty()) | 1279 if (m_text.isEmpty()) |
| 1596 return IntRect(); | 1280 return IntRect(); |
| 1597 const Font& font = style()->font(); | 1281 const Font& font = style()->font(); |
| 1598 int itemWidth = font.width(m_text); | 1282 int itemWidth = font.width(m_text); |
| 1599 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), '
' }; | 1283 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), '
' }; |
| 1600 int suffixSpaceWidth = font.width(constructTextRun(this, font, suffixSpa
ce, 2, styleRef(), style()->direction())); | 1284 int suffixSpaceWidth = font.width(constructTextRun(this, font, suffixSpa
ce, 2, styleRef(), style()->direction())); |
| 1601 relativeRect = IntRect(0, 0, itemWidth + suffixSpaceWidth, font.fontMetr
ics().height()); | 1285 relativeRect = IntRect(0, 0, itemWidth + suffixSpaceWidth, font.fontMetr
ics().height()); |
| 1602 } | 1286 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1643 if (style()) { | 1327 if (style()) { |
| 1644 // Reuse the current margins. Otherwise resetting the margins to initial
values | 1328 // Reuse the current margins. Otherwise resetting the margins to initial
values |
| 1645 // would trigger unnecessary layout. | 1329 // would trigger unnecessary layout. |
| 1646 newStyle->setMarginStart(style()->marginStart()); | 1330 newStyle->setMarginStart(style()->marginStart()); |
| 1647 newStyle->setMarginEnd(style()->marginRight()); | 1331 newStyle->setMarginEnd(style()->marginRight()); |
| 1648 } | 1332 } |
| 1649 setStyle(newStyle.release()); | 1333 setStyle(newStyle.release()); |
| 1650 } | 1334 } |
| 1651 | 1335 |
| 1652 } // namespace blink | 1336 } // namespace blink |
| OLD | NEW |