diff options
Diffstat (limited to 'layout/base/crashtests/1261351-iframe.html')
-rw-r--r-- | layout/base/crashtests/1261351-iframe.html | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/layout/base/crashtests/1261351-iframe.html b/layout/base/crashtests/1261351-iframe.html index 82c1e25fa..a0484f332 100644 --- a/layout/base/crashtests/1261351-iframe.html +++ b/layout/base/crashtests/1261351-iframe.html @@ -3,23 +3,26 @@ 'use strict'; // -sp-context: content (function () { - let proto = Object.create(HTMLDivElement.prototype); - proto.template = `<style></style>`; - proto.createdCallback = function() { - let shadow = this.createShadowRoot(); - if (this.template) { - let te = document.createElement('template'); - te.innerHTML = this.template; - shadow.appendChild(document.importNode(te.content, true)); - } - }; + class UiComponentTest extends HTMLDivElement { + constructor() { + super(); + this.template = `<style></style>`; + } - let UiComponentTest = document.registerElement('ui-component-test', { - prototype: proto, - }); + connectedCallback() { + let shadow = this.createShadowRoot(); + if (this.template) { + let te = document.createElement('template'); + te.innerHTML = this.template; + shadow.appendChild(document.importNode(te.content, true)); + } + } + }; - let uic = new UiComponentTest(); - document.body.appendChild(uic); + customElements.define('ui-component-test', UiComponentTest, { extend: 'div'} ); + + let uic = new UiComponentTest(); + document.body.appendChild(uic); })(); </script> |