| Index: third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association2.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association2.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association2.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e819b2d659f2524234cee6e2fbb4b69b03e94be6
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association2.html
|
| @@ -0,0 +1,39 @@
|
| +<!DOCTYPE html>
|
| +<body>
|
| +<!-- based on WebKit test: https://trac.webkit.org/changeset/160182 -->
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| +<script>
|
| +function stripSpaces(str) {
|
| + return str.replace(/[\s\n]/gm, '');
|
| +}
|
| +</script>
|
| +<form>
|
| + <template id="templateWithFormInsideForm">
|
| + <form>
|
| + <input>
|
| + </form>
|
| + </template>
|
| +</form>
|
| +<script>
|
| +test(function() {
|
| + var templateWithFormInsideForm = document.getElementById('templateWithFormInsideForm');
|
| + assert_equals(stripSpaces(templateWithFormInsideForm.innerHTML), '<form><input></form>');
|
| + var formInsideTemplate = templateWithFormInsideForm.content.firstElementChild;
|
| + assert_equals(formInsideTemplate.localName, 'form');
|
| + var inputInsideTemplate = templateWithFormInsideForm.content.querySelector('input');
|
| + assert_equals(inputInsideTemplate.form, formInsideTemplate);
|
| + assert_equals(formInsideTemplate.firstElementChild, inputInsideTemplate);
|
| +}, 'Form control elements inside templates should not be associated with forms outside the template.');
|
| +</script>
|
| +<template id="templateWithNestedForms">
|
| + <form>
|
| + <form></form>
|
| + </form>
|
| +</template>
|
| +<script>
|
| +test(function() {
|
| + var templateWithNestedForms = document.getElementById('templateWithNestedForms');
|
| + assert_equals(stripSpaces(templateWithNestedForms.innerHTML), '<form><form></form></form>');
|
| +}, '(Nested) form elements inside templates should be parsed correctly.');
|
| +</script>
|
|
|