зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1669599
- Support AXEditableAncestor and make it text event target. r=morgan
Depends on D92689 Differential Revision: https://phabricator.services.mozilla.com/D92690
This commit is contained in:
Родитель
c173a1f486
Коммит
f050b91638
|
@ -261,6 +261,9 @@
|
|||
// AXInsertionPointLineNumber
|
||||
- (NSNumber* _Nullable)moxInsertionPointLineNumber;
|
||||
|
||||
// AXEditableAncestor
|
||||
- (id _Nullable)moxEditableAncestor;
|
||||
|
||||
#pragma mark - AttributeSetters
|
||||
|
||||
// AXValue
|
||||
|
|
|
@ -187,6 +187,9 @@ inline mozAccessible* GetNativeFromGeckoAccessible(
|
|||
// override
|
||||
- (NSNumber*)moxRequired;
|
||||
|
||||
// override
|
||||
- (id)moxEditableAncestor;
|
||||
|
||||
// override
|
||||
- (NSArray*)moxUIElementsForSearchPredicate:(NSDictionary*)searchPredicate;
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#import "MacUtils.h"
|
||||
#import "mozView.h"
|
||||
#import "MOXSearchInfo.h"
|
||||
#import "mozTextAccessible.h"
|
||||
|
||||
#include "Accessible-inl.h"
|
||||
#include "nsAccUtils.h"
|
||||
|
@ -768,6 +769,17 @@ struct RoleDescrComparator {
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (id)moxEditableAncestor {
|
||||
for (id element = self; [element conformsToProtocol:@protocol(MOXAccessible)];
|
||||
element = [element moxUnignoredParent]) {
|
||||
if ([element isKindOfClass:[mozTextAccessible class]]) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray*)moxUIElementsForSearchPredicate:(NSDictionary*)searchPredicate {
|
||||
// Create our search object and set it up with the searchPredicate
|
||||
// params. The init function does additional parsing. We pass a
|
||||
|
@ -899,8 +911,10 @@ struct RoleDescrComparator {
|
|||
// reduntant.
|
||||
id<MOXTextMarkerSupport> delegate = [self moxTextMarkerDelegate];
|
||||
id selectedRange = [delegate moxSelectedTextMarkerRange];
|
||||
id editableAncestor = [self moxEditableAncestor];
|
||||
id textChangeElement = editableAncestor ? editableAncestor : self;
|
||||
NSDictionary* userInfo = @{
|
||||
@"AXTextChangeElement" : self,
|
||||
@"AXTextChangeElement" : textChangeElement,
|
||||
@"AXSelectedTextMarkerRange" :
|
||||
(selectedRange ? selectedRange : [NSNull null])
|
||||
};
|
||||
|
@ -909,8 +923,9 @@ struct RoleDescrComparator {
|
|||
[webArea
|
||||
moxPostNotification:NSAccessibilitySelectedTextChangedNotification
|
||||
withUserInfo:userInfo];
|
||||
[self moxPostNotification:NSAccessibilitySelectedTextChangedNotification
|
||||
withUserInfo:userInfo];
|
||||
[textChangeElement
|
||||
moxPostNotification:NSAccessibilitySelectedTextChangedNotification
|
||||
withUserInfo:userInfo];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -271,7 +271,14 @@ addAccessibleTask(
|
|||
addAccessibleTask(
|
||||
`<div id="input" contentEditable="true" tabindex="0" role="textbox" aria-multiline="true"><div id="inner"><br /></div></div>`,
|
||||
async (browser, accDoc) => {
|
||||
await focusIntoInputAndType(accDoc, "input", "inner");
|
||||
const inner = getNativeInterface(accDoc, "inner");
|
||||
const editableAncestor = inner.getAttributeValue("AXEditableAncestor");
|
||||
is(
|
||||
editableAncestor.getAttributeValue("AXDOMIdentifier"),
|
||||
"input",
|
||||
"Editable ancestor is input"
|
||||
);
|
||||
await focusIntoInputAndType(accDoc, "input");
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче