$.contains uses `document.contains` but uses `compareDocumentPosition` if it's not available. Since these are assertions for jQuery, I think we should use it where possible.