|
@@ -146,17 +146,17 @@ exports.module = function(phantomas) {
|
|
|
|
|
|
|
|
|
|
// count DOM inserts
|
|
// count DOM inserts
|
|
- function appendChild(child, context, appended) {
|
|
|
|
|
|
+ function appendChild(child, element, context, appended) {
|
|
/*jshint validthis: true */
|
|
/*jshint validthis: true */
|
|
|
|
|
|
// ignore appending to the node that's not yet added to DOM tree
|
|
// ignore appending to the node that's not yet added to DOM tree
|
|
- if (!this.parentNode) {
|
|
|
|
|
|
+ if (!element.parentNode) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
// don't count elements added to fragments as a DOM inserts (issue #350)
|
|
// don't count elements added to fragments as a DOM inserts (issue #350)
|
|
// DocumentFragment > div[0]
|
|
// DocumentFragment > div[0]
|
|
- if (destNodePath.indexOf('DocumentFragment') === 0) {
|
|
|
|
|
|
+ if (context.indexOf('DocumentFragment') === 0) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -171,7 +171,7 @@ exports.module = function(phantomas) {
|
|
|
|
|
|
var context = phantomas.getDOMPath(this);
|
|
var context = phantomas.getDOMPath(this);
|
|
var appended = phantomas.getDOMPath(child);
|
|
var appended = phantomas.getDOMPath(child);
|
|
- appendChild(child, context, appended);
|
|
|
|
|
|
+ appendChild(child, this, context, appended);
|
|
|
|
|
|
phantomas.enterContext({
|
|
phantomas.enterContext({
|
|
type: 'appendChild',
|
|
type: 'appendChild',
|
|
@@ -191,7 +191,7 @@ exports.module = function(phantomas) {
|
|
|
|
|
|
var context = phantomas.getDOMPath(this);
|
|
var context = phantomas.getDOMPath(this);
|
|
var appended = phantomas.getDOMPath(child);
|
|
var appended = phantomas.getDOMPath(child);
|
|
- appendChild(child, context, appended);
|
|
|
|
|
|
+ appendChild(child, this, context, appended);
|
|
|
|
|
|
phantomas.enterContext({
|
|
phantomas.enterContext({
|
|
type: 'insertBefore',
|
|
type: 'insertBefore',
|