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

Unified Diff: LayoutTests/fast/dom/HTMLTemplateElement/no-form-association.html

Issue 17033002: HTML parser should not associate elements inside templates with forms (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 6 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/no-form-association-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/HTMLTemplateElement/no-form-association.html
diff --git a/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association.html b/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association.html
new file mode 100644
index 0000000000000000000000000000000000000000..97b5e0e541e1f4d0dfd2aca6df7077857bc3495f
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<body>
+<form style="display:none">
+<template id="one"><input></template>
+</form>
+<template id="two"><form><template><input></template></form></template>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script>
+description("Form control elements inside templates should not be associated with forms outside the template");
+
+debug('Form in document, input inside template:');
+var form = document.querySelector('form');
+var input = document.querySelector('#one').content.querySelector('input');
+shouldBe('form.length', '0');
+shouldBeNull('input.form');
+
+debug('\nForm in template, input in sub-template:');
+form = document.querySelector('#two').content.querySelector('form');
+input = document.querySelector('#two').content.querySelector('template').content.querySelector('input');
+shouldBe('form.length', '0');
+shouldBeNull('input.form');
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLTemplateElement/no-form-association-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698