- Refactoring: Avoid redundant use of *AttributeNS methods with
`null` value; just use *Attribute methods without namespace
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
@@ -169,7 +169,7 @@ QUnit.test('Test getPathBBox', function (assert) {
|
||||
assert.expect(3);
|
||||
const doc = utilities.text2xml('<svg></svg>');
|
||||
const path = doc.createElementNS(NS.SVG, 'path');
|
||||
path.setAttributeNS(null, 'd', 'm0,0l5,0l0,5l-5,0l0,-5z');
|
||||
path.setAttribute('d', 'm0,0l5,0l0,5l-5,0l0,-5z');
|
||||
const bb = utilities.getPathBBox(path);
|
||||
assert.equal(typeof bb, 'object', 'BBox returned object');
|
||||
assert.ok(bb.x && !isNaN(bb.x));
|
||||
@@ -181,7 +181,7 @@ QUnit.test('Test getPathDFromSegments', function (assert) {
|
||||
|
||||
const doc = utilities.text2xml('<svg></svg>');
|
||||
const path = doc.createElementNS(NS.SVG, 'path');
|
||||
path.setAttributeNS(null, 'd', 'm0,0l5,0l0,5l-5,0l0,-5z');
|
||||
path.setAttribute('d', 'm0,0l5,0l0,5l-5,0l0,-5z');
|
||||
let d = getPathDFromSegments([
|
||||
['M', [1, 2]],
|
||||
['Z', []]
|
||||
|
||||
Reference in New Issue
Block a user