зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1437873 - Move XBL accessibility role="xul:toolbarbutton" and role="xul:button" into XULMap.h r=enndeakin+6102
This patch intentionally re-map the following controls from button to toolbarbutton - browser/components/downloads/content/download.xml#download-subview-toolbarbutton - toolkit/content/widgets/toolbarbutton.xml#menu-button MozReview-Commit-ID: E806LA6NAvC --HG-- extra : rebase_source : 8e7534dc34f95e1d0cc6d00370475cc796acc36e
This commit is contained in:
Родитель
59c932e340
Коммит
0b070afeaf
|
@ -3,6 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
XULMAP_TYPE(browser, OuterDocAccessible)
|
||||
XULMAP_TYPE(button, XULButtonAccessible)
|
||||
XULMAP_TYPE(checkbox, XULCheckboxAccessible)
|
||||
XULMAP_TYPE(dropMarker, XULDropmarkerAccessible)
|
||||
XULMAP_TYPE(editor, OuterDocAccessible)
|
||||
|
@ -37,6 +38,7 @@ XULMAP_TYPE(treecol, XULColumnItemAccessible)
|
|||
XULMAP_TYPE(treecolpicker, XULButtonAccessible)
|
||||
XULMAP_TYPE(treecols, XULTreeColumAccessible)
|
||||
XULMAP_TYPE(toolbar, XULToolbarAccessible)
|
||||
XULMAP_TYPE(toolbarbutton, XULToolbarButtonAccessible)
|
||||
XULMAP_TYPE(tooltip, XULTooltipAccessible)
|
||||
|
||||
XULMAP(
|
||||
|
|
|
@ -1478,10 +1478,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
|||
RefPtr<Accessible> accessible;
|
||||
#ifdef MOZ_XUL
|
||||
// XUL controls
|
||||
if (role.EqualsLiteral("xul:button")) {
|
||||
accessible = new XULButtonAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:colorpicker")) {
|
||||
if (role.EqualsLiteral("xul:colorpicker")) {
|
||||
accessible = new XULColorPickerAccessible(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:colorpickertile")) {
|
||||
|
@ -1511,9 +1508,6 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
|
|||
} else if (role.EqualsLiteral("xul:textbox")) {
|
||||
accessible = new EnumRoleAccessible<roles::SECTION>(aContent, aDoc);
|
||||
|
||||
} else if (role.EqualsLiteral("xul:toolbarbutton")) {
|
||||
accessible = new XULToolbarButtonAccessible(aContent, aDoc);
|
||||
|
||||
}
|
||||
#endif // MOZ_XUL
|
||||
|
||||
|
|
|
@ -169,21 +169,16 @@ XULButtonAccessible::IsAcceptableChild(nsIContent* aEl) const
|
|||
// buttons can have button (@type="menu-button") and popup accessibles
|
||||
// (@type="menu-button", @type="menu" or columnpicker.
|
||||
|
||||
// XXX: no children until the button is menu button. Probably it's not
|
||||
// totally correct but in general AT wants to have leaf buttons.
|
||||
nsAutoString role;
|
||||
nsCoreUtils::XBLBindingRole(aEl, role);
|
||||
|
||||
// Get an accessible for menupopup or popup elements.
|
||||
if (aEl->IsXULElement(nsGkAtoms::menupopup) ||
|
||||
aEl->IsXULElement(nsGkAtoms::popup)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Button type="menu-button" contains a real button. Get an accessible
|
||||
// Button and toolbarbutton are real buttons. Get an accessible
|
||||
// for it. Ignore dropmarker button which is placed as a last child.
|
||||
if ((!role.EqualsLiteral("xul:button") &&
|
||||
!role.EqualsLiteral("xul:toolbarbutton")) ||
|
||||
if ((!aEl->IsXULElement(nsGkAtoms::button) &&
|
||||
!aEl->IsXULElement(nsGkAtoms::toolbarbutton)) ||
|
||||
aEl->IsXULElement(nsGkAtoms::dropMarker)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||
|
||||
<binding id="button-base" extends="chrome://global/content/bindings/general.xml#basetext" role="xul:button">
|
||||
<binding id="button-base" extends="chrome://global/content/bindings/general.xml#basetext">
|
||||
<implementation implements="nsIDOMXULButtonElement">
|
||||
<property name="type"
|
||||
onget="return this.getAttribute('type');"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||
|
||||
<binding id="toolbarbutton" display="xul:button" role="xul:toolbarbutton"
|
||||
<binding id="toolbarbutton" display="xul:button"
|
||||
extends="chrome://global/content/bindings/button.xml#button-base">
|
||||
<resources>
|
||||
<stylesheet src="chrome://global/skin/toolbarbutton.css"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче