Skip to content

Commit

Permalink
core(perf): speed up getNodePath (#9055)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish authored May 28, 2019
1 parent 9d4d7ed commit fa053a9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lighthouse-core/lib/page-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ function getNodePath(node) {
while (prevNode = node.previousSibling) {
node = prevNode;
// skip empty text nodes
if (node.nodeType === Node.TEXT_NODE && node.textContent &&
node.textContent.trim().length === 0) continue;
if (node.nodeType === Node.TEXT_NODE && node.nodeValue.trim().length === 0) continue;
index++;
}
return index;
Expand Down

0 comments on commit fa053a9

Please sign in to comment.