diff --git a/accessible/mac/AccessibleWrap.mm b/accessible/mac/AccessibleWrap.mm
index 32094065a2ad..40c9d48aee01 100644
--- a/accessible/mac/AccessibleWrap.mm
+++ b/accessible/mac/AccessibleWrap.mm
@@ -15,6 +15,7 @@
#include "TextRange.h"
#include "gfxPlatform.h"
+#import "MOXLandmarkAccessibles.h"
#import "MOXMathAccessibles.h"
#import "MOXTextMarkerDelegate.h"
#import "MOXWebAreaAccessible.h"
@@ -268,6 +269,9 @@ Class a11y::GetTypeFromRole(roles::Role aRole) {
case roles::STATICTEXT:
return [mozTextLeafAccessible class];
+ case roles::LANDMARK:
+ return [MOXLandmarkAccessible class];
+
case roles::LINK:
return [mozLinkAccessible class];
diff --git a/accessible/mac/MOXLandmarkAccessibles.h b/accessible/mac/MOXLandmarkAccessibles.h
new file mode 100644
index 000000000000..bea44e7a8f24
--- /dev/null
+++ b/accessible/mac/MOXLandmarkAccessibles.h
@@ -0,0 +1,15 @@
+/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset:
+ * 2 -*- */
+/* vim:expandtab:shiftwidth=2:tabstop=2:
+ */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#import "mozAccessible.h"
+
+@interface MOXLandmarkAccessible : mozAccessible
+// overrides
+- (NSString*)moxTitle;
+
+@end
diff --git a/accessible/mac/MOXLandmarkAccessibles.mm b/accessible/mac/MOXLandmarkAccessibles.mm
new file mode 100644
index 000000000000..4a3aa8f59757
--- /dev/null
+++ b/accessible/mac/MOXLandmarkAccessibles.mm
@@ -0,0 +1,15 @@
+/* -*- (Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil;
+ * c-basic-offset:) 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#import "MOXLandmarkAccessibles.h"
+
+@implementation MOXLandmarkAccessible
+
+- (NSString*)moxTitle {
+ return @"";
+}
+
+@end
diff --git a/accessible/mac/MOXWebAreaAccessible.mm b/accessible/mac/MOXWebAreaAccessible.mm
index 544d668d8d98..345c14fe7d8c 100644
--- a/accessible/mac/MOXWebAreaAccessible.mm
+++ b/accessible/mac/MOXWebAreaAccessible.mm
@@ -193,6 +193,13 @@ using namespace mozilla::a11y;
: PivotRoleRule(roles::ARTICLE);
[matches addObjectsFromArray:[self getMatchesForRule:rule]];
}
+
+ if ([key isEqualToString:@"AXLandmarkSearchKey"]) {
+ PivotRoleRule rule = mImmediateDescendantsOnly
+ ? PivotRoleRule(roles::LANDMARK, mStartElem)
+ : PivotRoleRule(roles::LANDMARK);
+ [matches addObjectsFromArray:[self getMatchesForRule:rule]];
+ }
}
return matches;
diff --git a/accessible/mac/moz.build b/accessible/mac/moz.build
index 881e047df4fe..90fea97e60a4 100644
--- a/accessible/mac/moz.build
+++ b/accessible/mac/moz.build
@@ -20,6 +20,7 @@ UNIFIED_SOURCES += [
'HyperTextAccessibleWrap.mm',
'MacUtils.mm',
'MOXAccessibleBase.mm',
+ 'MOXLandmarkAccessibles.mm',
'MOXMathAccessibles.mm',
'MOXTextMarkerDelegate.mm',
'MOXWebAreaAccessible.mm',
diff --git a/accessible/mac/mozSelectableElements.mm b/accessible/mac/mozSelectableElements.mm
index d0843ad2505a..6c4edbd0cbd6 100644
--- a/accessible/mac/mozSelectableElements.mm
+++ b/accessible/mac/mozSelectableElements.mm
@@ -6,6 +6,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#import "mozSelectableElements.h"
+#import "nsCocoaUtils.h"
+#import "MacUtils.h"
+
+#include "Accessible-inl.h"
+
+using namespace mozilla::a11y;
@implementation mozSelectableAccessible
diff --git a/accessible/tests/browser/mac/browser_rotor.js b/accessible/tests/browser/mac/browser_rotor.js
index e48dfa83654d..d79aadfcaf95 100644
--- a/accessible/tests/browser/mac/browser_rotor.js
+++ b/accessible/tests/browser/mac/browser_rotor.js
@@ -117,3 +117,155 @@ addAccessibleTask(
);
}
);
+
+/**
+ * Test rotor with landmarks
+ */
+addAccessibleTask(
+ `
+ This is a heading within a header
+