mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision 912d5081b62d6e6a2f847935c82722e31cca7a1f
This commit is contained in:
parent
eeaca0b26d
commit
a44e48301c
75 changed files with 1894 additions and 292 deletions
|
@ -146,4 +146,65 @@ test(t => {
|
|||
|
||||
}, "clicking a button inside a disabled fieldset's legend *should* trigger submit");
|
||||
|
||||
async_test(t => {
|
||||
|
||||
const form = document.createElement("form");
|
||||
const button = document.createElement("button");
|
||||
const span = document.createElement("span");
|
||||
button.appendChild(span);
|
||||
form.appendChild(button);
|
||||
document.body.appendChild(form);
|
||||
|
||||
form.addEventListener("submit", t.step_func_done(ev => {
|
||||
ev.preventDefault();
|
||||
assert_equals(ev.target, form);
|
||||
}));
|
||||
|
||||
span.click();
|
||||
|
||||
}, "clicking the child of a button with .click() should trigger a submit");
|
||||
|
||||
async_test(t => {
|
||||
|
||||
const form = document.createElement("form");
|
||||
const button = document.createElement("button");
|
||||
const span = document.createElement("span");
|
||||
button.appendChild(span);
|
||||
form.appendChild(button);
|
||||
document.body.appendChild(form);
|
||||
|
||||
form.addEventListener("submit", t.step_func_done(ev => {
|
||||
ev.preventDefault();
|
||||
assert_equals(ev.target, form);
|
||||
}));
|
||||
|
||||
const e = new MouseEvent("click", { bubbles: true });
|
||||
span.dispatchEvent(e);
|
||||
|
||||
}, "clicking the child of a button by dispatching a bubbling event should trigger a submit");
|
||||
|
||||
async_test(t => {
|
||||
|
||||
const form = document.createElement("form");
|
||||
const button = document.createElement("button");
|
||||
const span = document.createElement("span");
|
||||
button.appendChild(span);
|
||||
form.appendChild(button);
|
||||
document.body.appendChild(form);
|
||||
|
||||
form.addEventListener("submit", t.step_func_done(ev => {
|
||||
ev.preventDefault();
|
||||
assert_unreached("Form should not be submitted");
|
||||
}));
|
||||
|
||||
span.addEventListener("click", t.step_func(ev => {
|
||||
ev.preventDefault();
|
||||
t.step_timeout(() => t.done(), 500);
|
||||
}));
|
||||
|
||||
const e = new MouseEvent("click", { bubbles: false });
|
||||
span.dispatchEvent(e);
|
||||
|
||||
}, "clicking the child of a button by dispatching a non-bubbling event should not trigger submit");
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue