Bug 1416493 - Remove the menuseparator XBL binding;r=Gijs
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 22 Nov 2017 13:47:09 -0800
changeset 437829 5f57907f645bf30a72e0dd0a7013054fe328a3ce
parent 437828 87368e9f8bada46d65cd3d78984ad14e152a5e60
child 437830 cb9898849653827705e19a56afc59e1146fb48a4
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersGijs
bugs1416493
milestone59.0a1
Bug 1416493 - Remove the menuseparator XBL binding;r=Gijs Key accessibility off of the tag name instead of the role attribute and load styles in global.css instead of <resources> MozReview-Commit-ID: Epv0rHHzbz0
accessible/base/XULMap.h
accessible/base/nsAccessibilityService.cpp
layout/reftests/xul/menuitem-key-ref.xul
layout/reftests/xul/menuitem-key.xul
layout/reftests/xul/menulist-shrinkwrap-1-ref.xul
layout/reftests/xul/menulist-shrinkwrap-1.xul
layout/reftests/xul/menulist-shrinkwrap-2-ref.xul
layout/reftests/xul/menulist-shrinkwrap-2.xul
toolkit/content/widgets/menu.xml
toolkit/content/xul.css
toolkit/themes/linux/global/global.css
toolkit/themes/osx/global/global.css
toolkit/themes/windows/global/global.css
--- a/accessible/base/XULMap.h
+++ b/accessible/base/XULMap.h
@@ -1,5 +1,6 @@
 /* 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/. */
 
 XULMAP(image, New_MaybeImageOrToolbarButtonAccessible)
+XULMAP(menuseparator, New_MenuSeparator)
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -270,16 +270,21 @@ New_MaybeImageOrToolbarButtonAccessible(
 
   // Don't include nameless images in accessible tree.
   if (!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext)) {
     return nullptr;
   }
 
   return new ImageAccessibleWrap(aContent, aContext->Document());
 }
+
+static Accessible*
+New_MenuSeparator(nsIContent* aContent, Accessible* aContext)
+  { return new XULMenuSeparatorAccessible(aContent, aContext->Document()); }
+
 #endif
 
 /**
  * Cached value of the PREF_ACCESSIBILITY_FORCE_DISABLED preference.
  */
 static int32_t sPlatformDisabledState = 0;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -1530,19 +1535,16 @@ nsAccessibilityService::CreateAccessible
     // then strip out redundant accessibles in the AccessibleWrap class for each platform.
     nsIContent *parent = aContent->GetParent();
     if (parent && parent->IsXULElement(nsGkAtoms::menu))
       return nullptr;
 #endif
 
     accessible = new XULMenupopupAccessible(aContent, aDoc);
 
-  } else if(role.EqualsLiteral("xul:menuseparator")) {
-    accessible = new XULMenuSeparatorAccessible(aContent, aDoc);
-
   } else if(role.EqualsLiteral("xul:pane")) {
     accessible = new EnumRoleAccessible<roles::PANE>(aContent, aDoc);
 
   } else if (role.EqualsLiteral("xul:panel")) {
     if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::noautofocus,
                               nsGkAtoms::_true, eCaseMatters))
       accessible = new XULAlertAccessible(aContent, aDoc);
     else
--- a/layout/reftests/xul/menuitem-key-ref.xul
+++ b/layout/reftests/xul/menuitem-key-ref.xul
@@ -1,9 +1,10 @@
 <?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 <menuitem id="m1" label="Menu1" key="keytwo"/>
 <menuitem id="m2" label="Menu2"/>
 <menuitem id="m3" label="Menu3" key="keythree"/>
 <menuitem id="m4" label="Menu4" acceltext="Text"/>
 <menuitem id="m5" label="Menu5" acceltext="Text"/>
 <menuitem id="m6" label="Menu6" acceltext="Text"/>
--- a/layout/reftests/xul/menuitem-key.xul
+++ b/layout/reftests/xul/menuitem-key.xul
@@ -1,9 +1,10 @@
 <?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <window class="reftest-wait" onload="changeKeys()"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 <menuitem id="m1" label="Menu1" key="keyone"/>
 <menuitem id="m2" label="Menu2" key="keytwo"/>
 <menuitem id="m3" label="Menu3"/>
 <menuitem id="m4" label="Menu4"/>
 <menuitem id="m5" label="Menu5"/>
--- a/layout/reftests/xul/menulist-shrinkwrap-1-ref.xul
+++ b/layout/reftests/xul/menulist-shrinkwrap-1-ref.xul
@@ -1,9 +1,10 @@
 <?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" align="left">
   <menulist style="color: transparent">
     <menupopup>
       <menuitem value="1" label="short" />
       <menuitem value="2" label="long item" />
     </menupopup>
   </menulist>
 </window>
--- a/layout/reftests/xul/menulist-shrinkwrap-1.xul
+++ b/layout/reftests/xul/menulist-shrinkwrap-1.xul
@@ -1,9 +1,10 @@
 <?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" align="left">
   <menulist style="color: transparent">
     <menupopup>
       <menuitem value="1" label="long item" />
       <menuitem value="2" label="short" />
     </menupopup>
   </menulist>
 </window>
--- a/layout/reftests/xul/menulist-shrinkwrap-2-ref.xul
+++ b/layout/reftests/xul/menulist-shrinkwrap-2-ref.xul
@@ -1,9 +1,10 @@
 <?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <style xmlns="http://www.w3.org/1999/xhtml">
     <![CDATA[
       menulist, menuitem, label { font: Menu }
       #measurelabel { color: transparent }
     ]]>
   </style>
   <stack>
--- a/layout/reftests/xul/menulist-shrinkwrap-2.xul
+++ b/layout/reftests/xul/menulist-shrinkwrap-2.xul
@@ -1,9 +1,10 @@
 <?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <style xmlns="http://www.w3.org/1999/xhtml">
     <![CDATA[
       menulist, menuitem, label { font: Menu }
       #measurelabel { color: transparent }
     ]]>
   </style>
   <stack>
--- a/toolkit/content/widgets/menu.xml
+++ b/toolkit/content/widgets/menu.xml
@@ -6,19 +6,16 @@
 
 <bindings id="menuitemBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="menuitem-base" role="xul:menuitem"
            extends="chrome://global/content/bindings/general.xml#basetext">
-    <resources>
-      <stylesheet src="chrome://global/skin/menu.css"/>
-    </resources>
     <implementation implements="nsIDOMXULSelectControlItemElement, nsIDOMXULContainerItemElement">
       <property name="value" onset="this.setAttribute('value', val); return val;"
                              onget="return this.getAttribute('value');"/>
       <!-- nsIDOMXULSelectControlItemElement -->
       <property name="selected" readonly="true"
                 onget="return this.getAttribute('selected') == 'true';"/>
       <property name="control" readonly="true">
         <getter>
@@ -273,14 +270,9 @@
   </binding>
 
   <binding id="menubutton-item" extends="chrome://global/content/bindings/menu.xml#menuitem-base">
     <content>
       <xul:label class="menubutton-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
       <children includes="menupopup"/>
     </content>
   </binding>
-
-  <binding id="menuseparator" role="xul:menuseparator"
-           extends="chrome://global/content/bindings/menu.xml#menuitem-base">
-  </binding>
-
 </bindings>
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -390,22 +390,16 @@ menuitem.menuitem-non-iconic {
 menucaption {
   -moz-binding: url("chrome://global/content/bindings/menu.xml#menucaption");
 }
 
 .menu-text {
   -moz-box-flex: 1;
 }
 
-/********* menuseparator ***********/
-
-menuseparator {
-  -moz-binding: url("chrome://global/content/bindings/menu.xml#menuseparator");
-}
-
 /********* popup & menupopup ***********/
 
 /* <popup> is deprecated.  Only <menupopup> and <tooltip> are still valid. */
 
 popup,
 menupopup {
   -moz-binding: url("chrome://global/content/bindings/popup.xml#popup");
   -moz-box-orient: vertical;
--- a/toolkit/themes/linux/global/global.css
+++ b/toolkit/themes/linux/global/global.css
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* ===== global.css =====================================================
   == Styles that apply everywhere.
   ======================================================================= */
 
 /* all localizable skin settings shall live here */
 @import url("chrome://global/locale/intl.css");
+@import url("chrome://global/skin/menu.css");
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
 /* ::::: XBL bindings ::::: */
 
 menulist > menupopup {
   -moz-binding: url("chrome://global/content/bindings/popup.xml#popup-scrollbars");
 }
--- a/toolkit/themes/osx/global/global.css
+++ b/toolkit/themes/osx/global/global.css
@@ -1,14 +1,15 @@
 /* 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/. */
 
 /* all localizable skin settings shall live here */
 @import url("chrome://global/locale/intl.css");
+@import url("chrome://global/skin/menu.css");
 
 %include shared.inc
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
 /* ::::: XBL bindings ::::: */
 
 menulist > menupopup {
   -moz-binding: url("chrome://global/content/bindings/popup.xml#popup-scrollbars");
--- a/toolkit/themes/windows/global/global.css
+++ b/toolkit/themes/windows/global/global.css
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* ===== global.css =====================================================
   == Styles that apply everywhere.
   ======================================================================= */
 
 /* all localizable skin settings shall live here */
 @import url("chrome://global/locale/intl.css");
+@import url("chrome://global/skin/menu.css");
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
 /* ::::: XBL bindings ::::: */
 
 menulist > menupopup {
   -moz-binding: url("chrome://global/content/bindings/popup.xml#popup-scrollbars");
 }