[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric at webkit.org eric at webkit.org
Thu Oct 29 20:51:47 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit b8b5a727e73db0c788c21d6a9a62821e28104330
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Oct 25 20:15:56 2009 +0000

    2009-10-25  Hironori Bono  <hbono at 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 at 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):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50046 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e1de708..4675dc8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2009-10-25  Hironori Bono  <hbono at 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  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Dan Bernstein.
diff --git a/LayoutTests/fast/forms/listbox-typeahead-cyrillic-expected.txt b/LayoutTests/fast/forms/listbox-typeahead-cyrillic-expected.txt
new file mode 100644
index 0000000..aba4512
--- /dev/null
+++ b/LayoutTests/fast/forms/listbox-typeahead-cyrillic-expected.txt
@@ -0,0 +1,35 @@
+This test verifies a drop-down menu can refine the selection when we send keydown events consisting of Cyrillic characters.
+
+
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
diff --git a/LayoutTests/fast/forms/listbox-typeahead-cyrillic.html b/LayoutTests/fast/forms/listbox-typeahead-cyrillic.html
new file mode 100644
index 0000000..3b877e6
--- /dev/null
+++ b/LayoutTests/fast/forms/listbox-typeahead-cyrillic.html
@@ -0,0 +1,71 @@
+<html>
+<head>
+    <title></title>
+</head>
+<body>
+    <p>This test verifies a drop-down menu can refine the selection when we send keydown events consisting of Cyrillic characters.</p>
+    <select id="test">
+        <option value="-1">should not see me</option>
+        <option value="0">&#x0410;</option>
+        <option value="1">&#x0410;&#x0411;</option>
+        <option value="2">&#x0410;&#x0411;&#x0412;</option>
+        <option value="3">&#x0410;&#x0411;&#x0412;&#x0413;</option>
+        <option value="4">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;</option>
+        <option value="5">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;</option>
+        <option value="6">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;</option>
+        <option value="7">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;</option>
+        <option value="8">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;</option>
+        <option value="9">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;</option>
+        <option value="10">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;</option>
+        <option value="11">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;</option>
+        <option value="12">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;</option>
+        <option value="13">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;</option>
+        <option value="14">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;</option>
+        <option value="15">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;</option>
+        <option value="16">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;</option>
+        <option value="17">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;</option>
+        <option value="18">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;</option>
+        <option value="19">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;</option>
+        <option value="20">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;</option>
+        <option value="21">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;</option>
+        <option value="22">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;</option>
+        <option value="23">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;</option>
+        <option value="24">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;</option>
+        <option value="25">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;</option>
+        <option value="26">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042A;</option>
+        <option value="27">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042A;&#x042B;</option>
+        <option value="28">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042A;&#x042B;&#x042C;</option>
+        <option value="29">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042A;&#x042B;&#x042C;&#x042D;</option>
+        <option value="30">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042A;&#x042B;&#x042C;&#x042D;&#x042E;</option>
+        <option value="31">&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042A;&#x042B;&#x042C;&#x042D;&#x042E;&#x042F;</option>
+    </select>
+    <ul id="console"></ul>
+</body>
+<script>
+function log(str) {
+    var li = document.createElement("li");
+    li.appendChild(document.createTextNode(str));
+    var console = document.getElementById("console");
+    console.appendChild(li);
+}
+
+if (window.layoutTestController)
+    window.layoutTestController.dumpAsText();
+
+// Set the input focus to the <select> element.
+var node = document.getElementById("test");
+node.focus();
+
+var base = 0x0430;
+for (var i = base; i <= 0x044F; i++) {
+    // Send a key event consisting of a Cyrillic small character.
+    eventSender.keyDown(String.fromCharCode(i));
+
+    // Compare the value of this <select> element with the expected result.
+    if (node.value == i - base)
+        log('SUCCEEDED');
+    else
+        log('FAILED: expected="' + i + '", actual="' + node.value + '".');
+}
+</script>
+</html>
diff --git a/LayoutTests/fast/forms/listbox-typeahead-greek-expected.txt b/LayoutTests/fast/forms/listbox-typeahead-greek-expected.txt
new file mode 100644
index 0000000..bf856cf
--- /dev/null
+++ b/LayoutTests/fast/forms/listbox-typeahead-greek-expected.txt
@@ -0,0 +1,27 @@
+This test verifies a drop-down menu can refine the selection when we send keydown events consisting of Greek small characters.
+
+
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
+SUCCEEDED
diff --git a/LayoutTests/fast/forms/listbox-typeahead-greek.html b/LayoutTests/fast/forms/listbox-typeahead-greek.html
new file mode 100644
index 0000000..4927d72
--- /dev/null
+++ b/LayoutTests/fast/forms/listbox-typeahead-greek.html
@@ -0,0 +1,66 @@
+<html>
+<head>
+    <title></title>
+</head>
+<body>
+    <p>This test verifies a drop-down menu can refine the selection when we send keydown events consisting of Greek small characters.</p>
+    <select id="test">
+        <option value="-1">should not see me</option>
+        <option value="0">&#x0391;</option>
+        <option value="1">&#x0391;&#x0392;</option>
+        <option value="2">&#x0391;&#x0392;&#x0393;</option>
+        <option value="3">&#x0391;&#x0392;&#x0393;&#x0394;</option>
+        <option value="4">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;</option>
+        <option value="5">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;</option>
+        <option value="6">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;</option>
+        <option value="7">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;</option>
+        <option value="8">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;</option>
+        <option value="9">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;</option>
+        <option value="10">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;</option>
+        <option value="11">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;</option>
+        <option value="12">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;</option>
+        <option value="13">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;</option>
+        <option value="14">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;</option>
+        <option value="15">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;&#x03A0;</option>
+        <option value="16">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;&#x03A0;&#x03A1;</option>
+        <option value="18">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;&#x03A0;&#x03A1;&#x03A3;</option>
+        <option value="19">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;&#x03A0;&#x03A1;&#x03A3;&#x03A4;</option>
+        <option value="20">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;&#x03A0;&#x03A1;&#x03A3;&#x03A4;&#x03A5;</option>
+        <option value="21">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;&#x03A0;&#x03A1;&#x03A3;&#x03A4;&#x03A5;&#x03A6;</option>
+        <option value="22">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;&#x03A0;&#x03A1;&#x03A3;&#x03A4;&#x03A5;&#x03A6;&#x03A7;</option>
+        <option value="23">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;&#x03A0;&#x03A1;&#x03A3;&#x03A4;&#x03A5;&#x03A6;&#x03A7;&#x03A8;</option>
+        <option value="24">&#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;&#x0397;&#x0398;&#x0399;&#x039A;&#x039B;&#x039C;&#x039D;&#x039E;&#x039F;&#x03A0;&#x03A1;&#x03A3;&#x03A4;&#x03A5;&#x03A6;&#x03A7;&#x03A8;&#x03A9;</option>
+    </select>
+    <ul id="console"></ul>
+</body>
+<script>
+function log(str) {
+    var li = document.createElement("li");
+    li.appendChild(document.createTextNode(str));
+    var console = document.getElementById("console");
+    console.appendChild(li);
+}
+
+if (window.layoutTestController)
+    window.layoutTestController.dumpAsText();
+
+// Set the input focus to the <select> element.
+var node = document.getElementById("test");
+node.focus();
+
+var base = 0x03B1;
+for (var i = base; i <= 0x03C9; i++) {
+    // We don't have to send U+03C2 (Greek Small Letter Final Sigma).
+    if (i != 0x03C2) {
+        // Send a key event consisting of a Greek small character.
+        eventSender.keyDown(String.fromCharCode(i));
+
+        // Compare the value of this <select> element with the expected result.
+        if (node.value == i - base)
+            log('SUCCEEDED');
+        else
+            log('FAILED: expected="' + i + '", actual="' + node.value + '".');
+    }
+}
+</script>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index bf7be1f..d7eb4e9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-25  Hironori Bono  <hbono at 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):
+
 2009-10-25  Keishi Hattori  <casey.hattori at gmail.com>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/dom/SelectElement.cpp b/WebCore/dom/SelectElement.cpp
index 49713ba..ac7d08f 100644
--- a/WebCore/dom/SelectElement.cpp
+++ b/WebCore/dom/SelectElement.cpp
@@ -874,13 +874,19 @@ void SelectElement::typeAheadFind(SelectElementData& data, Element* element, Key
     int index = (optionToListIndex(data, element, selected >= 0 ? selected : 0) + searchStartOffset) % itemCount;
     ASSERT(index >= 0);
 
+    // Compute a case-folded copy of the prefix string before beginning the search for
+    // a matching element. This code uses foldCase to work around the fact that
+    // String::startWith does not fold non-ASCII characters. This code can be changed
+    // to use startWith once that is fixed.
+    String prefixWithCaseFolded(prefix.foldCase());
     for (int i = 0; i < itemCount; ++i, index = (index + 1) % itemCount) {
         OptionElement* optionElement = toOptionElement(items[index]);
         if (!optionElement || items[index]->disabled())
             continue;
 
+        // Fold the option string and check if its prefix is equal to the folded prefix.
         String text = optionElement->textIndentedToRespectGroupLabel();
-        if (stripLeadingWhiteSpace(text).startsWith(prefix, false)) {
+        if (stripLeadingWhiteSpace(text).foldCase().startsWith(prefixWithCaseFolded)) {
             setSelectedIndex(data, element, listToOptionIndex(data, element, index));
             if (!data.usesMenuList())
                 listBoxOnChange(data, element);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list