Skip to content

Commit

Permalink
fix(selector/focusable): dropping namespace attribute to find SVG lin…
Browse files Browse the repository at this point in the history
…ks in IE9
  • Loading branch information
rodneyrehm committed Feb 4, 2016
1 parent 1407878 commit d4cac0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/api/selector.md
Expand Up @@ -12,4 +12,4 @@ It is impossible to query focusable elements by way of CSS selector alone, becau

## Contributing

While `ally/selector/focusable` will identify elements that are filtered by [`ally.query.focusable`](query/focusable.md), the inverse is not true - whatever cannot be identified as *potentially* focusable via CSS selector, will *not* be returned by [`ally.query.focusable`](query/focusable.md) either. To identify *everything*, the `query/focusable.strict` implementation uses [TreeWalker](https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker) instead of `document.querySelectorAll()`.
While `ally/selector/focusable` will identify elements that are filtered by [`ally.query.focusable`](query/focusable.md), the inverse is not true - whatever cannot be identified as *potentially* focusable via CSS selector, will *not* be returned by [`ally.query.focusable`](query/focusable.md) (with `strategy: "quick"`) either. To identify *everything*, the `query/focusable.strict` implementation uses [TreeWalker](https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker) instead of `document.querySelectorAll()`.
5 changes: 3 additions & 2 deletions src/selector/focusable.js
Expand Up @@ -26,8 +26,9 @@ export default function() {
// IE11 supports.can focus <fieldset>
+ (supports.canFocusFieldset ? 'fieldset,' : '')
// Namespace problems of [xlink:href] explained in http://stackoverflow.com/a/23047888/515124
// Firefox supports.cannot focus <svg> child elements from script
+ 'svg a[*|href],'
// svg a[*|href] does not match in IE9, but since we're filtering
// through is/focusable we can include all <a> from SVG
+ 'svg a,'
// may behave as 'svg, svg *,' in chrome as *every* svg element with a focus event listener is focusable
// navigational elements
+ 'a[href],'
Expand Down

0 comments on commit d4cac0c

Please sign in to comment.