Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255

This commit is contained in:
James Graham 2015-03-27 09:15:38 +00:00
parent b2a5225831
commit 1a81b18b9f
12321 changed files with 544385 additions and 6 deletions

View file

@ -0,0 +1,47 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_autocomplete</h3>
</p>
<li>input text in textbox and press enter key.</li>
<li>When you input same text, you can see hint text.</li>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><input type='text' id='input_text'></p>
</form>
<script>
var input_text = document.getElementById("input_text");
input_text.autocomplete = 'on';
if (typeof(input_text.autocomplete) == "string") {
if (input_text.autocomplete != "on") {
test(function() {
assert_true(false, "autocomplete attribute is not correct.");
});
}
} else {
test(function() {
assert_unreached("autocomplete attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,47 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_list</h3>
</p>
<li>List is showed list when click the input control.</li>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
name="input_form">
<p><input type='text' id='input_url' list="urls"></p>
<datalist id="urls">
<option value="http://www.google.com/" label="Google">
<option value="http://www.reddit.com/" label="Reddit">
</datalist>
</form>
<script>
var input_url = document.getElementById("input_url");
var ele = input_url.list;
if (typeof(ele) != "object") {
if (typeof(ele) == "null") {
test(function() {
assert_unreached("list attribute is not correct.");
});
} else {
test(function() {
assert_unreached("list attribute is not exist.");
});
}
}
</script>
</body>
</html>

View file

@ -0,0 +1,52 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_valueAsDate</h3>
</p>
<li>Date is showed in input when window is loaded.</li>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
name="input_form">
<p><input type='date' id='input_date'></p>
</form>
<script>
var input_date = document.getElementById("input_date");
// Setting
try {
input_date.valueAsDate = new Date();
} catch(e) {
test(function() {
assert_unreached("Failed to set valueAsDate attribute.");
});
}
// Getting
if (input_date.valueAsDate != null) {
if (typeof(input_date.valueAsDate) != "object") {
test(function() {
assert_true(false, "valueAsDate attribute is not correct.");
});
}
} else {
test(function() {
assert_unreached("Failed to get valueAsDate attribute.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_valueAsNumber</h3>
</p>
<li>Number 5 is showed in input when window is loaded.</li>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
name="input_form">
<p><input type='number' id='input_number'></p>
</form>
<script>
var input_number = document.getElementById("input_number");
input_number.valueAsNumber = 5;
if (typeof(input_number.valueAsNumber) == "number") {
if (input_number.value != 5) {
test(function() {
assert_true(false, "valueAsNumber attribute is not correct.");
});
}
} else {
test(function() {
assert_unreached("valueAsNumber attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,56 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>select_length</h3>
</p>
<li>In select control there is only 3 items.</li>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p>
<label for="unittype">Select unit type:</label>
<select id="unittype" name="unittype">
<option value="1"> Miner </option>
<option value="2"> Puffer </option>
<option value="3" selected> Snipey </option>
<option value="4"> Max </option>
<option value="5"> Firebot </option>
</select>
</p>
</form>
<script>
var select = document.getElementById("unittype");
var length = select.length;
select.length = 3;
if (typeof(length) == "number") {
if (length != 5) {
test(function() {
assert_true(false, "length attribute is not correct.");
});
}
} else {
test(function() {
assert_unreached("length attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,50 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>select_selectedIndex</h3>
</p>
<li>In select control second item is selected.</li>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p>
<label for="unittype">Select unit type:</label>
<select id="unittype" name="unittype">
<option value="1"> Miner </option>
<option value="2"> Puffer </option>
<option value="3" selected> Snipey </option>
<option value="4"> Max </option>
<option value="5"> Firebot </option>
</select>
</p>
</form>
<script>
var select = document.getElementById("unittype");
var selectedindex = select.selectedIndex;
if (selectedindex != 2) {
test(function() {
assert_true(false, "selectedindex attribute is not correct.");
});
}
select.selectedIndex = 1;
</script>
</body>
</html>

View file

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>button_checkValidity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><button id='button_id'>button</button></p>
</form>
<script>
var button = document.getElementById("button_id");
try
{
var ret = button.checkValidity();
test(function() {
assert_equals(ret, true, "calling of checkValidity method is failed.");
});
}
catch (e) {
test(function() {
assert_unreached("autofocus attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,48 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>button_labels</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><label>Full name:<label>(name)<button id='button_id1'>button1</button><small>Format: First Last</small></label></label></p>
<p><label>Age: <button id='button_id2'>button2</button></label></p>
</form>
<script>
var button1 = document.getElementById("button_id1");
var button2 = document.getElementById("button_id2");
if (typeof(button1.labels) == "object") {
if (button1.labels.length == 2 && button2.labels.length == 1) {
test(function() {
assert_true(true, "labels attribute is correct.");
});
} else {
test(function() {
assert_unreached("labels attribute is not correct.");
});
}
} else {
test(function() {
assert_unreached("labels attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>button_setCustomValidity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><button id='button_id'>button</button></p>
</form>
<script>
var button = document.getElementById("button_id");
try
{
button.setCustomValidity("custom error");
test(function() {
assert_true(true, "calling of setCustomValidity method is successed.");
});
}
catch (e) {
test(function() {
assert_unreached("Error is raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>button_validationMessage</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><button id='button_id'>button</button></p>
</form>
<script>
var button = document.getElementById("button_id");
if (typeof(button.validationMessage) == "string") {
test(function() {
assert_equals(button.validationMessage, "", "validationMessage attribute is not correct.");
});
} else {
test(function() {
assert_unreached("validationMessage attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>button_validity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><button id='button_id'>button</button></p>
</form>
<script>
var button = document.getElementById("button_id");
if (typeof(button.validity) == "object") {
test(function() {
assert_equals(button.validity.valueMissing, false, "validity attribute is not correct.");
});
} else {
test(function() {
assert_unreached("validity attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>button_willValidate</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><button id='button_id'>button</button></p>
</form>
<script>
var button = document.getElementById("button_id");
if (typeof(button.willValidate) == "boolean") {
test(function() {
assert_equals(button.willValidate, true, "willValidate attribute is not correct.");
});
} else {
test(function() {
assert_unreached("willValidate attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>FieldSet_checkValidity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<fieldset id="input_field">
</fieldset>
</form>
<script>
var field = document.getElementById("input_field");
try
{
var ret = field.checkValidity();
test(function() {
assert_equals(ret, true, "calling of checkValidity method is failed.");
});
}
catch (e) {
test(function() {
assert_unreached("Error is raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>FieldSet_setCustomValidity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<fieldset id="input_field">
</fieldset>
</form>
<script>
var field = document.getElementById("input_field");
try
{
field.setCustomValidity("custom error");
test(function() {
assert_true(true, "calling of setCustomValidity method is successed.");
});
}
catch (e) {
test(function() {
assert_unreached("Error is raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,41 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>FieldSet_validationMessage</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<fieldset id="input_field">
</fieldset>
</form>
<script>
var field = document.getElementById("input_field");
if (typeof(field.validationMessage) == "string") {
test(function() {
assert_equals(field.validationMessage, "", "validationMessage attribute is not correct.");
});
} else {
test(function() {
assert_unreached("validationMessage attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,41 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>FieldSet_validity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<fieldset id="input_field">
</fieldset>
</form>
<script>
var field = document.getElementById("input_field");
if (typeof(field.validity) == "object") {
test(function() {
assert_equals(field.validity.valueMissing, false, "validity attribute is not correct.");
});
} else {
test(function() {
assert_unreached("validity attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,41 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>FieldSet_willValidate</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<fieldset id="input_field">
</fieldset>
</form>
<script>
var field = document.getElementById("input_field");
if (typeof(field.willValidate) == "boolean") {
test(function() {
assert_equals(field.willValidate, false, "willValidate attribute is not correct.");
});
} else {
test(function() {
assert_unreached("willValidate attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>Form_action</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action="http://www.google.com/"
id="input_form">
<p><input type=hidden name="custname"></p>
<p><input type=hidden name="custtel"></p>
<p><input type=hidden name="custemail"></p>
</form>
<script>
var form = document.getElementById("input_form");
if (typeof(form.action) == "string") {
test(function() {
assert_equals(form.action, "http://www.google.com/", "action attribute is not correct.");
});
} else {
test(function() {
assert_unreached("action attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,47 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>Form_checkValidity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><input type=hidden name="custname"></p>
<p><input type=hidden name="custtel"></p>
<p><input type=hidden name="custemail"></p>
</form>
<script>
var form = document.getElementById("input_form");
try
{
var ret = form.checkValidity();
test(function() {
assert_equals(ret, true, "calling of checkValidity method is failed.");
});
}
catch (e) {
test(function() {
assert_unreached("Error is raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,38 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>Form_length</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><input type=hidden name="custname"></p>
<p><input type=hidden name="custtel"></p>
<p><input type=hidden name="custemail"></p>
</form>
<script>
var form = document.getElementById("input_form");
var len = form.length;
test(function() {
assert_equals(len, 3, "length attribute is not correct.");
});
</script>
</body>
</html>

View file

@ -0,0 +1,51 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>Form_submit</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action="?x=1"
id="input_form">
<p><input type=hidden name="custname"></p>
<p><input type=hidden name="custtel"></p>
<p><input type=hidden name="custemail"></p>
</form>
<script>
var form = document.getElementById("input_form");
try
{
var url = location.href;
pos = url.lastIndexOf("?x=1");
if (pos == -1) {
form.submit();
} else {
test(function() {
assert_true(true, "calling of submit method is successed.");
});
}
}
catch (e) {
test(function() {
assert_unreached("Error is raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_checkValidity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><input type='hidden' id='input_text'></p>
</form>
<script>
var input = document.getElementById("input_text");
try
{
var ret = input.checkValidity();
test(function() {
assert_equals(ret, true, "calling of checkValidity method is failed.");
});
}
catch (e) {
test(function() {
assert_unreached("Error is raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,42 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_height</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
name="input_form">
<p><input type='image' id='input_text'></p>
</form>
<script>
var input_text = document.getElementById("input_text");
input_text.height = 30;
if (typeof(input_text.height) == "number") {
test(function() {
assert_equals(input_text.height, 30, "formTarget attribute is not correct.");
});
} else {
test(function() {
assert_unreached("height attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,49 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_labels</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><label>Full name:<label>(name)<input name=fn id='input_text1'> <small>Format: First Last</small></label></label></p>
<p><label>Age: <input name=age type=number min=0 id='input_text2'></label></p>
<p><label>Post code: <input name=pc> <small>Format: AB12 3CD</small></label></p>
</form>
<script>
var input1 = document.getElementById("input_text1");
var input2 = document.getElementById("input_text2");
if (typeof(input1.labels) == "object") {
if (input1.labels.length == 2 && input2.labels.length == 1) {
test(function() {
assert_true(true, "labels attribute is correct.");
});
} else {
test(function() {
assert_unreached("labels attribute is not correct.");
});
}
} else {
test(function() {
assert_unreached("labels attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_setCustomValidity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><input type='hidden' id='input_text'></p>
</form>
<script>
var input = document.getElementById("input_text");
try
{
input.setCustomValidity("custom error");
test(function() {
assert_true(true, "calling of setCustomValidity method is successed.");
});
}
catch (e) {
test(function() {
assert_unreached("Error is raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_stepDown</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
name="input_form">
<p><input type='number' id='input_number'></p>
</form>
<script>
var input_number = document.getElementById("input_number");
input_number.max = "30";
input_number.step = "3";
input_number.value = "30";
input_number.stepDown(5);
if (typeof(input_number.stepDown) == "function") {
test(function() {
assert_equals(input_number.value, "15", "call of stepDown method is failed.");
});
} else {
test(function() {
assert_unreached("stepDown attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_stepUp</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
name="input_form">
<p><input type='number' id='input_number'></p>
</form>
<script>
var input_number = document.getElementById("input_number");
input_number.max = "30";
input_number.step = "3";
input_number.value = "0";
input_number.stepUp(5);
if (typeof(input_number.stepUp) == "function") {
test(function() {
assert_equals(input_number.value, "15", "call of stepUp method is failed.");
});
} else {
test(function() {
assert_unreached("stepUp attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_validationMessage</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><input type='hidden' id='input_text'></p>
</form>
<script>
var input = document.getElementById("input_text");
if (typeof(input.validationMessage) == "string") {
test(function() {
assert_equals(input.validationMessage, "", "validationMessage attribute is not correct.");
});
} else {
test(function() {
assert_unreached("validationMessage attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_validity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><input type='hidden' id='input_text'></p>
</form>
<script>
var input = document.getElementById("input_text");
if (typeof(input.validity) == "object") {
test(function() {
assert_equals(input.validity.valueMissing, false, "validity attribute is not correct.");
});
} else {
test(function() {
assert_unreached("validity attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,41 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_value_INVALID_STATE_ERR</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
name="input_form">
<p><input type='file' id='input_file'></p>
</form>
<script>
var input_file = document.getElementById("input_file");
try {
input_file.value = "val";
test(function() {
assert_unreached("INVALID_STATE_ERR error is not raised.");
});
} catch (e) {
test(function() {
assert_equals(e.code, e["INVALID_STATE_ERR"], "INVALID_STATE_ERR error is not raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,41 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_valueAsDate_INVALID_STATE_ERR</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
name="input_form">
<p><input type='checkbox' id='input_checkbox'></p>
</form>
<script>
var input_checkbox = document.getElementById("input_checkbox");
try {
input_checkbox.valueAsDate = new Date('2011-11-01');
test(function() {
assert_reached("INVALID_STATE_ERR error is not raised.");
});
}
catch (e) {
test(function() {
assert_equals(e.code, e["INVALID_STATE_ERR"], "INVALID_STATE_ERR error is not raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,39 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_valueAsNumber_INVALID_STATE_ERR</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
name="input_form">
<p><input type='checkbox' id='input_checkbox'></p>
</form>
<script>
var input_checkbox = document.getElementById("input_checkbox");
try {
input_checkbox.valueAsNumber = 5;
}
catch (e) {
test(function() {
assert_equals(e.code, e["INVALID_STATE_ERR"], "INVALID_STATE_ERR error is not raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,42 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_width</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
name="input_form">
<p><input type='image' id='input_text'></p>
</form>
<script>
var input_text = document.getElementById("input_text");
input_text.width = 30;
if (typeof(input_text.width) == "number") {
test(function() {
assert_equals(input_text.width, 30, "width attribute is not correct.");
});
} else {
test(function() {
assert_unreached("width attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>input_willValidate</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><input type='hidden' id='input_text'></p>
</form>
<script>
var input = document.getElementById("input_text");
if (typeof(input.willValidate) == "boolean") {
test(function() {
assert_equals(input.willValidate, false, "willValidate attribute is not correct.");
});
} else {
test(function() {
assert_unreached("willValidate attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>keygen_checkValidity</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<keygen name='key' id='keygen_id'></keygen>
</form>
<script>
var keygen = document.getElementById("keygen_id");
try
{
var ret = keygen.checkValidity();
test(function() {
assert_equals(ret, true, "calling of checkValidity method is failed.");
});
}
catch (e) {
test(function() {
assert_unreached("Error is raised.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,48 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Forms</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>
<h3>keygen_labels</h3>
</p>
<hr>
<div id="log"></div>
<form method="post"
enctype="application/x-www-form-urlencoded"
action=""
id="input_form">
<p><label>Full name<label>(name):<keygen name='key1' id='keygen_id1'></keygen></label></label></p>
<p><label>Age:<keygen name='key2' id='keygen_id2'></keygen></label></p>
</form>
<script>
var keygen1 = document.getElementById("keygen_id1");
var keygen2 = document.getElementById("keygen_id2");
if (typeof(keygen1.labels) == "object") {
if (keygen1.labels.length == 2 && keygen2.labels.length == 1) {
test(function() {
assert_true(true, "labels attribute is correct.");
});
} else {
test(function() {
assert_unreached("labels attribute is not correct.");
});
}
} else {
test(function() {
assert_unreached("labels attribute is not exist.");
});
}
</script>
</body>
</html>

View file

@ -0,0 +1,12 @@
.pass {
color: green;
}
.fail {
color: red;
}
.manualpass {
color: green;
}
.manualfail {
color: red;
}

View file

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0, user-scalable=yes" />
<title>Session History</title>
<script type="text/javascript">
</script>
</head>
<body>
<p>
<b>Session History&nbsp;</b><br/>
<hr/>
<ol type="1">
<font size="2">
<!-- <li><a href="history_length.html">history_length</a></li> -->
<li><a href="history_state.html">history_state</a></li>
<li><a href="history_pushstate.html">history_pushState</a></li>
<li><a href="history_pushstate_nooptionalparam.html">history_pushState_NoOptionalParam</a></li>
<li><a href="history_pushstate_err.html">history_pushState SECURITY_ERR</a></li>
<li><a href="history_replacestate.html">history_replaceState</a></li>
<li><a href="history_replacestate_nooptionalparam.html">history_replaceStateNoOptionalParam</a></li>
<li><a href="history_replacestate_err.html">history_replaceState SECURITY_ERR</a></li>
<li><a href="history_back.html">history_back</a></li>
<li><a href="history_forward.html">history_forward</a></li>
<li><a href="history_go_minus.html">history_go_minus</a></li>
<li><a href="history_go_plus.html">history_go_plus</a></li>
<!-- <li><a href="history_go_zero.html">history_go_zero</a></li> -->
<!-- <li><a href="history_go_under.html">history_go_under</a></li> -->
<!-- <li><a href="history_go_over.html">history_go_over</a></li> -->
<li><a href="location_href.html">location_href</a></li>
<li><a href="location_assign.html">location_assign</a></li>
<li><a href="location_replace.html">location_replace</a></li>
<!-- <li><a href="location_reload.html">location_reload</a></li> -->
<li><a href="location_protocol.html">location_protocol</a></li>
<li><a href="location_host.html">location_host</a></li>
<li><a href="location_hostname.html">location_hostname</a></li>
<li><a href="location_port.html">location_port</a></li>
<li><a href="location_pathname.html">location_pathname</a></li>
<li><a href="location_search.html">location_search</a></li>
<li><a href="location_hash.html">location_hash</a></li>
<li><a href="combination_history_001.html">combination_history_001</a></li>
<li><a href="combination_history_002.html">combination_history_002</a></li>
<li><a href="combination_history_003.html">combination_history_003</a></li>
<li><a href="combination_history_004.html">combination_history_004</a></li>
<li><a href="combination_history_005.html">combination_history_005</a></li>
<li><a href="combination_history_006.html">combination_history_006</a></li>
<li><a href="combination_history_007.html">combination_history_007</a></li>
</font>
</ol>
<hr/>
<p>
</body>
</html>

View file

@ -0,0 +1,62 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Fire drag event during the drag and drop processing</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/>
<meta name="assert" content="Fire drag event during the drag and drop processing"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var EVENT, TARGET;
function DragEvent(evt)
{
if ((TARGET == evt.target) && (EVENT == evt.type))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
EVENT = "drag";
window.onload = function()
{
TARGET = document.getElementById("target");
AddEventListenersForElement(EVENT, DragEvent, false, TARGET);
}
</script>
</head>
<body>
<pre>Description: Fire drag event during the drag and drop processing</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Click and drag the blue image
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model
</p>
<p>
If the user agent is still performing the previous iteration of the sequence (if any) when the next iteration becomes due, abort these steps for this iteration (effectively "skipping missed frames" of the drag-and-drop operation).
Fire a DND event named drag event at the source node. If this event is canceled, the user agent must set the current drag operation to "none" (no drag operation).
</p>
<img src="../images/blue.png" style="width:200px; height:100px" draggable="true" id="target"/>
</body>
</html>

View file

@ -0,0 +1,62 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Fire drag event when dragging a div element</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/>
<meta name="assert" content="Fire drag event when dragging a div element"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var EVENT, TARGET;
function DragEvent(evt)
{
if ((TARGET == evt.target) && (EVENT == evt.type))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
EVENT = "drag";
window.onload = function()
{
TARGET = document.getElementById("target");
AddEventListenersForElement(EVENT, DragEvent, false, TARGET);
}
</script>
</head>
<body>
<pre>Description: Fire drag event when dragging a div element</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Click and drag the red box
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model
</p>
<p>
If the user agent is still performing the previous iteration of the sequence (if any) when the next iteration becomes due, abort these steps for this iteration (effectively "skipping missed frames" of the drag-and-drop operation).
Fire a DND event named drag event at the source node. If this event is canceled, the user agent must set the current drag operation to "none" (no drag operation).
</p>
<div id="target" style="border:2px red solid; width:200px; height:50px" draggable="true"></div>
</body>
</html>

View file

@ -0,0 +1,64 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Fire dragend event during the drag and drop processing</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/>
<meta name="assert" content="Fire dragend event during the drag and drop processing"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var EVENT, TARGET;
function DragendEvent(evt)
{
if ((TARGET == evt.target) && (EVENT == evt.type))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
EVENT = "dragend";
window.onload = function()
{
TARGET = document.getElementById("target");
AddEventListenersForElement(EVENT, DragendEvent, false, TARGET);
}
</script>
</head>
<body>
<pre>Description: Fire dragend event during the drag and drop processing</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Drag the blue image
<li> Drop it on the green box
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model
</p>
<p>
If the drag operation failed or succeeded, fire a DND event named dragend at the source node.
</p>
<img src="../images/blue.png" style="width:200px; height:100px" draggable="true" id="target"/>
<br /><br />
<input type="text" style="border:2px green solid; width:200px; height:50px"></input>
</body>
</html>

View file

@ -0,0 +1,67 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Fire dragenter event during the drag and drop processing</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/>
<meta name="assert" content="Fire dragenter event during the drag and drop processing"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var EVENT, TARGET;
function DragenterEvent(evt)
{
if ((TARGET == evt.target) && (EVENT == evt.type))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
EVENT = "dragenter";
window.onload = function()
{
TARGET = document.getElementById("target");
AddEventListenersForElement(EVENT, DragenterEvent, false, TARGET);
}
</script>
</head>
<body>
<pre>Description: Fire dragenter event during the drag and drop processing</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Select the text inside the red box
<li> Drag it and enter the green box
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model
</p>
<p>
If the user is indicating a different immediate user selection than during the last iteration (or if this is the first iteration), and if this immediate user selection is not the same as the current target element, then update the current target element as follows:
- If the new immediate user selection is null, Set the current target element to null also.
- If the new immediate user selection is in a non-DOM document or application, Set the current target element to the immediate user selection.
- Otherwise, Fire a DND event named dragenter at the immediate user selection.
</p>
<div style="border:2px red solid; width:200px; height:50px">SampleText</div>
<br /><br />
<input type="text" id="target" style="border:2px green solid; width:200px; height:50px"></input>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Auto state of draggable attribute for 'a' element</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#the-draggable-attribute"/>
<meta name="assert" content="Auto state of draggable attribute for 'a' element"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<a href="#" style="display:none" id="target">Drag this</a>
<script type="text/javascript">
test(function() {assert_true(document.getElementById("target").draggable)}, "Auto state of draggable attribute for 'a' element");
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Auto state of draggable attribute for div element</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#the-draggable-attribute"/>
<meta name="assert" content="Auto state of draggable attribute for div element"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<div style="border:2px red solid; width:200px; height:50px; display:none;" id="target">SampleText</div>
<script type="text/javascript">
test(function() {assert_false(document.getElementById("target").draggable)}, "Auto state of draggable attribute for div element");
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Auto state of draggable attribute for img element</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#the-draggable-attribute"/>
<meta name="assert" content="Auto state of draggable attribute for img element"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<img style="width:200px; height:100px; display:none;" id="target"/>
<script type="text/javascript">
test(function() {assert_true(document.getElementById("target").draggable)}, "Auto state of draggable attribute for img element");
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: False state of draggable attribute</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#the-draggable-attribute"/>
<meta name="assert" content="False state of draggable attribute"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<a href="#" style="display:none" id="target" draggable="false">Drag this</a>
<script type="text/javascript">
test(function() {assert_false(document.getElementById("target").draggable)}, "False state of draggable attribute");
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: True state of draggable attribute</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#the-draggable-attribute"/>
<meta name="assert" content="True state of draggable attribute"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<a href="#" style="display:none" id="target" draggable="true">Drag this</a>
<script type="text/javascript">
test(function() {assert_true(document.getElementById("target").draggable)}, "True state of draggable attribute");
</script>
</body>
</html>

View file

@ -0,0 +1,66 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Fire dragleave event during the drag and drop processing</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/>
<meta name="assert" content="Fire dragleave event during the drag and drop processing"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var EVENT, TARGET;
function DragleaveEvent(evt)
{
if ((TARGET == evt.target) && (EVENT == evt.type))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
EVENT = "dragleave";
window.onload = function()
{
TARGET = document.getElementById("target");
AddEventListenersForElement(EVENT, DragleaveEvent, false, TARGET);
}
</script>
</head>
<body>
<pre>Description: Fire dragleave event during the drag and drop processing</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Select the text inside the red box
<li> Drag it over the blue box and drop it on the green box
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model
</p>
<p>
If there is a change in the current target element, and if the previous target element was not null or a part of a non-DOM document, then fire a DND event named dragleave at the previous target element.
</p>
<div style="border:2px red solid; width:100px">SampleText</div>
<br />
<div id="target" style="border:2px blue solid; width:200px; height:50px"></div>
<br />
<input type="text" style="border:2px green solid; width:200px; height:50px"></input>
</body>
</html>

View file

@ -0,0 +1,64 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Fire dragover event during the drag and drop processing</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/>
<meta name="assert" content="Fire dragover event during the drag and drop processing"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var EVENT, TARGET;
function DragoverEvent(evt)
{
if ((TARGET == evt.target) && (EVENT == evt.type))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
EVENT = "dragover";
window.onload = function()
{
TARGET = document.getElementById("target");
AddEventListenersForElement(EVENT, DragoverEvent, false, TARGET);
}
</script>
</head>
<body>
<pre>Description: Fire dragover event during the drag and drop processing</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Select the text inside the red box.
<li> Drag it, hover over the green box and then release the mouse
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model
</p>
<p>
If the current target element is a DOM element, then fire a DND event named dragover at this current target element
</p>
<div style="border:2px red solid; width:100px">SampleText</div>
<br /><br />
<div id="target" style="border:2px green solid; width:200px; height:100px"></div>
</body>
</html>

View file

@ -0,0 +1,62 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Fire dragstart event during the drag and drop processing</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/>
<meta name="assert" content="Fire dragstart event during the drag and drop processing"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var EVENT, TARGET;
function DragstartEvent(evt)
{
if ((TARGET == evt.target) && (EVENT == evt.type))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
EVENT = "dragstart";
window.onload = function()
{
TARGET = document.getElementById("target");
AddEventListenersForElement(EVENT, DragstartEvent, false, TARGET);
}
</script>
</head>
<body>
<pre>Description: Fire dragstart event during the drag and drop processing</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Click and drag the red box
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model
</p>
<p>
If it is an element that is being dragged, then set the drag data store elements list to contain just the source node.
Fire a DND event named dragstart at the source node.
</p>
<div id="target" style="border:2px red solid; width:200px; height:50px" draggable="true"></div>
</body>
</html>

View file

@ -0,0 +1,64 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Fire drop event during the drag and drop processing</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model"/>
<meta name="assert" content="Fire drop event during the drag and drop processing"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var EVENT, TARGET;
function DropEvent(evt)
{
if ((TARGET == evt.target) && (EVENT == evt.type))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
EVENT = "drop";
window.onload = function()
{
TARGET = document.getElementById("target");
AddEventListenersForElement(EVENT, DropEvent, false, TARGET);
}
</script>
</head>
<body>
<pre>Description: Fire drop event during the drag and drop processing</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Select the text inside the red box
<li> Drag it and drop it on the green box
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#drag-and-drop-processing-model
</p>
<p>
If the drag operation was a success, if the current target element is a DOM element, fire a DND event named drop at it.
</p>
<div style="border:2px red solid; width:100px">SampleText</div>
<br /><br />
<input type="text" id="target" style="border:2px green solid; width:200px; height:50px"></input>
</body>
</html>

View file

@ -0,0 +1,76 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Set a value to effectAllowed attribute</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#datatransfer"/>
<meta name="assert" content="Set a value to effectAllowed attribute"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var TARGETEVENT1, TARGETEVENT2, TARGET1, TARGET2;
function DragstartEvent(evt)
{
if ((TARGET1 == evt.target) && (TARGETEVENT1 == evt.type))
{
evt.dataTransfer.effectAllowed = "move";
}
}
function DragenterEvent(evt)
{
if ((TARGET2 == evt.target) && (TARGETEVENT2 == evt.type))
{
if("move" == evt.dataTransfer.effectAllowed)
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
}
TARGETEVENT1 = "dragstart";
TARGETEVENT2 = "dragenter";
window.onload = function()
{
TARGET1 = document.getElementById("target1");
TARGET2 = document.getElementById("target2");
AddEventListenersForElement(TARGETEVENT1, DragstartEvent, false, TARGET1);
AddEventListenersForElement(TARGETEVENT2, DragenterEvent, false, TARGET2);
}
</script>
</head>
<body>
<pre>Description: Set a value to effectAllowed attribute</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Drag the blue image and enter the green box
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#datatransfer
</p>
<p>
On setting, if the new value is one of "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", or "uninitialized", then the attribute's current value must be set to the new value.
</p>
<img src="../images/blue.png" style="width:200px; height:100px" draggable="true" id="target1"/>
<br /><br />
<input type="text" id="target2" style="border:2px green solid; width:200px; height:50px"></input>
</body>
</html>

View file

@ -0,0 +1,81 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: files attribute returns a FileList</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#datatransfer"/>
<meta name="assert" content="files attribute returns a FileList"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var EVENT, TARGET;
function DropEvent(evt)
{
if ((TARGET == evt.target) && (EVENT == evt.type))
{
var files = evt.dataTransfer.files;
if(('[object FileList]' == files))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
else
{
LogTestResult("FAIL");
}
}
function DragenterEvent(evt)
{
evt.preventDefault();
}
function DragoverEvent(evt)
{
evt.preventDefault();
}
EVENT = "drop";
window.onload = function()
{
TARGET = document.getElementById("target");
AddEventListenersForElement(EVENT, DropEvent, false, TARGET);
AddEventListenersForElement("dragenter", DragenterEvent, false, TARGET);
AddEventListenersForElement("dragover", DragoverEvent, false, TARGET);
}
</script>
</head>
<body>
<pre>Description: files attribute returns a FileList</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Drag a file and drop it in the green box
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#datatransfer
</p>
<p>
The files attribute must return a live FileList sequence consisting of File objects representing the files.
</p>
<textarea type="text" id="target" style="border:2px green solid; width:200px; height:50px"></textarea>
</body>
</html>

View file

@ -0,0 +1,78 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: Add an item to the drag data store item list whose data is the string given by setData method's second argument</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#datatransfer"/>
<meta name="assert" content="Add an item to the drag data store item list whose data is the string given by setData method's second argument"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var TARGETEVENT1, TARGETEVENT2, TARGET1, TARGET2;
function DragstartEvent(evt)
{
if ((TARGET1 == evt.target) && (TARGETEVENT1 == evt.type))
{
evt.dataTransfer.setData("text", "SetText");
}
}
function DropEvent(evt)
{
if ((TARGET2 == evt.target) && (TARGETEVENT2 == evt.type))
{
if("SetText" == evt.dataTransfer.getData("text"))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
}
TARGETEVENT1 = "dragstart";
TARGETEVENT2 = "drop";
window.onload = function()
{
TARGET1 = document.getElementById("target1");
TARGET2 = document.getElementById("target2");
AddEventListenersForElement(TARGETEVENT1, DragstartEvent, false, TARGET1);
AddEventListenersForElement(TARGETEVENT2, DropEvent, false, TARGET2);
}
</script>
</head>
<body>
<pre>Description: Add an item to the drag data store item list whose data is the string given by setData method's second argument</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Drag the blue image and drop it in the green box
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#datatransfer
</p>
<p>
If format equals "text", change it to "text/plain".
Remove the item in the drag data store item list whose kind is Plain Unicode string and whose type string is equal to format, if there is one.
Add an item to the drag data store item list whose kind is Plain Unicode string, whose type string is equal to format, and whose data is the string given by the method's second argument.
</p>
<img src="../images/blue.png" style="width:200px; height:100px" draggable="customValue2" id="target1"/>
<br /><br />
<input type="text" id="target2" style="border:2px green solid; width:200px; height:50px"></input>
</body>
</html>

View file

@ -0,0 +1,72 @@
<!doctype html>
<html>
<head>
<title>HTML5 Drag and Drop: types attribute returns a DOMStringList</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
<link rel="help" href="http://dev.w3.org/html5/spec/dnd.html#datatransfer"/>
<meta name="assert" content="types attribute returns a DOMStringList"/>
<script src="dragdrop_support.js" type="text/javascript"></script>
<script type="text/javascript">
var EVENT, TARGET;
function DropEvent(evt)
{
if ((TARGET == evt.target) && (EVENT == evt.type))
{
var types = evt.dataTransfer.types;
if(('[object DOMStringList]' == types))
{
LogTestResult("PASS");
}
else
{
LogTestResult("FAIL");
}
}
else
{
LogTestResult("FAIL");
}
}
EVENT = "drop";
window.onload = function()
{
TARGET = document.getElementById("target");
AddEventListenersForElement(EVENT, DropEvent, false, TARGET);
}
</script>
</head>
<body>
<pre>Description: types attribute returns a DOMStringList</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_result'>Manual</td>
<td id='test_assertion'>Test passes if if the word "PASS" appears to the left after following the steps below.
<div id="manualsteps">
Steps:
<ol>
<li> Select the text inside the red box
<li> Drag and drop it in the green box
</ol>
</div>
</td>
</tr>
</table>
<p>
http://dev.w3.org/html5/spec/dnd.html#datatransfer
</p>
<p>
The types attribute must return a live DOMStringList.
</p>
<div style="border:2px red solid; width:200px; height:50px">SampleText</div>
<br /><br />
<input type="text" id="target" style="border:2px green solid; width:200px; height:50px"></input>
</body>
</html>

View file

@ -0,0 +1,9 @@
function AddEventListenersForElement(evt, callback, capture, element)
{
element.addEventListener(evt, callback, capture);
}
function LogTestResult(result)
{
document.getElementById("test_result").firstChild.data = result;
}

View file

@ -0,0 +1,47 @@
<!DOCTYPE html >
<html>
<head>
<title>HTML 5 Foreign Content SVG in HTML </title>
<meta description="Test to verify SVG inside HTML I element parses correctly" />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<script type="text/javascript">
function RunTest()
{
try
{
if(document.getElementsByTagName("i")[0].childNodes[1].localName=="svg")
{
var svgNamespace = "http://www.w3.org/2000/svg";
var textElem = document.createElementNS(svgNamespace, "text");
var textContent = document.createTextNode("FillerText");
textElem.appendChild(textContent);
var container = document.getElementById("svg1");
container.appendChild(textElem);
}
}
catch(ex)
{
}
}
</script>
</head>
<body onLoad="RunTest()">
<div class="testdata">
<p id="instructions">Test passes if 'FillerText' is rendered as italic.</p>
</div>
<div>
<i>
<svg id="svg1" width="100px" height="100px">
</svg>
</i>
</div>
</body>
</html>

View file

@ -0,0 +1,8 @@
<!DOCTYPE html>
<svg width="100px" height="100px" >
<rect width="100px" height="100px" fill="green" />
</svg>
<div>
<p> Test passes if a green rectangle is visible on the page above this line. </p>
</div>

View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>HTML 5 Foreign Content SVG in HTML </title>
<meta description="Test to verify SVG elements are styled using SCRIPT and STYLE element" />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<style>
svg
{
display: block;
fill: black;
}
</style>
<script>
function ChangeColor()
{
document.getElementById("rect1").style.fill = "green";
}
</script>
</head>
<body onload="ChangeColor()">
<div class="testdata">
<p id="instructions">Test passes if a green square appears above a black square. </p>
</div>
<svg width="200px" height="200px">
<rect id="rect1" x="0" y="0" width="100px" height="100px" />
<rect id="rect2" x="0" y="150" width="100px" height="100px" />
</svg>
</body>
</html>

View file

@ -0,0 +1,98 @@
<!DOCTYPE html>
<html>
<head>
<title>HTML 5 Foreign Content SVG in HTML </title>
<meta description="Test to verify SVG elements inside SVG namespace are camelCased" />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<script type="text/javascript">
function RunTest()
{
try
{
var bResult = "FAIL";
var parentNode = document.getElementById("svg1");
for(var i=1;i<parentNode.childNodes.length;i=i+2)
{
var idName = parentNode.childNodes[i].id;
var tagName = parentNode.childNodes[i].localName;
if(idName!=tagName)
{
bResult = "FAIL";
break;
}
else
{
bResult = "PASS"
}
}
}
catch(ex)
{
bResult = "PASS";
}
document.getElementById("testresult").innerHTML = bResult;
}
</script>
</head>
<body onload="RunTest()">
<div class="testdata">
<p id="instructions"> Test passes if the word "PASS" appears below </p>
<p> Test Result : </p>
<p id="testresult"> RUNNING </div>
</div>
<svg id="svg1">
<altglyph id="altGlyph" />
<ALTGLYPHDEF id="altGlyphDef" />
<AltGlyphItem id="altGlyphItem" />
<animatecolor id="animateColor" />
<animatemotion id="animateMotion" />
<animatetransform id="animateTransform" />
<clippath id="clipPath" />
<feblend id="feBlend" />
<fecolormatrix id="feColorMatrix" />
<fecomponenttransfer id="feComponentTransfer" />
<fecomposite id="feComposite" />
<feconvolvematrix id="feConvolveMatrix" />
<fediffuselighting id="feDiffuseLighting" />
<fedisplacementmap id="feDisplacementMap" />
<fedistantlight id="feDistantLight" />
<feflood id="feFlood" />
<fefunca id="feFuncA" />
<fefuncb id="feFuncB" />
<fefuncg id="feFuncG" />
<fefuncr id="feFuncR" />
<fegaussianblur id="feGaussianBlur" />
<feimage id="feImage" />
<femerge id="feMerge" />
<femergenode id="feMergeNode" />
<femorphology id="feMorphology" />
<feoffset id="feOffset" />
<fepointlight id="fePointLight" />
<fespecularlighting id="feSpecularLighting" />
<fespotlight id="feSpotLight" />
<fetile id="feTile" />
<feturbulence id="feTurbulence" />
<foreignobject id="foreignObject" />
<glyphref id="glyphRef" />
<lineargradient id="linearGradient" />
<radialgradient id="radialGradient" />
<textpath id="textPath" />
</svg>
</body>
</html>

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<title>HTML 5 Foreign Content SVG in HTML </title>
<meta description="Test to verify SVG Elements outside SVG namespace are camelCased" />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<script type="text/javascript">
function RunTest()
{
try
{
var parentNode = document.getElementById("div1");
for(var i=0;i<parentNode.childNodes.length;i++)
{
var idName = parentNode.childNodes[i].id;
var tagName = parentNode.childNodes[i].localName;
if(idName==tagName)
{
document.getElementById("testresult").innerHTML = "FAIL";
break;
}
else
{
document.getElementById("testresult").innerHTML = "PASS";
}
}
}
catch(ex)
{
document.getElementById("testresult").innerHTML = "FAIL";
}
}
</script>
</head>
<body onload="RunTest()">
<div id="div1">
<AlTglYph id="altGlyph" />
</div>
<p id="instructions"> Test passes if the word "PASS" appears below </p>
<p> Test Result : </p>
<div id="testresult"> RUNNING </div>
</body>
</html>

View file

@ -0,0 +1 @@
Page Not Found

View file

@ -0,0 +1,329 @@
<!doctype html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="http://dev.w3.org/html5/spec/history.html" />
<title>HTML5 History Test Cases</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<!-- Use this iframe to test url changes so that the base url does not change. Their document does not matter. -->
<iframe id="testframe1" style="display:none" src="./404.html"></iframe>
<iframe id="testframe2" style="display:none" src="./404.html"></iframe>
<script type="text/javascript">
var testCollection;
var testIndex = 0;
var testframe1 = document.getElementById("testframe1");
var testframe2 = document.getElementById("testframe2");
setup(function()
{
testCollection = [
function() {
test(function() {
assert_inherits(window, "onpopstate", "window inherits'onpopstate' event ");
}, "onpopstate in window");
},
function() {
test(function() {
assert_inherits(window.history, "pushState", "history inherits property 'pushState'");
assert_equals(window.history.pushState.constructor, Function, "pushState is a function");
}, "history.pushState is present");
},
function() {
test(function() {
assert_inherits(window.history, "replaceState", "history inherits property 'replaceState'");
assert_equals(window.history.replaceState.constructor, Function, "replaceState is a function");
}, "history.replaceState is present");
},
function() {
test(function() {
assert_inherits(window.history, "state", "history inherits property 'state'");
}, "history.state is present");
},
function() {
test(function() {
assert_equals(window.history.state, null, "history.state initialized to null");
}, "history.state is initialized to null");
},
function() {
test(function() {
var length = history.length;
history.pushState(null,null);
assert_equals(history.length, length+1, "history.length should be incremented by one");
}, "history.pushState increments history.length");
},
function() {
var t = async_test("history.pushState clears forward entries");
t.step(function() {
var length = history.length;
//push some extra entries into the session history
history.pushState(null,null);
history.pushState(null, null);
history.pushState(null, null);
//there should now be three extra
assert_equals(history.length, length+3, "Three additional travel entries add to history.length");
//travel back to the entry that the test started on
history.back();
history.back();
history.back();
//if the back navs are queued, queue verification task after them
queue(
t.step_func(function() {
//once the .back navigations have completed, push again and verify length is one more than starting value
history.pushState(null, null);
assert_equals(history.length, length+1, "History.length should now only be one more than original value");
t.done();
})
);
});
},
function() {
test(function() {
testframe1.contentWindow.history.pushState(null,null, "test-pushstate-url");
assert_equals(getPageName(testframe1.contentWindow.location.href), "test-pushstate-url", "iframe1 has the pushed url");
}, "history.pushState accepts a third parameter 'url' and uses it to alter location");
},
function() {
test(function() {
var oldurl = testframe1.contentWindow.location.href.toString();
var pagename = getPageName(oldurl);
//form a new absolute url (with protocol, host, etc) with "absolute-page" as the name of the page
var newurl = oldurl.replace(pagename, "absolute-page");
testframe1.contentWindow.history.pushState(null,null, newurl);
assert_equals(testframe1.contentWindow.location.href, newurl, "iframe1 has the pushed url correctly");
}, "history.pushState's url parameter can be an absolute url");
},
function() {
test(function() {
testframe1.contentWindow.history.pushState(null,null, "multiple-pushstate-url1");
testframe2.contentWindow.history.pushState(null,null, "multiple-pushstate-url2");
assert_equals(getPageName(testframe1.contentWindow.location.href), "multiple-pushstate-url1", "iframe1 has the pushed url");
assert_equals(getPageName(testframe2.contentWindow.location.href), "multiple-pushstate-url2", "iframe2 has the pushed url");
}, "history.pushState can modify location object in multiple frames");
},
function() {
test(function() {
//trigger a security error by replacing the host of the current url with a fake one that is cross-domain
var testurl = testframe1.contentWindow.location.href.toString().replace(testframe1.contentWindow.location.host, "fakelocation-push");
assert_throws("SECURITY_ERR", function() { history.pushState(null, null, testurl); }, "Security_Err 18 should be thrown");
}, "history.pushState throws DOMException with code SECURITY_ERR (18)");
},
function() {
test(function() {
//trigger a data clone error by passing invalid SCA data into the function
assert_throws("DATA_CLONE_ERR", function() { history.pushState(document.body, null); }, "pushState should throw an exception DATA_CLONE_ERR with code 25");
}, "history.pushState throws DATA_CLONE_ERR(25) for bad state parameter");
},
function() {
test(function() {
var length = history.length;
history.replaceState(null,null);
assert_equals(history.length, length, "history.length should not change");
}, "history.replaceState does not increment history.length");
},
function() {
var t = async_test("history.replaceState does not clear forward entries");
t.step(function() {
var length = history.length;
//push some extra entries into the session history
history.pushState(null,null);
history.pushState(null, null);
history.pushState(null, null);
//there should now be three extra
assert_equals(history.length, length+3, "Three additional travel entries add to history.length");
//travel back two entries to land in the middle
history.back();
history.back();
//if the back navs are queued, queue verification task after them
queue(
t.step_func(function() {
//once the .back navigations have fired, push again and verify length has not changed since the last check
history.replaceState(null, null);
assert_equals(history.length, length+3, "History.length should still be three more than original value");
t.done();
})
);
});
},
function() {
test(function() {
testframe1.contentWindow.history.replaceState(null,null, "test-replaceState-url");
assert_equals(getPageName(testframe1.contentWindow.location.href), "test-replaceState-url", "iframe1 has the pushed url");
}, "history.replaceState accepts a third parameter 'url' and uses it to alter location");
},
function() {
test(function() {
var oldurl = testframe1.contentWindow.location.href.toString();
var pagename = getPageName(oldurl);
//form a new absolute url (with protocol, host, etc) with "absolute-page" as the name of the page
var newurl = oldurl.replace(pagename, "absolute-page");
testframe1.contentWindow.history.replaceState(null,null, newurl);
assert_equals(testframe1.contentWindow.location.href, newurl, "iframe1 has the pushed url correctly");
}, "history.replaceState's url parameter can be an absolute url");
},
function() {
test(function() {
testframe1.contentWindow.history.replaceState(null,null, "multiple-replaceState-url1");
testframe2.contentWindow.history.replaceState(null,null, "multiple-replaceState-url2");
assert_equals(getPageName(testframe1.contentWindow.location.href), "multiple-replaceState-url1", "iframe1 has the pushed url");
assert_equals(getPageName(testframe2.contentWindow.location.href), "multiple-replaceState-url2", "iframe2 has the pushed url");
}, "history.replaceState can modify location object in multiple frames");
},
function() {
test(function() {
//trigger a security error by replacing the host of the current url with a fake one that is cross-domain
var testurl = testframe1.contentWindow.location.href.toString().replace(testframe1.contentWindow.location.host, "fakelocation-replace");
assert_throws("SECURITY_ERR", function() { history.replaceState(null, null, testurl); }, "Security_Err 18 should be thrown");
}, "history.replaceState throws DOMException with code SECURITY_ERR (18)");
},
function() {
test(function() {
//trigger a data clone error by passing invalid SCA data into the function
assert_throws("DATA_CLONE_ERR", function() {history.replaceState(document.body, null);}, "replaceState should throw an exception DATA_CLONE_ERR with code 25");
}, "history.replaceState throws DATA_CLONE_ERR(25) for bad state parameter");
},
function() {
var t = async_test("PopStateEvent fires on Back navigation");
t.step(function() {
history.pushState(null, null);
history.pushState(null, null);
//prepare to end the test as soon as popstate fires
onpopstate = function(e) {
t.done();
}
//go back to fire the popstate event
history.back();
});
},
function() {
var t = async_test("PopStateEvent fires on Forward navigation");
t.step( function() {
onpopstate = null;
history.pushState(null, null);
history.pushState(null, null);
history.back();
//if the back navigation is queued, set up the rest of the test after it is done
queue(
t.step_func(function() {
//prepare to end the test as soon as popstate fires
onpopstate = function(e) {
t.done();
}
//go forward to fire the popstate event
history.forward();
})
);
});
},
function() {
var t = async_test("PopStateEvent receives state data on Back navigation");
t.step(function() {
history.pushState("popstate-data", null);
history.pushState(null, null);
//prepare the popstate event to validate the data
onpopstate = t.step_func(function(e) {
assert_equals(e.state, "popstate-data", "State data is passed to the event correctly");
t.done();
});
//go back to fire the popstate event
history.back();
});
},
function() {
test(function() {
history.pushState("pushstate-data", null);
//history.state should be set immediately
assert_equals(history.state, "pushstate-data", "State data is set correctly");
}, "history.state is set by history.pushState");
},
function() {
test(function() {
history.replaceState("replacestate-data", null);
//history.state should be set immediately
assert_equals(history.state, "replacestate-data", "State data is set correctly");
}, "history.state is set by history.replaceState");
},
function() {
var t = async_test("history.state changes on navigation");
t.step(function() {
history.pushState("state-back1", null);
history.pushState("state-back2", null);
//precondition
assert_equals(history.state, "state-back2", "Verify that history.state is set to a second value");
//set up the popstate event to verify that history.state was changed
onpopstate = t.step_func(function(e) {
assert_equals(e.state, "state-back1", "Verify that history.state reverted to the first value");
t.done();
});
history.back();
});
},
];
}, {explicit_done:true, timeout:8000});
//used to get the name of a page within a path
// to check correctness of url parameter
function getPageName(path) {
var path = path || location.pathname;
var segments = path.split('/');
return segments[segments.length-1];
}
//Callback for result_callback
//queues the next test in the array testCollection
//serves to make test execution sequential despite asynchronous behaviors
function testFinished(test) {
if(testIndex < testCollection.length - 1) {
//queue the function so that stack remains shallow
queue(testCollection[++testIndex]);
} else {
//when the last test has run, explicitly end test suite
done();
}
}
function queue(func) {
//50 allows adequate time for .back and .forward navigations to queue first
setTimeout(func, 50);
}
add_result_callback(testFinished);
//start the first test manually
queue(testCollection[testIndex]);
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="svg-root" width="100" height="50">
<rect width="100" height="50" fill="black" />
</svg>

After

Width:  |  Height:  |  Size: 229 B

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Page with script</title>
</head>
<body>
<script type="text/javascript">
parent.window.postMessage("script ran", "*");
</script>
</body>
</html>

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>HTML5 video with autoplay attribute.</title>
<script type="text/javascript" src="/common/media.js"></script>
</head>
<body>
<script type="text/javascript">
function do_play(event)
{
parent.window.postMessage("play event fired", "*");
}
document.write(
"<video id='video0' src='" + getVideoURI("/media/green-at-15") + "'" +
" autoplay onplay='do_play(event);'>"
);
</script>
Your browser does not support HTML5 video.
</video>
</body>
</html>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>autofocus on form control</title>
</head>
<body>
<div>Below form control has autofocus attribute set.</div><br />
<form action="">
<span>Textbox: </span><input autofocus="autofocus" type="text" name="movie" />
</form>
</body>
</html>

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>object tag</title>
</head>
<body>
<object width="400" height="600" data="sandbox.pdf">
</object>
</body>
</html>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Form submission</title>
</head>
<body>
<form id="form1" action="standalone-pass.htm">
<span>Name: </span><input type="text" name="name" value="browser" /><br />
<input id="submitButton" type="submit" value="Submit Form" />
</form>
</body>
</html>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Form submission</title>
</head>
<body>
<form id="form1" action="standalone-fail.htm">
<span>Name: </span><input type="text" name="name" value="browser" /><br />
<input id="submitButton" type="submit" value="Submit Form" />
</form>
</body>
</html>

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Page with hyperlink and target set to self</title>
</head>
<body>
<a id="hyperlink" href="standalone-pass.htm" target="_self">Click here to perform self navigation</a>
</body>
</html>

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Page with showModalDialog() API</title>
</head>
<body>
<button type="button" onclick="javascript:showModalDialog('standalone-fail.htm')">Click here to call showModalDialog() API</button>
</body>
</html>

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Page with window.open()</title>
</head>
<body>
<button type="button" onclick="javascript:window.open('standalone-fail.htm')">Click here to call window.open() API</button>
</body>
</html>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Page with access to document.cookie</title>
</head>
<body>
<script type="text/javascript">
cookie = document.cookie;
document.cookie = "name=browser";
parent.window.postMessage("cookies are R/W", "*");
</script>
</body>
</html>

View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<title>Page with iframes</title>
</head>
<body>
<table cellpadding="5" cellspacing="10">
<tr>
<td>
<span>child iframe with sandbox="allow-scripts" attribute</span><br />
<iframe id="Iframe1" src="iframe_sandbox_020a.htm" sandbox="allow-scripts" style="height: 50px; width: 250px;"></iframe>
</td>
</tr>
<tr>
<td>
<span>child iframe with sandbox="" attribute</span><br />
<iframe id="Iframe2" src="iframe_sandbox_020a.htm" sandbox="" style="height: 50px; width: 250px;"></iframe>
</td>
</tr>
<tr>
<td>
<span>child iframe without sandbox attribute</span><br />
<iframe id="Iframe3" src="iframe_sandbox_020a.htm" style="height: 50px; width: 250px;"></iframe>
</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Page with script</title>
</head>
<body>
<div>Script Execution: <span id="scriptExecute" style="Color: Green">Blocked</span></div>
<script type="text/javascript">
document.getElementById("scriptExecute").innerHTML = "Not Blocked";
document.getElementById("scriptExecute").style.color = "Red";
</script>
</body>
</html>

View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<title>Page with iframes</title>
</head>
<body>
<table cellpadding="5" cellspacing="10">
<tr>
<td>
<span>child iframe with sandbox="allow-scripts" attribute</span><br />
<iframe id="Iframe1" src="iframe_sandbox_021a.htm" sandbox="allow-scripts" style="height: 50px; width: 250px;"></iframe>
</td>
</tr>
<tr>
<td>
<span>child iframe with sandbox="" attribute</span><br />
<iframe id="Iframe2" src="iframe_sandbox_020a.htm" sandbox="" style="height: 50px; width: 250px;"></iframe>
</td>
</tr>
<tr>
<td>
<span>child iframe without sandbox attribute</span><br />
<iframe id="Iframe3" src="iframe_sandbox_021a.htm" style="height: 50px; width: 250px;"></iframe>
</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Page with script</title>
</head>
<body>
<div>Script Execution: <span id="scriptExecute" style="Color: Red">Blocked</span></div>
<script type="text/javascript">
document.getElementById("scriptExecute").innerHTML = "Allowed";
document.getElementById("scriptExecute").style.color = "Green";
</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>target=_top</title>
</head>
<body>
<div>hyperlink with target=_top</div>
<br />
<a href="standalone-pass.htm" target="_top">Open the link in top window</a>
</body>
</html>

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head><title>Access parent dom</title>
</head>
<body>
<script type="text/javascript">
if (window.parent.document)
{
parent.window.postMessage("window.parent.document", "*");
}else{
parent.window.postMessage("!window.parent.document", "*");
}
</script>
</body>
</html>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head><title>Page with access to document.cookie</title>
</head>
<body>
<div>Cookie Read: <span id="readCookie"></span></div>
<script type="text/javascript">
cookie = document.cookie;
document.cookie = "name=browser";
parent.window.postMessage("cookies are R/W", "*");
</script>
</body>
</html>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head><title>Page with access to localStorage and sessionStorage</title>
</head>
<body>
<script type="text/javascript">
if (window.localStorage && window.sessionStorage) {
parent.window.postMessage("access to window.localStorage and window.sessionStorage", "*");
}
</script>
</body>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head><title>XMLHttpRequest</title>
</head>
<body>
<script type="text/javascript">
xhrRequest = new XMLHttpRequest();
xhrRequest.onreadystatechange = function () {
if (xhrRequest.readyState == 4 && xhrRequest.status == 200) {
//xhr successful
parent.window.postMessage("access to window.XMLHttpRequest", "*");
}
}
xhrRequest.open("GET", "standalone-pass.htm", true);
xhrRequest.send();
</script>
</body>
</html>

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head><title>Access parent dom</title>
</head>
<body>
<script type="text/javascript">
try
{
if (window.parent.document)
{
parent.window.postMessage("window.parent.document", "*");
}
}
catch(e)
{
parent.window.postMessage("!window.parent.document", "*");
}
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head><title>Page with access to document.cookie</title>
</head>
<body>
<div>Cookie Read: <span id="readCookie"></span></div>
<script type="text/javascript">
try
{
cookie = document.cookie;
document.cookie = "name=browser";
parent.window.postMessage("cookies are R/W", "*");
}catch(e)
{
parent.window.postMessage("cookies are not R/W", "*");
}
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head><title>Page with access to localStorage and sessionStorage</title>
</head>
<body>
<script type="text/javascript">
try
{
if (window.localStorage && window.sessionStorage) {
parent.window.postMessage("access to window.localStorage and window.sessionStorage", "*");
}
}
catch(e)
{
parent.window.postMessage("no access to window.localStorage and window.sessionStorage", "*");
}
</script>
</body>
</html>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head><title>XMLHttpRequest</title>
</head>
<body>
<script type="text/javascript">
try
{
xhrRequest = new XMLHttpRequest();
xhrRequest.onreadystatechange = function () {
if (xhrRequest.readyState == 4 && xhrRequest.status == 200) {
//xhr successful
parent.window.postMessage("access to window.XMLHttpRequest", "*");
}
}
xhrRequest.open("GET", "standalone-pass.htm", true);
xhrRequest.send();
}catch(e){}
parent.window.postMessage("no access to window.XMLHttpRequest", "*");
</script>
</body>
</html>

View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Sandbox: Allow script execution inside iframe with sandbox attribute when sandbox="allow-scripts".</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-scripts-browsing-context-flag" />
<meta name="assert" content="Allow script execution inside iframe with sandbox attribute when sandbox='allow-scripts'." />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script type="text/javascript">
var t = async_test("Allow script execution inside iframe with sandbox attribute when sandbox='allow-scripts'.");
function callback(event)
{
t.step(function(){
assert_true('sandbox' in document.createElement('iframe'));
assert_equals(event.data, "script ran");
});
t.done();
}
var timer = setTimeout(callback, 8000);
window.addEventListener("message", callback, false);
</script>
<iframe src="iframe_sandbox_001.htm" sandbox="allow-scripts" style="display: none"></iframe>
<div id=log></div>
</body>
</html>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Sandbox: Allow autoplay for HTML5 Video inside iframe with sandbox attribute if sandbox='allow-scripts'.</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-automatic-features-browsing-context-flag" />
<meta name="assert" content="Allow autoplay for HTML5 Video inside iframe with sandbox attribute if sandbox='allow-scripts'." />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script type="text/javascript">
var t = async_test("Allow autoplay for HTML5 Video inside iframe with sandbox attribute if sandbox='allow-scripts'.");
function callback(event)
{
t.step(function(){
assert_true('sandbox' in document.createElement('iframe'));
assert_equals(event.data, "play event fired");
});
t.done();
}
var timer = setTimeout(callback, 8000);
window.addEventListener("message", callback, false);
</script>
<iframe src="iframe_sandbox_002.htm" sandbox="allow-scripts" style="display: none"></iframe>
<div id=log></div>
</body>
</html>

View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Sandbox: Block autofocus on form control inside iframe with sandbox attribute.</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-automatic-features-browsing-context-flag" />
<meta name="assert" content="Block autofocus on form control inside iframe with sandbox attribute." />
<script src="sandbox_helper.js" type="text/javascript"></script>
</head>
<body>
<pre>Description: Block autofocus on form controls inside iframe with sandbox attribute.</pre>
<table id='testtable' border='1'>
<tr>
<td>Test Result</td>
<td>Test Assertion</td>
</tr>
<tr>
<td id='test_0_result'>Manual</td>
<td id='test_0_assertion'>Test passes if caret (text cursor) is not on the textbox in the below iframe.</td>
</tr>
</table>
<br />
<div id="testframe">
<pre>iframe with sandbox</pre>
<iframe src="iframe_sandbox_003.htm" sandbox style="height: 100px; width: 400px;"></iframe>
</div>
<script type="text/javascript">
DisableTestForNonSupportingBrowsers();
</script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show more