Changeset 50046 in webkit


Ignore:
Timestamp:
Oct 25, 2009 1:15:56 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-10-25 Hironori Bono <hbono@chromium.org>

Reviewed by Darin Adler.

A quick fix for Bug 29103.
Since String::startsWith() cannot fold non-ASCII characters, this change folds the prefix string
and the option string before calling String::startsWith().
https://bugs.webkit.org/show_bug.cgi?id=29103

  • fast/forms/listbox-typeahead-cyrillic-expected.txt: Added.
  • fast/forms/listbox-typeahead-cyrillic.html: Added.
  • fast/forms/listbox-typeahead-greek-expected.txt: Added.
  • fast/forms/listbox-typeahead-greek.html: Added.

2009-10-25 Hironori Bono <hbono@chromium.org>

Reviewed by Darin Adler.

A quick fix for Bug 29103.
Since String::startsWith() cannot fold non-ASCII characters, this change folds the prefix string
and the option string before calling String::startsWith().
https://bugs.webkit.org/show_bug.cgi?id=29103

Tests: fast/forms/listbox-typeahead-cyrillic.html

fast/forms/listbox-typeahead-greek.html

  • dom/SelectElement.cpp: (WebCore::SelectElement::typeAheadFind):
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r50041 r50046  
     12009-10-25  Hironori Bono  <hbono@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        A quick fix for Bug 29103.
     6        Since String::startsWith() cannot fold non-ASCII characters, this change folds the prefix string
     7        and the option string before calling String::startsWith().
     8        https://bugs.webkit.org/show_bug.cgi?id=29103
     9
     10        * fast/forms/listbox-typeahead-cyrillic-expected.txt: Added.
     11        * fast/forms/listbox-typeahead-cyrillic.html: Added.
     12        * fast/forms/listbox-typeahead-greek-expected.txt: Added.
     13        * fast/forms/listbox-typeahead-greek.html: Added.
     14
    1152009-10-25  Sam Weinig  <sam@webkit.org>
    216
  • trunk/WebCore/ChangeLog

    r50044 r50046  
     12009-10-25  Hironori Bono  <hbono@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        A quick fix for Bug 29103.
     6        Since String::startsWith() cannot fold non-ASCII characters, this change folds the prefix string
     7        and the option string before calling String::startsWith().
     8        https://bugs.webkit.org/show_bug.cgi?id=29103
     9
     10        Tests: fast/forms/listbox-typeahead-cyrillic.html
     11               fast/forms/listbox-typeahead-greek.html
     12
     13        * dom/SelectElement.cpp:
     14        (WebCore::SelectElement::typeAheadFind):
     15
    1162009-10-25  Keishi Hattori  <casey.hattori@gmail.com>
    217
  • trunk/WebCore/dom/SelectElement.cpp

    r48379 r50046  
    875875    ASSERT(index >= 0);
    876876
     877    // Compute a case-folded copy of the prefix string before beginning the search for
     878    // a matching element. This code uses foldCase to work around the fact that
     879    // String::startWith does not fold non-ASCII characters. This code can be changed
     880    // to use startWith once that is fixed.
     881    String prefixWithCaseFolded(prefix.foldCase());
    877882    for (int i = 0; i < itemCount; ++i, index = (index + 1) % itemCount) {
    878883        OptionElement* optionElement = toOptionElement(items[index]);
     
    880885            continue;
    881886
     887        // Fold the option string and check if its prefix is equal to the folded prefix.
    882888        String text = optionElement->textIndentedToRespectGroupLabel();
    883         if (stripLeadingWhiteSpace(text).startsWith(prefix, false)) {
     889        if (stripLeadingWhiteSpace(text).foldCase().startsWith(prefixWithCaseFolded)) {
    884890            setSelectedIndex(data, element, listToOptionIndex(data, element, index));
    885891            if (!data.usesMenuList())
Note: See TracChangeset for help on using the changeset viewer.