According to spec:
“The Range() constructor, when invoked, must return a new range with
(current global object’s associated Document, 0) as its start and end.”
We don’t have a global object (window) with an associated document, thus
we have to pass one instead.