mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update web-platform-tests to revision 41a7d8732d8e5c65728c153d29a34fe9d5192b29
This commit is contained in:
parent
b05c3fc0c0
commit
5e8b92f3de
77 changed files with 1871 additions and 1412 deletions
|
@ -10,18 +10,18 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<meta name='flags' content='dom'>
|
||||
<style type='text/css'>
|
||||
#colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
|
||||
#colonlangcontroltest:lang(xx) { display:none; }
|
||||
#colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
|
||||
#colonlangcontroltest:lang(xx) { display:none; }
|
||||
.test div { width: 50px; }
|
||||
|
||||
#box:lang(ko) { width: 100px; }
|
||||
#box:lang(zh) { width: 100px; }
|
||||
#box:lang(ja) { width: 100px; }
|
||||
|
||||
/* styling for debugging related notes */
|
||||
.notes span:lang(ko) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
.notes span:lang(zh) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
.notes span:lang(ja) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
/* styling for debugging related notes */
|
||||
.notes span:lang(ko) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
.notes span:lang(zh) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
.notes span:lang(ja) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
<head>
|
||||
<title>Pattern Attribute</title>
|
||||
<meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
|
||||
<link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
|
||||
<link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-input-pattern">
|
||||
<link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
|
||||
<link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-input-pattern">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
|
@ -14,20 +14,20 @@
|
|||
<body>
|
||||
|
||||
|
||||
<h1>Pattern Attribute</h1>
|
||||
<div style="display: none">
|
||||
<input pattern="[a-z]{3}" value="abcd" title="three letters max"/>
|
||||
</div>
|
||||
<h1>Pattern Attribute</h1>
|
||||
<div style="display: none">
|
||||
<input pattern="[a-z]{3}" value="abcd" title="three letters max"/>
|
||||
</div>
|
||||
|
||||
<div id="log">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function() {assert_equals(document.getElementsByTagName("input")[0].getAttribute("pattern"), "[a-z]{3}")}, "pattern attribute support on input element");
|
||||
test(function() {assert_equals(document.getElementsByTagName("input")[0].getAttribute("pattern"), "[a-z]{3}")}, "pattern attribute support on input element");
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
<head>
|
||||
<title>Required Attribute</title>
|
||||
<meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
|
||||
<link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
|
||||
<link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-input-required">
|
||||
<link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
|
||||
<link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-input-required">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
|
@ -14,20 +14,20 @@
|
|||
<body>
|
||||
|
||||
|
||||
<h1>Required Attribute</h1>
|
||||
<div style="display: none">
|
||||
<input type="text" required="required" />
|
||||
</div>
|
||||
<h1>Required Attribute</h1>
|
||||
<div style="display: none">
|
||||
<input type="text" required="required" />
|
||||
</div>
|
||||
|
||||
<div id="log">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function() {assert_equals(document.getElementsByTagName("input")[0].getAttribute("required"), "required")}, "required attribute support on input element");
|
||||
test(function() {assert_equals(document.getElementsByTagName("input")[0].getAttribute("required"), "required")}, "required attribute support on input element");
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
<head>
|
||||
<title>Search Input</title>
|
||||
<meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
|
||||
<link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
|
||||
<link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-input-element">
|
||||
<link rel="author" title="Fabrice Clari" href="mailto:f.clari@inno-group.com">
|
||||
<link rel="author" title="Dimitri Bocquet" href="mailto:Dimitri.Bocquet@mosquito-fp7.eu">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-input-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
|
@ -14,21 +14,21 @@
|
|||
<body>
|
||||
|
||||
|
||||
<h1>Search Input</h1>
|
||||
<input type="search" style="display:none" placeholder="Search..." />
|
||||
<h1>Search Input</h1>
|
||||
<input type="search" style="display:none" placeholder="Search..." />
|
||||
|
||||
<div id="log">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
test(function() {assert_equals(document.getElementsByTagName("input")[0].type, "search")}, "search type support on input element", {
|
||||
"help" : "https://html.spec.whatwg.org/multipage/#dom-input-type" });
|
||||
test(function() {assert_equals(document.getElementsByTagName("input")[0].placeholder, "Search...")}, "placeholder attribute support on input element", {
|
||||
"help" : "https://html.spec.whatwg.org/multipage/#dom-input-placeholder" });
|
||||
test(function() {assert_equals(document.getElementsByTagName("input")[0].type, "search")}, "search type support on input element", {
|
||||
"help" : "https://html.spec.whatwg.org/multipage/#dom-input-type" });
|
||||
test(function() {assert_equals(document.getElementsByTagName("input")[0].placeholder, "Search...")}, "placeholder attribute support on input element", {
|
||||
"help" : "https://html.spec.whatwg.org/multipage/#dom-input-placeholder" });
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -1,84 +1,84 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Input tel</title>
|
||||
<link rel="author" title="Kazuki Kanamori" href="mailto:yogurito@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#telephone-state-(type=tel)">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<title>Input tel</title>
|
||||
<link rel="author" title="Kazuki Kanamori" href="mailto:yogurito@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#telephone-state-(type=tel)">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Input tel</h1>
|
||||
<input type="tel" id="novalue" />
|
||||
<input type="tel" id="value_with_LF" value="0
1" />
|
||||
<input type="tel" id="value_with_CR" value="0
1" />
|
||||
<input type="tel" id="value_with_CRLF" value="0

1" />
|
||||
<div id="log">
|
||||
</div>
|
||||
<h1>Input tel</h1>
|
||||
<input type="tel" id="novalue" />
|
||||
<input type="tel" id="value_with_LF" value="0
1" />
|
||||
<input type="tel" id="value_with_CR" value="0
1" />
|
||||
<input type="tel" id="value_with_CRLF" value="0

1" />
|
||||
<div id="log">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var element = document.getElementById('novalue');
|
||||
test(function(){
|
||||
assert_equals(element.type, 'tel');
|
||||
}, 'tel type supported on input element');
|
||||
test(function(){
|
||||
element.value = '0\u000A1';
|
||||
assert_equals(element.value, '01');
|
||||
}, 'User agents must not allow users to insert "LF" (U+000A)');
|
||||
test(function(){
|
||||
element.value = '0\u000D1';
|
||||
assert_equals(element.value, '01');
|
||||
}, 'User agents must not allow users to insert "CR" (U+000D)');
|
||||
<script type="text/javascript">
|
||||
var element = document.getElementById('novalue');
|
||||
test(function(){
|
||||
assert_equals(element.type, 'tel');
|
||||
}, 'tel type supported on input element');
|
||||
test(function(){
|
||||
element.value = '0\u000A1';
|
||||
assert_equals(element.value, '01');
|
||||
}, 'User agents must not allow users to insert "LF" (U+000A)');
|
||||
test(function(){
|
||||
element.value = '0\u000D1';
|
||||
assert_equals(element.value, '01');
|
||||
}, 'User agents must not allow users to insert "CR" (U+000D)');
|
||||
|
||||
element = document.getElementById('value_with_LF');
|
||||
test(function(){
|
||||
assert_equals(element.value, '01');
|
||||
}, 'The value attribute, if specified, must have a value that contains no "LF" (U+000A)');
|
||||
element = document.getElementById('value_with_LF');
|
||||
test(function(){
|
||||
assert_equals(element.value, '01');
|
||||
}, 'The value attribute, if specified, must have a value that contains no "LF" (U+000A)');
|
||||
|
||||
element = document.getElementById('value_with_CR');
|
||||
test(function(){
|
||||
assert_equals(element.value, '01');
|
||||
}, 'The value attribute, if specified, must have a value that contains no "CR" (U+000D)');
|
||||
element = document.getElementById('value_with_CR');
|
||||
test(function(){
|
||||
assert_equals(element.value, '01');
|
||||
}, 'The value attribute, if specified, must have a value that contains no "CR" (U+000D)');
|
||||
|
||||
test(function(){
|
||||
element = document.getElementById('novalue');
|
||||
element.value = '0\u000D\u000A1';
|
||||
assert_equals(element.value, '01');
|
||||
test(function(){
|
||||
element = document.getElementById('novalue');
|
||||
element.value = '0\u000D\u000A1';
|
||||
assert_equals(element.value, '01');
|
||||
|
||||
element = document.getElementById('value_with_CRLF');
|
||||
assert_equals(element.value, '01');
|
||||
}, 'The value sanitization algorithm is as follows: Strip line breaks from the value');
|
||||
element = document.getElementById('value_with_CRLF');
|
||||
assert_equals(element.value, '01');
|
||||
}, 'The value sanitization algorithm is as follows: Strip line breaks from the value');
|
||||
|
||||
element = document.getElementById('novalue');
|
||||
test(function(){
|
||||
element.value = '+811234';
|
||||
assert_equals(element.value, '+811234');
|
||||
}, 'Element can accept the phone number with plus sign(country code)');
|
||||
test(function(){
|
||||
element.value = '1234#5678';
|
||||
assert_equals(element.value, '1234#5678');
|
||||
}, 'Element can accept the phone number with hash mark(extension number)');
|
||||
test(function(){
|
||||
element.value = '123-456-789';
|
||||
assert_equals(element.value, '123-456-789');
|
||||
}, 'Element can accept the phone number with hyphen');
|
||||
test(function(){
|
||||
element.value = '123.456.789';
|
||||
assert_equals(element.value, '123.456.789');
|
||||
}, 'Element can accept the phone number with dots');
|
||||
test(function(){
|
||||
element.value = '1 23 4';
|
||||
assert_equals(element.value, '1 23 4');
|
||||
}, 'Element can accept the phone number with whitespace');
|
||||
test(function(){
|
||||
element.value = ' 1234 ';
|
||||
assert_equals(element.value, ' 1234 ');
|
||||
}, 'Element can accept the phone number with leading & following whitespaces');
|
||||
test(function(){
|
||||
element.value = '(03)12345678';
|
||||
assert_equals(element.value, '(03)12345678');
|
||||
}, 'Element can accept the phone number with parentheses(area code)');
|
||||
</script>
|
||||
element = document.getElementById('novalue');
|
||||
test(function(){
|
||||
element.value = '+811234';
|
||||
assert_equals(element.value, '+811234');
|
||||
}, 'Element can accept the phone number with plus sign(country code)');
|
||||
test(function(){
|
||||
element.value = '1234#5678';
|
||||
assert_equals(element.value, '1234#5678');
|
||||
}, 'Element can accept the phone number with hash mark(extension number)');
|
||||
test(function(){
|
||||
element.value = '123-456-789';
|
||||
assert_equals(element.value, '123-456-789');
|
||||
}, 'Element can accept the phone number with hyphen');
|
||||
test(function(){
|
||||
element.value = '123.456.789';
|
||||
assert_equals(element.value, '123.456.789');
|
||||
}, 'Element can accept the phone number with dots');
|
||||
test(function(){
|
||||
element.value = '1 23 4';
|
||||
assert_equals(element.value, '1 23 4');
|
||||
}, 'Element can accept the phone number with whitespace');
|
||||
test(function(){
|
||||
element.value = ' 1234 ';
|
||||
assert_equals(element.value, ' 1234 ');
|
||||
}, 'Element can accept the phone number with leading & following whitespaces');
|
||||
test(function(){
|
||||
element.value = '(03)12345678';
|
||||
assert_equals(element.value, '(03)12345678');
|
||||
}, 'Element can accept the phone number with parentheses(area code)');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -4,43 +4,43 @@
|
|||
<head>
|
||||
<title>Input Time</title>
|
||||
<meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-input-element">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-input-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Input Time</h1>
|
||||
<div style="display:none;">
|
||||
<input type="time "id="chkDefaultValue" />
|
||||
<input type="time" id="chkStep" />
|
||||
<input type="time" id="chkSetValueTest" />
|
||||
<input type="time" id="chkSupportAttribute" min="01:01:01.001" max="12:12:12.012" step="600" />
|
||||
</div>
|
||||
<div id="log">
|
||||
<h1>Input Time</h1>
|
||||
<div style="display:none;">
|
||||
<input type="time "id="chkDefaultValue" />
|
||||
<input type="time" id="chkStep" />
|
||||
<input type="time" id="chkSetValueTest" />
|
||||
<input type="time" id="chkSupportAttribute" min="01:01:01.001" max="12:12:12.012" step="600" />
|
||||
</div>
|
||||
<div id="log">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
|
||||
/* check default value */
|
||||
test(function(){ assert_equals(document.getElementById("chkDefaultValue").value, "");
|
||||
}, "time element of default time value");
|
||||
test(function(){assert_equals(document.getElementById('chkStep').step, "");
|
||||
} , "step attribute on default value check");
|
||||
}, "step attribute on default value check");
|
||||
test(function(){assert_equals(document.getElementById('chkDefaultValue').max, "");
|
||||
} , "max attribute on default value check")
|
||||
}, "max attribute on default value check")
|
||||
test(function(){assert_equals(document.getElementById('chkDefaultValue').max, "");
|
||||
} , "min attribute on default value check")
|
||||
}, "min attribute on default value check")
|
||||
|
||||
/* simple attribute test*/
|
||||
test(function(){assert_equals(document.getElementById("chkSupportAttribute").type,"time");}
|
||||
, "type attribute support on input element");
|
||||
, "type attribute support on input element");
|
||||
test(function(){assert_equals(document.getElementById('chkSupportAttribute').min, "01:01:01.001")}
|
||||
, "max attribute support on input element");
|
||||
, "max attribute support on input element");
|
||||
test(function(){assert_equals(document.getElementById('chkSupportAttribute').max, "12:12:12.012")}
|
||||
, "min attribute support on input element");
|
||||
, "min attribute support on input element");
|
||||
test(function(){assert_equals(document.getElementById("chkSupportAttribute").step, "600")}
|
||||
, "step attribute support on input element");
|
||||
, "step attribute support on input element");
|
||||
|
||||
/* check step up and down */
|
||||
var _StepTest = document.getElementById("chkStep");
|
||||
|
@ -48,160 +48,160 @@ test(function(){ assert_true(typeof(_StepTest.stepUp) ==="function" ) } , "ste
|
|||
test(function(){ assert_true(typeof(_StepTest.stepDown) ==="function" ) } , "stepDown function support on input Element");
|
||||
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value,"12:01");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value,"12:01");
|
||||
} , "stepUp step value empty on default step value ");
|
||||
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value,"11:59");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value,"11:59");
|
||||
}, "stepDown step value empty default step value");
|
||||
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "-600";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "12:01");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "-600";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "12:01");
|
||||
},"stepUp on step value minus");
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "-600";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "11:59");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "-600";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "11:59");
|
||||
},"stepDown on step value minus");
|
||||
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "0";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "12:01");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "0";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "12:01");
|
||||
} , "stepUp on step value zero ");
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "0";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "11:59");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "0";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "11:59");
|
||||
} , "stepDown on step value zero ");
|
||||
|
||||
test(function(){
|
||||
_StepTest.value = "00:00";
|
||||
_StepTest.step = "86399";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "23:59:59");
|
||||
_StepTest.value = "00:00";
|
||||
_StepTest.step = "86399";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "23:59:59");
|
||||
} , "stepUp on step value 24 hour");
|
||||
test(function(){
|
||||
_StepTest.value = "23:59:59";
|
||||
_StepTest.step = "86399";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "00:00:00");
|
||||
_StepTest.value = "23:59:59";
|
||||
_StepTest.step = "86399";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "00:00:00");
|
||||
} , "stepDown on step value 24 hour ");
|
||||
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "3600";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "13:00");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "3600";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "13:00");
|
||||
} , "stepUp on step value hour ");
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "3600";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "11:00");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "3600";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "11:00");
|
||||
} , "stepDown on step value hour ");
|
||||
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "1";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "12:00:01");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "1";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "12:00:01");
|
||||
} , "stepUp on step value second ");
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "1";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "11:59:59");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "1";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "11:59:59");
|
||||
} , "stepDown on step value second ");
|
||||
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "0.001";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "12:00:00.001");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "0.001";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "12:00:00.001");
|
||||
} , "stepUp on step value miri second ");
|
||||
test(function(){
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "0.001";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "11:59:59.999");
|
||||
_StepTest.value = "12:00";
|
||||
_StepTest.step = "0.001";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "11:59:59.999");
|
||||
} , "stepDown on step value miri second ");
|
||||
|
||||
test(function(){
|
||||
_StepTest.value = "13:00:00";
|
||||
_StepTest.step = "1";
|
||||
_StepTest.stepUp(2);
|
||||
assert_equals(_StepTest.value, "13:00:02");
|
||||
_StepTest.value = "13:00:00";
|
||||
_StepTest.step = "1";
|
||||
_StepTest.stepUp(2);
|
||||
assert_equals(_StepTest.value, "13:00:02");
|
||||
}, "stepUp argment 2 times");
|
||||
test(function(){
|
||||
_StepTest.value = "13:00:00";
|
||||
_StepTest.step = "1";
|
||||
_StepTest.stepDown(2);
|
||||
assert_equals(_StepTest.value, "12:59:58");
|
||||
_StepTest.value = "13:00:00";
|
||||
_StepTest.step = "1";
|
||||
_StepTest.stepDown(2);
|
||||
assert_equals(_StepTest.value, "12:59:58");
|
||||
}, "stepDown argment 2 times");
|
||||
|
||||
test(function(){
|
||||
_StepTest.max = "15:00";
|
||||
_StepTest.value = "15:00";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "15:00");
|
||||
_StepTest.max = "";
|
||||
_StepTest.max = "15:00";
|
||||
_StepTest.value = "15:00";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "15:00");
|
||||
_StepTest.max = "";
|
||||
} , "stepUp stop because it exceeds the maximum value");
|
||||
test(function(){
|
||||
_StepTest.min = "13:00";
|
||||
_StepTest.value = "13:00";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "13:00");
|
||||
_StepTest.min="";
|
||||
_StepTest.min = "13:00";
|
||||
_StepTest.value = "13:00";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "13:00");
|
||||
_StepTest.min="";
|
||||
} , "stepDown Stop so lower than the minimum value");
|
||||
|
||||
test(function(){
|
||||
_StepTest.max = "15:01";
|
||||
_StepTest.value = "15:00";
|
||||
_StepTest.step = "120";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "15:01");
|
||||
_StepTest.max = "";
|
||||
_StepTest.max = "15:01";
|
||||
_StepTest.value = "15:00";
|
||||
_StepTest.step = "120";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "15:01");
|
||||
_StepTest.max = "";
|
||||
} , "stop at border on stepUp");
|
||||
test(function(){
|
||||
_StepTest.min = "12:59";
|
||||
_StepTest.value = "13:00";
|
||||
_StepTest.step = "120";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "12:59");
|
||||
_StepTest.min="";
|
||||
_StepTest.min = "12:59";
|
||||
_StepTest.value = "13:00";
|
||||
_StepTest.step = "120";
|
||||
_StepTest.stepDown();
|
||||
assert_equals(_StepTest.value, "12:59");
|
||||
_StepTest.min="";
|
||||
} , "stop at border on stepDown");
|
||||
|
||||
test(function(){
|
||||
_StepTest.value = "";
|
||||
_StepTest.step = "60";
|
||||
_StepTest.value = "";
|
||||
_StepTest.step = "60";
|
||||
_StepTest.stepUp();
|
||||
assert_equals(_StepTest.value, "00:01");
|
||||
assert_equals(_StepTest.value, "00:01");
|
||||
} , " empty value of stepUp");
|
||||
|
||||
|
||||
/* set value test */
|
||||
test(function(){
|
||||
var _time = document.getElementById("chkSetValueTest");
|
||||
_time.value = "12:00:00.000";
|
||||
assert_equals(_time.value, "12:00:00.000");
|
||||
_time.value = "hh:mi:ss.sss";
|
||||
assert_equals(_time.value, "");
|
||||
var _time = document.getElementById("chkSetValueTest");
|
||||
_time.value = "12:00:00.000";
|
||||
assert_equals(_time.value, "12:00:00.000");
|
||||
_time.value = "hh:mi:ss.sss";
|
||||
assert_equals(_time.value, "");
|
||||
}, "set value on not time format value");
|
||||
|
||||
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,59 +1,59 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Input url</title>
|
||||
<link rel="author" title="Hyeonseok Shin" href="mailto:hyeonseok@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#url-state-%28type=url%29">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<title>Input url</title>
|
||||
<link rel="author" title="Hyeonseok Shin" href="mailto:hyeonseok@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#url-state-%28type=url%29">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Input url</h1>
|
||||
<div style="display: none">
|
||||
<input type="url" id="type_support" />
|
||||
<input type="url" id="set_value_LF" />
|
||||
<input type="url" id="set_value_CR" />
|
||||
<input type="url" id="set_value_CRLF" />
|
||||
<input type="url" id="value_with_CRLF" value="a
a" />
|
||||
<input type="url" id="value_with_leading_trailing_white_space" value=" aa " />
|
||||
<input type="url" id="value_with_leading_trailing_inner_white_space" value=" a a " />
|
||||
</div>
|
||||
<div id="log">
|
||||
</div>
|
||||
<h1>Input url</h1>
|
||||
<div style="display: none">
|
||||
<input type="url" id="type_support" />
|
||||
<input type="url" id="set_value_LF" />
|
||||
<input type="url" id="set_value_CR" />
|
||||
<input type="url" id="set_value_CRLF" />
|
||||
<input type="url" id="value_with_CRLF" value="a
a" />
|
||||
<input type="url" id="value_with_leading_trailing_white_space" value=" aa " />
|
||||
<input type="url" id="value_with_leading_trailing_inner_white_space" value=" a a " />
|
||||
</div>
|
||||
<div id="log">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
test(function(){
|
||||
var element = document.getElementById('type_support');
|
||||
assert_equals(element.type, 'url');
|
||||
}, 'url type supported on input element');
|
||||
<script type="text/javascript">
|
||||
test(function(){
|
||||
var element = document.getElementById('type_support');
|
||||
assert_equals(element.type, 'url');
|
||||
}, 'url type supported on input element');
|
||||
|
||||
test(function(){
|
||||
var element = document.getElementById('set_value_LF');
|
||||
element.value = 'a\u000Aa';
|
||||
assert_equals(element.value, 'aa');
|
||||
test(function(){
|
||||
var element = document.getElementById('set_value_LF');
|
||||
element.value = 'a\u000Aa';
|
||||
assert_equals(element.value, 'aa');
|
||||
|
||||
element = document.getElementById('set_value_CR');
|
||||
element.value = 'a\u000Da';
|
||||
assert_equals(element.value, 'aa');
|
||||
element = document.getElementById('set_value_CR');
|
||||
element.value = 'a\u000Da';
|
||||
assert_equals(element.value, 'aa');
|
||||
|
||||
element = document.getElementById('set_value_CRLF');
|
||||
element.value = 'a\u000D\u000Aa';
|
||||
assert_equals(element.value, 'aa');
|
||||
}, 'The value must not be set with "LF" (U+000A) or "CR" (U+000D)');
|
||||
element = document.getElementById('set_value_CRLF');
|
||||
element.value = 'a\u000D\u000Aa';
|
||||
assert_equals(element.value, 'aa');
|
||||
}, 'The value must not be set with "LF" (U+000A) or "CR" (U+000D)');
|
||||
|
||||
test(function(){
|
||||
var element = document.getElementById('value_with_CRLF');
|
||||
assert_equals(element.value, 'aa');
|
||||
}, 'The value sanitization algorithm is as follows: Strip line breaks from the value');
|
||||
test(function(){
|
||||
var element = document.getElementById('value_with_CRLF');
|
||||
assert_equals(element.value, 'aa');
|
||||
}, 'The value sanitization algorithm is as follows: Strip line breaks from the value');
|
||||
|
||||
test(function(){
|
||||
var element = document.getElementById('value_with_leading_trailing_white_space');
|
||||
assert_equals(element.value, 'aa');
|
||||
test(function(){
|
||||
var element = document.getElementById('value_with_leading_trailing_white_space');
|
||||
assert_equals(element.value, 'aa');
|
||||
|
||||
element = document.getElementById('value_with_leading_trailing_inner_white_space');
|
||||
assert_equals(element.value, 'a a');
|
||||
}, 'The value sanitization algorithm is as follows: Strip leading and trailing whitespace from the value.');
|
||||
</script>
|
||||
element = document.getElementById('value_with_leading_trailing_inner_white_space');
|
||||
assert_equals(element.value, 'a a');
|
||||
}, 'The value sanitization algorithm is as follows: Strip leading and trailing whitespace from the value.');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Template tag with children div tags inside</title>
|
||||
<title>Template tag with children div tags inside</title>
|
||||
<link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru"/>
|
||||
</head>
|
||||
<body>
|
||||
<p>Template tag with div tags inside</p>
|
||||
<template>
|
||||
<div>This is div inside template</div>
|
||||
<div>This is another div inside template</div>
|
||||
</template>
|
||||
<p>Template tag with div tags inside</p>
|
||||
<template>
|
||||
<div>This is div inside template</div>
|
||||
<div>This is another div inside template</div>
|
||||
</template>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Template tag with children div tags inside another template tag</title>
|
||||
<title>Template tag with children div tags inside another template tag</title>
|
||||
<link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru"/>
|
||||
</head>
|
||||
<body>
|
||||
<p>Template tag with children div tags inside another template tag</p>
|
||||
<template>
|
||||
<template>
|
||||
<div>This is div inside template</div>
|
||||
<div>This is another div inside template</div>
|
||||
</template>
|
||||
</template>
|
||||
<p>Template tag with children div tags inside another template tag</p>
|
||||
<template>
|
||||
<template>
|
||||
<div>This is div inside template</div>
|
||||
<div>This is another div inside template</div>
|
||||
</template>
|
||||
</template>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,56 +1,56 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Creating and deleting captions</title>
|
||||
<link rel="author" title="Erika Navara" href="mailto:edoyle@microsoft.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-table-element" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-createcaption" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-deletecaption" />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<title>Creating and deleting captions</title>
|
||||
<link rel="author" title="Erika Navara" href="mailto:edoyle@microsoft.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-table-element" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-createcaption" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-table-deletecaption" />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<table id="table1" style="display:none">
|
||||
<caption id="caption1">caption</caption>
|
||||
<tr>
|
||||
<td>cell</td>
|
||||
<td>cell</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="table2" style="display:none">
|
||||
<tr>
|
||||
<td>cell</td>
|
||||
<td>cell</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="table3" style="display:none">
|
||||
<caption id="caption3">caption 3</caption>
|
||||
<tr>
|
||||
<td>cell</td>
|
||||
<td>cell</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script>
|
||||
test(function () {
|
||||
var table1 = document.getElementById('table1');
|
||||
var testCaption = table1.createCaption();
|
||||
var table1FirstCaption = table1.caption;
|
||||
assert_equals(testCaption, table1FirstCaption);
|
||||
}, "createCaption method returns the first caption element child of the table")
|
||||
test(function () {
|
||||
var table2 = document.getElementById('table2');
|
||||
var test2Caption = table2.createCaption();
|
||||
var table2FirstNode = table2.firstChild;
|
||||
assert_true(test2Caption instanceof HTMLTableCaptionElement);
|
||||
assert_equals(table2FirstNode, test2Caption);
|
||||
}, "createCaption method creates a new caption and inserts it as the first node of the table element")
|
||||
test(function () {
|
||||
var table3 = document.getElementById('table3');
|
||||
assert_equals(table3.caption.textContent, "caption 3");
|
||||
table3.deleteCaption();
|
||||
assert_equals(table3.caption, null);
|
||||
}, "deleteCaption method removes the first caption element child of the table element")
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
<table id="table1" style="display:none">
|
||||
<caption id="caption1">caption</caption>
|
||||
<tr>
|
||||
<td>cell</td>
|
||||
<td>cell</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="table2" style="display:none">
|
||||
<tr>
|
||||
<td>cell</td>
|
||||
<td>cell</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="table3" style="display:none">
|
||||
<caption id="caption3">caption 3</caption>
|
||||
<tr>
|
||||
<td>cell</td>
|
||||
<td>cell</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script>
|
||||
test(function () {
|
||||
var table1 = document.getElementById('table1');
|
||||
var testCaption = table1.createCaption();
|
||||
var table1FirstCaption = table1.caption;
|
||||
assert_equals(testCaption, table1FirstCaption);
|
||||
}, "createCaption method returns the first caption element child of the table")
|
||||
test(function () {
|
||||
var table2 = document.getElementById('table2');
|
||||
var test2Caption = table2.createCaption();
|
||||
var table2FirstNode = table2.firstChild;
|
||||
assert_true(test2Caption instanceof HTMLTableCaptionElement);
|
||||
assert_equals(table2FirstNode, test2Caption);
|
||||
}, "createCaption method creates a new caption and inserts it as the first node of the table element")
|
||||
test(function () {
|
||||
var table3 = document.getElementById('table3');
|
||||
assert_equals(table3.caption.textContent, "caption 3");
|
||||
table3.deleteCaption();
|
||||
assert_equals(table3.caption, null);
|
||||
}, "deleteCaption method removes the first caption element child of the table element")
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8>
|
||||
<title>HTML time element API</title>
|
||||
<style>
|
||||
<head>
|
||||
<meta charset=utf-8>
|
||||
<title>HTML time element API</title>
|
||||
<style>
|
||||
#time { visibility: hidden; }
|
||||
</style>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-time-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<!-- intentionally nested to test parsing rules -->
|
||||
<p id="time"><time pubdate datetime="2000-02-01T03:04:05Z">Dummy text <time>2001-06-07T<time>08:09<time></time></time>Z</time></time></p>
|
||||
<script type="text/javascript">
|
||||
</style>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-time-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<!-- intentionally nested to test parsing rules -->
|
||||
<p id="time"><time pubdate datetime="2000-02-01T03:04:05Z">Dummy text <time>2001-06-07T<time>08:09<time></time></time>Z</time></time></p>
|
||||
<script type="text/javascript">
|
||||
function makeTime(dateTime,contents,dateTimeProp) {
|
||||
var timeEl = document.createElement('time');
|
||||
if( dateTime ) {
|
||||
timeEl.setAttribute('datetime',dateTime);
|
||||
}
|
||||
if( contents ) {
|
||||
timeEl.innerHTML = contents;
|
||||
}
|
||||
if( dateTimeProp ) {
|
||||
timeEl.dateTime = dateTimeProp;
|
||||
}
|
||||
return timeEl;
|
||||
var timeEl = document.createElement('time');
|
||||
if( dateTime ) {
|
||||
timeEl.setAttribute('datetime',dateTime);
|
||||
}
|
||||
if( contents ) {
|
||||
timeEl.innerHTML = contents;
|
||||
}
|
||||
if( dateTimeProp ) {
|
||||
timeEl.dateTime = dateTimeProp;
|
||||
}
|
||||
return timeEl;
|
||||
}
|
||||
|
||||
var timep = document.getElementById('time');
|
||||
|
@ -34,35 +34,35 @@ var times = timep.getElementsByTagName('time');
|
|||
|
||||
//TIME elements
|
||||
test(function () {
|
||||
assert_equals( times.length, 4 );
|
||||
assert_equals( times.length, 4 );
|
||||
}, 'HTML parsing should locate 4 time elements in this document');
|
||||
test(function () {
|
||||
assert_true( !!window.HTMLTimeElement );
|
||||
assert_true( !!window.HTMLTimeElement );
|
||||
}, 'HTMLTimeElement should be exposed for prototyping');
|
||||
test(function () {
|
||||
assert_true( makeTime() instanceof window.HTMLTimeElement, 'createElement variant' );
|
||||
assert_true( times[0] instanceof window.HTMLTimeElement, 'HTML parsing variant' );
|
||||
assert_true( makeTime() instanceof window.HTMLTimeElement, 'createElement variant' );
|
||||
assert_true( times[0] instanceof window.HTMLTimeElement, 'HTML parsing variant' );
|
||||
}, 'the time elements should be instanceof HTMLTimeElement');
|
||||
|
||||
//dateTime
|
||||
test(function () {
|
||||
assert_equals( makeTime('2000-02-01T03:04:05Z','2001-02-01T03:04:05Z').dateTime, '2000-02-01T03:04:05Z' );
|
||||
assert_equals( makeTime('2000-02-01T03:04:05Z','2001-02-01T03:04:05Z').dateTime, '2000-02-01T03:04:05Z' );
|
||||
}, 'the datetime attribute should be reflected by the .dateTime property');
|
||||
test(function () {
|
||||
assert_equals( typeof makeTime().dateTime, 'string', 'typeof test' );
|
||||
assert_equals( makeTime().dateTime, '', 'value test' );
|
||||
assert_equals( typeof makeTime().dateTime, 'string', 'typeof test' );
|
||||
assert_equals( makeTime().dateTime, '', 'value test' );
|
||||
}, 'the dateTime IDL property should default to an empty string');
|
||||
test(function () {
|
||||
assert_equals( makeTime(false,false,'2000-02-01T03:04:05Z').dateTime, '2000-02-01T03:04:05Z' );
|
||||
assert_equals( makeTime(false,false,'2000-02-01T03:04:05Z').dateTime, '2000-02-01T03:04:05Z' );
|
||||
}, 'the dateTime property should be read/write');
|
||||
test(function () {
|
||||
assert_equals( makeTime('go fish').dateTime, 'go fish' );
|
||||
assert_equals( makeTime('go fish').dateTime, 'go fish' );
|
||||
}, 'the datetime attribute should be reflected by the .dateTime property even if it is invalid');
|
||||
test(function () {
|
||||
assert_equals( makeTime(false,'2000-02-01T03:04:05Z').dateTime, '' );
|
||||
assert_equals( makeTime(false,'2000-02-01T03:04:05Z').dateTime, '' );
|
||||
}, 'the datetime attribute should not reflect the textContent');
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue