Bug 328680, remove nsIListControlFrame interface, r=mats
authorNeil Deakin <neil@mozilla.com>
Wed, 26 Sep 2018 10:41:01 -0400
changeset 438349 d081601f722b18327d3504023b2e88e09921e632
parent 438348 d7a945fc6271a0497a02b00d76df98f55063ecba
child 438350 785a53ae44c0e8df1e8e900dc9be656319978359
push id34717
push usershindli@mozilla.com
push dateWed, 26 Sep 2018 21:52:33 +0000
treeherdermozilla-central@7ac88abc3c57 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs328680
milestone64.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 328680, remove nsIListControlFrame interface, r=mats
accessible/html/HTMLSelectAccessible.cpp
accessible/html/moz.build
dom/html/HTMLOptionsCollection.cpp
dom/html/HTMLSelectElement.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/forms/moz.build
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsComboboxControlFrame.h
layout/forms/nsIListControlFrame.h
layout/forms/nsListControlFrame.cpp
layout/forms/nsListControlFrame.h
--- a/accessible/html/HTMLSelectAccessible.cpp
+++ b/accessible/html/HTMLSelectAccessible.cpp
@@ -14,17 +14,17 @@
 #include "Role.h"
 #include "States.h"
 
 #include "nsCOMPtr.h"
 #include "mozilla/dom/HTMLOptionElement.h"
 #include "mozilla/dom/HTMLSelectElement.h"
 #include "nsIComboboxControlFrame.h"
 #include "nsContainerFrame.h"
-#include "nsIListControlFrame.h"
+#include "nsListControlFrame.h"
 
 using namespace mozilla::a11y;
 using namespace mozilla::dom;
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLSelectListAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -90,17 +90,17 @@ bool
 HTMLSelectListAccessible::AreItemsOperable() const
 {
   return true;
 }
 
 Accessible*
 HTMLSelectListAccessible::CurrentItem() const
 {
-  nsIListControlFrame* listControlFrame = do_QueryFrame(GetFrame());
+  nsListControlFrame* listControlFrame = do_QueryFrame(GetFrame());
   if (listControlFrame) {
     nsCOMPtr<nsIContent> activeOptionNode = listControlFrame->GetCurrentOption();
     if (activeOptionNode) {
       DocAccessible* document = Document();
       if (document)
         return document->GetAccessible(activeOptionNode);
     }
   }
--- a/accessible/html/moz.build
+++ b/accessible/html/moz.build
@@ -14,16 +14,17 @@ UNIFIED_SOURCES += [
     'HTMLSelectAccessible.cpp',
     'HTMLTableAccessible.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/accessible/base',
     '/accessible/generic',
     '/accessible/xpcom',
+    '/layout/forms',
     '/layout/generic',
     '/layout/tables',
     '/layout/xul',
 ]
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     LOCAL_INCLUDES += [
         '/accessible/atk',
--- a/dom/html/HTMLOptionsCollection.cpp
+++ b/dom/html/HTMLOptionsCollection.cpp
@@ -18,17 +18,16 @@
 #include "nsContentCreatorFunctions.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsIComboboxControlFrame.h"
 #include "nsIDocument.h"
 #include "nsIFormControlFrame.h"
 #include "nsIForm.h"
 #include "nsIFormProcessor.h"
-#include "nsIListControlFrame.h"
 #include "nsLayoutUtils.h"
 #include "nsMappedAttributes.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStyleConsts.h"
 #include "jsfriendapi.h"
 
 namespace mozilla {
 namespace dom {
--- a/dom/html/HTMLSelectElement.cpp
+++ b/dom/html/HTMLSelectElement.cpp
@@ -23,17 +23,17 @@
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsIComboboxControlFrame.h"
 #include "nsIDocument.h"
 #include "nsIFormControlFrame.h"
 #include "nsIForm.h"
 #include "nsIFormProcessor.h"
 #include "nsIFrame.h"
-#include "nsIListControlFrame.h"
+#include "nsListControlFrame.h"
 #include "nsISelectControlFrame.h"
 #include "nsLayoutUtils.h"
 #include "nsMappedAttributes.h"
 #include "mozilla/PresState.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStyleConsts.h"
 #include "nsTextNode.h"
 
@@ -1600,17 +1600,17 @@ HTMLSelectElement::DispatchContentReset(
     // Only dispatch content reset notification if this is a list control
     // frame or combo box control frame.
     if (IsCombobox()) {
       nsIComboboxControlFrame* comboFrame = do_QueryFrame(formControlFrame);
       if (comboFrame) {
         comboFrame->OnContentReset();
       }
     } else {
-      nsIListControlFrame* listFrame = do_QueryFrame(formControlFrame);
+      nsListControlFrame* listFrame = do_QueryFrame(formControlFrame);
       if (listFrame) {
         listFrame->OnContentReset();
       }
     }
   }
 }
 
 static void
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -47,17 +47,17 @@
 #ifdef MOZ_XUL
 #include "nsXULElement.h"
 #include "mozilla/dom/BoxObject.h"
 #endif // MOZ_XUL
 #include "nsContainerFrame.h"
 #include "nsNameSpaceManager.h"
 #include "nsIComboboxControlFrame.h"
 #include "nsComboboxControlFrame.h"
-#include "nsIListControlFrame.h"
+#include "nsListControlFrame.h"
 #include "nsPlaceholderFrame.h"
 #include "nsTableRowGroupFrame.h"
 #include "nsIFormControl.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsTextFragment.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsBindingManager.h"
 #include "nsXBLBinding.h"
@@ -3048,17 +3048,17 @@ nsCSSFrameConstructor::ConstructSelectFr
     listStyle = mPresShell->StyleSet()->
       ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::dropDownList(),
                                          computedStyle);
 
     // Create a listbox
     nsContainerFrame* listFrame = NS_NewListControlFrame(mPresShell, listStyle);
 
     // Notify the listbox that it is being used as a dropdown list.
-    nsIListControlFrame * listControlFrame = do_QueryFrame(listFrame);
+    nsListControlFrame * listControlFrame = do_QueryFrame(listFrame);
     if (listControlFrame) {
       listControlFrame->SetComboboxFrame(comboboxFrame);
     }
     // Notify combobox that it should use the listbox as it's popup
     comboboxFrame->SetDropDown(listFrame);
 
     if (!nsLayoutUtils::IsContentSelectEnabled()) {
       // TODO(kuoe0) Remove this assertion when content-select is shipped.
--- a/layout/forms/moz.build
+++ b/layout/forms/moz.build
@@ -8,17 +8,16 @@ with Files('**'):
     BUG_COMPONENT = ('Core', 'Layout: Form Controls')
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 
 EXPORTS += [
     'nsIComboboxControlFrame.h',
     'nsIFormControlFrame.h',
-    'nsIListControlFrame.h',
     'nsISelectControlFrame.h',
     'nsITextControlFrame.h',
 ]
 
 UNIFIED_SOURCES += [
     'nsButtonFrameRenderer.cpp',
     'nsCheckboxRadioFrame.cpp',
     'nsColorControlFrame.cpp',
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -13,31 +13,30 @@
 #include "nsCOMPtr.h"
 #include "nsFocusManager.h"
 #include "nsCheckboxRadioFrame.h"
 #include "nsGkAtoms.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsHTMLParts.h"
 #include "nsIFormControl.h"
 #include "nsNameSpaceManager.h"
-#include "nsIListControlFrame.h"
+#include "nsListControlFrame.h"
 #include "nsPIDOMWindow.h"
 #include "nsIPresShell.h"
 #include "mozilla/PresState.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsIContentInlines.h"
 #include "nsIDOMEventListener.h"
 #include "nsISelectControlFrame.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/HTMLSelectElement.h"
 #include "nsIDocument.h"
 #include "nsIScrollableFrame.h"
-#include "nsListControlFrame.h"
 #include "mozilla/ServoStyleSet.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsLayoutUtils.h"
 #include "nsDisplayList.h"
 #include "nsITheme.h"
 #include "nsStyleConsts.h"
 #include "mozilla/Likely.h"
--- a/layout/forms/nsComboboxControlFrame.h
+++ b/layout/forms/nsComboboxControlFrame.h
@@ -27,17 +27,17 @@
 #include "nsIFormControlFrame.h"
 #include "nsIComboboxControlFrame.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsISelectControlFrame.h"
 #include "nsIRollupListener.h"
 #include "nsIStatefulFrame.h"
 #include "nsThreadUtils.h"
 
-class nsIListControlFrame;
+class nsListControlFrame;
 class nsComboboxDisplayFrame;
 class nsIDOMEventListener;
 class nsIScrollableFrame;
 class nsTextNode;
 
 namespace mozilla {
 namespace gfx {
 class DrawTarget;
@@ -286,17 +286,17 @@ private:
 
 protected:
   nsFrameList              mPopupFrames;             // additional named child list
   RefPtr<nsTextNode>       mDisplayContent;          // Anonymous content used to display the current selection
   RefPtr<Element>     mButtonContent;                // Anonymous content for the button
   nsContainerFrame*        mDisplayFrame;            // frame to display selection
   nsIFrame*                mButtonFrame;             // button frame
   nsIFrame*                mDropdownFrame;           // dropdown list frame
-  nsIListControlFrame *    mListControlFrame;        // ListControl Interface for the dropdown frame
+  nsListControlFrame*      mListControlFrame;        // ListControl for the dropdown frame
 
   // The inline size of our display area.  Used by that frame's reflow
   // to size to the full inline size except the drop-marker.
   nscoord mDisplayISize;
 
   nsRevocableEventPtr<RedisplayTextEvent> mRedisplayTextEvent;
 
   int32_t               mRecentSelectedIndex;
deleted file mode 100644
--- a/layout/forms/nsIListControlFrame.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsIListControlFrame_h___
-#define nsIListControlFrame_h___
-
-#include "nsQueryFrame.h"
-#include "nsStringFwd.h"
-
-namespace mozilla {
-namespace dom {
-class HTMLOptionElement;
-} // namespace dom
-} // namespace mozilla
-
-/**
-  * nsIListControlFrame is the interface for frame-based listboxes.
-  */
-class nsIListControlFrame : public nsQueryFrame
-{
-public:
-  NS_DECL_QUERYFRAME_TARGET(nsIListControlFrame)
-
-  /**
-   * Sets the ComboBoxFrame
-   *
-   */
-  virtual void SetComboboxFrame(nsIFrame* aComboboxFrame) = 0;
-
-  /**
-   * Get the display string for an item
-   */
-  virtual void GetOptionText(uint32_t aIndex, nsAString& aStr) = 0;
-
-  /**
-   * Get the Selected Item's index
-   *
-   */
-  virtual int32_t GetSelectedIndex() = 0;
-
-  /**
-   * Return current option. The current option is the option displaying
-   * the focus ring when the listbox is focused.
-   */
-  virtual mozilla::dom::HTMLOptionElement* GetCurrentOption() = 0;
-
-  /**
-   * Initiates mouse capture for the listbox
-   *
-   */
-  virtual void CaptureMouseEvents(bool aGrabMouseEvents) = 0;
-
-  /**
-   * Returns the block size of a single row in the list.  This is the
-   * maximum of the block sizes of all the options/optgroups.
-   */
-  virtual nscoord GetBSizeOfARow() = 0;
-
-  /**
-   * Returns the number of options in the listbox
-   */
-
-  virtual uint32_t GetNumberOfOptions() = 0;
-
-  /**
-   * Called by combobox when it's about to drop down
-   */
-  virtual void AboutToDropDown() = 0;
-
-  /**
-   * Called by combobox when it's about to roll up
-   */
-  virtual void AboutToRollup() = 0;
-
-  /**
-   * Fire on input and on change (used by combobox)
-   */
-  virtual void FireOnInputAndOnChange() = 0;
-
-  /**
-   * Tell the selected list to roll up and ensure that the proper index is
-   * selected, possibly firing onChange if the index has changed
-   *
-   * @param aIndex the index to actually select
-   */
-  virtual void ComboboxFinish(int32_t aIndex) = 0;
-
-  /**
-   * Notification that the content has been reset
-   */
-  virtual void OnContentReset() = 0;
-};
-
-#endif
-
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -262,18 +262,18 @@ nsListControlFrame::InvalidateFocus()
   nsIFrame* containerFrame = GetOptionsContainer();
   if (containerFrame) {
     containerFrame->InvalidateFrame();
   }
 }
 
 NS_QUERYFRAME_HEAD(nsListControlFrame)
   NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
-  NS_QUERYFRAME_ENTRY(nsIListControlFrame)
   NS_QUERYFRAME_ENTRY(nsISelectControlFrame)
+  NS_QUERYFRAME_ENTRY(nsListControlFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsHTMLScrollFrame)
 
 #ifdef ACCESSIBILITY
 a11y::AccType
 nsListControlFrame::AccessibleType()
 {
   return a11y::eHTMLSelectListType;
 }
--- a/layout/forms/nsListControlFrame.h
+++ b/layout/forms/nsListControlFrame.h
@@ -15,17 +15,16 @@
 //#define DO_REFLOW_COUNTER
 //#define DO_UNCONSTRAINED_CHECK
 //#define DO_PIXELS
 #endif
 
 #include "mozilla/Attributes.h"
 #include "nsGfxScrollFrame.h"
 #include "nsIFormControlFrame.h"
-#include "nsIListControlFrame.h"
 #include "nsISelectControlFrame.h"
 #include "nsSelectsAreaFrame.h"
 
 // X.h defines KeyPress
 #ifdef KeyPress
 #undef KeyPress
 #endif
 
@@ -42,17 +41,16 @@ class HTMLOptionsCollection;
 } // namespace mozilla
 
 /**
  * Frame-based listbox.
  */
 
 class nsListControlFrame final : public nsHTMLScrollFrame,
                                  public nsIFormControlFrame,
-                                 public nsIListControlFrame,
                                  public nsISelectControlFrame
 {
 public:
   typedef mozilla::dom::HTMLOptionElement HTMLOptionElement;
 
   friend nsContainerFrame* NS_NewListControlFrame(nsIPresShell* aPresShell,
                                                   ComputedStyle* aStyle);
 
@@ -105,50 +103,49 @@ public:
   virtual mozilla::ScrollStyles GetScrollStyles() const override;
   virtual bool ShouldPropagateComputedBSizeToScrolledContent() const override;
 
     // for accessibility purposes
 #ifdef ACCESSIBILITY
   virtual mozilla::a11y::AccType AccessibleType() override;
 #endif
 
-    // nsIListControlFrame
-  virtual void SetComboboxFrame(nsIFrame* aComboboxFrame) override;
-  virtual int32_t GetSelectedIndex() override;
-  virtual HTMLOptionElement* GetCurrentOption() override;
+  void SetComboboxFrame(nsIFrame* aComboboxFrame);
+  int32_t GetSelectedIndex();
+  HTMLOptionElement* GetCurrentOption();
 
   /**
    * Gets the text of the currently selected item.
    * If the there are zero items then an empty string is returned
    * If there is nothing selected, then the 0th item's text is returned.
    */
-  virtual void GetOptionText(uint32_t aIndex, nsAString& aStr) override;
+  void GetOptionText(uint32_t aIndex, nsAString& aStr);
 
-  virtual void CaptureMouseEvents(bool aGrabMouseEvents) override;
-  virtual nscoord GetBSizeOfARow() override;
-  virtual uint32_t GetNumberOfOptions() override;
-  virtual void AboutToDropDown() override;
+  void CaptureMouseEvents(bool aGrabMouseEvents);
+  nscoord GetBSizeOfARow();
+  uint32_t GetNumberOfOptions();
+  void AboutToDropDown();
 
   /**
    * @note This method might destroy the frame, pres shell and other objects.
    */
-  virtual void AboutToRollup() override;
+  void AboutToRollup();
 
   /**
    * Dispatch a DOM oninput and onchange event synchroniously.
    * @note This method might destroy the frame, pres shell and other objects.
    */
-  virtual void FireOnInputAndOnChange() override;
+  void FireOnInputAndOnChange();
 
   /**
    * Makes aIndex the selected option of a combobox list.
    * @note This method might destroy the frame, pres shell and other objects.
    */
-  virtual void ComboboxFinish(int32_t aIndex) override;
-  virtual void OnContentReset() override;
+  void ComboboxFinish(int32_t aIndex);
+  void OnContentReset();
 
   // nsISelectControlFrame
   NS_IMETHOD AddOption(int32_t index) override;
   NS_IMETHOD RemoveOption(int32_t index) override;
   NS_IMETHOD DoneAddingChildren(bool aIsDone) override;
 
   /**
    * Gets the content (an option) by index and then set it as