When setting contenteditable to false, editing session destroys HTMLEditor. Destroying HTMLEditor means that selection visibility is reset by FinalizeSelection. So after calling TearDownEditorOnWindow on nsHTMLDocument, we should initialize selection visibility if current focus is text control that has editor. MozReview-Commit-ID: 4V8kZtOtKO3
19 lines
378 B
HTML
19 lines
378 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script>
|
|
function init()
|
|
{
|
|
document.getElementById("t1").focus();
|
|
document.getElementById("t1").setSelectionRange(0, 1);
|
|
document.getElementById("d1").setAttribute("contentEditable", "false");
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="init()">
|
|
<div contenteditable=true id="d1">
|
|
<input type="text" id=t1 value="ABCD" readonly>
|
|
</div>
|
|
</body>
|
|
</html>
|