OK this is mighty weird and easily reproduced even on the demo at fckeditor.net, in IE and Firefox
Paste in the following code in source mode:
<img osrc="off.gif" src="on.gif" />
Flick to design mode, and then back to source mode.
The osrc and src values are swapped!
Incidentally it doesn't happen if you reverse the order the attributes appear in:
eg. <img src="on.gif" osrc="off.gif" />
Now I know the osrc attribute is not standard XHTML. I could kinda understand if it was stripped (although I'm not suggesting this!). But to swap the values - can anyone explain it?
Paste in the following code in source mode:
<img osrc="off.gif" src="on.gif" />
Flick to design mode, and then back to source mode.
The osrc and src values are swapped!
Incidentally it doesn't happen if you reverse the order the attributes appear in:
eg. <img src="on.gif" osrc="off.gif" />
Now I know the osrc attribute is not standard XHTML. I could kinda understand if it was stripped (although I'm not suggesting this!). But to swap the values - can anyone explain it?
RE: Attributes on IMG tag swapped! - Bizarre
I was builing a versioning control for content ( A la CVS ) and because of this "Tag swapping" that happens only in firefox I couldn't finish it.
Does someone have a workaround for this ?
It will be very appreciated.
Thanks,
MARTIN
RE: Attributes on IMG tag swapped! - Bizarre
FCKXHtml._GetMainXmlString=function()
{
var A=new XMLSerializer();
return A.serializeToString(this.MainNode);
};
in fckeditorcode_gecko.js
When serializeToString returns, the attributes are in a different order. I'm not familiar with this serialize method, does anyone know what it does and if its necessary?
Monte
Re: Attributes on IMG tag swapped! - Bizarre Bug?
FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node )
One of the first lines is
for ( var n = 0 ; n < aAttributes.length ; n++ )
This for some reason causes the listing of attributes for a node to be reversed each time it is processed. So I changed the previous line to:
for ( var n = aAttributes.length-1 ; n >= 0; n-- )
Which seems to work, unless someone can come up with a compelling reason as to why this shouldn't be done.
Monte
Re: Attributes on IMG tag swapped! - Bizarre Bug?
Re: Attributes on IMG tag swapped! - Bizarre Bug?
Re: Attributes on IMG tag swapped! - Bizarre Bug?