Empty code blocks and code blocks with a single new line act the same

I'm having trouble figuring why these two <code> blocks act the same:

Empty code block:

<pre><code contentEditable="true"></code></pre>

Code block with single new line:

<pre><code contentEditable="true">
</code></pre>

Shouldn't the code block with the new line act and feel different given that its textContent length is not the same as the empty block?

JSFiddle here: https://jsfiddle.net/ruzv50qj/15/