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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association2.html

Issue 2143833003: [Match Spec] Form element pointer should not be updated w/in <template> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo labels which have been split into separate CL Created 4 years, 5 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 | third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698