OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.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 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 return current - 1; | 1646 return current - 1; |
1647 | 1647 |
1648 long result = iterator->preceding(current); | 1648 long result = iterator->preceding(current); |
1649 if (result == TextBreakDone) | 1649 if (result == TextBreakDone) |
1650 result = current - 1; | 1650 result = current - 1; |
1651 | 1651 |
1652 | 1652 |
1653 return result; | 1653 return result; |
1654 } | 1654 } |
1655 | 1655 |
1656 #if OS(MACOSX) || OS(POSIX) | 1656 #if OS(POSIX) |
1657 | 1657 |
1658 #define HANGUL_CHOSEONG_START (0x1100) | 1658 #define HANGUL_CHOSEONG_START (0x1100) |
1659 #define HANGUL_CHOSEONG_END (0x115F) | 1659 #define HANGUL_CHOSEONG_END (0x115F) |
1660 #define HANGUL_JUNGSEONG_START (0x1160) | 1660 #define HANGUL_JUNGSEONG_START (0x1160) |
1661 #define HANGUL_JUNGSEONG_END (0x11A2) | 1661 #define HANGUL_JUNGSEONG_END (0x11A2) |
1662 #define HANGUL_JONGSEONG_START (0x11A8) | 1662 #define HANGUL_JONGSEONG_START (0x11A8) |
1663 #define HANGUL_JONGSEONG_END (0x11F9) | 1663 #define HANGUL_JONGSEONG_END (0x11F9) |
1664 #define HANGUL_SYLLABLE_START (0xAC00) | 1664 #define HANGUL_SYLLABLE_START (0xAC00) |
1665 #define HANGUL_SYLLABLE_END (0xD7AF) | 1665 #define HANGUL_SYLLABLE_END (0xD7AF) |
1666 #define HANGUL_JONGSEONG_COUNT (28) | 1666 #define HANGUL_JONGSEONG_COUNT (28) |
(...skipping 21 matching lines...) Expand all Loading... |
1688 inline bool isRegionalIndicator(UChar32 c) | 1688 inline bool isRegionalIndicator(UChar32 c) |
1689 { | 1689 { |
1690 // National flag emoji each consists of a pair of regional indicator symbols
. | 1690 // National flag emoji each consists of a pair of regional indicator symbols
. |
1691 return 0x1F1E6 <= c && c <= 0x1F1FF; | 1691 return 0x1F1E6 <= c && c <= 0x1F1FF; |
1692 } | 1692 } |
1693 | 1693 |
1694 #endif | 1694 #endif |
1695 | 1695 |
1696 int RenderText::previousOffsetForBackwardDeletion(int current) const | 1696 int RenderText::previousOffsetForBackwardDeletion(int current) const |
1697 { | 1697 { |
1698 #if OS(MACOSX) || OS(POSIX) | 1698 #if OS(POSIX) |
1699 ASSERT(m_text); | 1699 ASSERT(m_text); |
1700 StringImpl& text = *m_text.impl(); | 1700 StringImpl& text = *m_text.impl(); |
1701 UChar32 character; | 1701 UChar32 character; |
1702 bool sawRegionalIndicator = false; | 1702 bool sawRegionalIndicator = false; |
1703 while (current > 0) { | 1703 while (current > 0) { |
1704 if (U16_IS_TRAIL(text[--current])) | 1704 if (U16_IS_TRAIL(text[--current])) |
1705 --current; | 1705 --current; |
1706 if (current < 0) | 1706 if (current < 0) |
1707 break; | 1707 break; |
1708 | 1708 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 } | 1772 } |
1773 if (state == HangulStateBreak) | 1773 if (state == HangulStateBreak) |
1774 break; | 1774 break; |
1775 | 1775 |
1776 --current; | 1776 --current; |
1777 } | 1777 } |
1778 } | 1778 } |
1779 | 1779 |
1780 return current; | 1780 return current; |
1781 #else | 1781 #else |
1782 // Platforms other than Mac or Unix delete by one code point. | 1782 // Platforms other than Unix-like delete by one code point. |
1783 if (U16_IS_TRAIL(m_text[--current])) | 1783 if (U16_IS_TRAIL(m_text[--current])) |
1784 --current; | 1784 --current; |
1785 if (current < 0) | 1785 if (current < 0) |
1786 current = 0; | 1786 current = 0; |
1787 return current; | 1787 return current; |
1788 #endif | 1788 #endif |
1789 } | 1789 } |
1790 | 1790 |
1791 int RenderText::nextOffset(int current) const | 1791 int RenderText::nextOffset(int current) const |
1792 { | 1792 { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 } | 1841 } |
1842 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); | 1842 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); |
1843 } | 1843 } |
1844 | 1844 |
1845 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox() | 1845 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox() |
1846 { | 1846 { |
1847 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox); | 1847 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox); |
1848 } | 1848 } |
1849 | 1849 |
1850 } // namespace WebCore | 1850 } // namespace WebCore |
OLD | NEW |