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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/html/semantics/scripting-1/the-template-element/template-element/template-content.html

Issue 2400923003: Import more tests of web-platform-tests. (Closed)
Patch Set: Skip html/infrastructure/urls/terminology-0/document-base-url.html Created 4 years, 2 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
Index: third_party/WebKit/LayoutTests/imported/wpt/html/semantics/scripting-1/the-template-element/template-element/template-content.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/scripting-1/the-template-element/template-element/template-content.html b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/scripting-1/the-template-element/template-element/template-content.html
new file mode 100644
index 0000000000000000000000000000000000000000..8ed55d0d2db43a308a9d295aedd0a944395158a8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/scripting-1/the-template-element/template-element/template-content.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>HTML Templates: HTML elements in template content</title>
+<meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<meta name="author" title="Aleksei Yu. Semenov" href="a.semenov@unipro.ru">
+<meta name="assert" content="Template may contain any element, except the html element, the head element, the body element, or the frameset element">
+<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src='/html/resources/common.js'></script>
+</head>
+<body>
+<div id="log"></div>
+<script type="text/javascript">
+
+var parameters = [];
+
+HTML5_ELEMENTS.forEach(function(value) {
+ if (value !== 'body' && value !== 'html' && value !== 'head' && value !== 'frameset') {
+
+ var doc = newHTMLDocument();
+ var template = doc.createElement('template');
+ var element = doc.createElement(value);
+ template.content.appendChild(element);
+ var valueToTest = template.content.querySelector(value);
+
+ doc.body.appendChild(template);
+
+ parameters.push([
+ 'Template may contain ' + value + ' element',
+ valueToTest,
+ null
+ ]);
+ }
+});
+
+generate_tests(assert_not_equals, parameters,
+ 'Template may contain any element, except the html element, '
+ + 'the head element, the body element, or the frameset element');
+
+
+
+
+var parameters = [];
+
+HTML5_ELEMENTS.forEach(function(value) {
+ if (value !== 'body' && value !== 'html' && value !== 'head' && value !== 'frameset') {
+
+ var doc = newHTMLDocument();
+
+ if (isVoidElement(value)) {
+ doc.body.innerHTML = '<template><' + value + '/></template>';
+ } else {
+ doc.body.innerHTML = '<template><' + value + '></' + value + '></template>';
+ }
+
+ var template = doc.querySelector('template');
+ var element = template.content.querySelector(value);
+
+ parameters.push([
+ 'Template may contain ' + value + ' element. '
+ +'The template element and contents are added via body.innerHTML',
+ element,
+ null
+ ]);
+ }
+});
+
+generate_tests(assert_not_equals, parameters,
+ 'Template may contain any element, except the html element, '
+ + 'the head element, the body element, or the frameset element. '
+ +'The template element and contents are added via body.innerHTML');
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698