mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-08 12:22:34 +00:00
Bug 1672243 - Introduce AXIndexForChildUIElement and implement AXTopLevelUIElement. r=MarcoZ
AXTopLevelUIElement is not really testable because it doesn't give a useful result in headless mode. Since it is a clone of AXWindow, this shouldn't be much of an issue. Differential Revision: https://phabricator.services.mozilla.com/D94154
This commit is contained in:
parent
b7133788f4
commit
0e6061d30d
@ -114,6 +114,12 @@ inline id<mozAccessible> GetObjectOrRepresentedView(id<mozAccessible> aObject) {
|
||||
// override
|
||||
- (id<mozAccessible>)moxParent;
|
||||
|
||||
// override
|
||||
- (NSNumber*)moxIndexForChildUIElement:(id)child;
|
||||
|
||||
// override
|
||||
- (id)moxTopLevelUIElement;
|
||||
|
||||
// override
|
||||
- (id<MOXTextMarkerSupport>)moxTextMarkerDelegate;
|
||||
|
||||
|
@ -398,6 +398,14 @@ mozilla::LogModule* GetMacAccessibilityLog() {
|
||||
|
||||
#pragma mark - MOXAccessible protocol
|
||||
|
||||
- (NSNumber*)moxIndexForChildUIElement:(id)child {
|
||||
return @([[self moxUnignoredChildren] indexOfObject:child]);
|
||||
}
|
||||
|
||||
- (id)moxTopLevelUIElement {
|
||||
return [self moxWindow];
|
||||
}
|
||||
|
||||
- (id)moxHitTest:(NSPoint)point {
|
||||
return GetObjectOrRepresentedView(self);
|
||||
}
|
||||
|
@ -345,6 +345,9 @@
|
||||
// AXCellForColumnAndRow
|
||||
- (id _Nullable)moxCellForColumnAndRow:(NSArray* _Nonnull)columnAndRow;
|
||||
|
||||
// AXIndexForChildUIElement
|
||||
- (NSNumber* _Nullable)moxIndexForChildUIElement:(id _Nonnull)child;
|
||||
|
||||
@end
|
||||
|
||||
// This protocol maps text marker and text marker range parameters to
|
||||
|
@ -37,3 +37,4 @@ skip-if = os == 'mac' && debug # Bug 1664577
|
||||
[browser_rootgroup.js]
|
||||
[browser_text_selection.js]
|
||||
[browser_navigate.js]
|
||||
[browser_hierarchy.js]
|
||||
|
29
accessible/tests/browser/mac/browser_hierarchy.js
Normal file
29
accessible/tests/browser/mac/browser_hierarchy.js
Normal file
@ -0,0 +1,29 @@
|
||||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Test AXIndexForChildUIElement
|
||||
*/
|
||||
addAccessibleTask(
|
||||
`<p id="p">Hello <a href="#" id="link">strange</a> world`,
|
||||
(browser, accDoc) => {
|
||||
let p = getNativeInterface(accDoc, "p");
|
||||
|
||||
let children = p.getAttributeValue("AXChildren");
|
||||
is(children.length, 3, "p has 3 children");
|
||||
is(
|
||||
children[1].getAttributeValue("AXDOMIdentifier"),
|
||||
"link",
|
||||
"second child is link"
|
||||
);
|
||||
|
||||
let index = p.getParameterizedAttributeValue(
|
||||
"AXIndexForChildUIElement",
|
||||
children[1]
|
||||
);
|
||||
is(index, 1, "link is second child");
|
||||
}
|
||||
);
|
Loading…
Reference in New Issue
Block a user