Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / custom / document-register-on-create-callback.html
blobc689984f6723febbdd543dbd14cb1e68a6d8620a
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <script>
5 (function() {
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']);
22 test.done();
23 });
26 document.registerElement('x-a', {prototype: protoA});
28 })();
29 </script>
30 <x-b id='elemB0'></x-b>
31 <x-a id='elemA0'></x-a>
32 <x-b id='elemB1'></x-b>