diff options
Diffstat (limited to 'accessible/mac')
-rw-r--r-- | accessible/mac/GeckoTextMarker.mm | 19 | ||||
-rw-r--r-- | accessible/mac/Platform.mm | 2 | ||||
-rw-r--r-- | accessible/mac/mozAccessible.mm | 4 |
3 files changed, 22 insertions, 3 deletions
diff --git a/accessible/mac/GeckoTextMarker.mm b/accessible/mac/GeckoTextMarker.mm index ba3a6e6231..bb787edd28 100644 --- a/accessible/mac/GeckoTextMarker.mm +++ b/accessible/mac/GeckoTextMarker.mm @@ -88,6 +88,13 @@ GeckoTextMarker GeckoTextMarker::MarkerFromIndex(Accessible* aRoot, // Iterate through all segments until we exhausted the index sum // so we can find the segment the index lives in. for (TextLeafRange segment : range) { + if (segment.Start().mAcc->IsMenuPopup() && + (segment.Start().mAcc->State() & states::COLLAPSED)) { + // XXX: Menu collapsed XUL menu popups are in our tree and we need to skip + // them. + continue; + } + if (segment.End().mAcc->Role() == roles::LISTITEM_MARKER) { // XXX: MacOS expects bullets to be in the range's text, but not in // the calculated length! @@ -392,6 +399,12 @@ NSString* GeckoTextMarkerRange::Text() const { for (TextLeafRange segment : range) { TextLeafPoint start = segment.Start(); + if (start.mAcc->IsMenuPopup() && + (start.mAcc->State() & states::COLLAPSED)) { + // XXX: Menu collapsed XUL menu popups are in our tree and we need to skip + // them. + continue; + } if (start.mAcc->IsTextField() && start.mAcc->ChildCount() == 0) { continue; } @@ -441,6 +454,12 @@ NSAttributedString* GeckoTextMarkerRange::AttributedText() const { for (TextLeafRange segment : range) { TextLeafPoint start = segment.Start(); TextLeafPoint attributesNext; + if (start.mAcc->IsMenuPopup() && + (start.mAcc->State() & states::COLLAPSED)) { + // XXX: Menu collapsed XUL menu popups are in our tree and we need to skip + // them. + continue; + } do { if (start.mAcc->IsText()) { attributesNext = start.FindTextAttrsStart(eDirNext, false); diff --git a/accessible/mac/Platform.mm b/accessible/mac/Platform.mm index eb507adefb..9f9738ab36 100644 --- a/accessible/mac/Platform.mm +++ b/accessible/mac/Platform.mm @@ -256,7 +256,7 @@ void PlatformRoleChangedEvent(Accessible* aTarget, const a11y::role& aRole, mozilla::Telemetry::ScalarSet( mozilla::Telemetry::ScalarID::A11Y_INSTANTIATORS, client); #endif // defined(MOZ_TELEMETRY_REPORTING) - CrashReporter::AnnotateCrashReport( + CrashReporter::RecordAnnotationNSCString( CrashReporter::Annotation::AccessibilityClient, NS_ConvertUTF16toUTF8(client)); } diff --git a/accessible/mac/mozAccessible.mm b/accessible/mac/mozAccessible.mm index 2d8e140343..aa98496511 100644 --- a/accessible/mac/mozAccessible.mm +++ b/accessible/mac/mozAccessible.mm @@ -295,7 +295,7 @@ using namespace mozilla::a11y; - (NSString*)moxRole { #define ROLE(geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \ - msaaRole, ia2Role, androidClass, nameRule) \ + msaaRole, ia2Role, androidClass, iosIsElement, nameRule) \ case roles::geckoRole: \ return macRole; @@ -366,7 +366,7 @@ using namespace mozilla::a11y; } #define ROLE(geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \ - msaaRole, ia2Role, androidClass, nameRule) \ + msaaRole, ia2Role, androidClass, iosIsElement, nameRule) \ case roles::geckoRole: \ if (![macSubrole isEqualToString:NSAccessibilityUnknownSubrole]) { \ return macSubrole; \ |