1
0
Fork 0

only use nodeType 1 and 3 (only relevant types)

This commit is contained in:
Maarten Schroeven 2016-08-18 10:56:59 +02:00 committed by Hakim El Hattab
parent ab33b31f0a
commit 7e99626b14
1 changed files with 1 additions and 1 deletions

View File

@ -558,7 +558,7 @@
var text = "";
if(node.nodeType === 3) { //text node
text += node.textContent;
}else {
}else if (node.nodeType === 1) { //element node
var isAriaHidden = node.getAttribute('aria-hidden');
var isDisplayHidden = window.getComputedStyle(node)['display'] === 'none';
if (isAriaHidden !== 'true' && !isDisplayHidden) {