RESOLVED FIXED 4616
Setting nodeValue on a textnode with collapsed whitespace only has no visual effect
https://bugs.webkit.org/show_bug.cgi?id=4616
Summary Setting nodeValue on a textnode with collapsed whitespace only has no visual ...
Christopher Schmidt
Reported 2005-08-23 23:25:38 PDT
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.
Attachments
proposed fix (3.01 KB, patch)
2006-03-26 07:36 PST, Alexey Proskuryakov
mjs: review+
Mark Rowe (bdash)
Comment 1 2005-09-07 01:35:56 PDT
Confirmed with WebKit 412.7 and ToT WebKit.
Alexey Proskuryakov
Comment 2 2006-03-26 07:36:42 PST
Created attachment 7308 [details] proposed fix Is there a better way to create a missing renderer than detach()/attach()?
Justin Garcia
Comment 3 2006-03-26 19:32:09 PST
createRendererIfNeeded?
Darin Adler
Comment 4 2006-03-26 22:50:22 PST
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.
Maciej Stachowiak
Comment 5 2006-03-28 15:15:45 PST
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.
Note You need to log in before you can comment on or make changes to this bug.