Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / custom / registration-context-delete-during-callback-recursion.html
blob1418f3379974903d1fc7e01e1ec999edd2d91b2d
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <script src="testutils.js"></script>
4 <body>
5 <div id="s">
6 </div>
7 <script>
8 if (fork()) {
9 // The controlling parent frame
10 description('Tests destroying a context during attributeChanged callback.');
11 jsTestIsAsync = true;
12 successfullyParsed = true;
13 } else {
14 // The child frame
16 var n = 0;
17 var proto = Object.create(HTMLElement.prototype);
18 proto.createdCallback = function () {
19 if (n++ == 2)
20 this.previousSibling.setAttribute('tick', '...');
22 proto.attributeChangedCallback = function (name) {
23 if (name == 'tick')
24 this.previousSibling.setAttribute('boom', 'tsk');
25 if (name == 'boom')
26 destroyContext();
29 var A = document.registerElement('x-a', {prototype: proto});
30 s.innerHTML =
31 '<x-a id="t"></x-a>' +
32 '<x-a id="u"></x-a>' +
33 '<x-a id="v"></x-a>' +
34 '<x-a id="w"></x-a>';
36 done();
38 </script>