1 <div id=
"test">This test verifies that we can get text/html from the clipboard
2 during an onpaste event. This test requires DRT.
</div>
4 <div id=
"target" contenteditable
onpaste=
"paste(event)">
5 Paste content in this div.
7 <div id=
"results">FAIL
</div>
9 <script src=
"../editing.js"></script>
12 function removeFontName(text
)
16 return text
.replace(/font-family: [^;]+;\s*/g, "");
21 console
.log("text/plain: " + ev
.clipboardData
.getData("text/plain"));
22 // Remove the font name because it varies depending on the platform.
23 console
.log("text/html: " + removeFontName(ev
.clipboardData
.getData("text/html")));
24 if (ev
.clipboardData
.getData("text/html") != undefined)
25 document
.getElementById("results").innerHTML
= "PASS";
28 function editingTest()
30 var selection
= window
.getSelection();
31 selection
.modify("extend", "forward", "sentence");
34 var elem
= document
.getElementById("target");
35 selection
.collapse(elem
, 0);
36 selection
.modify("move", "forward", "sentence");
40 runDumpAsTextEditingTest(false);