diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp index 61e2df65bef..c37d0ac5da8 100644 --- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -1436,15 +1436,21 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame, if (tag == nsGkAtoms::abbr || tag == nsGkAtoms::acronym || + tag == nsGkAtoms::article || + tag == nsGkAtoms::aside || tag == nsGkAtoms::blockquote || tag == nsGkAtoms::form || + tag == nsGkAtoms::footer || + tag == nsGkAtoms::header || tag == nsGkAtoms::h1 || tag == nsGkAtoms::h2 || tag == nsGkAtoms::h3 || tag == nsGkAtoms::h4 || tag == nsGkAtoms::h5 || tag == nsGkAtoms::h6 || - tag == nsGkAtoms::q) { + tag == nsGkAtoms::nav || + tag == nsGkAtoms::q || + tag == nsGkAtoms::section) { nsRefPtr accessible = new HyperTextAccessibleWrap(aContent, document); return accessible.forget(); diff --git a/accessible/src/jsat/Constants.jsm b/accessible/src/jsat/Constants.jsm index 81bb6d63359..1526044316d 100644 --- a/accessible/src/jsat/Constants.jsm +++ b/accessible/src/jsat/Constants.jsm @@ -3,7 +3,8 @@ const Cu = Components.utils; Cu.import('resource://gre/modules/XPCOMUtils.jsm'); -this.EXPORTED_SYMBOLS = ['Roles', 'Events', 'Relations', 'Filters', 'States']; +this.EXPORTED_SYMBOLS = ['Roles', 'Events', 'Relations', + 'Filters', 'States', 'Prefilters']; function ConstantsMap (aObject, aPrefix, aMap = {}, aModifier = null) { let offset = aPrefix.length; @@ -35,6 +36,12 @@ XPCOMUtils.defineLazyGetter( return ConstantsMap(Ci.nsIAccessibleRelation, 'RELATION_'); }); +XPCOMUtils.defineLazyGetter( + this, 'Prefilters', + function() { + return ConstantsMap(Ci.nsIAccessibleTraversalRule, 'PREFILTER_'); + }); + XPCOMUtils.defineLazyGetter( this, 'Filters', function() { diff --git a/accessible/src/jsat/TraversalRules.jsm b/accessible/src/jsat/TraversalRules.jsm index feb48f7231b..b37dd373e13 100644 --- a/accessible/src/jsat/TraversalRules.jsm +++ b/accessible/src/jsat/TraversalRules.jsm @@ -19,6 +19,8 @@ XPCOMUtils.defineLazyModuleGetter(this, 'Filters', 'resource://gre/modules/accessibility/Constants.jsm'); XPCOMUtils.defineLazyModuleGetter(this, 'States', 'resource://gre/modules/accessibility/Constants.jsm'); +XPCOMUtils.defineLazyModuleGetter(this, 'Prefilters', + 'resource://gre/modules/accessibility/Constants.jsm'); let gSkipEmptyImages = new PrefCache('accessibility.accessfu.skip_empty_images'); @@ -146,21 +148,18 @@ var gSimpleMatchFunc = function gSimpleMatchFunc(aAccessible) { } }; -var gSimplePreFilter = Ci.nsIAccessibleTraversalRule.PREFILTER_DEFUNCT | - Ci.nsIAccessibleTraversalRule.PREFILTER_INVISIBLE | - Ci.nsIAccessibleTraversalRule.PREFILTER_ARIA_HIDDEN | - Ci.nsIAccessibleTraversalRule.PREFILTER_TRANSPARENT; +var gSimplePreFilter = Prefilters.DEFUNCT | + Prefilters.INVISIBLE | + Prefilters.ARIA_HIDDEN | + Prefilters.TRANSPARENT; this.TraversalRules = { Simple: new BaseTraversalRule(gSimpleTraversalRoles, gSimpleMatchFunc), SimpleOnScreen: new BaseTraversalRule( gSimpleTraversalRoles, gSimpleMatchFunc, - Ci.nsIAccessibleTraversalRule.PREFILTER_DEFUNCT | - Ci.nsIAccessibleTraversalRule.PREFILTER_INVISIBLE | - Ci.nsIAccessibleTraversalRule.PREFILTER_ARIA_HIDDEN | - Ci.nsIAccessibleTraversalRule.PREFILTER_TRANSPARENT | - Ci.nsIAccessibleTraversalRule.PREFILTER_OFFSCREEN), + Prefilters.DEFUNCT | Prefilters.INVISIBLE | Prefilters.ARIA_HIDDEN | + Prefilters.TRANSPARENT | Prefilters.OFFSCREEN), Anchor: new BaseTraversalRule( [Roles.LINK], diff --git a/accessible/tests/mochitest/role/test_general.html b/accessible/tests/mochitest/role/test_general.html index 0a689208141..e4c13577ed9 100644 --- a/accessible/tests/mochitest/role/test_general.html +++ b/accessible/tests/mochitest/role/test_general.html @@ -29,6 +29,15 @@ testRole("aside", ROLE_NOTE); testRole("section", ROLE_SECTION); + // Bug 996821 + // Check that landmark elements get accessibles with styled overflow. + testRole("section_overflow", ROLE_SECTION); + testRole("nav_overflow", ROLE_SECTION); + testRole("header_overflow", ROLE_HEADER); + testRole("aside_overflow", ROLE_NOTE); + testRole("footer_overflow", ROLE_FOOTER); + testRole("article_overflow", ROLE_DOCUMENT); + // test html:div testRole("sec", ROLE_SECTION); @@ -127,6 +136,19 @@
a section
+
+ +
overflow header
+ +
overflow footer
+
+
overflow article
+

A paragraph for comparison.

A normal div
A citation
diff --git a/browser/components/preferences/in-content/main.xul b/browser/components/preferences/in-content/main.xul index be7d4fd52fa..e22df5003f3 100644 --- a/browser/components/preferences/in-content/main.xul +++ b/browser/components/preferences/in-content/main.xul @@ -34,14 +34,14 @@ + + - -