summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cycles.html
blob: 01277267f21c959578d5f6269f3d934e396155d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<script src="../../js/resources/js-test-pre.js"></script>
<script>
description('Test that cycles are not allowed in template content');
var template = document.createElement('template');
shouldThrow('template.content.appendChild(template)');
var outerDiv = document.createElement('div');
outerDiv.appendChild(template);
shouldThrow('template.content.appendChild(outerDiv)');
var innerDiv = template.content.appendChild(document.createElement('div'));
shouldThrow('innerDiv.appendChild(template)');
shouldThrow('innerDiv.appendChild(outerDiv)');
var innerTemplate = innerDiv.appendChild(document.createElement('template'));
shouldThrow('innerTemplate.appendChild(outerDiv)');
</script>