From 1b455367de7e56fc0b51c7d74795f1f4d933f75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 29 Oct 2014 19:27:29 +0100 Subject: [PATCH] Fixes on duplicated queries --- phantomas_custom/modules/domQYLT/domQYLT.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phantomas_custom/modules/domQYLT/domQYLT.js b/phantomas_custom/modules/domQYLT/domQYLT.js index 8f4f37f..9c80e22 100644 --- a/phantomas_custom/modules/domQYLT/domQYLT.js +++ b/phantomas_custom/modules/domQYLT/domQYLT.js @@ -74,7 +74,7 @@ exports.module = function(phantomas) { phantomas.incrMetric('DOMqueriesByTagName'); phantomas.addOffender('DOMqueriesByTagName', tagName); - querySpy('tag name', tagName, 'getElementsByTagName', context); + querySpy('tag name', tagName.toLowerCase(), 'getElementsByTagName', context); phantomas.enterContext({ type: 'getElementsByTagName', @@ -214,7 +214,9 @@ exports.module = function(phantomas) { //phantomas.log('DOM query: by %s - "%s" (using %s on context %s)', type, query, fnName, context); phantomas.incrMetric('DOMqueries'); - DOMqueries.push(type + ' "' + query + '" with ' + fnName + ' (in context ' + context + ')'); + if (context && context.indexOf('DocumentFragment') === -1) { + DOMqueries.push(type + ' "' + query + '" with ' + fnName + ' (in context ' + context + ')'); + } }); phantomas.on('report', function() {