eError');
 }, 'document.open() must throw an InvalidStateError when synchronously constructing a custom element');

 promise_test(async function () {
     const result = await construct_custom_element_in_parser(this, (document) => document.open('text/html'));
     assert_throws_dom('InvalidStateError', result.window.DOMException, () => { throw result.exception; }, 'Must throw an InvalidStateError');
 }, 'document.open("text/html") must throw an InvalidStateError when synchronously constructing a custom elem