[whatwg/dom] concept-range-bp-set should compare root nodes before bp relative position (#924)

In https://dom.spec.whatwg.org/#concept-range-bp-set:


> If bp is after the range’s end, or if range’s root is not equal to node’s root, set range’s end to bp.

(and similar for "set the end")

This implies that implementations should check if "bp is after the range’s end", however the first step of comparing boundary points is to "Assert: nodeA and nodeB have the same root.".

I would suggest this be re-ordered to:

> If range’s root is not equal to node’s root, or if bp is after the range’s end, set range’s end to bp.

(and similar for "set the end")

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/924

Received on Monday, 16 November 2020 13:28:58 UTC