Changeset 41588 in webkit


Ignore:
Timestamp:
Mar 11, 2009 9:05:04 AM (15 years ago)
Author:
ap@webkit.org
Message:

2009-03-11 Hironori Bono <hbono@chromium.org>

Reviewed by Alexey Proskuryakov.

https://bugs.webkit.org/show_bug.cgi?id=15790
Ligatures aren't accounted for when manipulating VisiblePositions

Changed cursorMovementIterator rules to prevent a cursor from moving in the middle of an
Indic ligature which uses a virama sign.


Test: editing/deleting/skip-virama-001.html

  • platform/text/TextBreakIteratorICU.cpp: (WebCore::cursorMovementIterator):
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r41583 r41588  
     12009-03-11  Hironori Bono  <hbono@chromium.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=15790
     6        Ligatures aren't accounted for when manipulating VisiblePositions
     7
     8        Verify that we can prevent a cursor from moving in the middle of an Indic ligature.
     9
     10        * editing/deleting/skip-virama-001-expected.txt: Added.
     11        * editing/deleting/skip-virama-001.html: Added.
     12
     13        * platform/mac-tiger/Skipped: This fix requires a customized cursorMovementIterator,
     14        which is not enabled on Tiger (see bug 24513).
     15
    1162009-03-11  Jan Michael Alonzo  <jmalonzo@webkit.org>
    217
    318        Reviewed by Holger Freyther.
    419
    5         Gtk] Implement LayoutTestControllerGtk::setPrivateBrowsingEnabled
     20        [Gtk] Implement LayoutTestControllerGtk::setPrivateBrowsingEnabled
    621        https://bugs.webkit.org/show_bug.cgi?id=24487
    722
  • trunk/LayoutTests/platform/mac-tiger/Skipped

    r38456 r41588  
    2323http/tests/xmlhttprequest/upload-onprogress-event.html
    2424http/tests/xmlhttprequest/upload-progress-events.html
     25
     26# Customized cursorMovementIterator doesn't work with ICU 3.2
     27editing/deleting/skip-virama-001.html
  • trunk/WebCore/ChangeLog

    r41587 r41588  
     12009-03-11  Hironori Bono  <hbono@chromium.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=15790
     6        Ligatures aren't accounted for when manipulating VisiblePositions
     7
     8        Changed cursorMovementIterator rules to prevent a cursor from moving in the middle of an
     9        Indic ligature which uses a virama sign.
     10       
     11        Test: editing/deleting/skip-virama-001.html
     12
     13        * platform/text/TextBreakIteratorICU.cpp:
     14        (WebCore::cursorMovementIterator):
     15
    1162009-03-11  Alexey Proskuryakov  <ap@webkit.org>
    217
  • trunk/WebCore/platform/text/TextBreakIteratorICU.cpp

    r41587 r41588  
    149149    return characterBreakIterator(string, length);
    150150#else
    151     // This rule set is based on character-break iterator rules of ICU 3.8
    152     // <http://source.icu-project.org/repos/icu/icu/tags/release-3-8/source/data/brkitr/char.txt>.
     151    // This rule set is based on character-break iterator rules of ICU 4.0
     152    // <http://source.icu-project.org/repos/icu/icu/tags/release-4-0/source/data/brkitr/char.txt>.
     153    // The major differences from the original ones are listed below:
     154    // * Replaced '[\p{Grapheme_Cluster_Break = SpacingMark}]' with '[\p{General_Category = Spacing Mark} - $Extend]' for ICU 3.8 or earlier;
     155    // * Removed rules that prevent a cursor from moving after prepend characters (Bug 24342);
     156    // * Added rules that prevent a cursor from moving after virama signs of Indic languages except Tamil (Bug 15790), and;
     157    // * Added rules that prevent a cursor from moving before Japanese half-width katakara voiced marks.
    153158    static const char* kRules =
    154159        "$CR      = [\\p{Grapheme_Cluster_Break = CR}];"
    155160        "$LF      = [\\p{Grapheme_Cluster_Break = LF}];"
    156161        "$Control = [\\p{Grapheme_Cluster_Break = Control}];"
    157         "$VoiceMarks = [\\uff9e\\uff9f];"
     162        "$VoiceMarks = [\\uFF9E\\uFF9F];"  // Japanese half-width katakana voiced marks
    158163        "$Extend  = [\\p{Grapheme_Cluster_Break = Extend} $VoiceMarks];"
     164        "$SpacingMark = [[\\p{General_Category = Spacing Mark}] - $Extend];"
    159165        "$L       = [\\p{Grapheme_Cluster_Break = L}];"
    160166        "$V       = [\\p{Grapheme_Cluster_Break = V}];"
     
    162168        "$LV      = [\\p{Grapheme_Cluster_Break = LV}];"
    163169        "$LVT     = [\\p{Grapheme_Cluster_Break = LVT}];"
    164         "$HangulSyllable = $L+ | ($L* ($LV? $V+ | $LV | $LVT) $T*) | $T+;"
     170        "$Hin0    = [\\u0905-\\u0939];"    // Devanagari Letter A,...,Ha
     171        "$HinV    = \\u094D;"              // Devanagari Sign Virama
     172        "$Hin1    = [\\u0915-\\u0939];"    // Devanagari Letter Ka,...,Ha
     173        "$Ben0    = [\\u0985-\\u09B9];"    // Bengali Letter A,...,Ha
     174        "$BenV    = \\u09CD;"              // Bengali Sign Virama
     175        "$Ben1    = [\\u0995-\\u09B9];"    // Bengali Letter Ka,...,Ha
     176        "$Pan0    = [\\u0A05-\\u0A39];"    // Gurmukhi Letter A,...,Ha
     177        "$PanV    = \\u0A4D;"              // Gurmukhi Sign Virama
     178        "$Pan1    = [\\u0A15-\\u0A39];"    // Gurmukhi Letter Ka,...,Ha
     179        "$Guj0    = [\\u0A85-\\u0AB9];"    // Gujarati Letter A,...,Ha
     180        "$GujV    = \\u0ACD;"              // Gujarati Sign Virama
     181        "$Guj1    = [\\u0A95-\\u0AB9];"    // Gujarati Letter Ka,...,Ha
     182        "$Ori0    = [\\u0B05-\\u0B39];"    // Oriya Letter A,...,Ha
     183        "$OriV    = \\u0B4D;"              // Oriya Sign Virama
     184        "$Ori1    = [\\u0B15-\\u0B39];"    // Oriya Letter Ka,...,Ha
     185        "$Tel0    = [\\u0C05-\\u0C39];"    // Telugu Letter A,...,Ha
     186        "$TelV    = \\u0C4D;"              // Telugu Sign Virama
     187        "$Tel1    = [\\u0C14-\\u0C39];"    // Telugu Letter Ka,...,Ha
     188        "$Kan0    = [\\u0C85-\\u0CB9];"    // Kannada Letter A,...,Ha
     189        "$KanV    = \\u0CCD;"              // Kannada Sign Virama
     190        "$Kan1    = [\\u0C95-\\u0CB9];"    // Kannada Letter A,...,Ha
     191        "$Mal0    = [\\u0D05-\\u0D39];"    // Malayalam Letter A,...,Ha
     192        "$MalV    = \\u0D4D;"              // Malayalam Sign Virama
     193        "$Mal1    = [\\u0D15-\\u0D39];"    // Malayalam Letter A,...,Ha
     194        "!!chain;"
    165195        "!!forward;"
    166196        "$CR $LF;"
    167         "([^$Control $CR $LF] | $HangulSyllable) $Extend*;"
     197        "$L ($L | $V | $LV | $LVT);"
     198        "($LV | $V) ($V | $T);"
     199        "($LVT | $T) $T;"
     200        "[^$Control $CR $LF] $Extend;"
     201        "[^$Control $CR $LF] $SpacingMark;"
     202        "$Hin0 $HinV $Hin1;"               // Devanagari Virama (forward)
     203        "$Ben0 $BenV $Ben1;"               // Bengali Virama (forward)
     204        "$Pan0 $PanV $Pan1;"               // Gurmukhi Virama (forward)
     205        "$Guj0 $GujV $Guj1;"               // Gujarati Virama (forward)
     206        "$Ori0 $OriV $Ori1;"               // Oriya Virama (forward)
     207        "$Tel0 $TelV $Tel1;"               // Telugu Virama (forward)
     208        "$Kan0 $KanV $Kan1;"               // Kannada Virama (forward)
     209        "$Mal0 $MalV $Mal1;"               // Malayalam Virama (forward)
    168210        "!!reverse;"
    169         "$BackHangulSyllable = $L+ | ($T* ($V+$LV? | $LV | $LVT) $L*) | $T+;"
    170         "$BackOneCluster = ($LF $CR) | ($Extend* ([^$Control $CR $LF] | $BackHangulSyllable));"
    171         "$BackOneCluster;"
     211        "$LF $CR;"
     212        "($L | $V | $LV | $LVT) $L;"
     213        "($V | $T) ($LV | $V);"
     214        "$T ($LVT | $T);"
     215        "$Extend      [^$Control $CR $LF];"
     216        "$SpacingMark [^$Control $CR $LF];"
     217        "$Hin1 $HinV $Hin0;"               // Devanagari Virama (backward)
     218        "$Ben1 $BenV $Ben0;"               // Bengali Virama (backward)
     219        "$Pan1 $PanV $Pan0;"               // Gurmukhi Virama (backward)
     220        "$Guj1 $GujV $Guj0;"               // Gujarati Virama (backward)
     221        "$Ori1 $OriV $Ori0;"               // Gujarati Virama (backward)
     222        "$Tel1 $TelV $Tel0;"               // Telugu Virama (backward)
     223        "$Kan1 $KanV $Kan0;"               // Kannada Virama (backward)
     224        "$Mal1 $MalV $Mal0;"               // Malayalam Virama (backward)
    172225        "!!safe_reverse;"
    173         "$V+ $L;"
    174         "!!safe_forward;"
    175         "$V+ $T;";
    176     static bool createdInputCursorIterator = false;
    177     static TextBreakIterator* staticInputCursorIterator;
    178     return setUpIteratorWithRules(createdInputCursorIterator, staticInputCursorIterator, kRules, string, length);
     226        "!!safe_forward;";
     227    static bool createdCursorMovementIterator = false;
     228    static TextBreakIterator* staticCursorMovementIterator;
     229    return setUpIteratorWithRules(createdCursorMovementIterator, staticCursorMovementIterator, kRules, string, length);
    179230#endif // BUILDING_ON_TIGER
    180231}
Note: See TracChangeset for help on using the changeset viewer.