Hacker News new | past | comments | ask | show | jobs | submit login

I thought the same thing until I watched a talk a few weeks ago about HTML5, and the guy demonstrated the world's smallest text editor:

  data:text/html,<pre contenteditable>

Doesn't work for me, but data:text/html,<pre contenteditable>Hello</pre> works for me.

If the Hello version works, the smaller version should work too. The <pre> will be 1-line high on HTML5 browsers, not window high, so you have to click the very top of the page body for it to focus.

(If that still doesn't work, out of curiosity, what browser are you using?)

    data:text/html,<pre contenteditable/>
Works in Chrome 15 without content but Firefox requires content.

Oh! Looks like we found a most unexciting difference in Fx's and Chrome's HTML5 rendering engines. Someone alert the authorities!

What's happening is in fact a little bit more complex than that. Both browsers create the pre element (you can verify that by typing that URI and hitting the tab key to switch focus from the address bar into it).

Now, where Chrome renders a line-sized pre element even when it's empty, Firefox renders it as a 0px element until you feed text into it (that's probably its standard behaviour for pre elements without a child text node, but I can't be bothered verifying that).

Boy, I love getting a rush out of figuring out something completely irrelevant! :-)

pshaw, try data:text/html,<textarea>

that's 11 bytes shorter

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact