1 <script src='../../../resources/js-test.js'
></script>
4 description('Ensure that custom element callback fires before DOMContentLoaded event');
8 addEventListener('DOMContentLoaded', function(e
) {
9 eventlog
.push('DOMContentLoaded event');
11 addEventListener('load', function(e
) {
12 eventlog
.push('load event');
14 shouldBe("eventlog[0]", "'created x-foo'");
15 shouldBe("eventlog[1]", "'DOMContentLoaded event'");
16 shouldBe("eventlog[2]", "'load event'");
18 var proto
= Object
.create(HTMLElement
.prototype);
19 proto
.createdCallback = function() {
20 eventlog
.push('created ' + this.localName
);
22 document
.registerElement('x-foo', {prototype: proto
});