From 2714b2bd117aadcec7bb569afec440e76b2b91f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 17 Sep 2014 13:22:05 +0200 Subject: [PATCH] Update Phantomas version --- package.json | 2 +- .../modules/domComplexYLT/domComplexYLT.js | 23 +------------------ 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index a24f682..b015e9d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "url": "git://github.com/gmetais/YellowLabTools.git" }, "dependencies": { - "phantomas": "1.5.0", + "phantomas": "1.6.0", "express": "~4.9.0", "async": "~0.9.0", "socket.io": "~1.1.0", diff --git a/phantomas_custom/modules/domComplexYLT/domComplexYLT.js b/phantomas_custom/modules/domComplexYLT/domComplexYLT.js index 3efa341..f35bf9d 100644 --- a/phantomas_custom/modules/domComplexYLT/domComplexYLT.js +++ b/phantomas_custom/modules/domComplexYLT/domComplexYLT.js @@ -3,7 +3,7 @@ */ /* global document: true, Node: true, window: true */ -exports.version = '0.3.a'; +exports.version = '0.4.a'; exports.module = function(phantomas) { 'use strict'; @@ -11,9 +11,6 @@ exports.module = function(phantomas) { // total length of HTML comments (including brackets) phantomas.setMetric('commentsSize'); // @desc the size of HTML comments on the page @offenders - // total length of HTML of hidden elements (i.e. display: none) - phantomas.setMetric('hiddenContentSize'); // @desc the size of content of hidden elements on the page (with CSS display: none) @offenders - // total length of text nodes with whitespaces only (i.e. pretty formatting of HTML) phantomas.setMetric('whiteSpacesSize'); // @desc the size of text nodes with whitespaces only @@ -77,24 +74,6 @@ exports.module = function(phantomas) { return false; } - // @see https://developer.mozilla.org/en/DOM%3awindow.getComputedStyle - var styles = window.getComputedStyle(node); - - if (styles && styles.getPropertyValue('display') === 'none') { - if (typeof node.innerHTML === 'string') { - size = node.innerHTML.length; - phantomas.incrMetric('hiddenContentSize', size); - - // log hidden containers bigger than 1 kB - if (size > 1024) { - phantomas.addOffender('hiddenContentSize', phantomas.getDOMPath(node) + ' (' + size + ' characters)'); - } - } - - // don't run for child nodes as they're hidden as well - return false; - } - // count nodes with inline CSS if (node.hasAttribute('style')) { phantomas.incrMetric('nodesWithInlineCSS');