diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/html/semantics/forms/the-fieldset-element | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/the-fieldset-element')
4 files changed, 150 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/.gitkeep b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/.gitkeep diff --git a/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/HTMLFieldSetElement.html b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/HTMLFieldSetElement.html new file mode 100644 index 000000000..0c394cbed --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/HTMLFieldSetElement.html @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: HTMLFieldSetElement interface</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-fieldset-element"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<form name="fm1" style="display:none"> + <fieldset id="fs_outer"> + <legend><input type="checkbox" name="cb"></legend> + <input type=text name="txt" id="ctl1"> + <button id="ctl2" name="btn">BUTTON</button> + <fieldset id="fs_inner"> + <input type="text" name="txt_inner"> + <progress name="pg" value="0.5"></progress> + </fieldset> + </fieldset> +</form> +<script> + +var fm1, + fs_outer, + children_outer; + +setup(function () { + fm1 = document.forms.fm1; + fs_outer = document.getElementById("fs_outer"); + children_outer = fs_outer.elements; +}); + +test(function () { + assert_equals(fs_outer.type, "fieldset", "The value of type attribute is incorrect."); +}, "The type attribute must return 'fieldset'"); + +test(function () { + assert_equals(fs_outer.form, fm1, "The fieldset should have a form owner."); +}, "The form attribute must return the fieldset's form owner"); + +test(function () { + assert_true(children_outer instanceof HTMLFormControlsCollection, + "The elements attribute should be an HTMLFormControlsCollection object"); +}, "The elements must return an HTMLFormControlsCollection object"); + +test(function () { + var fs_inner = document.getElementById("fs_inner"); + var children_inner = fs_inner.elements; + assert_array_equals(children_inner, [fm1.txt_inner], + "The items in the collection must be children of the inner fieldset element."); + assert_array_equals(children_outer, [fm1.cb, fm1.txt, fm1.btn, fm1.fs_inner, fm1.txt_inner], + "The items in the collection must be children of the outer fieldset element."); +}, "The controls must root at the fieldset element"); + +</script> diff --git a/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-001.html b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-001.html new file mode 100644 index 000000000..cbbda4ab0 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-001.html @@ -0,0 +1,71 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Fieldset disabled</title> +<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-fieldset-element"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<form> + <fieldset id=fs disabled> + <legend> + <input type=checkbox id=clubc_l1> + <input type=radio id=clubr_l1> + <input type=text id=clubt_l1> + </legend> + <legend><input type=checkbox id=club_l2></legend> + <p><label>Name on card: <input id=clubname required></label></p> + <p><label>Card number: <input id=clubnum required pattern="[-0-9]+"></label></p> + </fieldset> + <fieldset id=fs2 disabled> + <p><legend><input type=checkbox id=club2></legend></p> + <p><label>Name on card: <input id=clubname2 required></label></p> + <p><label>Card number: <input id=clubnum2 required pattern="[-0-9]+"></label></p> + </fieldset> + <fieldset id=fs3 disabled> + <fieldset> + <legend><input type=checkbox id=club3></legend> + </fieldset> + <p><label>Name on card: <input id=clubname3 required></label></p> + <p><label>Card number: <input id=clubnum3 required pattern="[-0-9]+"></label></p> + </fieldset> + <fieldset id=fs4 disabled> + <legend> + <fieldset><input type=checkbox id=club4></fieldset> + </legend> + <p><label>Name on card: <input id=clubname4 required></label></p> + <p><label>Card number: <input id=clubnum4 required pattern="[-0-9]+"></label></p> + </fieldset> +</form> +<script> + test(function () { + assert_true(document.getElementById('fs').disabled, "The fieldset is disabled"); + assert_false(document.getElementById('clubname').willValidate, "fieldset is disabled so is input 'clubname'"); + assert_false(document.getElementById('clubnum').willValidate, "fieldset is disabled so is input 'clubnum'"); + assert_true(document.getElementById('clubc_l1').willValidate, "input 'clubc_l1' is descendant of the first legend child of the fieldset. It should not be disabled"); + assert_true(document.getElementById('clubr_l1').willValidate, "input 'clubr_l1' is descendant of the first legend child of the fieldset. It should not be disabled"); + assert_true(document.getElementById('clubt_l1').willValidate, "input 'clubt_l1' is descendant of the first legend child of the fieldset. It should not be disabled"); + assert_false(document.getElementById('club_l2').willValidate, "input 'club_l2' is a descendant of the second legend child of the fieldset. It should be disabled"); + }, "The disabled attribute, when specified, causes all the form control descendants of the fieldset element, excluding those that are descendants of the fieldset element's first legend element child, if any, to be disabled."); + + test(function () { + assert_true(document.getElementById('fs2').disabled, "The fieldset is disabled"); + assert_false(document.getElementById('clubname2').willValidate, "fieldset is disabled so is input 'clubname2'"); + assert_false(document.getElementById('clubnum2').willValidate, "fieldset is disabled so is input 'clubnum2'"); + assert_false(document.getElementById('club2').willValidate, "the first legend is not a child of the disbled fieldset: input 'club2' is disabled"); + }, "The first 'legend' element is not a child of the disabled fieldset: Its descendants should be disabled."); + + test(function () { + assert_true(document.getElementById('fs3').disabled, "The fieldset is disabled"); + assert_false(document.getElementById('clubname3').willValidate, "fieldset is disabled so is input 'clubname3'"); + assert_false(document.getElementById('clubnum3').willValidate, "fieldset is disabled so is input 'clubnum3'"); + assert_false(document.getElementById('club3').willValidate, "the first legend is not a child of the disbled fieldset: input 'club3' is disabled"); + }, "The <legend> element is not a child of the disabled fieldset: Its descendants should be disabled."); + + test(function () { + assert_true(document.getElementById('fs4').disabled, "The fieldset is disabled"); + assert_false(document.getElementById('clubname4').willValidate, "fieldset is disabled so is input 'clubname4'"); + assert_false(document.getElementById('clubnum4').willValidate, "fieldset is disabled so is input 'clubnum4'"); + assert_true(document.getElementById('club4').willValidate, "the first legend a child of the disbled fieldset: input 'club4' is disabled"); + }, "The <legend> element is child of the disabled fieldset: Its descendants should be disabled."); +</script> diff --git a/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-002.xhtml b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-002.xhtml new file mode 100644 index 000000000..896d737df --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/the-fieldset-element/disabled-002.xhtml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>File input descendants of disabled fieldsets</title> + <link rel="author" title="Chris Rebert" href="http://chrisrebert.com" /> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-fieldset-disabled" /> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <div id="log"></div> + <form> + <fieldset id="fs" disabled="disabled"> + <input id="myfile" type="file" /> + </fieldset> + </form> + <script> + test(function () { + assert_true(document.getElementById('fs').disabled, "disabled fieldset should be disabled"); + assert_false(document.getElementById('myfile').willValidate, "form control descendant of disabled fieldset that is not also a descendant of a legend should be disabled"); + }, "A file input without a disabled attribute that is a descendant of a disabled fieldset should be disabled (modulo legend-related complications that don't apply here)"); + </script> +</body> +</html> |