Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down