[0].collapsed);
  assert_equals(sel.anchorNode, inText.firstChild);
  assert_equals(sel.anchorOffset, 0);
  assert_equals(sel.focusNode, inText.firstChild);
  assert_equals(sel.focusOffset, 5);
}, "Selection in shadow tree is not collapsed");

test(() => {
  const sel = window.getSelection();
  sel.setBaseAndExtent(inText.firstChild, 0, outText.firstChild, 1);
  assert_true(sel.isCollapsed);
  assert_false(sel.getComposedRanges()[0].collapsed);
  assert_equals(sel.anchorNode, outText.firstChild);
  assert_e