summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/parser/strip-script-attrs-on-input.html
blob: feba9acb85f7a80019695b511131aedc3313c0ca (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
<!DOCTYPE html>
<body>
<div contenteditable="true" id="target">
    <!-- Blink will remove javascript url attrs when copy&pasted. -->
    <input onblur="javascript:false;" onclick="javascript:false;" type="text"/>
</div>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

requestAnimationFrame(function() {
    var target = document.getElementById("target");
    var selection = window.getSelection();
    var range = document.createRange();
    range.selectNodeContents(target);
    selection.addRange(range);

    // Invoke HTML parser with ParserContentPolicy disabling scripting content.
    document.execCommand("Cut");
    document.execCommand("Paste");

    target.innerHTML = '';
    testRunner.notifyDone();
});
</script>
<p>PASS: if no OOB access detected in ASAN.</p>
</body>