summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/input-user-modify.html
blob: 639b45798ea9f3290f2cfc2a0421a4e2e6a6efa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<head>
<style>
input::-webkit-textfield-decoration-container,
input[type="search"]::-webkit-textfield-decoration-container,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-decoration,
input[type="search"]::-webkit-search-results-button,
::-webkit-input-placeholder,
input::-webkit-input-placeholder,
isindex::-webkit-input-placeholder,
input[type="button"], input[type="submit"], input[type="reset"],
input[type="file"]::-webkit-file-upload-button,
button,
input[type="range"]::-webkit-slider-container,
input[type="range"]::-webkit-media-slider-container,
input[type="range"]::-webkit-slider-runnable-track,
input[type="range"]::-webkit-slider-thumb,
input[type="range"]::-webkit-color-swatch-wrapper,
input[type="range"]::-webkit-color-swatch,
input::-webkit-calendar-picker-indicator {
    -webkit-user-modify: read-write;
}
</style>
</head>
<body>

<p>The inner element of input should not be modifiable.
   Trying to delete the inner element of input should not cause a crash.</p>

<div id="container">
    <input id="search" type="search">
    <input id="file" type="file">
    <input id="range" type="range">
    <input id="color" type="color">
    <input id="number" type="number">
    <input id="placeholder" type="text" placeholder="something">
    <button id="button">something</button>
    <input id="date" type="date">
    <video id="video" controls>
    <audio id="audio" controls>
</div>

<script>
if (window.testRunner)
    testRunner.dumpAsText();
    
function focusAndType(id, key)
{
    if (!window.eventSenver)
        return;

    var target = document.getElementById(id);
    eventSender.mouseMoveTo(target.offsetLeft + 2, target.offsetTop + 2);
    eventSender.mouseDown();
    eventSender.mouseUp();
    eventSender.keyDown(key);
}

var container = document.getElementById("container");

focusAndType("search", "delete");
focusAndType("file", "delete");
focusAndType("range", "delete");
focusAndType("color", "delete");
focusAndType("number", "delete");
focusAndType("placeholder", "delete");
focusAndType("button", "delete");
focusAndType("date", "delete");
focusAndType("video", "delete");
focusAndType("audio", "delete");

if (window.testRunner)
    container.innerHTML = "PASS";
</script>
</body>
</html>