Update web-platform-tests to revision 3b3585e368841b77caea8576fa56cef91c3fbdf0

This commit is contained in:
Ms2ger 2016-09-26 10:52:50 +02:00
parent d00639c55f
commit 3b4f0ec0bb
541 changed files with 14609 additions and 3288 deletions

View file

@ -44,12 +44,12 @@
},
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {}, expected: true, name: "[target] no constraint"},
{conditions: {max: "2000-01-01T12:00:00Z", value: "2001-01-01T12:00:00Z"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01-01T12:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00Z"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
]
},
@ -71,7 +71,7 @@
{conditions: {}, expected: true, name: "[target] no constraint"},
{conditions: {max: "2000-01", value: "2001-01"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01", value: "2000-01"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {step: 3 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
]
},

View file

@ -44,12 +44,12 @@
},
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {}, expected: true, name: "[target] no constraint"},
{conditions: {max: "2000-01-01T12:00:00Z", value: "2001-01-01T12:00:00Z"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01-01T12:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00Z"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
]
},
@ -71,7 +71,7 @@
{conditions: {}, expected: true, name: "[target] no constraint"},
{conditions: {max: "2000-01", value: "2001-01"}, expected: false, name: "[target] suffering from an overflow"},
{conditions: {min: "2001-01", value: "2000-01"}, expected: false, name: "[target] suffering from an underflow"},
{conditions: {step: 2 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {step: 3 * 1 * 1, value: "2001-03"}, expected: false, name: "[target] suffering from a step mismatch"},
{conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"}
]
},

View file

@ -12,20 +12,19 @@
var testElements = [
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {max: "", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] The max attribute is not set"},
{conditions: {max: "2000-01-01T12:00:00Z", value: ""}, expected: false, name: "[target] Value is empty string"},
{conditions: {max: "2000-01-01 12:00:00Z", value: "2001-01-01T12:00:00Z"}, expected: false, name: "[target] The max attribute is an invalid global date time string"},
{conditions: {max: "2000-01-01T12:00:00Z", value: "2000-01-01T11:00:00Z"}, expected: false, name: "[target] The max attribute is greater than the value attribute"},
{conditions: {max: "2000-01-01T23:59:59Z", value: "2001-01-01T24:00:00Z"}, expected: false, name: "[target] The value is an invalid datetime string(hour is greater than 23)"},
{conditions: {max: "1970-01-01T12:00Z", value: "80-01-01T12:00Z"}, expected: false, name: "[target] The value if an invalid date time string(year is two digits)"},
{conditions: {max: "2000-01-01T12:00:00Z", value: "2001-01-01T13:00:00Z"}, expected: true, name: "[target] The value is greater than max"},
{conditions: {max: "2000-01-01T12:00:00.1Z", value: "2000-01-01T12:00:00.2Z"}, expected: true, name: "[target] The value is greater than max(with millisecond in 1 digit)"},
{conditions: {max: "2000-01-01T12:00:00.01Z", value: "2000-01-01T12:00:00.02Z"}, expected: true, name: "[target] The value is greater than max(with millisecond in 2 digits)"},
{conditions: {max: "2000-01-01T12:00:00.001Z", value: "2000-01-01T12:00:00.002Z"}, expected: true, name: "[target] The value is greater than max(with millisecond in 3 digits)"},
{conditions: {max: "", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The max attribute is not set"},
{conditions: {max: "2000-01-01T12:00:00", value: ""}, expected: false, name: "[target] Value is empty string"},
{conditions: {max: "2000-01-01 12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] The max attribute is an invalid local date time string"},
{conditions: {max: "2000-01-01T12:00:00", value: "2000-01-01T11:00:00"}, expected: false, name: "[target] The max attribute is greater than the value attribute"},
{conditions: {max: "2000-01-01T23:59:59", value: "2001-01-01T24:00:00"}, expected: false, name: "[target] The value is an invalid local date time string(hour is greater than 23)"},
{conditions: {max: "1970-01-01T12:00", value: "80-01-01T12:00"}, expected: false, name: "[target] The value if an invalid local date time string(year is two digits)"},
{conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T13:00:00"}, expected: true, name: "[target] The value is greater than max"},
{conditions: {max: "2000-01-01T12:00:00.1", value: "2000-01-01T12:00:00.2"}, expected: true, name: "[target] The value is greater than max(with millisecond in 1 digit)"},
{conditions: {max: "2000-01-01T12:00:00.01", value: "2000-01-01T12:00:00.02"}, expected: true, name: "[target] The value is greater than max(with millisecond in 2 digits)"},
{conditions: {max: "2000-01-01T12:00:00.001", value: "2000-01-01T12:00:00.002"}, expected: true, name: "[target] The value is greater than max(with millisecond in 3 digits)"},
{conditions: {max: "2000-01-01T12:00:00", value: "10000-01-01T12:00:00"}, expected: true, name: "[target] The value is greater than max(Year is 10000 should be valid)"},
{conditions: {max: "8592-01-01T02:09+02:09", value: "8593-01-01T02:09+02:09"}, expected: true, name: "[target] The value is greater than max(with timezone)"}
]
},
{

View file

@ -12,20 +12,20 @@
var testElements = [
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {min: "", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] The min attribute is not set"},
{conditions: {min: "2000-01-01T12:00:00Z", value: ""}, expected: false, name: "[target] Value is empty string"},
{conditions: {min: "2001-01-01 12:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] The min attribute is an invalid global date time string"},
{conditions: {min: "2000-01-01T11:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] The min attribute is less than the value attribute"},
{conditions: {min: "2001-01-01T23:59:59Z", value: "2000-01-01T24:00:00Z"}, expected: false, name: "[target] The value is an invalid datetime string(hour is greater than 23)"},
{conditions: {min: "1980-01-01T12:00Z", value: "79-01-01T12:00Z"}, expected: false, name: "[target] The value is an invalid date time string(year is two digits)"},
{conditions: {min: "2000-01-01T13:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: true, name: "[target] The value is less than min"},
{conditions: {min: "2000-01-01T12:00:00.2Z", value: "2000-01-01T12:00:00.1Z"}, expected: true, name: "[target] The value is less than min(with millisecond in 1 digit)"},
{conditions: {min: "2000-01-01T12:00:00.02Z", value: "2000-01-01T12:00:00.01Z"}, expected: true, name: "[target] The value is less than min(with millisecond in 2 digits)"},
{conditions: {min: "2000-01-01T12:00:00.002Z", value: "2000-01-01T12:00:00.001Z"}, expected: true, name: "[target] The value is less than min(with millisecond in 3 digits)"},
{conditions: {min: "10000-01-01T12:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: true, name: "[target] The value is less than min(Year is 10000 should be valid)"},
{conditions: {min: "8593-01-01T02:09+02:09", value: "8592-01-01T02:09+02:09"}, expected: true, name: "[target] The value is greater than max(with timezone)"}
{conditions: {min: "", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The min attribute is not set"},
{conditions: {min: "2000-01-01T12:00:00", value: ""}, expected: false, name: "[target] Value is empty string"},
{conditions: {min: "2001-01-01 12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The min attribute is an invalid local date time string"},
{conditions: {min: "2000-01-01T11:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] The min attribute is less than the value attribute"},
{conditions: {min: "2001-01-01T23:59:59", value: "2000-01-01T24:00:00"}, expected: false, name: "[target] The value is an invalid local date time string(hour is greater than 23)"},
{conditions: {min: "1980-01-01T12:00", value: "79-01-01T12:00"}, expected: false, name: "[target] The value is an invalid local date time string(year is two digits)"},
{conditions: {min: "2000-01-01T13:00:00", value: "2000-01-01T12:00:00"}, expected: true, name: "[target] The value is less than min"},
{conditions: {min: "2000-01-01T12:00:00.2", value: "2000-01-01T12:00:00.1"}, expected: true, name: "[target] The value is less than min(with millisecond in 1 digit)"},
{conditions: {min: "2000-01-01T12:00:00.02", value: "2000-01-01T12:00:00.01"}, expected: true, name: "[target] The value is less than min(with millisecond in 2 digits)"},
{conditions: {min: "2000-01-01T12:00:00.002", value: "2000-01-01T12:00:00.001"}, expected: true, name: "[target] The value is less than min(with millisecond in 3 digits)"},
{conditions: {min: "10000-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: true, name: "[target] The value is less than min(Year is 10000 should be valid)"},
{conditions: {max: "8593-01-01T02:09", value: "8592-01-01T02:09"}, expected: false, name: "[target] The value is greater than max"}
]
},
{

View file

@ -11,16 +11,6 @@
<script>
//set step = 2 * default step * factor
var testElements = [
{
tag: "input",
types: ["datetime"],
testData: [
{conditions: {step: "", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] The step attribute is not set"},
{conditions: {step: 2 * 60 * 1000, value: ""}, expected: false, name: "[target] The value attibute is empty string"},
{conditions: {step: 2 * 60 * 1000, value: "2000-01-01T12:58Z"}, expected: false, name: "[target] The value must match the step"},
{conditions: {step: 2 * 60 * 1000, value: "2000-01-01T12:59Z"}, expected: true, name: "[target] The value must mismatch the step"}
]
},
{
tag: "input",
types: ["date"],

View file

@ -41,11 +41,11 @@
},
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {max: "2000-01-01T12:00:00Z", value: "2001-01-01T12:00:00Z"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
{conditions: {min: "2001-01-01T12:00:00Z", value: "2000-01-01T12:00:00Z"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00Z"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
{conditions: {max: "2000-01-01T12:00:00", value: "2001-01-01T12:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeOverflow is true"},
{conditions: {min: "2001-01-01T12:00:00", value: "2000-01-01T12:00:00"}, expected: false, name: "[target] validity.valid must be false if validity.rangeUnderflow is true"},
{conditions: {step: 2 * 60 * 1000, value: "2001-01-01T12:03:00"}, expected: false, name: "[target] validity.valid must be false if validity.stepMismatch is true"},
{conditions: {required: true, value: ""}, expected: false, name: "[target] validity.valid must be false if validity.valueMissing is true"}
]
},

View file

@ -21,18 +21,17 @@
},
{
tag: "input",
types: ["datetime"],
types: ["datetime-local"],
testData: [
{conditions: {required: false, value: ""}, expected: false, name: "[target] The required attribute is not set"},
{conditions: {required: true, value: "2000-12-10T12:00:00Z"}, expected: false, name: "[target] Valid global date and time string(2000-12-10T12:00:00Z)"},
{conditions: {required: true, value: "2000-12-10 12:00Z"}, expected: false, name: "[target] Valid global date and time string(2000-12-10 12:00Z)"},
{conditions: {required: true, value: "1979-10-14T12:00:00.001-04:00"}, expected: false, name: "[target] Valid global date and time string(1979-10-14T12:00:00.001-04:00)"},
{conditions: {required: true, value: "8592-01-01T02:09+02:09"}, expected: false, name: "[target] Valid global date and time string(8592-01-01T02:09+02:09)"},
{conditions: {required: true, value: "2000-12-10T12:00:00"}, expected: false, name: "[target] Valid local date and time string(2000-12-10T12:00:00)"},
{conditions: {required: true, value: "2000-12-10 12:00"}, expected: false, name: "[target] Valid local date and time string(2000-12-10 12:00)"},
{conditions: {required: true, value: "1979-10-14T12:00:00.001"}, expected: false, name: "[target] Valid local date and time string(1979-10-14T12:00:00.001)"},
{conditions: {required: true, value: 1234567}, expected: true, name: "[target] The value attribute is a number(1234567)"},
{conditions: {required: true, value: new Date()}, expected: true, name: "[target] The value attribute is a Date object"},
{conditions: {required: true, value: "1979-10-99 99:99Z"}, expected: true, name: "[target] Invalid global date and time string(1979-10-99 99:99Z)"},
{conditions: {required: true, value: "1979-10-14 12:00:00"}, expected: true, name: "[target] Invalid global date and time string(1979-10-14 12:00:00)"},
{conditions: {required: true, value: "2001-12-21 12:00Z"}, expected: true, name: "[target] Invalid global date and time string(2001-12-21 12:00Z)-two white space"},
{conditions: {required: true, value: "1979-10-99 99:99"}, expected: true, name: "[target] Invalid local date and time string(1979-10-99 99:99)"},
{conditions: {required: true, value: "1979-10-14 12:00:00"}, expected: false, name: "[target] Valid local date and time string(1979-10-14 12:00:00)"},
{conditions: {required: true, value: "2001-12-21 12:00"}, expected: true, name: "[target] Invalid local date and time string(2001-12-21 12:00)-two white space"},
{conditions: {required: true, value: "abc"}, expected: true, name: "[target] the value attribute is a string(abc)"},
{conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
]

View file

@ -49,7 +49,7 @@
//If the readonly attribute is specified on an INPUT element, the element is barred from constraint validation.
{
tag: "input",
types: ["text", "search", "tel", "url", "email", "password", "datetime", "date", "month", "week", "time", "color", "file", "submit"],
types: ["text", "search", "tel", "url", "email", "password", "datetime-local", "date", "month", "week", "time", "color", "file", "submit"],
testData: [
{conditions: {disabled: true}, expected: false, name: "[target] Must be barred from the constraint validation if it is disabled"},
{conditions: {disabled: false, readOnly: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},

View file

@ -0,0 +1,85 @@
<!doctype html>
<title>Historical forms features should not be supported</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<form id=form hidden>
<label id=label></label>
<input id=input>
<button id=button></button>
<select id=select>
<optgroup id=optgroup>
<option id=option>
</select>
<datalist id=datalist></datalist>
<textarea id=textarea></textarea>
<progress id=progress></progress>
<meter id=meter></meter>
<fieldset id=fieldset>
<legend id=legend></legend>
</fieldset>
</form>
<form hidden action="isindex-support.txt" target=isindex_iframe id=isindex_form>
<input name=isindex value=x>
<iframe name=isindex_iframe id=isindex_iframe></iframe>
</form>
<script>
var tags = ['form', 'label', 'input', 'button', 'select', 'datalist',
'optgroup', 'option', 'textarea', 'progress', 'meter', 'fieldset', 'legend'];
function t(property, tagName) {
var tagNames = tagName ? [tagName] : tags;
tagNames.forEach(function(tagName) {
test(function() {
assert_false(property in document.getElementById(tagName));
}, tagName + '.' + property + ' should not be supported');
});
}
function inputType(type) {
test(function() {
var input = document.createElement('input');
input.type = type;
assert_equals(input.type, 'text');
}, '<input type=' + type + '> should not be supported');
}
// <input type=range multiple>
// added in https://github.com/whatwg/html/commit/1efac390abb3f95df61f2d2ac6c0feb47349d97b
// removed in https://github.com/whatwg/html/commit/b598d4f873fb8c27d4b23b033837108edfbc3d75
t('valueLow', 'input');
t('valueHigh', 'input');
// requestAutoComplete()
// added in https://github.com/whatwg/html/commit/321659e4db11228857632487ab72b6959db1ba86
// removed in https://github.com/whatwg/html/commit/6a257aae619f85390eee20b47767f34887450fcd
t('requestAutocomplete', 'form');
t('onautocomplete', 'form');
t('onautocompleteerror', 'form');
// <input type=datetime>
// added in WF2
// removed in https://github.com/whatwg/html/commit/80ba4fa24e5d3d81a10aa1bbd8a2f72f4bcc3f7c
inputType('datetime');
// <progress form>, <meter form>
// removed in https://github.com/whatwg/html/commit/3814376a311837ddfac229d9a631cd10adf53157
t('form', 'progress');
t('form', 'meter');
// form.item(), form.namedItem()
// removed in https://github.com/whatwg/html/commit/da87ab9009d5aeca95a602e718439e35b00d0731
t('item', 'form');
t('namedItem', 'form');
// <input name=isindex>
// removed in https://github.com/whatwg/html/commit/5c44abc734eb483f9a7ec79da5844d2fe63d9c3b
async_test(function() {
var iframe = document.getElementById('isindex_iframe');
iframe.onload = this.step_func_done(function() {
assert_regexp_match(iframe.contentWindow.location.href, /\?isindex=x$/);
});
document.getElementById('isindex_form').submit();
}, '<input name=isindex> should not be supported');
</script>

View file

@ -7,7 +7,7 @@
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var types = ["hidden", "email", "datetime", "date", "month", "week", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"]; //types for which the API doesn't apply
var types = ["hidden", "email", "datetime-local", "date", "month", "week", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"]; //types for which the API doesn't apply
var types2 = ["text", "search", "tel", "url", "password"]; //types for which the API applies
types.forEach(function(type){

View file

@ -30,7 +30,7 @@
t5 = async_test("canceled activation steps on unchecked checkbox"),
t6 = async_test("canceled activation steps on unchecked checkbox (indeterminate=true in onclick)");
checkbox1.onclick = t1.step_func(function () {
checkbox1.onclick = t1.step_func(function(e) {
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");

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Cloning of input elements</title>
<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone">
<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone-ext">
<link rel="help" href="https://html.spec.whatwg.org/multipage/forms.html#the-input-element:concept-node-clone-ext">
<link rel="author" title="Matthew Phillips" href="mailto:matthew@matthewphillips.info">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(function() {
var input = document.createElement("input");
input.value = "foo bar";
var copy = input.cloneNode();
assert_equals(copy.value, "foo bar");
}, "input element's value should be cloned");
test(function() {
var input = document.createElement("input");
input.value = "foo bar";
var copy = input.cloneNode();
copy.setAttribute("value", "something else");
assert_equals(copy.value, "foo bar");
}, "input element's dirty value flag should be cloned, so setAttribute doesn't affect the cloned input's value");
test(function() {
var input = document.createElement("input");
input.setAttribute("type", "radio");
input.checked = true;
var copy = input.cloneNode();
assert_equals(copy.checked, true);
}, "input element's checkedness should be cloned");
test(function() {
var input = document.createElement("input");
input.setAttribute("type", "radio");
input.checked = false;
var copy = input.cloneNode();
copy.setAttribute("checked", "checked");
assert_equals(copy.checked, false);
}, "input element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness");
</script>

View file

@ -1,45 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Form input type=datetime</title>
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
<link rel=help href="https://html.spec.whatwg.org/multipage/multipage/common-microsyntaxes.html#global-dates-and-times">
<link rel=help href="https://html.spec.whatwg.org/multipage/multipage/states-of-the-type-attribute.html#local-date-and-time-state-(type=datetime)">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var datetime = [
// valid values
{value: "", expected: "", testname: "empty value"},
{value: "2014-01-01T11:11Z", expected: "2014-01-01T11:11Z", testname: "datetime input value set to 2014-01-01T11:11Z without min/max"},
{value: "2014-01-01 11:11Z", expected: "2014-01-01T11:11Z", testname: "datetime input value set to 2014-01-01 11:11Z without min/max"},
{value: "2014-01-01 11:11-04:00", expected: "2014-01-01T15:11Z", testname: "datetime input value set to 2014-01-01 11:11-04:00 without min/max"},
{value: "2014-01-01 11:11-0400", expected: "2014-01-01T15:11Z", testname: "datetime input value set to 2014-01-01 11:11-0400 without min/max"},
{value: "2014-01-01 11:11:00.000-04:00", expected: "2014-01-01T15:11Z", testname: "datetime input value set to 2014-01-01 11:11:00.000-04:00 without min/max"},
// invalid values
{value: "2014-01-01 11:11:00.000Z", expected: "", testname: "datetime input value set to 2014-01-01 11:11:00.000Z without min/max"},
{value: "2014-01-01 11:11:00.000", expected: "", testname: "datetime input value set to 2014-01-01 11:11:00.000 without min/max"},
{value: "2014-01-01 11:11:00.000+", expected: "", testname: "datetime input value set to 2014-01-01 11:11:00.000+ without min/max"},
{value: "2014-01-01 11:11:00.000+24", expected: "", testname: "datetime input value set to 2014-01-01 11:11:00.000+24 without min/max"},
{value: "2014-01-01 11:11:00.000+2360", expected: "", testname: "datetime input value set to 2014-01-01 11:11:00.000+2360 without min/max"},
{value: "2014-01-0 11:11:00.000+0400", expected: "", testname: "datetime input value set to 2014-01-0 11:11:00.000+0400 without min/max"},
{value: "2014-01-01 11:1:00.000+0400", expected: "", testname: "datetime input value set to 2014-01-01 11:1:00.000+0400 without min/max"},
// min/max
{value: "2014-01-01 11:11Z", attributes: { min: "2014-01-01T11:10Z" }, expected: "2014-01-01T11:11Z", testname: "Value >= min attribute"},
{value: "2014-01-01 11:10Z", attributes: { min: "2014-01-01T11:11Z" }, expected: "2014-01-01T11:11Z", testname: "Value < min attribute"},
{value: "2014-01-01 11:10Z", attributes: { max: "2014-01-01T11:11Z" }, expected: "2014-01-01T11:11Z", testname: "Value <= max attribute"},
{value: "2014-01-01 11:11Z", attributes: { max: "2014-01-01T11:10Z" }, expected: "2014-01-01T11:10Z", testname: "Value > max attribute"}
];
for (var i = 0; i < datetime.length; i++) {
var w = datetime[i];
test(function() {
var input = document.createElement("input");
input.type = "datetime";
input.value = w.value;
for(var attr in w.attributes) {
input[attr] = w.attributes[attr];
}
assert_equals(input.value, w.expected);
}, w.testname);
}
</script>

View file

@ -13,7 +13,6 @@ var types = [
"url",
"email",
"password",
"datetime",
"date",
"month",
"week",

View file

@ -14,16 +14,10 @@
<h1>Inputs Month</h1>
<div style="display: none">
<input id="valid" type="month" value="2011-11" min="2011-01" max="2011-12" />
<input id="too_small_value" type="month" value="1999-01" min="2011-01" max="2011-12"/>
<input id="too_large_value" type="month" value="2099-01" min="2011-01" max="2011-12"/>
<input id="invalid_value" type="month" value="invalid-month" min="2011-01" max="2011-12"/>
<input id="invalid_min" type="month" value="2011-01" min="invalid_min" max="2011-12"/>
<input id="invalid_max" type="month" value="2011-01" min="2011-01" max="invalid_max"/>
<input id="min_larger_than_max" type="month" value="2011-01" min="2099-01" max="2011-12"/>
<input id="value_can_be_empty_string" type="month" value="2013-06" />
<input id="invalid_value_with_two_digits_year" type="month" value="13-06" />
<input id="invalid_value_is_set" type="month" />
<input id="invalid_value_is_set_to_valid_value" type="month" value="2013-05" />
<input id="step_attribute_is_invalid_value" type="month" value="2013-06" step="invalid_step_value" />
<input id="invalid_month_too_high" type="month" value="2013-13" />
<input id="invalid_month_too_low" type="month" value="2013-00" />
@ -36,23 +30,6 @@
assert_equals(document.getElementById("valid").type, "month")
}, "month type support on input element");
test(function() {
assert_equals(document.getElementById("valid").value, "2011-11"),
assert_equals(document.getElementById("too_small_value").value, "2011-01"),
assert_equals(document.getElementById("too_large_value").value, "2011-12")
}, "The value attribute, if specified and not empty, must have a value that is a valid month string");
test(function() {
assert_equals(document.getElementById("valid").min, "2011-01"),
assert_equals(document.getElementById("invalid_min").min, "")
}, "The min attribute, if specified, must have a value that is a valid month string.");
test(function() {
assert_equals(document.getElementById("valid").max, "2011-12"),
assert_equals(document.getElementById("min_larger_than_max").max, "2099-01"),
assert_equals(document.getElementById("invalid_max").max, "")
}, "The max attribute, if specified, must have a value that is a valid month string");
test(function() {
assert_equals(document.getElementById("invalid_value").value, "")
}, "User agents must not allow the user to set the value to a non-empty string that is not a valid month string.");
@ -71,11 +48,6 @@
assert_equals(document.getElementById("invalid_value_is_set").value, "")
}, "When value is set with invalid value, the value must return empty string.");
test(function() {
document.getElementById("invalid_value_is_set_to_valid_value").value = "invalid value";
assert_equals(document.getElementById("invalid_value_is_set_to_valid_value").value, "2013-05")
}, "When value is given invalid value to non-empty valid string, the value must be same as before.");
test(function() {
document.getElementById("step_attribute_is_invalid_value").stepUp();
assert_equals(document.getElementById("step_attribute_is_invalid_value").value, "2013-07")

View file

@ -15,7 +15,7 @@
{ type: "url", sanitizedValue: "foobar" },
{ type: "email", sanitizedValue: "foobar" },
{ type: "password", sanitizedValue: " foobar " },
{ type: "datetime", sanitizedValue: "" },
{ type: "datetime-local", sanitizedValue: "" },
{ type: "date", sanitizedValue: "" },
{ type: "month", sanitizedValue: "" },
{ type: "week", sanitizedValue: "" },

View file

@ -14,7 +14,7 @@
{ type: "url", mode: "value", sanitizedValue: "foo" },
{ type: "email", mode: "value", sanitizedValue: "foo" },
{ type: "password", mode: "value", sanitizedValue: "foo" },
{ type: "datetime", mode: "value", sanitizedValue: "" },
{ type: "datetime-local", mode: "value", sanitizedValue: "" },
{ type: "date", mode: "value", sanitizedValue: "" },
{ type: "month", mode: "value", sanitizedValue: "" },
{ type: "week", mode: "value", sanitizedValue: "" },

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Cloning of textarea elements</title>
<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode">
<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone">
<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone-ext">
<link rel="help" href="https://html.spec.whatwg.org/multipage/forms.html#the-textarea-element:concept-node-clone-ext">
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(function() {
var textarea = document.createElement("textarea");
textarea.value = "foo bar";
var copy = textarea.cloneNode();
assert_equals(copy.value, "foo bar");
}, "textarea element's value should be cloned");
test(function() {
var textarea = document.createElement("textarea");
textarea.value = "foo bar";
var copy = textarea.cloneNode();
copy.setAttribute("value", "something else");
assert_equals(copy.value, "foo bar");
}, "textarea element's dirty value flag should be cloned, so setAttribute doesn't affect the cloned textarea's value");
</script>

View file

@ -1,5 +1,6 @@
<!DOCTYPE html>
<title>Dynamic manipulation of textarea.wrap</title>
<link rel=match href=wrap-reflect-1-ref.html>
<link rel=help href=https://html.spec.whatwg.org/multipage/#dom-textarea-wrap>
<link rel=author title=Ms2ger href=mailto:ms2ger@gmail.com>
<textarea wrap=off cols=20>01234567890 01234567890 01234567890</textarea>

View file

@ -1,5 +1,6 @@
<!DOCTYPE html>
<title>Dynamic manipulation of textarea.wrap</title>
<link rel=match href=wrap-reflect-1-ref.html>
<link rel=help href=https://html.spec.whatwg.org/multipage/#dom-textarea-wrap>
<link rel=author title=Ms2ger href=mailto:ms2ger@gmail.com>
<textarea wrap=off cols=20>01234567890 01234567890 01234567890</textarea>