SIGN IN SIGN UP

[DOM] Fix Fragment compareDocumentPosition(document) TypeError (#37579)

## Summary

Fixes #37578.

`FragmentInstance.compareDocumentPosition(document)` threw:

```
TypeError: Cannot read properties of null (reading 'documentElement')
```

because `Document.ownerDocument` is `null`, and the `CONTAINS`
fiber-validation fallback read `ownerDocument.documentElement`
unconditionally. `document.body` / `document.documentElement` already
worked.

This treats a `Document` node as its own owner document, matching
`Node.compareDocumentPosition(document)`.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
C
Changsu Seong committed
019019be403c3269e15b8d7ebefb57d30f84086b
Parent: 9a78595
Committed by GitHub <noreply@github.com> on 9/11/2026, 1:24:41 PM