Bug 1585482 - Remove C++ special-casing of top-level <dialog> elements r=Jamie
authorKirk Steuber <ksteuber@mozilla.com>
Tue, 10 Dec 2019 18:10:45 +0000
changeset 506295 9ed1b123250d4c9f616532a80f54b00099cf34b6
parent 506294 db3709c80ad1540170537a0a986642038ffad410
child 506296 e183cbb4983cfb3aecf97ab18fad916b91f89e7e
push id36902
push useraciure@mozilla.com
push dateWed, 11 Dec 2019 03:34:51 +0000
treeherdermozilla-central@7635669b8d72 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJamie
bugs1585482
milestone73.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 1585482 - Remove C++ special-casing of top-level <dialog> elements r=Jamie Differential Revision: https://phabricator.services.mozilla.com/D53721
accessible/generic/RootAccessible.cpp
accessible/generic/RootAccessible.h
layout/xul/nsBoxFrame.cpp
--- a/accessible/generic/RootAccessible.cpp
+++ b/accessible/generic/RootAccessible.cpp
@@ -75,26 +75,16 @@ ENameValueFlag RootAccessible::Name(nsSt
     Accessible::Name(aName);
     if (!aName.IsEmpty()) return eNameOK;
   }
 
   mDocumentNode->GetTitle(aName);
   return eNameOK;
 }
 
-role RootAccessible::NativeRole() const {
-  // If it's a <dialog>, use roles::DIALOG instead
-  dom::Element* rootElm = mDocumentNode->GetRootElement();
-  if (rootElm && rootElm->IsXULElement(nsGkAtoms::dialog)) {
-    return roles::DIALOG;
-  }
-
-  return DocAccessibleWrap::NativeRole();
-}
-
 // RootAccessible protected member
 #ifdef MOZ_XUL
 uint32_t RootAccessible::GetChromeFlags() const {
   // Return the flag set for the top level window as defined
   // by nsIWebBrowserChrome::CHROME_WINDOW_[FLAGNAME]
   // Not simple: nsIAppWindow is not just a QI from nsIDOMWindow
   nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(mDocumentNode);
   NS_ENSURE_TRUE(docShell, 0);
--- a/accessible/generic/RootAccessible.h
+++ b/accessible/generic/RootAccessible.h
@@ -25,17 +25,16 @@ class RootAccessible : public DocAccessi
 
   // nsIDOMEventListener
   NS_DECL_NSIDOMEVENTLISTENER
 
   // Accessible
   virtual void Shutdown() override;
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) const override;
   virtual Relation RelationByType(RelationType aType) const override;
-  virtual mozilla::a11y::role NativeRole() const override;
   virtual uint64_t NativeState() const override;
 
   // RootAccessible
 
   /**
    * Notify that the sub document presshell was activated.
    */
   virtual void DocumentActivated(DocAccessible* aDocument);
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -819,17 +819,17 @@ nsContainerFrame* nsBoxFrame::GetContent
 
 nsresult nsBoxFrame::AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
                                       int32_t aModType) {
   nsresult rv =
       nsContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
 
   // Ignore 'width', 'height', 'screenX', 'screenY' and 'sizemode' on a
   // <window>.
-  if (mContent->IsAnyOfXULElements(nsGkAtoms::window, nsGkAtoms::dialog) &&
+  if (mContent->IsXULElement(nsGkAtoms::window) &&
       (nsGkAtoms::width == aAttribute || nsGkAtoms::height == aAttribute ||
        nsGkAtoms::screenX == aAttribute || nsGkAtoms::screenY == aAttribute ||
        nsGkAtoms::sizemode == aAttribute)) {
     return rv;
   }
 
   if (aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height ||
       aAttribute == nsGkAtoms::align || aAttribute == nsGkAtoms::valign ||