diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /accessible/mac/GeckoTextMarker.mm | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/mac/GeckoTextMarker.mm')
-rw-r--r-- | accessible/mac/GeckoTextMarker.mm | 19 |
1 files changed, 19 insertions, 0 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); |