Skip to content

Commit 4b4b2ee

Browse files
authored
Test for the removal of <keygen>
Follows whatwg/html#2221.
1 parent f751698 commit 4b4b2ee

File tree

18 files changed

+50
-142
lines changed

18 files changed

+50
-142
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset=utf-8>
5+
<title>keygen is never valid</title>
6+
</head>
7+
<body>
8+
<keygen>
9+
</body>
10+
</html>

conformance-checkers/messages.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -1419,15 +1419,16 @@
14191419
"html/elements/keygen/id-bad-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
14201420
"html/elements/keygen/id-missing-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
14211421
"html/elements/keygen/id-redundant-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
1422-
"html/elements/keygen/keytype-bad-value-novalid.html": "Bad value \u201cdsa\u201d for attribute \u201ckeytype\u201d on element \u201ckeygen\u201d.",
1423-
"html/elements/keygen/keytype-empty-novalid.html": "Bad value \u201c\u201d for attribute \u201ckeytype\u201d on element \u201ckeygen\u201d.",
1422+
"html/elements/keygen/keygen-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
1423+
"html/elements/keygen/keytype-bad-value-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
1424+
"html/elements/keygen/keytype-empty-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
14241425
"html/elements/keygen/keytype-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
14251426
"html/elements/keygen/model-also-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
14261427
"html/elements/keygen/model-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
14271428
"html/elements/keygen/no-attributes-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
14281429
"html/elements/keygen/non-void-novalid.html": "The \u201ckeygen\u201d element is obsolete. ",
14291430
"html/elements/label/for-descendant-no-id-novalid.html": "Any \u201cinput\u201d descendant of a \u201clabel\u201d element with a \u201cfor\u201d attribute must have an ID value that matches that \u201cfor\u201d attribute.",
1430-
"html/elements/label/multiple-descendants-novalid.html": "The \u201clabel\u201d element may contain at most one \u201cbutton\u201d, \u201cinput\u201d, \u201ckeygen\u201d, \u201cmeter\u201d, \u201coutput\u201d, \u201cprogress\u201d, \u201cselect\u201d, or \u201ctextarea\u201d descendant.",
1431+
"html/elements/label/multiple-descendants-novalid.html": "The \u201clabel\u201d element may contain at most one \u201cbutton\u201d, \u201cinput\u201d, \u201cmeter\u201d, \u201coutput\u201d, \u201cprogress\u201d, \u201cselect\u201d, or \u201ctextarea\u201d descendant.",
14311432
"html/elements/link/href-empty-novalid.html": "Bad value \u201c\u201d for attribute \u201chref\u201d on element \u201clink\u201d: Bad URL: Must be non-empty.",
14321433
"html/elements/link/href-missing-novalid.html": "Element \u201clink\u201d is missing required attribute \u201chref\u201d.",
14331434
"html/elements/link/href-whitespace-only-novalid.html": "Bad value \u201c\t \n\u201d for attribute \u201chref\u201d on element \u201clink\u201d: Bad URL: Must be non-empty.",
@@ -2415,19 +2416,20 @@
24152416
"xhtml/elements/keygen/054-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24162417
"xhtml/elements/keygen/055-also-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24172418
"xhtml/elements/keygen/056-also-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
2418-
"xhtml/elements/keygen/056-novalid.xhtml": "Bad value \u201cdsa\u201d for attribute \u201ckeytype\u201d on element \u201ckeygen\u201d.",
2419+
"xhtml/elements/keygen/056-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24192420
"xhtml/elements/keygen/057-also-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
2420-
"xhtml/elements/keygen/057-novalid.xhtml": "Bad value \u201c\u201d for attribute \u201ckeytype\u201d on element \u201ckeygen\u201d.",
2421+
"xhtml/elements/keygen/057-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24212422
"xhtml/elements/keygen/058-also-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24222423
"xhtml/elements/keygen/058-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24232424
"xhtml/elements/keygen/059-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24242425
"xhtml/elements/keygen/060-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24252426
"xhtml/elements/keygen/061-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24262427
"xhtml/elements/keygen/154-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
2427-
"xhtml/elements/keygen/157-novalid.xhtml": "Bad value \u201c\u201d for attribute \u201ckeytype\u201d on element \u201ckeygen\u201d.",
2428+
"xhtml/elements/keygen/157-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24282429
"xhtml/elements/keygen/359-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24292430
"xhtml/elements/keygen/360-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24302431
"xhtml/elements/keygen/361-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
2432+
"xhtml/elements/keygen/keygen-novalid.xhtml": "The \u201ckeygen\u201d element is obsolete. ",
24312433
"xhtml/elements/link/001-novalid.xhtml": "Element \u201clink\u201d is missing required attribute \u201chref\u201d.",
24322434
"xhtml/elements/menu/001-haswarn.xhtml": "The \u201cmenu\u201d element is not supported in all browsers. Please be sure to test, and consider using a polyfill.",
24332435
"xhtml/elements/menu/001-novalid.xhtml": "The \u201ccontextmenu\u201d attribute must refer to a \u201cmenu\u201d element.",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<html xmlns="http://www.w3.org/1999/xhtml">
2+
<head>
3+
<title>keygen is never valid</title>
4+
</head>
5+
<body>
6+
<keygen/>
7+
</body>
8+
</html>

html/dom/interfaces.html

-21
Original file line numberDiff line numberDiff line change
@@ -1718,26 +1718,6 @@ <h1>HTML IDL tests</h1>
17181718
void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
17191719
};
17201720

1721-
interface HTMLKeygenElement : HTMLElement {
1722-
attribute boolean autofocus;
1723-
attribute DOMString challenge;
1724-
attribute boolean disabled;
1725-
readonly attribute HTMLFormElement? form;
1726-
attribute DOMString keytype;
1727-
attribute DOMString name;
1728-
1729-
readonly attribute DOMString type;
1730-
1731-
readonly attribute boolean willValidate;
1732-
readonly attribute ValidityState validity;
1733-
readonly attribute DOMString validationMessage;
1734-
boolean checkValidity();
1735-
boolean reportValidity();
1736-
void setCustomValidity(DOMString error);
1737-
1738-
readonly attribute NodeList labels;
1739-
};
1740-
17411721
interface HTMLOutputElement : HTMLElement {
17421722
[PutForwards=value] readonly attribute DOMTokenList htmlFor;
17431723
readonly attribute HTMLFormElement? form;
@@ -3301,7 +3281,6 @@ <h1>HTML IDL tests</h1>
33013281
HTMLOptGroupElement: ['document.createElement("optgroup")'],
33023282
HTMLOptionElement: ['document.createElement("option")', 'new Option()'],
33033283
HTMLTextAreaElement: ['document.createElement("textarea")'],
3304-
HTMLKeygenElement: ['document.createElement("keygen")'],
33053284
HTMLOutputElement: ['document.createElement("output")'],
33063285
HTMLProgressElement: ['document.createElement("progress")'],
33073286
HTMLMeterElement: ['document.createElement("meter")'],

html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html

+11-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<script src="/resources/testharnessreport.js"></script>
88
<div id="log"></div>
99
<form id="f1">
10-
<input type="radio" id="r1">
11-
<keygen id="kg" name="key"></keygen>
10+
<input type="radio" id="r1" name="ra">
11+
<keygen id="kg" name="key"></keygen> <!-- we test that it does *not* appear in form.elements -->
1212
</form>
1313
<form id="f2">
1414
<table>
@@ -39,7 +39,7 @@
3939

4040
//length
4141
test(function () {
42-
assert_equals(coll1.length, 2, "The length attribute is incorrect.");
42+
assert_equals(coll1.length, 1, "The length attribute is incorrect.");
4343
assert_equals(coll2.length, 4, "The length attribute is incorrect.");
4444
}, "The length attribute must return the number of elements in the form");
4545

@@ -83,17 +83,22 @@
8383
}, "The namedItem(name) must return null if there is no matched element");
8484

8585
test(function () {
86-
assert_equals(coll1.namedItem("kg"), document.getElementById("kg"), "Controls can be named by 'id' attribute.");
87-
assert_equals(coll1.namedItem("key"), document.getElementById("kg"), "Controls can be named by 'name' attribute.");
86+
assert_equals(coll1.namedItem("r1"), document.getElementById("r1"), "Controls can be named by 'id' attribute.");
87+
assert_equals(coll1.namedItem("ra"), document.getElementById("r1"), "Controls can be named by 'name' attribute.");
8888
}, "Controls can be indexed by id or name attribute");
8989

90+
test(function () {
91+
assert_equals(coll1.namedItem("kg"), null, "Keygen does not show up when queried by id.");
92+
assert_equals(coll1.namedItem("key"), null, "Keygen does not show up when queried by name.");
93+
}, "Keygen controls do not show up at all");
94+
9095
test(function () {
9196
assert_equals(coll2.namedItem("btn").length, 2, "The length attribute should be 2.");
9297
}, "The namedItem(name) must return the items with id or name attribute");
9398

9499
//various controls in fieldset and form
95100
var containers = ["form", "fieldset"],
96-
controls = ["button", "fieldset", "input", "keygen", "object", "output", "select", "textarea"];
101+
controls = ["button", "fieldset", "input", "object", "output", "select", "textarea"];
97102
for (var m = 0; m < containers.length; m++) {
98103
test(function () {
99104
var container = document.createElement(containers[m]);

html/rendering/bindings/the-keygen-element-0/.gitkeep

Whitespace-only changes.

html/resources/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var HTML5_VOID_ELEMENTS = [ 'area', 'base', 'br', 'col', 'command', 'embed',
3131
'track', 'wbr' ];
3232

3333
// https://html.spec.whatwg.org/multipage/multipage/forms.html#form-associated-element
34-
var HTML5_FORM_ASSOCIATED_ELEMENTS = [ 'button', 'fieldset', 'input', 'keygen',
34+
var HTML5_FORM_ASSOCIATED_ELEMENTS = [ 'button', 'fieldset', 'input',
3535
'object', 'output', 'select', 'textarea' ];
3636

3737
function newDocument() {

html/semantics/forms/constraints/form-validation-willValidate.html

-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@
3939
types: [],
4040
testData: [{conditions: {}, expected: false, name: "[target] Must be barred from the constraint validation"}]
4141
},
42-
{
43-
tag: "keygen",
44-
types: [],
45-
testData: [{conditions: {}, expected: false, name: "[target] Must be barred from the constraint validation"}]
46-
},
4742
//If an element is disabled, it is barred from constraint validation.
4843
//The willValidate attribute must be true if an element is mutable
4944
//If the readonly attribute is specified on an INPUT element, the element is barred from constraint validation.

html/semantics/forms/form-control-infrastructure/form.html

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<p><button id="button">button</button>
1010
<p><fieldset id="fieldset">fieldset</fieldset>
1111
<p><input id="input">
12-
<p><keygen id="keygen">
1312
<p><object id="object">object</object>
1413
<p><output id="output">output</output>
1514
<p><select id="select"><option>select</option></select>
@@ -59,7 +58,6 @@
5958
"button",
6059
"fieldset",
6160
"input",
62-
"keygen",
6361
"object",
6462
"output",
6563
"select",

html/semantics/forms/form-submission-0/url-encoded.html

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
input: "<textarea name=foo>bar</textarea>",
1616
output: "foo=bar"
1717
},
18+
{
19+
name: "nokeygen.simple",
20+
input: "<input name=foo value=barb><keygen>",
21+
output: "foo=barb"
22+
}
1823
];
1924
simple_tests.forEach(function(test_obj) {
2025
test_obj.test = async_test(test_obj.name);

html/semantics/forms/resetting-a-form/reset-form.html

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<input type="checkbox" id="cb1" checked="checked" />
1616
<input type="checkbox" id="cb2" />
1717
<textarea id="ta">abc</textarea>
18-
<!--<keygen id="kg"></keygen>-->
1918
<output id="opt">5</output>
2019
<select id="slt1">
2120
<option value="1">ITEM1</option>
@@ -114,7 +113,6 @@
114113
assert_true(document.getElementById("slt3").options[1].selected, "The second option in the select element with multiple attribute should be selected.");
115114
assert_true(document.getElementById("slt3").options[2].selected, "The third option in the select element with multiple attribute should be selected.");
116115
}, "Resetting <select> " + description);
117-
//TODO: The keygen reset algorithm
118116
}
119117

120118
</script>

html/semantics/forms/the-form-element/form-nameditem.html

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<script src="/resources/testharnessreport.js"></script>
66
<div id=log></div>
77
<!-- XXX Nothing tests id attributes yet. -->
8-
<!-- XXX Keygen. -->
98
<!-- XXX We also need tests for moving inputs and forms in the DOM. -->
109
<form>
1110
<input type=button name=button>

html/semantics/forms/the-keygen-element/.gitkeep

Whitespace-only changes.

html/semantics/forms/the-label-element/labelable-elements.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@
103103
}, "Check if the input element in radio state can access 'labels'");
104104

105105
test(function() {
106-
assert_equals(document.getElementById("lbl7").control.id, "testkeygen", "A keygen element should be labelable.");
107-
}, "Check if the keygen element is a labelable element");
106+
assert_not_equals(document.getElementById("lbl7").control, document.getElementById("testkeygen"));
107+
assert_equals(document.getElementById("lbl7").control, null, "A keygen element should not be labelable.");
108+
}, "Check if the keygen element is not a labelable element");
108109

109110
test(function() {
110-
testLabelsAttr("testkeygen", "lbl7");
111+
assert_equals(document.getElementById("testkeygen").labels, undefined);
111112
}, "Check if the keygen element can access 'labels'");
112113

113114
test(function() {

html/semantics/interfaces.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var elements = [
7272
["ins", "Mod"],
7373
["isindex", "Unknown"],
7474
["kbd", ""],
75-
["keygen", "Keygen"],
75+
["keygen", "Unknown"],
7676
["label", "Label"],
7777
["legend", "Legend"],
7878
["li", "LI"],

html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="author" title="Sergey G. Grekhov" href="mailto:[email protected]">
66
<meta name="author" title="Aleksei Yu. Semenov" href="mailto:[email protected]">
77
<meta name="assert" content="Template element can be a descendant of the body element">
8-
<link rel="help" href="http://www.w3.org/TR/2013/WD-html-templates-20130214/#template-element">
8+
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-template-element">
99
<script src="/resources/testharness.js"></script>
1010
<script src="/resources/testharnessreport.js"></script>
1111
<script src='/html/resources/common.js'></script>
@@ -93,7 +93,7 @@
9393
generate_tests(templateIsAnIndirectChild, parameters,
9494
'Template element as an indirect descendant of the HEAD, BODY and FRAMESET elements');
9595

96-
parameters = [['Template element as a descendant of the FRAMESET element. ' +
96+
parameters = [['Template element as an indirect descendant of the FRAMESET element. ' +
9797
'Template element is created by innerHTML',
9898
frameset],
9999
];

old-tests/submission/Infraware/Forms/contents/Forms/keygen_checkvalidity.html

-44
This file was deleted.

old-tests/submission/Infraware/Forms/contents/Forms/keygen_labels.html

-48
This file was deleted.

0 commit comments

Comments
 (0)