Bug 899931 - Part j: Cleanup nsListControlFrame::GetSelectedIndex; r=dzbarsky
authorMs2ger <ms2ger@gmail.com>
Fri, 02 Aug 2013 09:09:05 +0200
changeset 153246 2e99a8e6be1ccc74a5bf66f0c2a8ecc6af816e3c
parent 153245 f81a119405640561ed4a576a29d17638b83ca883
child 153247 8a7a62729e5b4a37e16b7e2d479993ec8dabf439
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdzbarsky
bugs899931
milestone25.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 899931 - Part j: Cleanup nsListControlFrame::GetSelectedIndex; r=dzbarsky
layout/forms/nsListControlFrame.cpp
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1065,22 +1065,19 @@ nsListControlFrame::GetOptionText(uint32
   if (dom::HTMLOptionElement* optionElement = GetOption(aIndex)) {
     optionElement->GetText(aStr);
   }
 }
 
 int32_t
 nsListControlFrame::GetSelectedIndex()
 {
-  int32_t aIndex;
-  
-  nsCOMPtr<nsIDOMHTMLSelectElement> selectElement(do_QueryInterface(mContent));
-  selectElement->GetSelectedIndex(&aIndex);
-  
-  return aIndex;
+  dom::HTMLSelectElement* select =
+    dom::HTMLSelectElement::FromContentOrNull(mContent);
+  return select->SelectedIndex();
 }
 
 dom::HTMLOptionElement*
 nsListControlFrame::GetCurrentOption()
 {
   // The mEndSelectionIndex is what is currently being selected. Use
   // the selected index if this is kNothingSelected.
   int32_t focusedIndex = (mEndSelectionIndex == kNothingSelected) ?