mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision bda2059150dca8ab47f088b4cc619fcdc1f262fa
This commit is contained in:
parent
3535f3f6c2
commit
7c4281f3da
182 changed files with 7692 additions and 1042 deletions
|
@ -99,6 +99,11 @@
|
|||
}, "Check the checkValidity method of the form element when it has a fieldset child");
|
||||
|
||||
test(function(){
|
||||
// Restore the condition to default which was modified during the previous test.
|
||||
document.getElementById("fs").disabled = false;
|
||||
document.getElementById("inp1").value = "";
|
||||
document.getElementById("inp1").type = "text";
|
||||
|
||||
assert_true("reportValidity" in fm3, "The reportValidity method is not supported.");
|
||||
assert_false(fm3.reportValidity(), "The reportValidity method should be false.");
|
||||
document.getElementById("fs").disabled = true;
|
||||
|
|
|
@ -10,37 +10,88 @@
|
|||
<p><fieldset id="fieldset">fieldset</fieldset>
|
||||
<p><input id="input">
|
||||
<p><keygen id="keygen">
|
||||
<p><label id="label">label</label>
|
||||
<p><object id="object">object</object>
|
||||
<p><output id="output">output</output>
|
||||
<p><select id="select"><option>select</option></select>
|
||||
<p><textarea id="textarea">textarea</textarea>
|
||||
|
||||
<!-- label is special: label.form is an alias for label.control.form -->
|
||||
<p><label id="label">label</label>
|
||||
<p><label id="label-form" form="form">label-form</label>
|
||||
<p><label id="label-form-form2" form="form2">label-form-form2</label>
|
||||
<p><label id="label-with-control">label-with-control <input></label>
|
||||
<p><label id="label-for" for="control-for-label">label-for</label> <input id="control-for-label">
|
||||
<p><label id="label-with-progress">label-with-progress <progress></progress></label>
|
||||
<p><label id="label-with-meter">label-with-meter <meter></meter></label>
|
||||
<p>
|
||||
<input id="input-with-form-attr-in-form" form="form2">
|
||||
<label id="label-for-control-form-in-form" for="input-with-form-attr-in-form">label-for-control-form-in-form</label>
|
||||
</p>
|
||||
</form>
|
||||
<form id="form2"></form>
|
||||
<p>
|
||||
<input id="input-with-form-attr" form="form2">
|
||||
<label id="label-for-control-form" for="input-with-form-attr">label-for-control-form</label>
|
||||
</p>
|
||||
<!-- misnested tags where form-association is set by the HTML parser -->
|
||||
<table>
|
||||
<form id="form3"><!-- self-closes but sets the form element pointer -->
|
||||
<tr>
|
||||
<td><label id="label-in-table">label-in-table</label>
|
||||
<td><label id="label-in-table-with-control">label-in-table <input></label>
|
||||
<td><label id="label-in-table-for" for="input-in-table">label-in-table-for</label>
|
||||
<td><input id="input-in-table"><!-- is associated with form3 -->
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
<script>
|
||||
var form;
|
||||
setup(function() {
|
||||
form = document.getElementById("form");
|
||||
if (!form) {
|
||||
throw new TypeError("Didn't find form");
|
||||
form2 = document.getElementById("form2");
|
||||
form3 = document.getElementById("form3");
|
||||
if (!form || !form2 || !form3) {
|
||||
throw new TypeError("Didn't find all forms");
|
||||
}
|
||||
});
|
||||
|
||||
var reassociateableElements = [
|
||||
var listedElements = [
|
||||
"button",
|
||||
"fieldset",
|
||||
"input",
|
||||
"keygen",
|
||||
"label",
|
||||
"object",
|
||||
"output",
|
||||
"select",
|
||||
"textarea",
|
||||
];
|
||||
|
||||
reassociateableElements.forEach(function(localName) {
|
||||
listedElements.forEach(function(localName) {
|
||||
test(function() {
|
||||
var button = document.getElementById(localName);
|
||||
assert_equals(button.form, form);
|
||||
var control = document.getElementById(localName);
|
||||
assert_equals(control.form, form);
|
||||
}, localName + ".form");
|
||||
});
|
||||
|
||||
// label
|
||||
function testLabel(id, expected) {
|
||||
test(function() {
|
||||
var label = document.getElementById(id);
|
||||
assert_equals(label.control && label.control.form, expected, 'Sanity check: label.control.form');
|
||||
assert_equals(label.form, expected, 'label.form');
|
||||
}, id + ".form");
|
||||
}
|
||||
|
||||
testLabel("label", null);
|
||||
testLabel("label-form", null);
|
||||
testLabel("label-form-form2", null);
|
||||
testLabel("label-with-control", form);
|
||||
testLabel("label-for", form);
|
||||
testLabel("label-with-progress", null);
|
||||
testLabel("label-with-meter", null);
|
||||
testLabel("label-for-control-form-in-form", form2);
|
||||
testLabel("label-for-control-form", form2);
|
||||
testLabel("label-in-table", null);
|
||||
testLabel("label-in-table-with-control", form3);
|
||||
testLabel("label-in-table-for", form3);
|
||||
</script>
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
c1_click_fired = true;
|
||||
assert_false(c1_input_fired, "click event should fire before input event");
|
||||
assert_false(c1_change_fired, "click event should fire before change event");
|
||||
assert_false(e.isTrusted, "click()-initiated click event should not be trusted");
|
||||
});
|
||||
checkbox1.oninput = t1.step_func(function(e) {
|
||||
c1_input_fired = true;
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
click_fired = true;
|
||||
assert_false(input_fired, "click event should fire before input event");
|
||||
assert_false(change_fired, "click event should fire before change event");
|
||||
assert_false(e.isTrusted, "click()-initiated click event shouldn't be trusted");
|
||||
});
|
||||
|
||||
radio5.oninput = t1.step_func(function(e) {
|
||||
|
@ -90,7 +91,7 @@
|
|||
assert_true(click_fired, "input event should fire after click event");
|
||||
assert_false(change_fired, "input event should fire before change event");
|
||||
assert_true(e.bubbles, "input event should bubble")
|
||||
assert_false(e.isTrusted, "click()-initiated input event shouldn't be trusted");
|
||||
assert_true(e.isTrusted, "input event should be trusted");
|
||||
assert_false(e.cancelable, "input event should not be cancelable");
|
||||
});
|
||||
|
||||
|
@ -99,7 +100,7 @@
|
|||
assert_true(click_fired, "change event should fire after click event");
|
||||
assert_true(input_fired, "change event should fire after input event");
|
||||
assert_true(e.bubbles, "change event should bubble")
|
||||
assert_false(e.isTrusted, "click()-initiated change event shouldn't be trusted");
|
||||
assert_true(e.isTrusted, "change event should be trusted");
|
||||
assert_false(e.cancelable, "change event should not be cancelable");
|
||||
});
|
||||
|
||||
|
|
|
@ -105,6 +105,8 @@ test(function() {
|
|||
input.selectionStart = 0;
|
||||
a = input.selectionEnd;
|
||||
input.selectionEnd = 0;
|
||||
a = input.selectionDirection;
|
||||
input.selectionDirection = "none";
|
||||
input.setSelectionRange(0, 0);
|
||||
input.setRangeText('', 0, 0);
|
||||
|
||||
|
@ -118,10 +120,12 @@ test(function() {
|
|||
input.type = type;
|
||||
assert_equals(input.type, type, "the given input type is not supported");
|
||||
|
||||
assert_throws("INVALID_STATE_ERR", function() { var a = input.selectionStart; });
|
||||
assert_equals(input.selectionStart, null, 'getting input.selectionStart');
|
||||
assert_throws("INVALID_STATE_ERR", function() { input.selectionStart = 0; });
|
||||
assert_throws("INVALID_STATE_ERR", function() { var a = input.selectionEnd; });
|
||||
assert_equals(input.selectionEnd, null, 'getting input.selectionEnd');
|
||||
assert_throws("INVALID_STATE_ERR", function() { input.selectionEnd = 0; });
|
||||
assert_equals(input.selectionDirection, null, 'getting input.selectionDirection');
|
||||
assert_throws("INVALID_STATE_ERR", function() { input.selectionDirection = "none"; });
|
||||
assert_throws("INVALID_STATE_ERR", function() { input.setSelectionRange(0, 0); });
|
||||
assert_throws("INVALID_STATE_ERR", function() { input.setRangeText('', 0, 0); });
|
||||
|
||||
|
|
|
@ -121,14 +121,14 @@
|
|||
|
||||
// form attribute
|
||||
test(function () {
|
||||
assert_equals(document.getElementById("lbl0").form, document.getElementById("fm"),
|
||||
"The 'form' property for a label with a form owner should return the form owner.");
|
||||
}, "A label's form attribute should return its form owner.");
|
||||
assert_equals(document.getElementById("lbl0").form, null,
|
||||
"The 'form' property for a label should return null if label.control is null.");
|
||||
}, "A label in a form without a control");
|
||||
|
||||
test(function () {
|
||||
assert_equals(document.getElementById("lbl6").form, null,
|
||||
"The 'form' property for a label without a form owner should return null.");
|
||||
}, "Check that the labels property of a form control with no label returns a zero-length NodeList.");
|
||||
assert_equals(document.getElementById("lbl6").form, document.getElementById("fm"),
|
||||
"The 'form' property for a label should return label.control.form.");
|
||||
}, "A label outside a form with a control inside the form");
|
||||
|
||||
// htmlFor attribute
|
||||
test(function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue