OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../../resources/js-test.js"></script> | |
dominicc (has gone to gerrit)
2013/12/13 05:11:16
We could use the W3C test harness for this test an
Hajime Morrita
2013/12/13 07:02:29
In this case the execution order matters.
So I'd r
| |
5 </head> | |
6 <body> | |
7 <script> | |
8 description("document.register() should affect even for queued elements."); | |
9 | |
10 var createdElements = []; | |
11 | |
12 var protoA = Object.create(HTMLElement.prototype); | |
13 protoA.createdCallback = function () { | |
14 createdElements.push(this); | |
15 var protoB = Object.create(HTMLElement.prototype); | |
16 protoB.createdCallback = function () { | |
17 createdElements.push(this); | |
18 }; | |
19 | |
20 document.register('x-b', {prototype: protoB}); | |
21 }; | |
22 | |
23 document.register('x-a', {prototype: protoA}); | |
24 </script> | |
25 <x-a id=elemA></x-a> | |
26 <x-b id=elemB></x-b> | |
27 <x-c id=elemC></x-c> | |
dominicc (has gone to gerrit)
2013/12/13 05:11:16
I think this element is a distraction; if it isn't
Hajime Morrita
2013/12/13 07:02:29
Done.
| |
28 <script> | |
29 shouldBe("createdElements.map(function(e) { return e.id; })", "['elemA', 'elemB' ]"); | |
dominicc (has gone to gerrit)
2013/12/13 05:11:16
It might be simpler to have the createdCallback si
Hajime Morrita
2013/12/13 07:02:29
Done.
| |
30 </script> | |
31 </body> | |
32 </html> | |
dominicc (has gone to gerrit)
2013/12/13 05:11:16
I think I understand what this is testing... it's
Hajime Morrita
2013/12/13 07:02:29
Good point. I added another element to exercise th
| |
OLD | NEW |