Commit 2f3832fa15 introduced a bug wherein
if the entire page has hidden content, the entire page text is returned
as visible text. The bug was introduced to support SVG text handling.
The svg element doesn't have an innerText property, but does have
textContent property, so the patch was written to fallback on
textContent. The thing is, innerText will return an empty string when
there is no visible text on the screen, which is a falsey condition, so
we fall back to textContent. Thankfully, calling innerText on an svg
element returns undefined, so now we can confidently return the empty
string when it exists before falling back to textContent.
The patch could also be written as:
return visible_text == undefined ? node.textContent : visible_text;
(double equals should work fine in this case)