瀏覽代碼

Fix DOMinsert count problem

Gaël Métais 11 年之前
父節點
當前提交
6b644e0078
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      phantomas_custom/modules/domQYLT/domQYLT.js

+ 5 - 5
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',