Skip to content

Commit 3afeb04

Browse files
committed
Test e.inputType
1 parent d93dfbb commit 3afeb04

7 files changed

+45
-9
lines changed

html/editing/dnd/drop/events-contenteditable-manual.tentative.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
<style>
77
[data-placeholder]:empty::before { content: attr(data-placeholder); }
88
</style>
9-
<body data-expected-events="b:drop,a:beforeinput,a:input,b:beforeinput,b:textInput,b:input">
9+
<body data-expected-events="
10+
b:drop:,
11+
a:beforeinput:deleteByDrag,
12+
a:input:deleteByDrag,
13+
b:beforeinput:insertFromDrop,
14+
b:textInput:,
15+
b:input:insertFromDrop">
1016
<div><input id=a data-select="0,7" value="Drag me"></div>
1117
<div contenteditable=true id=b data-placeholder="...to here"></div>
1218
<script src="/uievents/textInput/support/common.js"></script>

html/editing/dnd/drop/events-contenteditable-same-element-manual.tentative.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
<title>Selection drag and drop: events for contenteditable (same element)</title>
44
<script src="/resources/testharness.js"></script>
55
<script src="/resources/testharnessreport.js"></script>
6-
<body data-expected-events="b:drop,b:beforeinput,b:input,b:beforeinput,b:textInput,b:input">
6+
<body data-expected-events="
7+
b:drop:,
8+
b:beforeinput:deleteByDrag,
9+
b:input:deleteByDrag,
10+
b:beforeinput:insertFromDrop,
11+
b:textInput:,
12+
b:input:insertFromDrop">
713
<div contenteditable=true id=b data-select="0,7">Drag me ...to here:</div>
814
<script src="/uievents/textInput/support/common.js"></script>
915
<script src="support/events.js"></script>

html/editing/dnd/drop/events-input-manual.tentative.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
<title>Selection drag and drop: events for &lt;input></title>
44
<script src="/resources/testharness.js"></script>
55
<script src="/resources/testharnessreport.js"></script>
6-
<body data-expected-events="b:drop,a:beforeinput,a:input,b:beforeinput,b:textInput,b:input">
6+
<body data-expected-events="
7+
b:drop:,
8+
a:beforeinput:deleteByDrag,
9+
a:input:deleteByDrag,
10+
b:beforeinput:insertFromDrop,
11+
b:textInput:,
12+
b:input:insertFromDrop">
713
<div><input id=a data-select="0,7" value="Drag me"></div>
814
<div><input id=b placeholder="...to here"></div>
915
<script src="/uievents/textInput/support/common.js"></script>

html/editing/dnd/drop/events-input-same-element-manual.tentative.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
<title>Selection drag and drop: events for &lt;input> (same element)</title>
44
<script src="/resources/testharness.js"></script>
55
<script src="/resources/testharnessreport.js"></script>
6-
<body data-expected-events="b:drop,b:beforeinput,b:input,b:beforeinput,b:textInput,b:input">
6+
<body data-expected-events="
7+
b:drop:,
8+
b:beforeinput:deleteByDrag,
9+
b:input:deleteByDrag,
10+
b:beforeinput:insertFromDrop,
11+
b:textInput:,
12+
b:input:insertFromDrop">
713
<input id=b data-select="0,7" value="Drag me ...to here:">
814
<script src="/uievents/textInput/support/common.js"></script>
915
<script src="support/events.js"></script>

html/editing/dnd/drop/events-textarea-manual.tentative.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
<title>Selection drag and drop: events for &lt;textarea></title>
44
<script src="/resources/testharness.js"></script>
55
<script src="/resources/testharnessreport.js"></script>
6-
<body data-expected-events="b:drop,a:beforeinput,a:input,b:beforeinput,b:textInput,b:input">
6+
<body data-expected-events="
7+
b:drop:,
8+
a:beforeinput:deleteByDrag,
9+
a:input:deleteByDrag,
10+
b:beforeinput:insertFromDrop,
11+
b:textInput:,
12+
b:input:insertFromDrop">
713
<div><input id=a data-select="0,7" value="Drag me"></div>
814
<div><textarea id=b placeholder="...to here"></textarea></div>
915
<script src="/uievents/textInput/support/common.js"></script>

html/editing/dnd/drop/events-textarea-same-element-manual.tentative.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
<title>Selection drag and drop: events for &lt;textarea> (same element)</title>
44
<script src="/resources/testharness.js"></script>
55
<script src="/resources/testharnessreport.js"></script>
6-
<body data-expected-events="b:drop,b:beforeinput,b:input,b:beforeinput,b:textInput,b:input">
6+
<body data-expected-events="
7+
b:drop:,
8+
b:beforeinput:deleteByDrag,
9+
b:input:deleteByDrag,
10+
b:beforeinput:insertFromDrop,
11+
b:textInput:,
12+
b:input:insertFromDrop">
713
<textarea id=b data-select="0,7">Drag me ...to here:</textarea>
814
<script src="/uievents/textInput/support/common.js"></script>
915
<script src="support/events.js"></script>

html/editing/dnd/drop/support/events.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ function rAF() {
77
const a = document.getElementById('a');
88
const b = document.getElementById('b');
99
const actualEvents = [];
10-
const expectedEvents = document.body.dataset.expectedEvents.split(',');
10+
const expectedEvents = document.body.dataset.expectedEvents.replace(/\s+/g, '').split(',');
1111
const eventTypes = new Set(expectedEvents.map(s => s.split(':')[1]));
1212
for (const eventType of eventTypes) {
1313
if (a) {
1414
a.addEventListener(eventType, e => {
15-
actualEvents.push(`a:${e.type}`);
15+
actualEvents.push(`a:${e.type}:${e.inputType || ''}`);
1616
});
1717
}
1818
b.addEventListener(eventType, async (e) => {
19-
actualEvents.push(`b:${e.type}`);
19+
actualEvents.push(`b:${e.type}:${e.inputType || ''}`);
2020
if (e.type === "input") {
2121
await rAF();
2222
await rAF();

0 commit comments

Comments
 (0)