mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Update web-platform-tests to revision 0159b3ec9ba5355a3340621226e02ae026effd7f
This commit is contained in:
parent
d588ce8d85
commit
43a50e298a
37 changed files with 1341 additions and 62 deletions
|
@ -42,7 +42,7 @@ running in automation. In general the following order of preference holds:
|
|||
* WebDriver tests - for testing the webdriver protocol itself or (in
|
||||
the future) for certain tests that require access to privileged APIs.
|
||||
|
||||
* Manual tests - as a last resort for anything that can't be tested
|
||||
* [Manual tests][manual-tests] - as a last resort for anything that can't be tested
|
||||
using one of the above techniques.
|
||||
|
||||
Some scenarios demand certain test types. For example:
|
||||
|
@ -328,6 +328,7 @@ see the [lint-tool documentation][lint-tool].
|
|||
|
||||
[lint-tool]: ./lint-tool.html
|
||||
[reftests]: ./reftests.html
|
||||
[manual-tests]: ./manual-test.html
|
||||
[test-templates]: ./test-templates.html
|
||||
[requirement-flags]: ./test-templates.html#requirement-flags
|
||||
[testharness-documentation]: ./testharness-documentation.html
|
||||
|
|
|
@ -223,6 +223,7 @@ interface Document : Node {
|
|||
readonly attribute DOMString origin;
|
||||
readonly attribute DOMString compatMode;
|
||||
readonly attribute DOMString characterSet;
|
||||
readonly attribute DOMString charset; // legacy alias of .characterSet
|
||||
readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
|
||||
readonly attribute DOMString contentType;
|
||||
|
||||
|
|
|
@ -103,13 +103,20 @@ test(function() {
|
|||
var doc = document.implementation.createDocument(namespace, qualifiedName, doctype)
|
||||
assert_equals(doc.compatMode, "CSS1Compat")
|
||||
assert_equals(doc.characterSet, "UTF-8")
|
||||
assert_equals(doc.inputEncoding, "UTF-8")
|
||||
assert_equals(doc.contentType, "application/xml")
|
||||
assert_equals(doc.URL, "about:blank")
|
||||
assert_equals(doc.documentURI, "about:blank")
|
||||
assert_equals(doc.createElement("DIV").localName, "DIV");
|
||||
}, "createDocument test " + i + ": metadata for " +
|
||||
[namespace, qualifiedName, doctype].map(function(el) { return format_value(el) }))
|
||||
|
||||
test(function() {
|
||||
var doc = document.implementation.createDocument(namespace, qualifiedName, doctype)
|
||||
assert_equals(doc.characterSet, "UTF-8", "characterSet");
|
||||
assert_equals(doc.charset, "UTF-8", "charset");
|
||||
assert_equals(doc.inputEncoding, "UTF-8", "inputEncoding");
|
||||
}, "createDocument test " + i + ": characterSet aliases for " +
|
||||
[namespace, qualifiedName, doctype].map(function(el) { return format_value(el) }))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -69,11 +69,17 @@ test(function() {
|
|||
assert_equals(doc.documentURI, "about:blank");
|
||||
assert_equals(doc.compatMode, "CSS1Compat");
|
||||
assert_equals(doc.characterSet, "UTF-8");
|
||||
assert_equals(doc.inputEncoding, "UTF-8");
|
||||
assert_equals(doc.contentType, "text/html");
|
||||
assert_equals(doc.createElement("DIV").localName, "div");
|
||||
}, "createHTMLDocument(): metadata")
|
||||
|
||||
test(function() {
|
||||
var doc = document.implementation.createHTMLDocument("test");
|
||||
assert_equals(doc.characterSet, "UTF-8", "characterSet");
|
||||
assert_equals(doc.charset, "UTF-8", "charset");
|
||||
assert_equals(doc.inputEncoding, "UTF-8", "inputEncoding");
|
||||
}, "createHTMLDocument(): characterSet aliases")
|
||||
|
||||
test(function() {
|
||||
var doc = document.implementation.createHTMLDocument("test");
|
||||
var a = doc.createElement("a");
|
||||
|
|
|
@ -358,6 +358,8 @@ Object.keys(encodingMap).forEach(function(name) {
|
|||
" has label " + format_value(label) + " (characterSet)");
|
||||
var t2 = async_test("Name " + format_value(name) +
|
||||
" has label " + format_value(label) + " (inputEncoding)");
|
||||
var t3 = async_test("Name " + format_value(name) +
|
||||
" has label " + format_value(label) + " (charset)");
|
||||
/*
|
||||
iframe.src = "data:text/html,<!doctype html>" +
|
||||
'<meta charset="' + label + '">';
|
||||
|
@ -370,9 +372,13 @@ Object.keys(encodingMap).forEach(function(name) {
|
|||
t2.step(function() {
|
||||
assert_equals(iframe.contentDocument.inputEncoding, expected_case(name));
|
||||
});
|
||||
t3.step(function() {
|
||||
assert_equals(iframe.contentDocument.charset, expected_case(name));
|
||||
});
|
||||
document.body.removeChild(iframe);
|
||||
t.done();
|
||||
t2.done();
|
||||
t3.done();
|
||||
};
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
|
|
|
@ -32,11 +32,17 @@ test(function() {
|
|||
assert_equals(doc.documentURI, "about:blank");
|
||||
assert_equals(doc.compatMode, "CSS1Compat");
|
||||
assert_equals(doc.characterSet, "UTF-8");
|
||||
assert_equals(doc.inputEncoding, "UTF-8");
|
||||
assert_equals(doc.contentType, "application/xml");
|
||||
assert_equals(doc.createElement("DIV").localName, "DIV");
|
||||
}, "new Document(): metadata")
|
||||
|
||||
test(function() {
|
||||
var doc = new Document();
|
||||
assert_equals(doc.characterSet, "UTF-8", "characterSet");
|
||||
assert_equals(doc.charset, "UTF-8", "charset");
|
||||
assert_equals(doc.inputEncoding, "UTF-8", "inputEncoding");
|
||||
}, "new Document(): characterSet aliases")
|
||||
|
||||
test(function() {
|
||||
var doc = new Document();
|
||||
var a = doc.createElement("a");
|
||||
|
|
|
@ -136,7 +136,6 @@ var expected = {
|
|||
URL: String(location),
|
||||
compatMode: "CSS1Compat",
|
||||
characterSet: "UTF-8",
|
||||
inputEncoding: "UTF-8",
|
||||
contentType: "text/html",
|
||||
doctype: doctype,
|
||||
//documentElement: ,
|
||||
|
@ -153,7 +152,6 @@ var expected = {
|
|||
URL: "about:blank",
|
||||
compatMode: "CSS1Compat",
|
||||
characterSet: "UTF-8",
|
||||
inputEncoding: "UTF-8",
|
||||
contentType: "text/html",
|
||||
//doctype: ,
|
||||
//documentElement: ,
|
||||
|
@ -211,7 +209,6 @@ var expected = {
|
|||
URL: "about:blank",
|
||||
compatMode: "CSS1Compat",
|
||||
characterSet: "UTF-8",
|
||||
inputEncoding: "UTF-8",
|
||||
contentType: "application/xml",
|
||||
//doctype: ,
|
||||
//documentElement: ,
|
||||
|
@ -640,6 +637,8 @@ for (var node in expected) {
|
|||
expected[node].nextSibling = expected[node].nodeValue =
|
||||
expected[node].textContent = null;
|
||||
expected[node].documentURI = expected[node].URL;
|
||||
expected[node].charset = expected[node].inputEncoding =
|
||||
expected[node].characterSet;
|
||||
break;
|
||||
|
||||
case Node.DOCUMENT_TYPE_NODE:
|
||||
|
|
|
@ -38,6 +38,10 @@ test(function() {
|
|||
assert_equals(doc.inputEncoding, "UTF-8")
|
||||
}, 'inputEncoding');
|
||||
|
||||
test(function() {
|
||||
assert_equals(doc.charset, "UTF-8")
|
||||
}, 'charset');
|
||||
|
||||
test(function() {
|
||||
var url = document.URL;
|
||||
assert_equals(doc.documentURI, url,
|
||||
|
|
|
@ -10,6 +10,7 @@ function checkMetadata(doc, contentType) {
|
|||
assert_equals(doc.URL, document.URL, "URL");
|
||||
assert_equals(doc.documentURI, document.URL, "documentURI");
|
||||
assert_equals(doc.characterSet, "UTF-8", "characterSet");
|
||||
assert_equals(doc.charset, "UTF-8", "charset");
|
||||
assert_equals(doc.inputEncoding, "UTF-8", "inputEncoding");
|
||||
assert_equals(doc.contentType, contentType, "contentType");
|
||||
assert_equals(doc.location, null, "location");
|
||||
|
|
|
@ -235,6 +235,7 @@ interface Document : Node {
|
|||
readonly attribute DOMString origin;
|
||||
readonly attribute DOMString compatMode;
|
||||
readonly attribute DOMString characterSet;
|
||||
readonly attribute DOMString charset; // legacy alias of .characterSet
|
||||
readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
|
||||
readonly attribute DOMString contentType;
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
{conditions: {maxLength: "4", value: "abc"}, expected: false, name: "[target] Dirty value - value is less than maxlength", dirty: true},
|
||||
{conditions: {maxLength: "4", value: "\u0041\u0041\u0041"}, expected: false, name: "[target] Dirty value - length of value(AAA) in unicode is less than maxlength", dirty: true},
|
||||
{conditions: {maxLength: "4", value: "abcd"}, expected: false, name: "[target] Dirty value - value equals to maxlength", dirty: true},
|
||||
{conditions: {maxLength: "4", value: "abcde"}, expected: true, name: "[target] Dirty value - length of value is greater than maxlength", dirty: true}
|
||||
// False due to lack of required interactive editing by the user
|
||||
{conditions: {maxLength: "4", value: "abcde"}, expected: false, name: "[target] Dirty value - length of value is greater than maxlength", dirty: true}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -39,7 +40,8 @@
|
|||
{conditions: {maxLength: "4", value: "abc"}, expected: false, name: "[target] Dirty value - value is less than maxlength", dirty: true},
|
||||
{conditions: {maxLength: "4", value: "\u000D\u000A"}, expected: false, name: "[target] Dirty value - length of value(LF, CRLF) in unicode is less than maxlength", dirty: true},
|
||||
{conditions: {maxLength: "4", value: "abcd"}, expected: false, name: "[target] Dirty value - length of value equals to maxlength", dirty: true},
|
||||
{conditions: {maxLength: "4", value: "abcde"}, expected: true, name: "[target] Dirty value - length of value is greater than maxlength", dirty: true}
|
||||
// False due to lack of required interactive editing by the user
|
||||
{conditions: {maxLength: "4", value: "abcde"}, expected: false, name: "[target] Dirty value - length of value is greater than maxlength", dirty: true}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
{conditions: {required: true, value: " 123 "}, expected: true, name: "[target] Value is a number with some white spaces"},
|
||||
{conditions: {required: true, value: Math.pow(2, 1024)}, expected: true, name: "[target] Value is Math.pow(2, 1024)"},
|
||||
{conditions: {required: true, value: Math.pow(-2, 1024)}, expected: true, name: "[target] Value is Math.pow(-2, 1024)"},
|
||||
{conditions: {required: true, value: "abc"}, expected: true, name: "[target] Value is a string that can not be coverted to a number"},
|
||||
{conditions: {required: true, value: "abc"}, expected: true, name: "[target] Value is a string that cannot be converted to a number"},
|
||||
{conditions: {required: true, value: ""}, expected: true, name: "[target] The value attribute is empty string"}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
types: ["text", "search", "tel", "url", "email", "password", "datetime", "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 elment is mutable"},
|
||||
{conditions: {disabled: false, readOnly: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},
|
||||
{conditions: {readOnly: true}, expected: false, name: "[target] Must be barred from the constraint validation if it is readonly"},
|
||||
{conditions: {disabled: false, readOnly: false}, expected: false, name: "[target] The willValidate attribute must be false if it has a datalist ancestor", ancestor: "datalist"},
|
||||
]
|
||||
|
@ -62,7 +62,7 @@
|
|||
types: ["submit"],
|
||||
testData: [
|
||||
{conditions: {disabled: true}, expected: false, name: "[target] Must be barred from the constraint validation"},
|
||||
{conditions: {disabled: false}, expected: true, name: "[target] The willValidate attribute must be true if an elment is mutable"},
|
||||
{conditions: {disabled: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},
|
||||
{conditions: {disabled: false}, expected: false, name: "[target] The willValidate attribute must be false if it has a datalist ancestor", ancestor: "datalist"}
|
||||
]
|
||||
},
|
||||
|
@ -71,7 +71,7 @@
|
|||
types: [],
|
||||
testData: [
|
||||
{conditions: {disabled: true}, expected: false, name: "[target] Must be barred from the constraint validation"},
|
||||
{conditions: {disabled: false}, expected: true, name: "[target] The willValidate attribute must be true if an elment is mutable"},
|
||||
{conditions: {disabled: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},
|
||||
{conditions: {disabled: false}, expected: false, name: "[target] The willValidate attribute must be false if it has a datalist ancestor", ancestor: "datalist"}
|
||||
]
|
||||
},
|
||||
|
@ -80,7 +80,7 @@
|
|||
types: [],
|
||||
testData: [,
|
||||
{conditions: {disabled: true}, expected: false, name: "[target] Must be barred from the constraint validation"},
|
||||
{conditions: {disabled: false}, expected: true, name: "[target] The willValidate attribute must be true if an elment is mutable"},
|
||||
{conditions: {disabled: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},
|
||||
{conditions: {disabled: false}, expected: false, name: "[target] The willValidate attribute must be false if it has a datalist ancestor", ancestor: "datalist"}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -229,8 +229,8 @@ var validator = {
|
|||
assert_true(ctl.reportValidity(), "The reportValidity method should be true.");
|
||||
assert_false(eventFired, "The invalid event should not be fired.");
|
||||
} else {
|
||||
assert_true(eventFired, "The invalid event should be fired.");
|
||||
assert_false(ctl.reportValidity(), "The reportValidity method should be false.");
|
||||
assert_true(eventFired, "The invalid event should be fired.");
|
||||
}
|
||||
}, data.name);
|
||||
|
||||
|
@ -262,8 +262,20 @@ var validator = {
|
|||
},
|
||||
|
||||
set_conditions: function (ctl, obj) {
|
||||
["required", "pattern", "step", "max", "min", "maxlength",
|
||||
"value", "multiple", "checked", "selected"].forEach(function(item) {
|
||||
[
|
||||
"checked",
|
||||
"disabled",
|
||||
"max",
|
||||
"maxlength",
|
||||
"min",
|
||||
"minlength",
|
||||
"multiple",
|
||||
"pattern",
|
||||
"required",
|
||||
"selected",
|
||||
"step",
|
||||
"value"
|
||||
].forEach(function(item) {
|
||||
ctl.removeAttribute(item);
|
||||
});
|
||||
for (var attr in obj) {
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>input[type="email"], 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="email" value="jane.doe@example.com" 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>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>input[type="password"], 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="password" value="swordfish" 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>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>input[type="search"], 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="search" value="abcdefghi" 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>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>input[type="tel"], 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="tel" value="123-456-7890" maxlength="7" 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>
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ValidityState.tooLong and user editing</title>
|
||||
<title>input[type="text"], 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">
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>input[type="url"], 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="url" value="http://example.com/foo" maxlength="12" 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>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>textarea, 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, a textarea whose value was edited by the user but still exceeds the textarea'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 area:</p>
|
||||
<textarea maxlength="5" autocomplete="off" id="testinput">0123456789</textarea>
|
||||
|
||||
<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', 'HTMLTextAreaElement.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>
|
|
@ -105,7 +105,7 @@
|
|||
|
||||
test(function () {
|
||||
assert_equals(document.getElementById("test5").labels.length, 0,
|
||||
"The number of labels should be 0 if the form control has an ancestor label elment that the for attribute points to another control.");
|
||||
"The number of labels should be 0 if the form control has an ancestor label element that the for attribute points to another control.");
|
||||
assert_equals(document.getElementById("lbl2").control, null,
|
||||
"The labeled cotrol should be associated with the control whose ID is equal to the value of the 'for' attribute.");
|
||||
}, "A form control has no label 2.");
|
||||
|
|
|
@ -118,7 +118,9 @@ var elements = [
|
|||
["progress", "Progress"],
|
||||
["meter", "Meter"],
|
||||
["ruby", ""],
|
||||
["rb", ""],
|
||||
["rt", ""],
|
||||
["rtc", ""],
|
||||
["rp", ""],
|
||||
["figure", ""],
|
||||
["datalist", "DataList"],
|
||||
|
@ -126,7 +128,6 @@ var elements = [
|
|||
["details", "Details"],
|
||||
["command", "Command"],
|
||||
["nextid", "Unknown"],
|
||||
["rb", "Unknown"],
|
||||
["bdi", ""],
|
||||
["data", "Data"],
|
||||
["a", "Anchor"],
|
||||
|
|
|
@ -286,7 +286,7 @@
|
|||
true,
|
||||
"Same-origin with correct sha256 hash",
|
||||
{
|
||||
href: "style.css",
|
||||
href: "style.css?1",
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4="
|
||||
}
|
||||
);
|
||||
|
@ -296,7 +296,7 @@
|
|||
true,
|
||||
"Same-origin with correct sha384 hash",
|
||||
{
|
||||
href: "style.css",
|
||||
href: "style.css?2",
|
||||
integrity: "sha384-wDAWxH4tOWBwAwHfBn9B7XuNmFxHTMeigAMwn0iVQ0zq3FtmYMLxihcGnU64CwcX"
|
||||
}
|
||||
);
|
||||
|
@ -306,7 +306,7 @@
|
|||
true,
|
||||
"Same-origin with correct sha512 hash",
|
||||
{
|
||||
href: "style.css",
|
||||
href: "style.css?3",
|
||||
integrity: "sha512-9wXDjd6Wq3H6nPAhI9zOvG7mJkUr03MTxaO+8ztTKnfJif42laL93Be/IF6YYZHHF4esitVYxiwpY2HSZX4l6w=="
|
||||
}
|
||||
);
|
||||
|
@ -316,7 +316,7 @@
|
|||
true,
|
||||
"Same-origin with empty integrity",
|
||||
{
|
||||
href: "style.css",
|
||||
href: "style.css?4",
|
||||
integrity: ""
|
||||
}
|
||||
);
|
||||
|
@ -326,7 +326,7 @@
|
|||
false,
|
||||
"Same-origin with incorrect hash.",
|
||||
{
|
||||
href: "style.css",
|
||||
href: "style.css?5",
|
||||
integrity: "sha256-deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdead"
|
||||
}
|
||||
);
|
||||
|
@ -336,8 +336,8 @@
|
|||
true,
|
||||
"Same-origin with multiple sha256 hashes, including correct.",
|
||||
{
|
||||
href: "style.css",
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F-SPLT7YZk7gyCWUV4= sha256-deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdead"
|
||||
href: "style.css?6",
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4= sha256-deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdead"
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -346,8 +346,8 @@
|
|||
true,
|
||||
"Same-origin with multiple sha256 hashes, including unknown algorithm.",
|
||||
{
|
||||
href: "style.css",
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F-SPLT7YZk7gyCWUV4= foo666-deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdead"
|
||||
href: "style.css?7",
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4= foo666-deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdead"
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -356,7 +356,7 @@
|
|||
true,
|
||||
"Same-origin with sha256 mismatch, sha512 match",
|
||||
{
|
||||
href: "style.css",
|
||||
href: "style.css?8",
|
||||
integrity: "sha512-9wXDjd6Wq3H6nPAhI9zOvG7mJkUr03MTxaO+8ztTKnfJif42laL93Be/IF6YYZHHF4esitVYxiwpY2HSZX4l6w== sha256-deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdead"
|
||||
}
|
||||
);
|
||||
|
@ -366,7 +366,7 @@
|
|||
false,
|
||||
"Same-origin with sha256 match, sha512 mismatch",
|
||||
{
|
||||
href: "style.css",
|
||||
href: "style.css?9",
|
||||
integrity: "sha512-deadbeef9wXDjd6Wq3H6nPAhI9zOvG7mJkUr03MTxaO+8ztTKnfJif42laL93Be/IF6YYZHHF4esitVYxiwpY2== sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4="
|
||||
}
|
||||
);
|
||||
|
@ -376,7 +376,7 @@
|
|||
true,
|
||||
"<crossorigin='anonymous'> with correct hash, ACAO: *",
|
||||
{
|
||||
href: xorigin_anon_style,
|
||||
href: xorigin_anon_style + '?1',
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4=",
|
||||
crossorigin: "anonymous"
|
||||
}
|
||||
|
@ -387,7 +387,7 @@
|
|||
false,
|
||||
"<crossorigin='anonymous'> with incorrect hash, ACAO: *",
|
||||
{
|
||||
href: xorigin_anon_style,
|
||||
href: xorigin_anon_style + '?2',
|
||||
integrity: "sha256-deadbeefCzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk=",
|
||||
crossorigin: "anonymous"
|
||||
}
|
||||
|
@ -398,7 +398,7 @@
|
|||
true,
|
||||
"<crossorigin='use-credentials'> with correct hash, CORS-eligible",
|
||||
{
|
||||
href: xorigin_creds_style,
|
||||
href: xorigin_creds_style + '?1',
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4=",
|
||||
crossorigin: "use-credentials"
|
||||
}
|
||||
|
@ -409,7 +409,7 @@
|
|||
false,
|
||||
"<crossorigin='use-credentials'> with incorrect hash CORS-eligible",
|
||||
{
|
||||
href: xorigin_creds_style,
|
||||
href: xorigin_creds_style + '?2',
|
||||
integrity: "sha256-deadbeefCzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk=",
|
||||
crossorigin: "use-credentials"
|
||||
}
|
||||
|
@ -420,7 +420,7 @@
|
|||
false,
|
||||
"<crossorigin='anonymous'> with CORS-ineligible resource",
|
||||
{
|
||||
href: xorigin_ineligible_style,
|
||||
href: xorigin_ineligible_style + '?1',
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4=",
|
||||
crossorigin: "anonymous"
|
||||
}
|
||||
|
@ -431,7 +431,7 @@
|
|||
false,
|
||||
"Cross-origin, not CORS request, with correct hash",
|
||||
{
|
||||
href: xorigin_anon_style,
|
||||
href: xorigin_anon_style + '?3',
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4="
|
||||
}
|
||||
);
|
||||
|
@ -441,7 +441,7 @@
|
|||
false,
|
||||
"Cross-origin, not CORS request, with hash mismatch",
|
||||
{
|
||||
href: xorigin_anon_style,
|
||||
href: xorigin_anon_style + '?4',
|
||||
integrity: "sha256-deadbeefCzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk="
|
||||
}
|
||||
);
|
||||
|
@ -451,7 +451,7 @@
|
|||
true,
|
||||
"Cross-origin, empty integrity",
|
||||
{
|
||||
href: xorigin_anon_style,
|
||||
href: xorigin_anon_style + '?5',
|
||||
integrity: ""
|
||||
}
|
||||
);
|
||||
|
@ -461,7 +461,7 @@
|
|||
true,
|
||||
"Same-origin with correct hash, options.",
|
||||
{
|
||||
href: "style.css",
|
||||
href: "style.css?10",
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4=?foo=bar?spam=eggs"
|
||||
}
|
||||
);
|
||||
|
@ -471,7 +471,7 @@
|
|||
true,
|
||||
"Same-origin with unknown algorithm only.",
|
||||
{
|
||||
href: "style.css",
|
||||
href: "style.css?11",
|
||||
integrity: "foo666-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4=?foo=bar?spam=eggs"
|
||||
}
|
||||
);
|
||||
|
@ -481,8 +481,8 @@
|
|||
true,
|
||||
"Same-origin with correct sha256 hash, rel='stylesheet license'",
|
||||
{
|
||||
href: "style.css",
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F-SPLT7YZk7gyCWUV4=",
|
||||
href: "style.css?12",
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4=",
|
||||
rel: "stylesheet license"
|
||||
}
|
||||
);
|
||||
|
@ -492,8 +492,8 @@
|
|||
true,
|
||||
"Same-origin with correct sha256 hash, rel='license stylesheet'",
|
||||
{
|
||||
href: "style.css",
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F-SPLT7YZk7gyCWUV4=",
|
||||
href: "style.css?13",
|
||||
integrity: "sha256-CzHgdJ7wOccM8L89n4bhcJMz3F+SPLT7YZk7gyCWUV4=",
|
||||
rel: "license stylesheet"
|
||||
}
|
||||
);
|
||||
|
@ -503,7 +503,7 @@
|
|||
true,
|
||||
"Same-origin with correct sha256 and sha512 hash, rel='alternate stylesheet' enabled",
|
||||
{
|
||||
href: "alternate.css",
|
||||
href: "alternate.css?1",
|
||||
title: "alt",
|
||||
type: "text/css",
|
||||
class: "alternate",
|
||||
|
@ -523,7 +523,7 @@
|
|||
false,
|
||||
"Same-origin with incorrect sha256 and sha512 hash, rel='alternate stylesheet' enabled",
|
||||
{
|
||||
href: "alternate.css",
|
||||
href: "alternate.css?2",
|
||||
title: "alt",
|
||||
type: "text/css",
|
||||
class: "alternate",
|
||||
|
|
|
@ -290,7 +290,7 @@ function run() {
|
|||
|
||||
// In some cases, when multiple touch points are released simultaneously
|
||||
// the UA would dispatch the "same" touchend event (same changedTouches, same touches, but possibly different targetTouches)
|
||||
// to each of the elements that are starting elments of the released touch points.
|
||||
// to each of the elements that are starting elements of the released touch points.
|
||||
// in these situations, the subsequent events are exempt from TA 1.5.3.4 and 1.5.4.2
|
||||
var same_event_as_last = false;
|
||||
if (last_changedTouches && last_changedTouches.length==ev.changedTouches.length) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue