Whitespace in HTML is ill-defined: whether it defines a text node or not is up to implementation authors. It seems that Safari/Webkit defines a nodeValue for nodes like: <div> </div> (whitespace inbetween) -- however, it is not possible to set the nodeValue of this firstChild of the div element. The URI above demonstrates this problem: Opera 8.10 and Firefox 1.0 both will add "bar" text to the document, IE will simply return "whitespace is not significant" -- but Safari will pop up the "bar" alert, but not actually add the text.
Confirmed with WebKit 412.7 and ToT WebKit.
Created attachment 7308 [details] proposed fix Is there a better way to create a missing renderer than detach()/attach()?
createRendererIfNeeded?
Comment on attachment 7308 [details] proposed fix This does seem a little brute force. It's not immediately obvious to me if there's a better solution -- I'll have to research this later.
This actually seems ok to me as a way to create a missing renderer. createRenderIfNeeded might work, but normally renderers are only created at attach time and there doesn't seem to be a huge reason to step away from that, since this is an unusual situation.