Skip to content

Commit

Permalink
Added an exception for svg title elements as visible elements to test…
Browse files Browse the repository at this point in the history
…. This resolves #229. Reference issue #191 where aria-hidden attribute could be used as a workaround to releases prior to this commit..
  • Loading branch information
ironikart committed Aug 29, 2018
1 parent ee845c1 commit 5a4c8b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions HTMLCS.Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ _global.HTMLCS.util = function() {
self.isVisuallyHidden = function(element) {
var hidden = false;

// Handle titles in svg as a special visually hidden case (hidden by browsers but
// available to accessibility apis.
if (element.nodeName.toLowerCase() === 'title' && self.findParentNode(element, 'svg') !== null) {
return true;
}

// Do not point to elem if its hidden. Use computed styles.
var style = self.style(element);
if (style !== null) {
Expand Down

0 comments on commit 5a4c8b3

Please sign in to comment.