Change skipped node types to use a switch statement

This commit is contained in:
toasted-nutbread 2019-09-27 23:14:21 -04:00
parent 8195e5109b
commit 8110de514e

View File

@ -87,9 +87,11 @@ class TextSourceRange {
return false;
}
const skip = ['RT', 'SCRIPT', 'STYLE'];
if (skip.includes(node.nodeName.toUpperCase())) {
return false;
switch (node.nodeName.toUpperCase()) {
case 'RT':
case 'SCRIPT':
case 'STYLE':
return false;
}
const style = window.getComputedStyle(node);