Commit d07daebb authored by Robert Knight's avatar Robert Knight

Revise a comment per code review feedback

parent a3d50a93
...@@ -100,7 +100,7 @@ function* textNodesInRect(root, rect) { ...@@ -100,7 +100,7 @@ function* textNodesInRect(root, rect) {
const element = /** @type {Element} */ (node); const element = /** @type {Element} */ (node);
const elementRect = element.getBoundingClientRect(); const elementRect = element.getBoundingClientRect();
// Skip over subtrees which are entirely outside the viewport or hidden. // Only examine subtrees which are visible and intersect the viewport.
if (rectIntersects(elementRect, rect)) { if (rectIntersects(elementRect, rect)) {
yield* textNodesInRect(element, rect); yield* textNodesInRect(element, rect);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment