Skip to content

Commit 5a4c8b3

Browse files
committed
Added an exception for svg title elements as visible elements to test. This resolves #229. Reference issue #191 where aria-hidden attribute could be used as a workaround to releases prior to this commit..
1 parent ee845c1 commit 5a4c8b3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

HTMLCS.Util.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ _global.HTMLCS.util = function() {
218218
self.isVisuallyHidden = function(element) {
219219
var hidden = false;
220220

221+
// Handle titles in svg as a special visually hidden case (hidden by browsers but
222+
// available to accessibility apis.
223+
if (element.nodeName.toLowerCase() === 'title' && self.findParentNode(element, 'svg') !== null) {
224+
return true;
225+
}
226+
221227
// Do not point to elem if its hidden. Use computed styles.
222228
var style = self.style(element);
223229
if (style !== null) {

0 commit comments

Comments
 (0)