diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index 294739a7a88a..3c741d586aed 100644 --- a/content/base/public/nsContentUtils.h +++ b/content/base/public/nsContentUtils.h @@ -334,12 +334,6 @@ public: */ static bool IsHTMLWhitespace(PRUnichar aChar); - /* - * Returns whether the character is an HTML whitespace (see IsHTMLWhitespace) - * or a nbsp character (U+00A0). - */ - static bool IsHTMLWhitespaceOrNBSP(PRUnichar aChar); - /** * Is the HTML local name a block element? */ diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index 036a1205883e..906939b501f1 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -1199,13 +1199,6 @@ nsContentUtils::IsHTMLWhitespace(PRUnichar aChar) aChar == PRUnichar(0x0020); } -/* static */ -bool -nsContentUtils::IsHTMLWhitespaceOrNBSP(PRUnichar aChar) -{ - return IsHTMLWhitespace(aChar) || aChar == PRUnichar(0xA0); -} - /* static */ bool nsContentUtils::IsHTMLBlock(nsIAtom* aLocalName) @@ -2165,9 +2158,6 @@ nsContentUtils::TrimWhitespace(const nsAString&, bool); template const nsDependentSubstring nsContentUtils::TrimWhitespace(const nsAString&, bool); -template -const nsDependentSubstring -nsContentUtils::TrimWhitespace(const nsAString&, bool); static inline void KeyAppendSep(nsACString& aKey) { diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index a737919d84f4..bb8272a7b01b 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -2472,32 +2472,28 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent) startIndex++; } - for (uint32_t i = 0; i < numOptions; ++i) { + uint32_t i; + for (i = 0; i < numOptions; i++) { uint32_t index = (i + startIndex) % numOptions; - nsCOMPtr optionElement = GetOption(options, index); - if (!optionElement) { - continue; + nsCOMPtr optionElement = + GetOption(options, index); + if (optionElement) { + nsAutoString text; + if (NS_OK == optionElement->GetText(text)) { + if (StringBeginsWith(text, incrementalString, + nsCaseInsensitiveStringComparator())) { + bool wasChanged = PerformSelection(index, isShift, isControl); + if (wasChanged) { + // dispatch event, update combobox, etc. + if (!UpdateSelection()) { + return NS_OK; + } + } + break; + } + } } - - nsAutoString text; - if (NS_FAILED(optionElement->GetText(text)) || - !StringBeginsWith(nsContentUtils::TrimWhitespace(text, false), - incrementalString, - nsCaseInsensitiveStringComparator())) { - continue; - } - - if (!PerformSelection(index, isShift, isControl)) { - break; - } - - // If UpdateSelection() returns false, that means the frame is no longer - // alive. We should stop doing anything. - if (!UpdateSelection()) { - return NS_OK; - } - break; - } + } // for } break;//case } // switch diff --git a/layout/forms/test/Makefile.in b/layout/forms/test/Makefile.in index 7f9ba30757c0..e16b6012ca27 100644 --- a/layout/forms/test/Makefile.in +++ b/layout/forms/test/Makefile.in @@ -44,7 +44,6 @@ MOCHITEST_FILES = test_bug231389.html \ test_bug644542.html \ test_bug672810.html \ test_bug704049.html \ - test_listcontrol_search.html \ $(NULL) MOCHITEST_CHROME_FILES = \ diff --git a/layout/forms/test/test_listcontrol_search.html b/layout/forms/test/test_listcontrol_search.html deleted file mode 100644 index 7f73c5f7576c..000000000000 --- a/layout/forms/test/test_listcontrol_search.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Test for <select> list control search - - - - - - -Mozilla Bug 849438 -

-
- -
-
-
- -