From aec71218125a5b43f6ad282fb3fa2fa4774187f6 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Tue, 19 Mar 2013 16:44:14 -0400 Subject: [PATCH] Backed out changeset 2b2de9cc2f59 (bug 849438) for B2G mochitest failures. --- content/base/public/nsContentUtils.h | 6 --- content/base/src/nsContentUtils.cpp | 10 ---- layout/forms/nsListControlFrame.cpp | 44 ++++++++---------- layout/forms/test/Makefile.in | 1 - .../forms/test/test_listcontrol_search.html | 46 ------------------- 5 files changed, 20 insertions(+), 87 deletions(-) delete mode 100644 layout/forms/test/test_listcontrol_search.html diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index 294739a7a88..3c741d586ae 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 036a1205883..906939b501f 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 a737919d84f..bb8272a7b01 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 7f9ba30757c..e16b6012ca2 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 7f73c5f7576..00000000000 --- a/layout/forms/test/test_listcontrol_search.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Test for <select> list control search - - - - - - -Mozilla Bug 849438 -

-
- -
-
-
- -