* In IE9, setAttribute('class') will result in empty class * if the element also has the :class attribute; However in * PhantomJS, setting `className` does not work on SVG elements... * So we have to do a conditional check here. * * @param {Element} el * @param {String} cls
(el, cls)
| 1311 | */ |
| 1312 | |
| 1313 | function setClass(el, cls) { |
| 1314 | /* istanbul ignore if */ |
| 1315 | if (isIE9 && !/svg$/.test(el.namespaceURI)) { |
| 1316 | el.className = cls; |
| 1317 | } else { |
| 1318 | el.setAttribute('class', cls); |
| 1319 | } |
| 1320 | } |
| 1321 | |
| 1322 | /** |
| 1323 | * Add class with compatibility for IE & SVG |
no outgoing calls
no test coverage detected