Optimize and fix a bug in `isNodeInRange` if node had no parent
`isNodeInRange` in range would throw an exception if the passed node had no parent because `range.selectNode(...)` requires its argument to have a parent. This commit rewrites `isNodeInRange` to use `range.comparePoint` which avoids creating a temporary live range and handle exceptions that `comparePoint` may throw. It also updates the JSDoc to more accurately describe what the function does.
Showing
Please register or sign in to comment