Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/forms/textfieldselection/select-event.html

Issue 1144143009: W3C Test: Import web-platform-tests/html/semantics (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>text field selection: select()</title>
4 <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
5 <link rel=help href="https://html.spec.whatwg.org/multipage/#textFieldSelection" >
6 <script src="../../../../../../resources/testharness.js"></script>
7 <script src="../../../../../../resources/testharnessreport.js"></script>
8 <div id="log"></div>
9 <textarea>foobar</textarea>
10 <script>
11 var input_types = ["text", "search", "tel", "url", "password"],
12 t1 = async_test("select() on textarea queues select event"),
13 q1 = false;
14
15 input_types.forEach(function(type) {
16 var input = document.createElement("input"),
17 t = async_test("select() on input type " + type + " queues select event" ),
18 q = false;
19 t.step(function() {
20 input.type = type;
21 input.value = "foobar";
22 document.body.appendChild(input);
23 input.onselect = t.step_func_done(function(e) {
24 assert_true(q, "event should be queued");
25 assert_true(e.isTrusted, "event is trusted");
26 assert_true(e.bubbles, "event bubbles");
27 assert_false(e.cancelable, "event is not cancelable");
28 });
29 input.select();
30 q=true;
31 });
32 });
33
34 document.querySelector("textarea").onselect = t1.step_func_done(function(e) {
35 assert_true(q1, "event should be queued");
36 assert_true(e.isTrusted, "event is trusted");
37 assert_true(e.bubbles, "event bubbles");
38 assert_false(e.cancelable, "event is not cancelable");
39 });
40
41 t1.step(function() {
42 document.querySelector("textarea").select();
43 q1=true;
44 });
45 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698