diff --git a/cell.js b/cell.js index 9fbbc07f..968b607e 100644 --- a/cell.js +++ b/cell.js @@ -391,7 +391,10 @@ } else if (key === 'style' && typeof val === 'object') { Phenotype.get(key).set.call($node, val); } else if (typeof val === 'number' || typeof val === 'string' || typeof val === 'boolean') { - $node.setAttribute(key, val); + // AnyWhichWay 2017-12-16 + // the getAttribute avoids issues where other libaries may have redefined setAttribute or made attributes actual object properties + // these can cause recursion stack overflows if not trapped beforehand to ensure the value if not the same + $node.getAttribute(key)==val || $node.setAttribute(key, val); } else if (typeof val === 'function') { Phenotype.get(key).set.call($node, val); }