mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision 4052654d786236b493d2df3cb80b9d3d1d0a8354
This commit is contained in:
parent
eab848df3e
commit
3b6ddd885a
116 changed files with 4255 additions and 821 deletions
|
@ -16,6 +16,13 @@ var btn = document.getElementById("btn"),
|
|||
menu_btn = document.getElementById("menu_btn"),
|
||||
t1 = async_test("The submit event must be fired when click a button in submit status"),
|
||||
t2 = async_test("The reset event must be fired when click a button in reset status");
|
||||
t3 = async_test("type=button shouldn't trigger submit or reset events");
|
||||
t4 = async_test("Switching from type=button to type=submit should submit the form");
|
||||
t5 = async_test("Switching from type=button to type=reset should reset the form");
|
||||
t6 = async_test("Innermost button should submit its form");
|
||||
t7 = async_test("Innermost button should reset its form");
|
||||
t8 = async_test("Anchor inside a button should be prevent button activation");
|
||||
t9 = async_test("input type=submit inside a button should be prevent button activation");
|
||||
|
||||
document.forms.fm1.onsubmit = t1.step_func(function (evt) {
|
||||
evt.preventDefault();
|
||||
|
@ -46,4 +53,114 @@ t2.step(function () {
|
|||
btn.click();
|
||||
});
|
||||
|
||||
t3.step(function () {
|
||||
btn.type = "button";
|
||||
assert_equals(btn.type, "button", "The button type should be 'button'.");
|
||||
document.forms.fm1.onsubmit = t3.step_func(function (evt) {
|
||||
assert_unreached("type=button shouldn't trigger submission.");
|
||||
});
|
||||
document.forms.fm1.onreset = t3.step_func(function (evt) {
|
||||
assert_unreached("type=button shouldn't reset the form.");
|
||||
});
|
||||
btn.click();
|
||||
t3.done();
|
||||
});
|
||||
|
||||
t4.step(function () {
|
||||
btn.type = "button";
|
||||
btn.onclick = function() { btn.type = "submit"; }
|
||||
document.forms.fm1.onsubmit = t4.step_func(function (evt) {
|
||||
evt.preventDefault();
|
||||
assert_equals(btn.type, "submit", "The button type should be 'submit'.");
|
||||
t4.done();
|
||||
});
|
||||
btn.click();
|
||||
});
|
||||
|
||||
t5.step(function () {
|
||||
btn.type = "button";
|
||||
btn.onclick = function() { btn.type = "reset"; }
|
||||
document.forms.fm1.onreset = t5.step_func(function (evt) {
|
||||
evt.preventDefault();
|
||||
assert_equals(btn.type, "reset", "The button type should be 'reset'.");
|
||||
t5.done();
|
||||
});
|
||||
btn.click();
|
||||
});
|
||||
|
||||
t6.step(function () {
|
||||
btn.type = "submit";
|
||||
btn.innerHTML = "";
|
||||
var fm2 = document.createElement("form");
|
||||
var btn2 = document.createElement("button");
|
||||
btn2.type = "submit";
|
||||
fm2.appendChild(btn2);
|
||||
btn.appendChild(fm2);
|
||||
assert_true(document.forms.fm1.contains(fm2), "Should have nested forms");
|
||||
|
||||
function submitListener(evt) {
|
||||
evt.preventDefault();
|
||||
assert_equals(evt.target, fm2, "Innermost form should have got the submit event");
|
||||
};
|
||||
window.addEventListener("submit", submitListener, true);
|
||||
btn2.click();
|
||||
window.removeEventListener("submit", submitListener, true);
|
||||
t6.done();
|
||||
});
|
||||
|
||||
t7.step(function () {
|
||||
btn.type = "reset";
|
||||
btn.innerHTML = "";
|
||||
var fm2 = document.createElement("form");
|
||||
var btn2 = document.createElement("button");
|
||||
btn2.type = "reset";
|
||||
fm2.appendChild(btn2);
|
||||
btn.appendChild(fm2);
|
||||
assert_true(document.forms.fm1.contains(fm2), "Should have nested forms");
|
||||
|
||||
function resetListener(evt) {
|
||||
evt.currentTarget.removeEventListener(evt.type, resetListener, true);
|
||||
evt.preventDefault();
|
||||
assert_equals(evt.target, fm2, "Innermost form should have got the reset event");
|
||||
t7.done();
|
||||
};
|
||||
window.addEventListener("reset", resetListener, true);
|
||||
btn2.click();
|
||||
});
|
||||
|
||||
t8.step(function () {
|
||||
btn.type = "submit";
|
||||
btn.innerHTML = "";
|
||||
var a = document.createElement("a");
|
||||
a.href = "#";
|
||||
btn.appendChild(a);
|
||||
document.forms.fm1.onsubmit = t8.step_func(function (evt) {
|
||||
assert_unreached("type=button shouldn't trigger submission.");
|
||||
});
|
||||
|
||||
a.click();
|
||||
t8.done();
|
||||
});
|
||||
|
||||
t9.step(function () {
|
||||
btn.type = "submit";
|
||||
btn.innerHTML = "";
|
||||
var fm2 = document.createElement("form");
|
||||
var btn2 = document.createElement("input");
|
||||
btn2.type = "submit";
|
||||
fm2.appendChild(btn2);
|
||||
btn.appendChild(fm2);
|
||||
assert_true(document.forms.fm1.contains(fm2), "Should have nested forms");
|
||||
|
||||
function submitListener(evt) {
|
||||
evt.preventDefault();
|
||||
assert_equals(evt.target, fm2, "Innermost form should have got the submit event");
|
||||
};
|
||||
|
||||
window.addEventListener("submit", submitListener, true);
|
||||
btn2.click();
|
||||
window.removeEventListener("submit", submitListener, true);
|
||||
t9.done();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
<!DOCTYPE HTML>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html><head>
|
||||
<meta charset="utf-8">
|
||||
<title>Reference: type=range intrinsic size</title>
|
||||
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1512066">
|
||||
<style>
|
||||
html,body {
|
||||
color:black; background-color:white; font:16px/1 monospace;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: inline-flex;
|
||||
width: 0;
|
||||
border: 1px solid;
|
||||
justify-items:start;
|
||||
}
|
||||
.flex2 {
|
||||
display: inline-flex;
|
||||
border: 1px solid;
|
||||
justify-items:start;
|
||||
}
|
||||
.grid {
|
||||
display: inline-grid;
|
||||
grid: auto / 0;
|
||||
border: 1px solid;
|
||||
justify-items:start;
|
||||
}
|
||||
.grid2 {
|
||||
display: inline-grid;
|
||||
border: 1px solid;
|
||||
justify-items:start;
|
||||
}
|
||||
.ib {
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
border: 1px solid;
|
||||
justify-items:start;
|
||||
}
|
||||
|
||||
input {
|
||||
width: -moz-max-content;
|
||||
width: max-content;
|
||||
min-width: 0;
|
||||
}
|
||||
input.min {
|
||||
min-width: -moz-min-content;
|
||||
min-width: min-content;
|
||||
}
|
||||
input.mbp0 {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="flex"><input type="range" class="min"></div><br>
|
||||
<div class="flex"><input type="range" style="width:0"></div><br>
|
||||
<div class="flex"><input type="range" class="min"></div><br>
|
||||
<div class="flex"><input type="range" class="min"></div><br>
|
||||
<div class="flex"><input type="range" class="min"></div><br>
|
||||
<br>
|
||||
|
||||
<div class="flex2"><input type="range"></div>
|
||||
<div class="flex2" style="width:3px"><input type="range" style="width:3px" class="mbp0"></div>
|
||||
<div class="flex2" style="width:30px"><input type="range" class="mbp0"></div>
|
||||
<div class="flex2"><input type="range"></div>
|
||||
<div class="flex2"><input type="range"></div>
|
||||
<div class="flex2"><input type="range"></div>
|
||||
<div class="flex2"><input type="range"></div>
|
||||
<br>
|
||||
|
||||
<div class="grid"><input type="range" style="width:0"></div><br>
|
||||
<div class="grid"><input type="range" style="width:0"></div><br>
|
||||
<div class="grid" style="justify-items:start"><input type="range"></div><br>
|
||||
|
||||
<div class="grid2"><input type="range"></div>
|
||||
<div class="grid2"><input type="range" style="min-width:0"></div>
|
||||
<div class="grid2" style="width:3px"><input type="range" style="width:3px" class="mbp0"></div>
|
||||
<div class="flex2" style="width:30px"><input type="range" class="mbp0"></div>
|
||||
<div class="flex2" style="width:30px"><input type="range" class="mbp0"></div>
|
||||
<div class="grid2" style="justify-items:start"><input type="range"></div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="ib"><input type="range"></div><br>
|
||||
<div class="ib"><input type="range"></div><br>
|
||||
|
||||
<input type="range">
|
||||
<input type="range"
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE HTML>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html><head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test: type=range intrinsic size</title>
|
||||
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1512066">
|
||||
<link rel="match" href="range-intrinsic-size-ref.html">
|
||||
<style>
|
||||
html,body {
|
||||
color:black; background-color:white; font:16px/1 monospace;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: inline-flex;
|
||||
width: 0;
|
||||
border: 1px solid;
|
||||
}
|
||||
.flex2 {
|
||||
display: inline-flex;
|
||||
border: 1px solid;
|
||||
}
|
||||
.grid {
|
||||
display: inline-grid;
|
||||
grid: auto / 0;
|
||||
border: 1px solid;
|
||||
}
|
||||
.grid2 {
|
||||
display: inline-grid;
|
||||
border: 1px solid;
|
||||
}
|
||||
.ib {
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
border: 1px solid;
|
||||
}
|
||||
input.mbp0 {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="flex"><input type="range"></div><br>
|
||||
<div class="flex"><input type="range" style="min-width:0"></div><br>
|
||||
<div class="flex" style="justify-items:start"><input type="range"></div><br>
|
||||
<div class="flex" style="-webkit-box-pack: start"><input type="range"></div><br>
|
||||
<div class="flex" style="-webkit-box-pack: start; justify-content: flex-start;"><input type="range"></div><br>
|
||||
<br>
|
||||
|
||||
<div class="flex2"><input type="range"></div>
|
||||
<div class="flex2" style="width:3px"><input type="range" style="min-width:0" class="mbp0"></div>
|
||||
<div class="flex2" style="width:30px"><input type="range" style="min-width:0" class="mbp0"></div>
|
||||
<div class="flex2"><input type="range" style="min-width:0"></div>
|
||||
<div class="flex2" style="justify-items:start"><input type="range"></div>
|
||||
<div class="flex2" style="-webkit-box-pack: start"><input type="range"></div>
|
||||
<div class="flex2" style="-webkit-box-pack: start; justify-content: flex-start;"><input type="range"></div>
|
||||
<br>
|
||||
|
||||
<div class="grid"><input type="range"></div><br>
|
||||
<div class="grid"><input type="range" style="min-width:0"></div><br>
|
||||
<div class="grid" style="justify-items:start"><input type="range"></div><br>
|
||||
|
||||
<div class="grid2"><input type="range"></div>
|
||||
<div class="grid2"><input type="range" style="min-width:0"></div>
|
||||
<div class="grid2" style="width:3px"><input type="range" style="min-width:0" class="mbp0"></div>
|
||||
<div class="grid2" style="width:30px"><input type="range" style="min-width:0" class="mbp0"></div>
|
||||
<div class="grid2" style="grid:auto/30px"><input type="range" class="mbp0"></div>
|
||||
<div class="grid2" style="justify-items:start"><input type="range"></div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="ib"><input type="range"></div><br>
|
||||
<div class="ib"><input type="range" style="min-width:0"></div><br>
|
||||
|
||||
<input type="range" style="width:-moz-min-content; width:min-content;">
|
||||
<input type="range" style="width:-moz-max-content; width:max-content;">
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue