Bug 1422465 - Remove the nsIDOMXULPopupElement interface and [implements] attribute on the "popup-base" and "panel" bindings;r=surkov,r=bz draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Thu, 07 Dec 2017 13:37:06 -0800
changeset 709273 f2c75902b897ecdd8704743b95b99b57f55979d0
parent 709272 671b718fd010b5f6a2036a695d2c4c03c8b64654
child 743375 02354b92792415bf3c9f7b4e80be372ecb6ea9a2
push id92593
push userbgrinstead@mozilla.com
push dateThu, 07 Dec 2017 21:37:17 +0000
reviewerssurkov, bz
bugs1422465
milestone59.0a1
Bug 1422465 - Remove the nsIDOMXULPopupElement interface and [implements] attribute on the "popup-base" and "panel" bindings;r=surkov,r=bz MozReview-Commit-ID: EvzuohEgFSh
accessible/generic/DocAccessible.cpp
accessible/xul/XULListboxAccessible.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoID.h
dom/interfaces/xul/moz.build
dom/interfaces/xul/nsIDOMXULPopupElement.idl
dom/tests/mochitest/general/test_interfaces.js
toolkit/content/widgets/popup.xml
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -24,17 +24,16 @@
 #include "nsIDocShell.h"
 #include "nsIDocument.h"
 #include "nsIDOMAttr.h"
 #include "nsIDOMCharacterData.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMXULDocument.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsPIDOMWindow.h"
-#include "nsIDOMXULPopupElement.h"
 #include "nsIEditingSession.h"
 #include "nsIFrame.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsImageFrame.h"
 #include "nsIPersistentProperties2.h"
 #include "nsIPresShell.h"
 #include "nsIServiceManager.h"
 #include "nsViewManager.h"
--- a/accessible/xul/XULListboxAccessible.cpp
+++ b/accessible/xul/XULListboxAccessible.cpp
@@ -13,17 +13,16 @@
 #include "States.h"
 
 #include "nsComponentManagerUtils.h"
 #include "nsIAutoCompleteInput.h"
 #include "nsIAutoCompletePopup.h"
 #include "nsIDOMXULMenuListElement.h"
 #include "nsIDOMXULMultSelectCntrlEl.h"
 #include "nsIDOMNodeList.h"
-#include "nsIDOMXULPopupElement.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
 #include "nsIMutableArray.h"
 #include "nsIPersistentProperties2.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULColumAccessible
@@ -152,19 +151,17 @@ XULListboxAccessible::Value(nsString& aV
   }
 }
 
 role
 XULListboxAccessible::NativeRole()
 {
   // A richlistbox is used with the new autocomplete URL bar, and has a parent
   // popup <panel>.
-  nsCOMPtr<nsIDOMXULPopupElement> xulPopup =
-    do_QueryInterface(mContent->GetParent());
-  if (xulPopup)
+  if (mContent->GetParent()->IsXULElement(nsGkAtoms::panel))
     return roles::COMBOBOX_LIST;
 
   return IsMulticolumn() ? roles::TABLE : roles::LISTBOX;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULListboxAccessible: Table
 
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -58,17 +58,16 @@
 #include "nsIDOMWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMConstructor.h"
 
 // DOM core includes
 #include "nsError.h"
 #include "nsIDOMXULButtonElement.h"
 #include "nsIDOMXULCheckboxElement.h"
-#include "nsIDOMXULPopupElement.h"
 
 // Event related includes
 #include "nsIDOMEventTarget.h"
 
 // CSS related includes
 #include "nsIDOMCSSRule.h"
 #include "nsMemory.h"
 
@@ -189,18 +188,16 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULControlElement, nsDOMGenericSH,
                                       DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULLabeledControlElement, nsDOMGenericSH,
                                       DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULButtonElement, nsDOMGenericSH,
                                       DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULCheckboxElement, nsDOMGenericSH,
                                       DOM_DEFAULT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULPopupElement, nsDOMGenericSH,
-                                      DOM_DEFAULT_SCRIPTABLE_FLAGS)
 };
 
 nsIXPConnect *nsDOMClassInfo::sXPConnect = nullptr;
 bool nsDOMClassInfo::sIsInitialized = false;
 
 
 jsid nsDOMClassInfo::sConstructor_id     = JSID_VOID;
 jsid nsDOMClassInfo::sWrappedJSObject_id = JSID_VOID;
@@ -470,20 +467,16 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULButtonElement, nsIDOMXULButtonElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULButtonElement)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULCheckboxElement, nsIDOMXULCheckboxElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULCheckboxElement)
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULPopupElement, nsIDOMXULPopupElement)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULPopupElement)
-  DOM_CLASSINFO_MAP_END
-
   static_assert(MOZ_ARRAY_LENGTH(sClassInfoData) == eDOMClassInfoIDCount,
                 "The number of items in sClassInfoData doesn't match the "
                 "number of nsIDOMClassInfo ID's, this is bad! Fix it!");
 
 #ifdef DEBUG
   for (size_t i = 0; i < eDOMClassInfoIDCount; i++) {
     if (!sClassInfoData[i].mConstructorFptr ||
         sClassInfoData[i].mDebugID != i) {
--- a/dom/base/nsDOMClassInfoID.h
+++ b/dom/base/nsDOMClassInfoID.h
@@ -23,17 +23,16 @@ enum nsDOMClassInfoID
   eDOMClassInfo_ContentProcessMessageManager_id,
   eDOMClassInfo_ChromeMessageBroadcaster_id,
   eDOMClassInfo_ChromeMessageSender_id,
 
   eDOMClassInfo_XULControlElement_id,
   eDOMClassInfo_XULLabeledControlElement_id,
   eDOMClassInfo_XULButtonElement_id,
   eDOMClassInfo_XULCheckboxElement_id,
-  eDOMClassInfo_XULPopupElement_id,
 
   // This one better be the last one in this list
   eDOMClassInfoIDCount
 };
 
 /**
  * nsIClassInfo helper macros
  */
--- a/dom/interfaces/xul/moz.build
+++ b/dom/interfaces/xul/moz.build
@@ -16,17 +16,16 @@ XPIDL_SOURCES += [
     'nsIDOMXULControlElement.idl',
     'nsIDOMXULDescriptionElement.idl',
     'nsIDOMXULDocument.idl',
     'nsIDOMXULElement.idl',
     'nsIDOMXULLabeledControlEl.idl',
     'nsIDOMXULLabelElement.idl',
     'nsIDOMXULMenuListElement.idl',
     'nsIDOMXULMultSelectCntrlEl.idl',
-    'nsIDOMXULPopupElement.idl',
     'nsIDOMXULRelatedElement.idl',
     'nsIDOMXULSelectCntrlEl.idl',
     'nsIDOMXULSelectCntrlItemEl.idl',
     'nsIDOMXULTextboxElement.idl',
     'nsIDOMXULTreeElement.idl',
 ]
 
 XPIDL_MODULE = 'dom_xul'
deleted file mode 100644
--- a/dom/interfaces/xul/nsIDOMXULPopupElement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "nsIDOMElement.idl"
-#include "nsIDOMXULElement.idl"
-
-[scriptable, uuid(cb7eaa79-45d5-4ea3-ae17-b65fdcfe5e30)]
-interface nsIDOMXULPopupElement : nsISupports {
-  const unsigned short      BEFORE_START                   = 1;
-  const unsigned short      BEFORE_END                     = 2;
-  const unsigned short      AFTER_START                    = 3;
-  const unsigned short      AFTER_END                      = 4;
-  const unsigned short      START_BEFORE                   = 5;
-  const unsigned short      START_AFTER                    = 6;
-  const unsigned short      END_BEFORE                     = 7;
-  const unsigned short      END_AFTER                      = 8;
-  const unsigned short      OVERLAP                        = 9;
-  const unsigned short      AT_POINTER                     = 10;
-  const unsigned short      AFTER_POINTER                  = 11;
-
-  attribute DOMString position;
-  
-  void showPopup(in unsigned short alignment, 
-                 in nsIDOMElement target,
-                 in nsIDOMElement anchor);
-  void hidePopup();
-};
-
--- a/dom/tests/mochitest/general/test_interfaces.js
+++ b/dom/tests/mochitest/general/test_interfaces.js
@@ -1274,18 +1274,16 @@ var interfaceNamesInGlobalScope =
     {name: "XULControlElement", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "XULDocument", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "XULElement", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "XULLabeledControlElement", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    {name: "XULPopupElement", xbl: true},
-// IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "XULTemplateBuilder", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "XULTreeBuilder", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "XULTreeBuilderObserver", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
   ];
 // IMPORTANT: Do not change the list above without review from a DOM peer!
--- a/toolkit/content/widgets/popup.xml
+++ b/toolkit/content/widgets/popup.xml
@@ -11,17 +11,17 @@
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="popup-base">
     <resources>
       <stylesheet src="chrome://global/skin/popup.css"/>
     </resources>
 
-    <implementation implements="nsIDOMXULPopupElement">
+    <implementation>
       <property name="label" onget="return this.getAttribute('label');"
                              onset="this.setAttribute('label', val); return val;"/>
       <property name="position" onget="return this.getAttribute('position');"
                                 onset="this.setAttribute('position', val); return val;"/>
       <property name="popupBoxObject">
         <getter>
           return this.boxObject;
         </getter>
@@ -286,17 +286,17 @@
             array[i].width = width;
         ]]>
       </handler>
     </handlers>
   </binding>
 
   <binding id="panel" role="xul:panel"
            extends="chrome://global/content/bindings/popup.xml#popup-base">
-    <implementation implements="nsIDOMXULPopupElement">
+    <implementation>
       <field name="_prevFocus">0</field>
       <field name="_dragBindingAlive">true</field>
       <constructor>
       <![CDATA[
         if (this.getAttribute("backdrag") == "true" && !this._draggableStarted) {
           this._draggableStarted = true;
           try {
             let tmp = {};