- 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

@@ -517,7 +517,7 @@ QUnit.test('Test ChangeElementCommand', function (assert) {
assert.equal(justCalled, 'setHref');
const line = document.createElementNS(NS.SVG, 'line');
line.setAttributeNS(null, 'class', 'newClass');
line.setAttribute('class', 'newClass');
change = new history.ChangeElementCommand(line, {class: 'oldClass'});
assert.ok(change.unapply);
@@ -526,10 +526,10 @@ QUnit.test('Test ChangeElementCommand', function (assert) {
assert.equal(typeof change.apply, typeof function () {});
change.unapply();
assert.equal(line.getAttributeNS(null, 'class'), 'oldClass');
assert.equal(line.getAttribute('class'), 'oldClass');
change.apply();
assert.equal(line.getAttributeNS(null, 'class'), 'newClass');
assert.equal(line.getAttribute('class'), 'newClass');
tearDown();
});