IE 9 actually seemed fine once I cleared the browser cache and used the latest code. However, Safari and Chrome are still having problems. The problem appears to stem from a function in fileEntry.js. In iframeLoaded there's a check to see if the content of the iframe is an instance of XMLDocument or has a value for the xmlEncoding property:
var d = i.contentDocument;
if (d instanceof XMLDocument || d.xmlEncoding)
{
var serializer = new XMLSerializer();
var responseText = serializer.serializeToString(d);
//i.contentDocument.document.body?i.contentDocument.document.body.innerHTML:null;
ice_fileEntry.response(d, responseText, context);
}
For WebKit browsers running in Liferay, both these tests are failing, resulting in the response not being serialzed and passed on to JSF for final processing. After discussing this with the original developer, the check can be changed so that it simply checks if that property is available (not whether it has a non-null value).
var d = i.contentDocument;
if (d instanceof XMLDocument || "xmlEncoding" in d)
{
var serializer = new XMLSerializer();
var responseText = serializer.serializeToString(d);
//i.contentDocument.document.body?i.contentDocument.document.body.innerHTML:null;
ice_fileEntry.response(d, responseText, context);
}
This is the simplest changes that allows Chrome and Safari to work (IE 9 and FF continue to work as well). I did take a stab at refactoring a bit to simply what I thought was being done and removing those checks altogether. I highly recommend adding some logging as well to help pinpoint future failures.
iframeLoaded : function(context, id) {
var doc;
var i = document.getElementById(id);
if ((typeof XMLDocument != "undefined") && i.contentDocument)
{
doc = i.contentDocument;
}
else if (i.contentWindow && i.contentWindow.document)
{
doc = i.contentWindow.document.XMLDocument ?
i.contentWindow.document.XMLDocument :
i.contentWindow.document;
}
if(!doc)
{
//Log that we couldn't get the document
//error("could not get contents of iframe");
}
var responseText;
if (doc.xml)
{
responseText = doc.xml;
}
else
{
var serializer = new XMLSerializer();
responseText = serializer.serializeToString(doc);
}
if(!responseText)
{
//Log that we couldn't get serialize the response text
//error("could not serialize response text");
}
ice_fileEntry.response(doc,responseText,context);
},
Further testing shows that the first update may fail on Firefox as well. Subsequent uploads appear to work. This may be related or similar to the issue in http://jira.icefaces.org/browse/ICE-6640.