[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">А</option>
+ <option value="1">АБ</option>
+ <option value="2">АБВ</option>
+ <option value="3">АБВГ</option>
+ <option value="4">АБВГД</option>
+ <option value="5">АБВГДЕ</option>
+ <option value="6">АБВГДЕЖ</option>
+ <option value="7">АБВГДЕЖЗ</option>
+ <option value="8">АБВГДЕЖЗИ</option>
+ <option value="9">АБВГДЕЖЗИЙ</option>
+ <option value="10">АБВГДЕЖЗИЙК</option>
+ <option value="11">АБВГДЕЖЗИЙКЛ</option>
+ <option value="12">АБВГДЕЖЗИЙКЛМ</option>
+ <option value="13">АБВГДЕЖЗИЙКЛМН</option>
+ <option value="14">АБВГДЕЖЗИЙКЛМНО</option>
+ <option value="15">АБВГДЕЖЗИЙКЛМНОП</option>
+ <option value="16">АБВГДЕЖЗИЙКЛМНОПР</option>
+ <option value="17">АБВГДЕЖЗИЙКЛМНОПРС</option>
+ <option value="18">АБВГДЕЖЗИЙКЛМНОПРСТ</option>
+ <option value="19">АБВГДЕЖЗИЙКЛМНОПРСТУ</option>
+ <option value="20">АБВГДЕЖЗИЙКЛМНОПРСТУФ</option>
+ <option value="21">АБВГДЕЖЗИЙКЛМНОПРСТУФХ</option>
+ <option value="22">АБВГДЕЖЗИЙКЛМНОПРСТУФХЦ</option>
+ <option value="23">АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧ</option>
+ <option value="24">АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШ</option>
+ <option value="25">АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩ</option>
+ <option value="26">АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪ</option>
+ <option value="27">АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫ</option>
+ <option value="28">АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬ</option>
+ <option value="29">АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭ</option>
+ <option value="30">АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮ</option>
+ <option value="31">АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ</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">Α</option>
+ <option value="1">ΑΒ</option>
+ <option value="2">ΑΒΓ</option>
+ <option value="3">ΑΒΓΔ</option>
+ <option value="4">ΑΒΓΔΕ</option>
+ <option value="5">ΑΒΓΔΕΖ</option>
+ <option value="6">ΑΒΓΔΕΖΗ</option>
+ <option value="7">ΑΒΓΔΕΖΗΘ</option>
+ <option value="8">ΑΒΓΔΕΖΗΘΙ</option>
+ <option value="9">ΑΒΓΔΕΖΗΘΙΚ</option>
+ <option value="10">ΑΒΓΔΕΖΗΘΙΚΛ</option>
+ <option value="11">ΑΒΓΔΕΖΗΘΙΚΛΜ</option>
+ <option value="12">ΑΒΓΔΕΖΗΘΙΚΛΜΝ</option>
+ <option value="13">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞ</option>
+ <option value="14">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟ</option>
+ <option value="15">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠ</option>
+ <option value="16">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ</option>
+ <option value="18">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣ</option>
+ <option value="19">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤ</option>
+ <option value="20">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥ</option>
+ <option value="21">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦ</option>
+ <option value="22">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧ</option>
+ <option value="23">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨ</option>
+ <option value="24">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ</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