Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: LayoutTests/fast/dom/HTMLTemplateElement/importNode.html

Issue 180293002: Add a test for template contents handling in importNode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLTemplateElement/importNode-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/HTMLTemplateElement/importNode.html
diff --git a/LayoutTests/fast/dom/HTMLTemplateElement/importNode.html b/LayoutTests/fast/dom/HTMLTemplateElement/importNode.html
new file mode 100644
index 0000000000000000000000000000000000000000..d7119f59e43da9b5fcf4f0ed930346d09bc0eaaf
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTemplateElement/importNode.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<template id="template"><span>Contents</span></template>
+<script src="../../../resources/js-test.js"></script>
+<script>
+
+description('Test that template contents are correctly cloned when the template element is imported.');
+
+var template = document.getElementById('template');
+var div = template.appendChild(document.createElement('div'));
+
+shouldBe('template.content.childNodes.length', '1');
+var imported = document.importNode(template, true);
+shouldBe('imported.content.childNodes.length', '1');
+shouldBe('imported.outerHTML', 'template.outerHTML');
+shouldNotBe('imported.content.firstChild', 'template.content.firstChild');
+shouldNotBe('imported.content', 'template.content');
+shouldBe('imported.firstChild.tagName', '"DIV"');
+shouldNotBe('imported.firstChild', 'div');
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLTemplateElement/importNode-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698