MathML Blogs: Firefox issues

Wednesday, November 19, 2008

Firefox issues

For some reason in Firefox v.2.0, alternate math tags are rendered. This is not a problem in Firefox 3.0.

I believe it is due to my modified convert function as follows:

function convert() {
if (document.createElementNS == null)
return;
var mmlnode = document.getElementsByTagName("m:math");
for (var i=0; i<mmlnode.length; i++)
mmlnode[i].parentNode.replaceChild(convertMath(mmlnode[i]),mmlnode[i]);
}

In the for loop, when the replaceChild is called, the node is removed from the nodelist in FireFox 2.0. As a result, after replaceChild on mmlnode[0], mmlnode[0] is removed and in the next loop, mmlnode[1] will be actually the original mmlnode[2] and when replaceChild is called on that node, it is removed and mmlnode[2] will be the original mmlnode[4] and so on.

One would assume that the mmlnode list will remain static as the replacechild is called on each node, but that does not seem to be so in Firefox 2.0, yet works in Firefox 3.0.

No comments:

Post a Comment