Auto merge of #10714 - KiChjang:user-interaction-task, r=Ms2ger

Implement user interaction task source

Part of #7959.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10714)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-12 09:00:14 -07:00
commit 42141870e7
10 changed files with 114 additions and 66 deletions

View file

@ -116,6 +116,19 @@ test(function() {
},'input setSelectionRange(undefined,1)');
},"test of input.setSelectionRange");
async_test(function() {
var q = false;
var input = document.getElementById("a");
input.addEventListener("select", this.step_func_done(function(e) {
assert_true(q, "event should be queued");
assert_true(e.isTrusted, "event is trusted");
assert_true(e.bubbles, "event bubbles");
assert_false(e.cancelable, "event is not cancelable");
}));
input.setSelectionRange(0, 1);
q = true;
}, "input setSelectionRange fires a select event");
test(function() {
var textarea = document.getElementById("b");
test(function() {
@ -221,4 +234,17 @@ test(function() {
assert_equals(textarea.selectionEnd, 1, "element.selectionStart should be 1");
},'textarea setSelectionRange(undefined,1)');
},"test of textarea.setSelectionRange");
async_test(function() {
var q = false;
var textarea = document.getElementById("b");
textarea.addEventListener("select", this.step_func_done(function(e) {
assert_true(q, "event should be queued");
assert_true(e.isTrusted, "event is trusted");
assert_true(e.bubbles, "event bubbles");
assert_false(e.cancelable, "event is not cancelable");
}));
textarea.setSelectionRange(0, 1);
q = true;
}, "textarea setSelectionRange fires a select event");
</script>