• Robert Knight's avatar
    Optimize and fix a bug in `isNodeInRange` if node had no parent · 7d196444
    Robert Knight authored
    `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.
    7d196444
range-util-test.js 5.06 KB