mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-01 05:43:46 +00:00
Bug 1688680 - Don't include AXTextStateSync in read-only collapsed text selection events. r=morgan.
Differential Revision: https://phabricator.services.mozilla.com/D102948
This commit is contained in:
parent
0921a6cd36
commit
92f8f50dd8
@ -84,16 +84,16 @@ static nsDataHashtable<nsUint64HashKey, MOXTextMarkerDelegate*> sDelegates;
|
||||
- (NSDictionary*)selectionChangeInfo {
|
||||
GeckoTextMarkerRange selectedGeckoRange =
|
||||
GeckoTextMarkerRange(mGeckoDocAccessible, mSelection);
|
||||
int32_t stateChangeType = selectedGeckoRange.mStart == selectedGeckoRange.mEnd
|
||||
? AXTextStateChangeTypeSelectionMove
|
||||
: AXTextStateChangeTypeSelectionExtend;
|
||||
|
||||
// This is the base info object, includes the selected marker range and
|
||||
// the change type depending on the collapsed state of the selection.
|
||||
NSMutableDictionary* info = [@{
|
||||
@"AXSelectedTextMarkerRange" : selectedGeckoRange.IsValid() ? mSelection
|
||||
: [NSNull null],
|
||||
@"AXTextStateChangeType" :
|
||||
selectedGeckoRange.mStart == selectedGeckoRange.mEnd
|
||||
? @(AXTextStateChangeTypeSelectionMove)
|
||||
: @(AXTextStateChangeTypeSelectionExtend)
|
||||
@"AXTextStateChangeType" : @(stateChangeType),
|
||||
} mutableCopy];
|
||||
|
||||
GeckoTextMarker caretMarker(mGeckoDocAccessible, mCaret);
|
||||
@ -107,7 +107,7 @@ static nsDataHashtable<nsUint64HashKey, MOXTextMarkerDelegate*> sDelegates;
|
||||
[GetNativeFromGeckoAccessible(caretMarker.mContainer)
|
||||
moxEditableAncestor];
|
||||
|
||||
if (!caretEditable) {
|
||||
if (!caretEditable && stateChangeType == AXTextStateChangeTypeSelectionMove) {
|
||||
// If we are not in an editable, VO expects AXTextStateSync to be present
|
||||
// and true.
|
||||
info[@"AXTextStateSync"] = @YES;
|
||||
|
@ -22,7 +22,7 @@ addAccessibleTask(`<p id="p">Hello World</p>`, async (browser, accDoc) => {
|
||||
|
||||
let evt = waitForMacEventWithInfo("AXSelectedTextChanged", (elem, info) => {
|
||||
return (
|
||||
info.AXTextStateSync &&
|
||||
!info.AXTextStateSync &&
|
||||
info.AXTextStateChangeType == AXTextStateChangeTypeSelectionExtend &&
|
||||
elem.getAttributeValue("AXRole") == "AXWebArea"
|
||||
);
|
||||
@ -49,7 +49,7 @@ addAccessibleTask(`<p id="p">Hello World</p>`, async (browser, accDoc) => {
|
||||
|
||||
evt = waitForMacEventWithInfo("AXSelectedTextChanged", (elem, info) => {
|
||||
return (
|
||||
info.AXTextStateSync &&
|
||||
!info.AXTextStateSync &&
|
||||
info.AXTextStateChangeType == AXTextStateChangeTypeSelectionExtend &&
|
||||
elem.getAttributeValue("AXRole") == "AXWebArea"
|
||||
);
|
||||
@ -146,7 +146,7 @@ addAccessibleTask(
|
||||
|
||||
let evt = waitForMacEventWithInfo("AXSelectedTextChanged", (elem, info) => {
|
||||
return (
|
||||
info.AXTextStateSync &&
|
||||
!info.AXTextStateSync &&
|
||||
info.AXTextStateChangeType == AXTextStateChangeTypeSelectionExtend &&
|
||||
elem.getAttributeValue("AXRole") == "AXWebArea"
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user