index: Use document.contains when the UA supports it