summaryrefslogtreecommitdiff
path: root/addons/web/static/lib/qweb/qweb2.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2017-04-20 12:29:47 +0200
committerNicolas Lempereur <nle@odoo.com>2017-04-20 17:08:17 +0200
commit716ceede16a810e09c9d53f7f641826a34d276eb (patch)
treebb0e36185fd50603662fe695b7ff38e9d63b6610 /addons/web/static/lib/qweb/qweb2.js
parent0ae30c5997cd1c020364e9b0362b587f7d1e60f0 (diff)
[FIX] web_enterprise: kanban_state_selection ie
On IE (from 9.0 up to at least IE EDGE 14) we have this behavior for the method serializeToString of XMLSerializer: > (new XMLSerializer()).serializeToString($('<b>"</b>')[0]) '<b xmlns="http://www.w3.org/1999/xhtml">"</b>' > (new XMLSerializer()).serializeToString($('<b>"</b>')[0].firstChild) '&quot;' Whilst browser such as chromium or firefox have: > (new XMLSerializer()).serializeToString($('<b>"</b>')[0]) '<b xmlns="http://www.w3.org/1999/xhtml">"</b>' > (new XMLSerializer()).serializeToString($('<b>"</b>')[0].firstChild) '"' Hence for IE9 and over, if in a `<t t-extend/>` a `t-jquery` sub-directive (without `t-operation`) is available, we can have broken javascript if a " is transformed into an &quot; at a unfortunate location. This commit favour node.data over XMLSerializer serializeToString to avoid the possibility of this issue when a text node is processed. opw-727283
Diffstat (limited to 'addons/web/static/lib/qweb/qweb2.js')
-rw-r--r--addons/web/static/lib/qweb/qweb2.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js
index 92139b3c483..6ca59e8d525 100644
--- a/addons/web/static/lib/qweb/qweb2.js
+++ b/addons/web/static/lib/qweb/qweb2.js
@@ -120,12 +120,15 @@ var QWeb2 = {
}
return r.join('');
} else {
+ // avoid XMLSerializer with text node for IE
+ if (node.nodeType == 3) {
+ return node.data;
+ }
if (typeof XMLSerializer !== 'undefined') {
return (new XMLSerializer()).serializeToString(node);
} else {
switch(node.nodeType) {
case 1: return node.outerHTML;
- case 3: return node.data;
case 4: return '<![CDATA[' + node.data + ']]>';
case 8: return '<!-- ' + node.data + '-->';
}