summaryrefslogtreecommitdiffstats
path: root/accessible/mac/GeckoTextMarker.mm
diff options
context:
space:
mode:
Diffstat (limited to 'accessible/mac/GeckoTextMarker.mm')
-rw-r--r--accessible/mac/GeckoTextMarker.mm19
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);