mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Backed out 1 changesets (bug 1675292) for causing failures in browser_roles_elements. CLOSED TREE DONTBUILD
Backed out changeset f4cdad3fae02 (bug 1675292)
This commit is contained in:
parent
6ac3c7496b
commit
17d3157e82
@ -72,25 +72,13 @@ void AccessibleWrap::GetNativeInterface(void** aOutInterface) {
|
|||||||
Class AccessibleWrap::GetNativeType() {
|
Class AccessibleWrap::GetNativeType() {
|
||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||||
|
|
||||||
if (IsXULTabpanels()) {
|
if (IsXULTabpanels()) return [mozPaneAccessible class];
|
||||||
return [mozPaneAccessible class];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsTable()) {
|
if (IsTable()) return [mozTableAccessible class];
|
||||||
return [mozTableAccessible class];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsTableRow()) {
|
if (IsTableRow()) return [mozTableRowAccessible class];
|
||||||
return [mozTableRowAccessible class];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsTableCell()) {
|
if (IsTableCell()) return [mozTableCellAccessible class];
|
||||||
return [mozTableCellAccessible class];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsDoc()) {
|
|
||||||
return [MOXWebAreaAccessible class];
|
|
||||||
}
|
|
||||||
|
|
||||||
return GetTypeFromRole(Role());
|
return GetTypeFromRole(Role());
|
||||||
|
|
||||||
@ -244,6 +232,9 @@ Class a11y::GetTypeFromRole(roles::Role aRole) {
|
|||||||
case roles::COMBOBOX:
|
case roles::COMBOBOX:
|
||||||
return [mozPopupButtonAccessible class];
|
return [mozPopupButtonAccessible class];
|
||||||
|
|
||||||
|
case roles::DOCUMENT:
|
||||||
|
return [MOXWebAreaAccessible class];
|
||||||
|
|
||||||
case roles::PUSHBUTTON:
|
case roles::PUSHBUTTON:
|
||||||
return [mozButtonAccessible class];
|
return [mozButtonAccessible class];
|
||||||
|
|
||||||
|
@ -14,12 +14,6 @@ using namespace mozilla::a11y;
|
|||||||
@interface MOXWebAreaAccessible : mozAccessible {
|
@interface MOXWebAreaAccessible : mozAccessible {
|
||||||
MOXRootGroup* mRootGroup;
|
MOXRootGroup* mRootGroup;
|
||||||
}
|
}
|
||||||
// overrides
|
|
||||||
- (NSString*)moxRole;
|
|
||||||
|
|
||||||
// overrides
|
|
||||||
- (NSString*)moxRoleDescription;
|
|
||||||
|
|
||||||
// overrides
|
// overrides
|
||||||
- (NSURL*)moxURL;
|
- (NSURL*)moxURL;
|
||||||
|
|
||||||
@ -35,9 +29,6 @@ using namespace mozilla::a11y;
|
|||||||
// override
|
// override
|
||||||
- (NSArray*)moxUnignoredChildren;
|
- (NSArray*)moxUnignoredChildren;
|
||||||
|
|
||||||
// override
|
|
||||||
- (BOOL)moxBlockSelector:(SEL)selector;
|
|
||||||
|
|
||||||
// override
|
// override
|
||||||
- (void)handleAccessibleEvent:(uint32_t)eventType;
|
- (void)handleAccessibleEvent:(uint32_t)eventType;
|
||||||
|
|
||||||
@ -72,9 +63,6 @@ using namespace mozilla::a11y;
|
|||||||
// override
|
// override
|
||||||
- (NSString*)moxIdentifier;
|
- (NSString*)moxIdentifier;
|
||||||
|
|
||||||
// override
|
|
||||||
- (NSString*)moxSubrole;
|
|
||||||
|
|
||||||
// override
|
// override
|
||||||
- (id)moxHitTest:(NSPoint)point;
|
- (id)moxHitTest:(NSPoint)point;
|
||||||
|
|
||||||
|
@ -27,10 +27,6 @@ using namespace mozilla::a11y;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*)moxRoleDescription {
|
- (NSString*)moxRoleDescription {
|
||||||
if ([[self moxSubrole] isEqualToString:@"AXLandmarkApplication"]) {
|
|
||||||
return utils::LocalizedString(u"application"_ns);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NSAccessibilityRoleDescription(NSAccessibilityGroupRole, nil);
|
return NSAccessibilityRoleDescription(NSAccessibilityGroupRole, nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,11 +45,6 @@ using namespace mozilla::a11y;
|
|||||||
return @"root-group";
|
return @"root-group";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*)moxSubrole {
|
|
||||||
// Steal the subrole internally mapped to the web area.
|
|
||||||
return [mParent moxSubrole];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)moxHitTest:(NSPoint)point {
|
- (id)moxHitTest:(NSPoint)point {
|
||||||
return [mParent moxHitTest:point];
|
return [mParent moxHitTest:point];
|
||||||
}
|
}
|
||||||
@ -99,20 +90,6 @@ using namespace mozilla::a11y;
|
|||||||
|
|
||||||
@implementation MOXWebAreaAccessible
|
@implementation MOXWebAreaAccessible
|
||||||
|
|
||||||
- (NSString*)moxRole {
|
|
||||||
// The OS role is AXWebArea regardless of the gecko role
|
|
||||||
// (APPLICATION or DOCUMENT).
|
|
||||||
// If the web area has a role of APPLICATION, its root group will
|
|
||||||
// reflect that in a subrole/description.
|
|
||||||
return @"AXWebArea";
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString*)moxRoleDescription {
|
|
||||||
// The role description is "HTML Content" regardless of the gecko role
|
|
||||||
// (APPLICATION or DOCUMENT)
|
|
||||||
return utils::LocalizedString(u"htmlContent"_ns);
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSURL*)moxURL {
|
- (NSURL*)moxURL {
|
||||||
if ([self isExpired]) {
|
if ([self isExpired]) {
|
||||||
return nil;
|
return nil;
|
||||||
@ -217,23 +194,12 @@ using namespace mozilla::a11y;
|
|||||||
return [super moxUnignoredChildren];
|
return [super moxUnignoredChildren];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)moxBlockSelector:(SEL)selector {
|
|
||||||
if (selector == @selector(moxSubrole)) {
|
|
||||||
// Never expose a subrole for a web area.
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [super moxBlockSelector:selector];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)rootGroup {
|
- (id)rootGroup {
|
||||||
NSArray* children = [super moxUnignoredChildren];
|
NSArray* children = [super moxUnignoredChildren];
|
||||||
if (mRole != roles::APPLICATION && [children count] == 1 &&
|
if ([children count] == 1 &&
|
||||||
[[[children firstObject] moxUnignoredChildren] count] != 0) {
|
[[[children firstObject] moxUnignoredChildren] count] != 0) {
|
||||||
// We only need a root group if our document:
|
// We only need a root group if our document has multiple children or one
|
||||||
// (1) has multiple children, or
|
// child that is a leaf.
|
||||||
// (2) a one child that is a leaf, or
|
|
||||||
// (3) has a role of APPLICATION
|
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#include "AccessibleOrProxy.h"
|
#include "AccessibleOrProxy.h"
|
||||||
#include "DocAccessibleParent.h"
|
#include "DocAccessibleParent.h"
|
||||||
#include "mozTableAccessible.h"
|
#include "mozTableAccessible.h"
|
||||||
#include "MOXWebAreaAccessible.h"
|
|
||||||
|
|
||||||
#include "nsAppShell.h"
|
#include "nsAppShell.h"
|
||||||
|
|
||||||
@ -55,8 +54,6 @@ void ProxyCreated(ProxyAccessible* aProxy, uint32_t) {
|
|||||||
type = [mozTableRowAccessible class];
|
type = [mozTableRowAccessible class];
|
||||||
} else if (aProxy->IsTableCell()) {
|
} else if (aProxy->IsTableCell()) {
|
||||||
type = [mozTableCellAccessible class];
|
type = [mozTableCellAccessible class];
|
||||||
} else if (aProxy->IsDoc()) {
|
|
||||||
type = [MOXWebAreaAccessible class];
|
|
||||||
} else {
|
} else {
|
||||||
type = GetTypeFromRole(aProxy->Role());
|
type = GetTypeFromRole(aProxy->Role());
|
||||||
}
|
}
|
||||||
|
@ -538,6 +538,9 @@ struct RoleDescrComparator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
- (NSString*)moxRoleDescription {
|
- (NSString*)moxRoleDescription {
|
||||||
|
if (mRole == roles::DOCUMENT)
|
||||||
|
return utils::LocalizedString(u"htmlContent"_ns);
|
||||||
|
|
||||||
if (mRole == roles::FIGURE) return utils::LocalizedString(u"figure"_ns);
|
if (mRole == roles::FIGURE) return utils::LocalizedString(u"figure"_ns);
|
||||||
|
|
||||||
if (mRole == roles::HEADING) return utils::LocalizedString(u"heading"_ns);
|
if (mRole == roles::HEADING) return utils::LocalizedString(u"heading"_ns);
|
||||||
|
@ -58,104 +58,9 @@ addAccessibleTask(
|
|||||||
"group",
|
"group",
|
||||||
"Root group is a document element"
|
"Root group is a document element"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Adding an 'application' role to the body should
|
|
||||||
// create a root group with an application subrole.
|
|
||||||
let evt = waitForMacEvent("AXMozRoleChanged");
|
|
||||||
await SpecialPowers.spawn(browser, [], () => {
|
|
||||||
content.document.body.setAttribute("role", "application");
|
|
||||||
});
|
|
||||||
await evt;
|
|
||||||
|
|
||||||
is(
|
|
||||||
doc.getAttributeValue("AXRole"),
|
|
||||||
"AXWebArea",
|
|
||||||
"doc still has web area role"
|
|
||||||
);
|
|
||||||
is(
|
|
||||||
doc.getAttributeValue("AXRoleDescription"),
|
|
||||||
"HTML Content",
|
|
||||||
"doc has correct role description"
|
|
||||||
);
|
|
||||||
ok(
|
|
||||||
!doc.attributeNames.includes("AXSubrole"),
|
|
||||||
"sub role not available on web area"
|
|
||||||
);
|
|
||||||
|
|
||||||
rootGroup = doc.getAttributeValue("AXChildren")[0];
|
|
||||||
is(
|
|
||||||
rootGroup.getAttributeValue("AXIdentifier"),
|
|
||||||
"root-group",
|
|
||||||
"Is generated root group"
|
|
||||||
);
|
|
||||||
is(
|
|
||||||
rootGroup.getAttributeValue("AXRole"),
|
|
||||||
"AXGroup",
|
|
||||||
"root group has AXGroup role"
|
|
||||||
);
|
|
||||||
is(
|
|
||||||
rootGroup.getAttributeValue("AXSubrole"),
|
|
||||||
"AXLandmarkApplication",
|
|
||||||
"root group has application subrole"
|
|
||||||
);
|
|
||||||
is(
|
|
||||||
rootGroup.getAttributeValue("AXRoleDescription"),
|
|
||||||
"application",
|
|
||||||
"root group has application role description"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
* Test document with body[role=application] and a top-level group
|
|
||||||
*/
|
|
||||||
addAccessibleTask(
|
|
||||||
`<div role="grouping" id="group"><p>hello</p><p>world</p></div>`,
|
|
||||||
async (browser, accDoc) => {
|
|
||||||
let doc = accDoc.nativeInterface.QueryInterface(
|
|
||||||
Ci.nsIAccessibleMacInterface
|
|
||||||
);
|
|
||||||
|
|
||||||
is(
|
|
||||||
doc.getAttributeValue("AXRole"),
|
|
||||||
"AXWebArea",
|
|
||||||
"doc still has web area role"
|
|
||||||
);
|
|
||||||
is(
|
|
||||||
doc.getAttributeValue("AXRoleDescription"),
|
|
||||||
"HTML Content",
|
|
||||||
"doc has correct role description"
|
|
||||||
);
|
|
||||||
ok(
|
|
||||||
!doc.attributeNames.includes("AXSubrole"),
|
|
||||||
"sub role not available on web area"
|
|
||||||
);
|
|
||||||
|
|
||||||
let rootGroup = doc.getAttributeValue("AXChildren")[0];
|
|
||||||
is(
|
|
||||||
rootGroup.getAttributeValue("AXIdentifier"),
|
|
||||||
"root-group",
|
|
||||||
"Is generated root group"
|
|
||||||
);
|
|
||||||
is(
|
|
||||||
rootGroup.getAttributeValue("AXRole"),
|
|
||||||
"AXGroup",
|
|
||||||
"root group has AXGroup role"
|
|
||||||
);
|
|
||||||
is(
|
|
||||||
rootGroup.getAttributeValue("AXSubrole"),
|
|
||||||
"AXLandmarkApplication",
|
|
||||||
"root group has application subrole"
|
|
||||||
);
|
|
||||||
is(
|
|
||||||
rootGroup.getAttributeValue("AXRoleDescription"),
|
|
||||||
"application",
|
|
||||||
"root group has application role description"
|
|
||||||
);
|
|
||||||
},
|
|
||||||
{ contentDocBodyAttrs: { role: "application" } }
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test document with a single button
|
* Test document with a single button
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user