Bug 922082 - Skip display:none options when searching for a match. r=bz
authorMats Palmgren <matspal@gmail.com>
Wed, 02 Oct 2013 09:56:03 +0000
changeset 163443 8bc54ab0ef1489ca10e080b6f187b99a82859339
parent 163442 7689530c9fc66b435d519afd699c734509df363a
child 163452 aca286bc001391b280e998e06bb6ed8743d82704
child 163505 428bb4dfd0ea7ee2aac2b13411a1a6a0d2edc5ba
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs922082
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 922082 - Skip display:none options when searching for a match. r=bz
layout/forms/nsListControlFrame.cpp
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -2326,17 +2326,17 @@ nsListControlFrame::KeyPress(nsIDOMEvent
 
   uint32_t numOptions = options->Length();
 
   nsWeakFrame weakFrame(this);
   for (uint32_t i = 0; i < numOptions; ++i) {
     uint32_t index = (i + startIndex) % numOptions;
     nsRefPtr<dom::HTMLOptionElement> optionElement =
       options->ItemAsOption(index);
-    if (!optionElement) {
+    if (!optionElement || !optionElement->GetPrimaryFrame()) {
       continue;
     }
 
     nsAutoString text;
     if (NS_FAILED(optionElement->GetText(text)) ||
         !StringBeginsWith(
            nsContentUtils::TrimWhitespace<
              nsContentUtils::IsHTMLWhitespaceOrNBSP>(text, false),