From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- accessible/mac/GeckoTextMarker.mm | 19 +++++++++++++++++++ accessible/mac/Platform.mm | 2 +- accessible/mac/mozAccessible.mm | 4 ++-- 3 files changed, 22 insertions(+), 3 deletions(-) (limited to 'accessible/mac') 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; \ -- cgit v1.2.3