Permalink
Browse files

Documentation updated. bump to 2.4.5.

  • Loading branch information...
1 parent d36d447 commit b09f6ea5eebbe9aa6409d1faefe8b9a597b193bf Adam Moore committed Mar 7, 2011
View
2 LICENSE.TXT
@@ -1,6 +1,6 @@
YUI Compressor Copyright License Agreement (BSD License)
-Copyright (c) 2009, Yahoo! Inc.
+Copyright (c) 2010, Yahoo! Inc.
All rights reserved.
Redistribution and use of this software in source and binary forms,
View
2 ant.properties
@@ -3,6 +3,6 @@ lib.dir = lib
doc.dir = doc
build.dir = build
product.name = yuicompressor
-version.number = 2.4.4
+version.number = 2.4.5
jar.name = ${product.name}-${version.number}.jar
dist.package.name = ${product.name}-${version.number}
View
5 doc/CHANGELOG
@@ -1,4 +1,4 @@
-YUI Compressor 2.4.4, 2010-10-20
+YUI Compressor 2.4.5, 2011-03-13
-------------------------------
+ Default file encoding changed from system default to UTF-8.
+ Errors/messages/usage info all are sent to stderr.
@@ -17,6 +17,9 @@ YUI Compressor 2.4.4, 2010-10-20
+ fixed transform-origin: 0 0 [bug 2528060]
+ tests++
+YUI Compressor 2.4.4, 2010-10-20
++ Interim 2.4.5 release
+
YUI Compressor 2.4.3, 2009-12-07
-------------------------------
+ Changed custodian to ci-tools@
View
8 doc/README
@@ -16,7 +16,7 @@ SYNOPSIS
--charset <charset> Read the input file using <charset>
--line-break <column> Insert a line break after the specified column number
-v, --verbose Display informational messages and warnings
- -o <file> Place the output into <file> or a file pattern.
+ -o <file> Place the output into <file> or a file pattern.
Defaults to stdout.
JavaScript Options
@@ -65,8 +65,8 @@ GLOBAL OPTIONS
Place output in file outfile. If not specified, the YUI Compressor will
default to the standard output, which you can redirect to a file.
Supports a filter syntax for expressing the output pattern when there are
- multiple input files. ex:
- java -jar yuicompressor.jar -o '.css$:-min.css' *.css
+ multiple input files. ex:
+ java -jar yuicompressor.jar -o '.css$:-min.css' *.css
... will minify all .css files and save them as -min.css
-v, --verbose
@@ -140,6 +140,6 @@ MODIFIED RHINO FILES
COPYRIGHT AND LICENSE
- Copyright (c) 2010 Yahoo! Inc. All rights reserved.
+ Copyright (c) 2011 Yahoo! Inc. All rights reserved.
The copyrights embodied in the content of this file are licensed
by Yahoo! Inc. under the BSD (revised) open source license.
View
57 ports/js/cssmin.js
@@ -2,24 +2,25 @@
* cssmin.js
* Author: Stoyan Stefanov - http://phpied.com/
* This is a JavaScript port of the CSS minification tool
- * distributed with YUICompressor, itself a port
- * of the cssmin utility by Isaac Schlueter - http://foohack.com/
+ * distributed with YUICompressor, itself a port
+ * of the cssmin utility by Isaac Schlueter - http://foohack.com/
* Permission is hereby granted to use the JavaScript version under the same
* conditions as the YUICompressor (original YUICompressor note below).
*/
-
+
/*
* YUI Compressor
+* http://developer.yahoo.com/yui/compressor/
* Author: Julien Lecomte - http://www.julienlecomte.net/
-* Copyright (c) 2009 Yahoo! Inc. All rights reserved.
+* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/
var YAHOO = YAHOO || {};
YAHOO.compressor = YAHOO.compressor || {};
YAHOO.compressor.cssmin = function (css, linebreakpos) {
- var startIndex = 0,
+ var startIndex = 0,
endIndex = 0,
i = 0, max = 0,
preservedTokens = [],
@@ -43,46 +44,46 @@ YAHOO.compressor.cssmin = function (css, linebreakpos) {
// preserve strings so their content doesn't get accidentally minified
css = css.replace(/("([^\\"]|\\.|\\)*")|('([^\\']|\\.|\\)*')/g, function (match) {
var i, max, quote = match.substring(0, 1);
-
+
match = match.slice(1, -1);
-
+
// maybe the string contains a comment-like substring?
// one, maybe more? put'em back then
if (match.indexOf("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_") >= 0) {
for (i = 0, max = comments.length; i < max; i = i + 1) {
match = match.replace("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___", comments[i]);
}
}
-
+
// minify alpha opacity in filter strings
match = match.replace(/progid:DXImageTransform\.Microsoft\.Alpha\(Opacity=/gi, "alpha(opacity=");
-
+
preservedTokens.push(match);
return quote + "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.length - 1) + "___" + quote;
});
// strings are safe, now wrestle the comments
for (i = 0, max = comments.length; i < max; i = i + 1) {
-
+
token = comments[i];
placeholder = "___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___";
-
+
// ! in the first position of the comment means preserve
// so push to the preserved tokens keeping the !
if (token.charAt(0) === "!") {
preservedTokens.push(token);
css = css.replace(placeholder, "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.length - 1) + "___");
continue;
}
-
+
// \ in the last position looks like hack for Mac/IE5
// shorten that to /*\*/ and the next one to /**/
if (token.charAt(token.length - 1) === "\\") {
preservedTokens.push("\\");
css = css.replace(placeholder, "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.length - 1) + "___");
i = i + 1; // attn: advancing the loop
preservedTokens.push("");
- css = css.replace("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___", "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.length - 1) + "___");
+ css = css.replace("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___", "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.length - 1) + "___");
continue;
}
@@ -97,7 +98,7 @@ YAHOO.compressor.cssmin = function (css, linebreakpos) {
}
}
}
-
+
// in all other cases kill the comment
css = css.replace("/*" + placeholder + "*/", "");
}
@@ -117,19 +118,19 @@ YAHOO.compressor.cssmin = function (css, linebreakpos) {
// retain space for special IE6 cases
css = css.replace(/:first-(line|letter)(\{|,)/g, ":first-$1 $2");
-
+
// no space after the end of a preserved comment
- css = css.replace(/\*\/ /g, '*/');
-
-
+ css = css.replace(/\*\/ /g, '*/');
+
+
// If there is a @charset, then only allow one, and push to the top of the file.
css = css.replace(/^(.*)(@charset "[^"]*";)/gi, '$2$1');
css = css.replace(/^(\s*@charset [^;]+;\s*)+/gi, '$1');
-
+
// Put the space back in some cases, to support stuff like
// @media screen and (-webkit-min-device-pixel-ratio:0){
css = css.replace(/\band\(/gi, "and (");
-
+
// Remove the spaces after the things that should not have spaces after them.
css = css.replace(/([!{}:;>+\(\[,])\s+/g, '$1');
@@ -166,15 +167,15 @@ YAHOO.compressor.cssmin = function (css, linebreakpos) {
}
return '#' + rgbcolors.join('');
});
-
+
// Shorten colors from #AABBCC to #ABC. Note that we want to make sure
// the color is not preceded by either ", " or =. Indeed, the property
// filter: chroma(color="#FFFFFF");
// would become
// filter: chroma(color="#FFF");
// which makes the filter break in IE.
- css = css.replace(/([^"'=\s])(\s*)#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])/gi, function () {
+ css = css.replace(/([^"'=\s])(\s*)#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])/gi, function () {
var group = arguments;
if (
group[3].toLowerCase() === group[4].toLowerCase() &&
@@ -186,12 +187,12 @@ YAHOO.compressor.cssmin = function (css, linebreakpos) {
return group[0].toLowerCase();
}
});
-
+
// border: none -> border:0
css = css.replace(/(border|border-top|border-right|border-bottom|border-right|outline|background):none(;|\})/gi, function(all, prop, tail) {
return prop.toLowerCase() + ":0" + tail;
});
-
+
// shorter opacity IE filter
css = css.replace(/progid:DXImageTransform\.Microsoft\.Alpha\(Opacity=/gi, "alpha(opacity=");
@@ -202,7 +203,7 @@ YAHOO.compressor.cssmin = function (css, linebreakpos) {
// Some source control tools don't like it when files containing lines longer
// than, say 8000 characters, are checked in. The linebreak option is used in
// that case to split long lines after a specific column.
- startIndex = 0;
+ startIndex = 0;
i = 0;
while (i < css.length) {
i = i + 1;
@@ -211,7 +212,7 @@ YAHOO.compressor.cssmin = function (css, linebreakpos) {
startIndex = i;
}
}
- }
+ }
// Replace multiple semi-colons in a row by a single one
// See SF bug #1980989
@@ -221,10 +222,10 @@ YAHOO.compressor.cssmin = function (css, linebreakpos) {
for (i = 0, max = preservedTokens.length; i < max; i = i + 1) {
css = css.replace("___YUICSSMIN_PRESERVED_TOKEN_" + i + "___", preservedTokens[i]);
}
-
+
// Trim the final string (for any leading or trailing white spaces)
css = css.replace(/^\s+|\s+$/g, "");
return css;
-};
+};
View
7 src/com/yahoo/platform/yui/compressor/Bootstrap.java
@@ -1,7 +1,8 @@
/*
* YUI Compressor
- * Author: Julien Lecomte - http://www.julienlecomte.net/
- * Copyright (c) 2009 Yahoo! Inc. All rights reserved.
+ * http://developer.yahoo.com/yui/compressor/
+ * Author: Julien Lecomte - http://www.julienlecomte.net/
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/
@@ -19,4 +20,4 @@ public static void main(String args[]) throws Exception {
Method main = c.getMethod("main", new Class[]{String[].class});
main.invoke(null, new Object[]{args});
}
-}
+}
View
59 src/com/yahoo/platform/yui/compressor/CssCompressor.java
@@ -1,21 +1,21 @@
/*
* YUI Compressor
+ * http://developer.yahoo.com/yui/compressor/
* Author: Julien Lecomte - http://www.julienlecomte.net/
- * Author: Isaac Schlueter - http://foohack.com/
+ * Author: Isaac Schlueter - http://foohack.com/
* Author: Stoyan Stefanov - http://phpied.com/
- * Copyright (c) 2009 Yahoo! Inc. All rights reserved.
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/
-
package com.yahoo.platform.yui.compressor;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
-import java.util.ArrayList;
+import java.util.ArrayList;
public class CssCompressor {
@@ -36,7 +36,7 @@ public void compress(Writer out, int linebreakpos)
Matcher m;
String css = srcsb.toString();
StringBuffer sb = new StringBuffer(css);
-
+
int startIndex = 0;
int endIndex = 0;
int i = 0;
@@ -47,14 +47,27 @@ public void compress(Writer out, int linebreakpos)
int totallen = css.length();
String placeholder;
+ // // leave data urls alone to increase parse performance.
+ // sb = new StringBuffer();
+ // p = Pattern.compile("url\\(.*data\\:(.*)\\)");
+ // m = p.matcher(css);
+ // while (m.find()) {
+ // token = m.group();
+ // token = token.substring(1, token.length() - 1);
+ // preservedTokens.add(token);
+ // String preserver = "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.size() - 1) + "___";
+ // m.appendReplacement(sb, preserver);
+ // }
+ // m.appendTail(sb);
+ // css = sb.toString();
// collect all comment blocks...
while ((startIndex = sb.indexOf("/*", startIndex)) >= 0) {
endIndex = sb.indexOf("*/", startIndex + 2);
if (endIndex < 0) {
endIndex = totallen;
}
-
+
token = sb.substring(startIndex + 2, endIndex);
comments.add(token);
sb.replace(startIndex + 2, endIndex, "___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + (comments.size() - 1) + "___");
@@ -70,18 +83,18 @@ public void compress(Writer out, int linebreakpos)
token = m.group();
char quote = token.charAt(0);
token = token.substring(1, token.length() - 1);
-
+
// maybe the string contains a comment-like substring?
// one, maybe more? put'em back then
if (token.indexOf("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_") >= 0) {
for (i = 0, max = comments.size(); i < max; i += 1) {
token = token.replace("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___", comments.get(i).toString());
}
}
-
+
// minify alpha opacity in filter strings
token = token.replaceAll("(?i)progid:DXImageTransform.Microsoft.Alpha\\(Opacity=", "alpha(opacity=");
-
+
preservedTokens.add(token);
String preserver = quote + "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.size() - 1) + "___" + quote;
m.appendReplacement(sb, preserver);
@@ -95,26 +108,26 @@ public void compress(Writer out, int linebreakpos)
token = comments.get(i).toString();
placeholder = "___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___";
-
+
// ! in the first position of the comment means preserve
// so push to the preserved tokens while stripping the !
if (token.startsWith("!")) {
preservedTokens.add(token);
css = css.replace(placeholder, "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.size() - 1) + "___");
continue;
}
-
+
// \ in the last position looks like hack for Mac/IE5
// shorten that to /*\*/ and the next one to /**/
if (token.endsWith("\\")) {
preservedTokens.add("\\");
css = css.replace(placeholder, "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.size() - 1) + "___");
i = i + 1; // attn: advancing the loop
preservedTokens.add("");
- css = css.replace("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___", "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.size() - 1) + "___");
+ css = css.replace("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___", "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.size() - 1) + "___");
continue;
}
-
+
// keep empty comments after child selectors (IE7 hack)
// e.g. html >/**/ body
if (token.length() == 0) {
@@ -126,7 +139,7 @@ public void compress(Writer out, int linebreakpos)
}
}
}
-
+
// in all other cases kill the comment
css = css.replace("/*" + placeholder + "*/", "");
}
@@ -153,20 +166,20 @@ public void compress(Writer out, int linebreakpos)
css = css.replaceAll("\\s+([!{};:>+\\(\\)\\],])", "$1");
// bring back the colon
css = css.replaceAll("___YUICSSMIN_PSEUDOCLASSCOLON___", ":");
-
+
// retain space for special IE6 cases
css = css.replaceAll(":first\\-(line|letter)(\\{|,)", ":first-$1 $2");
-
+
// no space after the end of a preserved comment
- css = css.replaceAll("\\*/ ", "*/");
-
+ css = css.replaceAll("\\*/ ", "*/");
+
// If there is a @charset, then only allow one, and push to the top of the file.
css = css.replaceAll("^(.*)(@charset \"[^\"]*\";)", "$2$1");
css = css.replaceAll("^(\\s*@charset [^;]+;\\s*)+", "$1");
-
+
// Put the space back in some cases, to support stuff like
// @media screen and (-webkit-min-device-pixel-ratio:0){
- css = css.replaceAll("\\band\\(", "and (");
+ css = css.replaceAll("\\band\\(", "and (");
// Remove the spaces after the things that should not have spaces after them.
css = css.replaceAll("([!{}:;>+\\(\\[,])\\s+", "$1");
@@ -181,8 +194,8 @@ public void compress(Writer out, int linebreakpos)
css = css.replaceAll(":0 0 0 0(;|})", ":0$1");
css = css.replaceAll(":0 0 0(;|})", ":0$1");
css = css.replaceAll(":0 0(;|})", ":0$1");
-
-
+
+
// Replace background-position:0; with background-position:0 0;
// same for transform-origin
sb = new StringBuffer();
@@ -193,7 +206,7 @@ public void compress(Writer out, int linebreakpos)
}
m.appendTail(sb);
css = sb.toString();
-
+
// Replace 0.6 to .6, but only when preceded by : or a white-space
css = css.replaceAll("(:|\\s)0+\\.(\\d+)", "$1.$2");
View
8 src/com/yahoo/platform/yui/compressor/JarClassLoader.java
@@ -1,11 +1,11 @@
/*
* YUI Compressor
- * Author: Julien Lecomte - http://www.julienlecomte.net/
- * Copyright (c) 2009 Yahoo! Inc. All rights reserved.
+ * http://developer.yahoo.com/yui/compressor/
+ * Author: Julien Lecomte - http://www.julienlecomte.net/
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/
-
package com.yahoo.platform.yui.compressor;
import java.io.ByteArrayOutputStream;
@@ -155,4 +155,4 @@ private void copy(InputStream in, OutputStream out) throws IOException {
out.write(buf, 0, len);
}
}
-}
+}
View
6 src/com/yahoo/platform/yui/compressor/JavaScriptCompressor.java
@@ -1,11 +1,11 @@
/*
* YUI Compressor
- * Author: Julien Lecomte - http://www.julienlecomte.net/
- * Copyright (c) 2009 Yahoo! Inc. All rights reserved.
+ * http://developer.yahoo.com/yui/compressor/
+ * Author: Julien Lecomte - http://www.julienlecomte.net/
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/
-
package com.yahoo.platform.yui.compressor;
import org.mozilla.javascript.*;
View
6 src/com/yahoo/platform/yui/compressor/JavaScriptIdentifier.java
@@ -1,11 +1,11 @@
/*
* YUI Compressor
- * Author: Julien Lecomte - http://www.julienlecomte.net/
- * Copyright (c) 2009 Yahoo! Inc. All rights reserved.
+ * http://developer.yahoo.com/yui/compressor/
+ * Author: Julien Lecomte - http://www.julienlecomte.net/
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/
-
package com.yahoo.platform.yui.compressor;
import org.mozilla.javascript.Token;
View
6 src/com/yahoo/platform/yui/compressor/JavaScriptToken.java
@@ -1,11 +1,11 @@
/*
* YUI Compressor
- * Author: Julien Lecomte - http://www.julienlecomte.net/
- * Copyright (c) 2009 Yahoo! Inc. All rights reserved.
+ * http://developer.yahoo.com/yui/compressor/
+ * Author: Julien Lecomte - http://www.julienlecomte.net/
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/
-
package com.yahoo.platform.yui.compressor;
public class JavaScriptToken {
View
6 src/com/yahoo/platform/yui/compressor/ScriptOrFnScope.java
@@ -1,11 +1,11 @@
/*
* YUI Compressor
- * Author: Julien Lecomte - http://www.julienlecomte.net/
- * Copyright (c) 2009 Yahoo! Inc. All rights reserved.
+ * http://developer.yahoo.com/yui/compressor/
+ * Author: Julien Lecomte - http://www.julienlecomte.net/
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/
-
package com.yahoo.platform.yui.compressor;
import java.util.ArrayList;
View
6 src/com/yahoo/platform/yui/compressor/YUICompressor.java
@@ -1,11 +1,11 @@
/*
* YUI Compressor
- * Author: Julien Lecomte - http://www.julienlecomte.net/
- * Copyright (c) 2009 Yahoo! Inc. All rights reserved.
+ * http://developer.yahoo.com/yui/compressor/
+ * Author: Julien Lecomte - http://www.julienlecomte.net/
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/
-
package com.yahoo.platform.yui.compressor;
import jargs.gnu.CmdLineParser;

0 comments on commit b09f6ea

Please sign in to comment.