<html>

<head>
<script>
if (window.testRunner)
     testRunner.dumpEditingCallbacks();
</script>
</head>
<style>
div {
    border: 1px dotted blue;
    min-height: 20px;
    width: 90%;
}
</style>
<script src="../../resources/dump-as-markup.js"></script>
<script>
function foo() {
    Markup.description(`This tests the ability to start editing in blocks that are visible, but have little or no content.
Each of the divs below should be able to accept a caret.`);
    var selection = window.getSelection();
    var bar = 1;
    var divs = document.getElementsByTagName("div");
    for (var i = 0; divs[i]; i++) {
        selection.setPosition(divs[i], 0);
        document.execCommand("InsertText", false, 'c');
        Markup.dump(divs[i], divs[i].previousElementSibling.textContent);
    }
    Markup.notifyDone();
}
Markup.noAutoDump();
</script>
<body onload="foo()">

<p>This div contains some text.</p>
<div contentEditable="true">
hello
</div>

<p>This div is completely empty.</p>
<div contentEditable="true"></div>

<p>This div contains some collapsable whitespace (a '\n').</p>
<div contentEditable="true">
</div>

<p>This div contains a self-closing p tag.</p>
<div contentEditable="true"><p /></div>

<p>This div contains a self-closing p tag and some collapsable whitespace (two '\n's before and after the self closing p.</p>
<div contentEditable="true">
<p />
</div>

</body>
</html>
