Changeset 94947 in webkit


Ignore:
Timestamp:
Sep 12, 2011 12:14:38 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Characters beyond U+10000 should be deleted by one pressing delete key.
https://bugs.webkit.org/show_bug.cgi?id=40351

Patch by Shinya Kawanaka <shinyak@google.com> on 2011-09-12
Reviewed by Kent Tamura.

Source/WebCore:

If a character is the trail part of unicode surrogate pair, the lead part of it
should also be deleted. Also, If in MacOSX, the deletion should honor Mac's behavior.

Test: editing/deleting/delete-surrogatepair.html

  • rendering/RenderText.cpp:

(WebCore::RenderText::previousOffsetForBackwardDeletion):

Added if-macro to support chromium on mac, and added trail part check for unicode character.

LayoutTests:

Added deletion tests.

  • editing/deleting/delete-surrogatepair-expected.txt: Added.
  • editing/deleting/delete-surrogatepair.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    • Property svn:executable deleted
    r94946 r94947  
     12011-09-12  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Characters beyond U+10000 should be deleted by one pressing delete key.
     4        https://bugs.webkit.org/show_bug.cgi?id=40351
     5
     6        Reviewed by Kent Tamura.
     7
     8        Added deletion tests.
     9
     10        * editing/deleting/delete-surrogatepair-expected.txt: Added.
     11        * editing/deleting/delete-surrogatepair.html: Added.
     12
    1132011-09-11  Kentaro Hara  <haraken@google.com>
    214
  • trunk/Source/WebCore/ChangeLog

    • Property svn:executable deleted
    r94946 r94947  
     12011-09-12  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Characters beyond U+10000 should be deleted by one pressing delete key.
     4        https://bugs.webkit.org/show_bug.cgi?id=40351
     5
     6        Reviewed by Kent Tamura.
     7
     8        If a character is the trail part of unicode surrogate pair, the lead part of it
     9        should also be deleted. Also, If in MacOSX, the deletion should honor Mac's behavior.
     10
     11        Test: editing/deleting/delete-surrogatepair.html
     12
     13        * rendering/RenderText.cpp:
     14        (WebCore::RenderText::previousOffsetForBackwardDeletion):
     15          Added if-macro to support chromium on mac, and added trail part check for unicode character.
     16
    1172011-09-11  Kentaro Hara  <haraken@google.com>
    218
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r93909 r94947  
    16271627}
    16281628
    1629 #if PLATFORM(MAC)
     1629#if PLATFORM(MAC) || PLATFORM(CHROMIUM) && OS(MAC_OS_X)
    16301630
    16311631#define HANGUL_CHOSEONG_START (0x1100)
     
    16691669int RenderText::previousOffsetForBackwardDeletion(int current) const
    16701670{
    1671 #if PLATFORM(MAC)
     1671#if PLATFORM(MAC) || PLATFORM(CHROMIUM) && OS(MAC_OS_X)
    16721672    ASSERT(m_text);
    16731673    StringImpl& text = *m_text.impl();
     
    17571757#else
    17581758    // Platforms other than Mac delete by one code point.
    1759     return current - 1;
     1759    if (U16_IS_TRAIL(m_text[--current]))
     1760        --current;
     1761    if (current < 0)
     1762        current = 0;
     1763    return current;
    17601764#endif
    17611765}
Note: See TracChangeset for help on using the changeset viewer.