PDA

View Full Version : Weirdness updating text nodes in Safari


Alex Bischoff
11-07-2006, 10:54 PM
I'm running into some weirdness when I try to update text nodes in Safari. The code works as expected in Firefox, IE6, and the WebKit nightly build. In Safari 2.0, though, no-worky :(.

I've uploaded a test case here (http://www.handcoding.com/documents/testing/textnodes/textnode-update-test.html). What's supposed to happen is that the script walks through the paragraph and updates the first text node that it finds (which is typically a whitespace node). Any ideas there?

liorean
11-08-2006, 12:10 AM
Just tried it in Safari 1.3.2 (haven't got Tiger on my iBook). The text node change doesn't render, but looking in the DOM viewer (Enable the debug menu to reach it...) I can see that the DOM tree has been changed (and seems to be identical to ff) - it just hasn't rendered as it should. I haven't played around with forcing saf to render, but try manipulating something that forces repainting quickly and then reset it to the original value.

Alex Bischoff
11-08-2006, 04:57 PM
I haven't played around with forcing saf to render, but try manipulating something that forces repainting quickly and then reset it to the original value.

I appreciate your input -- I've updated the code (http://www.handcoding.com/documents/testing/textnodes/textnode-update-test.html) to try applying and removing "display:none" from the target element. However, the end result appears to be the same :-/.

For what it's worth, I've also uploaded a .zip (http://www.handcoding.com/documents/testing/textnodes/textnode-update-test.zip) of the testcase in case that may be more convenient for anyone.