;
    assert_equals(doc.caretPositionFromPoint(0, 0), null);
  }, "document.caretPositionFromPoint() should return null for a document with no viewport");

  test(() => {
    container.setHTMLUnsafe(`<div id="textDiv">aaa</div>`);
    assert_equals(document.caretPositionFromPoint(-5, 5), null);
    assert_equals(document.caretPositionFromPoint(5, -5), null);
    assert_equals(document.caretPositionFromPoint(document.documentElement.clientWidth * 2, 5), null);
    assert_equals(document.caretPositionFromPoin