2012-01-10 20:35:04 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html class="reftest-wait">
|
|
|
|
<head>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
function boom()
|
|
|
|
{
|
|
|
|
var div = document.querySelector("div");
|
|
|
|
div.contentEditable = "true";
|
|
|
|
div.focus();
|
|
|
|
|
|
|
|
var r = document.documentElement;
|
|
|
|
document["removeChild"](r);
|
|
|
|
document["appendChild"](r);
|
|
|
|
|
|
|
|
setTimeout(function() {
|
2010-11-16 20:45:49 +00:00
|
|
|
getSelection().collapse(div, 0);
|
2012-01-10 20:35:04 +00:00
|
|
|
document.execCommand("inserthtml", false, "a");
|
|
|
|
setTimeout(function() {
|
|
|
|
document.documentElement.removeAttribute("class");
|
|
|
|
}, 0);
|
|
|
|
}, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body onload="boom();"><div></div></body>
|
|
|
|
</html>
|