DOMSelection::containsNode has a bogus debug assertion that Range::compareBoundaryPoints(parentNode, nodeIndex, &selectedRange->startContainer(), selectedRange->startOffset()) would never return an exception. That is not true when startRange and parentNode belong to two different trees.
Created attachment 366156 [details] Fixes the bug
Committed r243621: <https://trac.webkit.org/changeset/243621>
<rdar://problem/49395651>
<rdar://problem/48566596>