- Refactoring: Avoid redundant use of *AttributeNS methods with

`null` value; just use *Attribute methods without namespace
This commit is contained in:
Brett Zamir
2018-10-23 18:13:36 +08:00
parent f4bbd34d34
commit 2835ec11b6
20 changed files with 98 additions and 96 deletions

View File

@@ -288,7 +288,7 @@ export default function ($) {
const svgroot = document.createElementNS(svgns, 'svg');
// Per https://www.w3.org/TR/xml-names11/#defaulting, the namespace for
// attributes should have no value.
svgroot.setAttributeNS(null, 'viewBox', [0, 0, iconW, iconH].join(' '));
svgroot.setAttribute('viewBox', [0, 0, iconW, iconH].join(' '));
let svg = elem.getElementsByTagNameNS(svgns, 'svg')[0];