From 6b644e0078689dffa992084e03db0cb419b7282d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 20 Aug 2014 09:48:29 +0200 Subject: [PATCH] Fix DOMinsert count problem --- phantomas_custom/modules/domQYLT/domQYLT.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phantomas_custom/modules/domQYLT/domQYLT.js b/phantomas_custom/modules/domQYLT/domQYLT.js index 0d1c9fc..da3925c 100644 --- a/phantomas_custom/modules/domQYLT/domQYLT.js +++ b/phantomas_custom/modules/domQYLT/domQYLT.js @@ -146,17 +146,17 @@ exports.module = function(phantomas) { // count DOM inserts - function appendChild(child, context, appended) { + function appendChild(child, element, context, appended) { /*jshint validthis: true */ // ignore appending to the node that's not yet added to DOM tree - if (!this.parentNode) { + if (!element.parentNode) { return; } // don't count elements added to fragments as a DOM inserts (issue #350) // DocumentFragment > div[0] - if (destNodePath.indexOf('DocumentFragment') === 0) { + if (context.indexOf('DocumentFragment') === 0) { return; } @@ -171,7 +171,7 @@ exports.module = function(phantomas) { var context = phantomas.getDOMPath(this); var appended = phantomas.getDOMPath(child); - appendChild(child, context, appended); + appendChild(child, this, context, appended); phantomas.enterContext({ type: 'appendChild', @@ -191,7 +191,7 @@ exports.module = function(phantomas) { var context = phantomas.getDOMPath(this); var appended = phantomas.getDOMPath(child); - appendChild(child, context, appended); + appendChild(child, this, context, appended); phantomas.enterContext({ type: 'insertBefore',