2 <script src=
"../../../resources/testharness.js"></script>
3 <script src=
"../../../resources/testharnessreport.js"></script>
7 var test
= async_test('document.registerElement() in a createdCallback should upgrade elements that are in the same processing queue.');
9 var createdElements
= [];
11 var protoA
= Object
.create(HTMLElement
.prototype);
12 protoA
.createdCallback = function() {
13 createdElements
.push(this.id
);
14 var protoB
= Object
.create(HTMLElement
.prototype);
15 protoB
.createdCallback = function () {
16 createdElements
.push(this.id
);
19 document
.registerElement('x-b', {prototype: protoB
});
20 test
.step(function() {
21 assert_array_equals(createdElements
, ['elemA0', 'elemB0', 'elemB1']);
26 document
.registerElement('x-a', {prototype: protoA
});
30 <x-b id='elemB0'
></x-b>
31 <x-a id='elemA0'
></x-a>
32 <x-b id='elemB1'
></x-b>