t_equals(table.tHead, thead);
    table.deleteTHead();
    assert_equals(table.tHead, null);
    assert_array_equals(element.takeLog().types(), ['disconnected']);
}, 'deleteTHead() on HTMLTableElement must enqueue disconnectedCallback when removing a custom element');


test_with_window(function (contentWindow, contentDocument) {
    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
    contentDocument.body.innerHTML = `<table></table>`;
    const table = contentDocument.