Simplify docs toggle cursor.
Fix `TypeError: Argument 1 of Node.compareDocumentPosition is not an object`.