blob: 8e42d4822790542b73359444a0dcf7fac438dda2 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<p>This tests removing an iframe with a custom element inside a callback. WebKit should not hit assertions.<br>
WebKit should not hit any assertions.</p>
<script>
customElements.define('test-element', class extends HTMLElement {
disconnectedCallback() { }
attributeChangedCallback(name, oldValue, newValue) {
if (newValue != 'bar')
return;
removeIframe();
GCController.collect();
}
static get observedAttributes() { return ['id']; }
});
function insertIframe() {
let iframe = document.createElement('iframe');
document.body.appendChild(iframe);
let container = document.createElement('div');
container.innerHTML = '<test-element></test-element><test-element id="foo"></test-element>';
iframe.contentDocument.body.appendChild(container);
}
function removeIframe() {
document.querySelector('iframe').remove();
}
if (!window.GCController)
document.write('This test requires GCController');
else {
testRunner.dumpAsText();
insertIframe();
document.createElement('test-element').id = 'bar';
document.write(`<p>PASS. WebKit did not hit any assertions.</p>`);
}
</script>
</body>
</html>