summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html')
-rw-r--r--testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html b/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html
new file mode 100644
index 0000000000..d9aee12b5f
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div>
+ <form id='form1'></form>
+ <table id='table1'>
+ <form id='form2'>
+ <script>
+ var t = document.getElementById('table1');
+ var f = document.getElementById('form2');
+ t.removeChild(f);
+ </script>
+ <tr><td><input id='input1'></td></tr>
+ <tr><td><input id='input2' form='form1'></td></tr>
+ </table>
+ <form id="form3">
+ <input id="input3" />
+ </form>
+ </div>
+
+ <script>
+ test(function() {
+ var form1 = document.getElementById('form1');
+
+ assert_equals(document.getElementById('input1').form, null,
+ "input1's form owner must be null since form2 is not in the" +
+ "same home subtree");
+
+ assert_equals(document.getElementById('input2').form, form1,
+ "input2's form owner must be the form with id 'form1'");
+
+ assert_equals(document.getElementById('input3').form, null,
+ "input3's form owner must be null instead of form2 (as per parsing rules)" +
+ "since form2 is not in the same home subtree");
+
+ }, "Controls nested in tables are not associated with form element inside the " +
+ "table if the form had been removed by script before the controls were " +
+ "inserted by the parser");
+ </script>
+ </body>
+</html>