I just found out the hard way: Chrome (or at least, the Linux dev builds but very likely the proper releases too) only fire DOM mutation events if the element which mutates is in the current document. Very likely Safari suffers from the same bug but until I can get it the Windows version working under WINE I can only test that theory at work.
This really quite sucks. Say you generate some XML, convert to HTML and put the HTML on the page, then start changing the XML and want to keep the HTML in sync. Well, you can't, unless you put the XML in the page too and hide it with style="display:none" or whatever. Luckily, the browsers don't seem to mind when you add weirdly named elements to the page.
The above example is essentially what I'm doing. The XML is my wikixml representation and the HTML is the same, as syntax highlighted HTML.
I'll try to work out if this is Chrome or webkit and send a bug report in as appropriate.

1 comments:
Have you tried registering the mutation event on a documentFragment that contains the XML?
Post a Comment