wCaption = contentDocument.createElement('caption');
    table.caption = newCaption; // Chrome doesn't support setting to null.
    assert_equals(table.caption, newCaption);
    assert_array_equals(element.takeLog().types(), ['disconnected']);
}, 'caption 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', []);
    contentDocum