Author: nbelaevski
Date: 2009-02-26 18:55:44 -0500 (Thu, 26 Feb 2009)
New Revision: 12763
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
https://jira.jboss.org/jira/browse/RF-4429
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2009-02-26 16:04:24 UTC
(rev 12762)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2009-02-26 23:55:44 UTC
(rev 12763)
@@ -377,7 +377,7 @@
}
var anchor = oldnode.parentNode;
- if(!window.opera && oldnode.outerHTML && !oldnode.tagName.match(
/(tbody|thead|tfoot|tr|th|td)/i ) ){
+ if(!window.opera && !A4J.AJAX.isWebkitBreakingAmps() &&
oldnode.outerHTML && !oldnode.tagName.match( /(tbody|thead|tfoot|tr|th|td)/i ) ){
LOG.debug("Replace content of node by outerHTML()");
try {
oldnode.innerHTML = "";
@@ -1617,6 +1617,23 @@
return s;
}
+A4J.AJAX.isWebkitBreakingAmps = function() {
+ //RF-4429
+ if (!this._webkitBreakingAmps) {
+ var elt = document.createElement("div");
+ elt.innerHTML = "<a href='#a=a&b=b'>link</a>";
+
+ var link = elt.firstChild;
+ if (link && link.getAttribute &&
/&b=b$/.test(link.getAttribute('href'))) {
+ this._webkitBreakingAmps = 2;
+ } else {
+ this._webkitBreakingAmps = 1;
+ }
+ }
+
+ return this._webkitBreakingAmps > 1;
+};
+
A4J.AJAX.isXhtmlScriptMode = function() {
if (!this._xhtmlScriptMode) {
var elt = document.createElement("div");