Skip to content

Commit ecfed2b

Browse files
committed
AnimationParser is now using value instead of nodeValue when parsing atlas XML files, avoiding Chrome deprecation warnings (thanks @valtterip phaserjs#1189)
1 parent ccc4e42 commit ecfed2b

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Version 2.1.2 - "Whitebridge" - in development
9595
* TypeScript definitions fixes and updates (thanks @clark-stevenson @englercj @benjamindulau)
9696
* Added the `sourceRect` and `maskRect` parameters back into `BitmapData.alphaMask` as they were accidentally removed in 2.1 (thanks seejay92)
9797
* jsdoc fixes (thanks @danxexe #1209)
98+
* AnimationParser is now using `value` instead of `nodeValue` when parsing atlas XML files, avoiding Chrome deprecation warnings (thanks @valtterip #1189)
9899

99100

100101

src/animation/AnimationParser.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -268,22 +268,22 @@ Phaser.AnimationParser = {
268268
uuid = game.rnd.uuid();
269269

270270
frame = frames[i].attributes;
271-
272-
name = frame.name.nodeValue;
273-
x = parseInt(frame.x.nodeValue, 10);
274-
y = parseInt(frame.y.nodeValue, 10);
275-
width = parseInt(frame.width.nodeValue, 10);
276-
height = parseInt(frame.height.nodeValue, 10);
271+
272+
name = frame.name.value;
273+
x = parseInt(frame.x.value, 10);
274+
y = parseInt(frame.y.value, 10);
275+
width = parseInt(frame.width.value, 10);
276+
height = parseInt(frame.height.value, 10);
277277

278278
frameX = null;
279279
frameY = null;
280280

281281
if (frame.frameX)
282282
{
283-
frameX = Math.abs(parseInt(frame.frameX.nodeValue, 10));
284-
frameY = Math.abs(parseInt(frame.frameY.nodeValue, 10));
285-
frameWidth = parseInt(frame.frameWidth.nodeValue, 10);
286-
frameHeight = parseInt(frame.frameHeight.nodeValue, 10);
283+
frameX = Math.abs(parseInt(frame.frameX.value, 10));
284+
frameY = Math.abs(parseInt(frame.frameY.value, 10));
285+
frameWidth = parseInt(frame.frameWidth.value, 10);
286+
frameHeight = parseInt(frame.frameHeight.value, 10);
287287
}
288288

289289
newFrame = data.addFrame(new Phaser.Frame(i, x, y, width, height, name, uuid));

0 commit comments

Comments
 (0)