Update web-platform-tests to revision 71a0d51d14d8b0f1b53cda3a7d39ef8765164485

This commit is contained in:
Ms2ger 2015-09-17 17:35:48 +02:00
parent d504015496
commit 163009575a
290 changed files with 2928 additions and 972 deletions

View file

@ -273,14 +273,16 @@ var validator = {
},
set_dirty: function(ctl) {
document.disgnMode = "on";
document.designMode = "on";
ctl.focus();
var old_value = ctl.value;
ctl.value = "a";
ctl.value = old_value;
ctl.setSelectionRange(ctl.value.length, ctl.value.length);
if (ctl.type !== 'email') {
ctl.setSelectionRange(ctl.value.length, ctl.value.length);
}
document.execCommand("Delete");
document.disgnMode = "off";
document.designMode = "off";
},
pre_check: function(ctl, item) {

View file

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ValidityState.tooLong and user editing</title>
<link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#limiting-user-input-length:-the-maxlength-attribute">
<meta name="flags" content="interact">
<meta name="assert" content="Per the 'Constraint validation' definition in the referenced section, an input whose value was edited by the user but still exceeds the input's maxlength should suffer from being too long.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<p>Delete one character from the following text input:</p>
<input type="text" value="0123456789" maxlength="5" autocomplete="off" id="testinput">
<div id="log"></div>
<script>
var input = document.getElementById('testinput');
setup({explicit_timeout: true, explicit_done: true});
on_event(input, "input", function () {
test(function() {
assert_class_string(input.validity, 'ValidityState', 'HTMLInputElement.validity must be a ValidityState instance');
assert_true(input.validity.tooLong, "tooLong must be true since the user just changed the input's value and the value exceeds the maxlength");
});
done();
});
</script>
</body>
</html>

View file

@ -181,7 +181,7 @@ test(function() {
test(function() {
textarea.setSelectionRange("string",1);
assert_equals(textarea.selectionStart, 1, "element.selectionStart should be 0");
assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
},'textarea setSelectionRange("string",1)');
@ -193,31 +193,31 @@ test(function() {
test(function() {
textarea.setSelectionRange([],1);
assert_equals(textarea.selectionStart, 1, "element.selectionStart should be 0");
assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
},'textarea setSelectionRange([],1)');
test(function() {
textarea.setSelectionRange({},1);
assert_equals(textarea.selectionStart, 1, "element.selectionStart should be 0");
assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
},'textarea setSelectionRange({},1)');
test(function() {
textarea.setSelectionRange(NaN,1);
assert_equals(textarea.selectionStart, 1, "element.selectionStart should be 0");
assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
},'textarea setSelectionRange(NaN,1)');
test(function() {
textarea.setSelectionRange(null,1);
assert_equals(textarea.selectionStart, 1, "element.selectionStart should be 0");
assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
},'textarea setSelectionRange(null,1)');
test(function() {
textarea.setSelectionRange(undefined,1);
assert_equals(textarea.selectionStart, 1, "element.selectionStart should be 0");
assert_equals(textarea.selectionStart, 0, "element.selectionStart should be 0");
assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
},'textarea setSelectionRange(undefined,1)');
},"test of textarea.setSelectionRange");

View file

@ -7,10 +7,10 @@
<div id="log"></div>
<script>
test(function() {
var valid = ["text", "search", "url", "tel", "email", "password"];
var valid = ["text", "search", "url", "tel", "password"];
var invalid = ["hidden", "datetime", "date", "month", "week", "datetime-local",
"number", "range", "color", "checkbox", "radio", "button",
"file", "submit", "image", "reset"];
"file", "email", "submit", "image", "reset"];
valid.forEach(function(aType) {
test(function() {
var input = document.createElement("input");

View file

@ -0,0 +1,35 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTMLOptGroupElement Test: disabled</title>
<meta name="flags" content="interact">
<link rel="author" title="Intel" href="http://www.intel.com/">
<form>
<select>
<optgroup label="8.01" disabled>
<option value="8.01.1">Lecture 01: Powers of Ten</option>
<option value="8.01.2">Lecture 02: 1D Kinematics</option>
<option value="8.01.3">Lecture 03: Vectors</option>
</optgroup>
<optgroup label="8.02">
<option value="8.02.1">Lecture 01: What holds our world together?</option>
<option value="8.02.2">Lecture 02: Electric Field</option>
<option value="8.02.3">Lecture 03: Electric Flux</option>
</optgroup>
</select>
</form>
<h2>Description</h2>
<p>
This test validates that an optgroup element is disabled if its disabled attribute is present.
</p>
<h2>Test steps:</h2>
<ol>
<li>
Click the select flag to select section '8.01'
</li>
</ol>
<h2>Result:</h2>
<p>Click the select flag and try to select section 8.01, test passes if the section 8.01 is disable to be selected</p>