From 17a21f1867d26dcfc24fcd58b380e3ea536c3154 Mon Sep 17 00:00:00 2001 From: jschwarty Date: Wed, 8 Jan 2014 12:06:45 -0800 Subject: [PATCH] Adding output info for inline minify suggestions Added output of the parent content node and the style/script body to the listing of the inline style and script tags that can be minified. This will help to track down what markup can be optimized. --- src/common/rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/rules.js b/src/common/rules.js index 69d7298..5f8f6f9 100644 --- a/src/common/rules.js +++ b/src/common/rules.js @@ -634,12 +634,12 @@ YSLOW.registerRule({ // check inline scripts/styles/whatever for (i = 0, len = styles.length; i < len; i += 1) { if (!YSLOW.util.isMinified(styles[i].body)) { - offenders.push('inline <style> tag #' + (i + 1)); + offenders.push('inline <style> tag #' + (i + 1) + ' (parent node is <'+styles[i].contentNode+'>)
' + YSLOW.util.escapeHtml(styles[i].body) + '
'); } } for (i = 0, len = scripts.length; i < len; i += 1) { if (!YSLOW.util.isMinified(scripts[i].body)) { - offenders.push('inline <script> tag #' + (i + 1)); + offenders.push('inline <script> tag #' + (i + 1) + ' (parent node is <'+scripts[i].contentNode+'>)
' + YSLOW.util.escapeHtml(scripts[i].body) + '
'); } }