├── .gitattributes ├── .gitignore ├── .travis.yml ├── LICENSE.TXT ├── README.md ├── ant.properties ├── build.xml ├── doc └── CHANGELOG ├── docs ├── README.md ├── css.mustache ├── index.mustache └── project.json ├── lib ├── jargs-1.0.jar └── rhino-1.7R2.jar ├── maven_central ├── build.xml └── template │ └── pom.xml.template ├── nodejs ├── cli.js └── index.js ├── nodejs_tests ├── files │ ├── yui.js │ └── yui.js.min └── tests.js ├── package.json ├── src ├── com │ └── yahoo │ │ └── platform │ │ └── yui │ │ └── compressor │ │ ├── Bootstrap.java │ │ ├── CssCompressor.java │ │ ├── JarClassLoader.java │ │ ├── JavaScriptCompressor.java │ │ ├── JavaScriptIdentifier.java │ │ ├── JavaScriptToken.java │ │ ├── ScriptOrFnScope.java │ │ └── YUICompressor.java └── org │ └── mozilla │ └── javascript │ ├── Decompiler.java │ ├── Decompiler.java.orig │ ├── Parser.java │ ├── Parser.java.orig │ ├── Token.java │ ├── Token.java.orig │ ├── TokenStream.java │ └── TokenStream.java.orig ├── tests ├── README ├── _munge.js ├── _munge.js.min ├── _string_combo.js ├── _string_combo.js.min ├── _string_combo2.js ├── _string_combo2.js.min ├── _string_combo3.js ├── _string_combo3.js.min ├── _syntax_error.js ├── _syntax_error.js.min ├── background-position.css ├── background-position.css.min ├── border-none.css ├── border-none.css.min ├── box-model-hack.css ├── box-model-hack.css.min ├── bug-flex.css ├── bug-flex.css.min ├── bug-nested-pseudoclass.css ├── bug-nested-pseudoclass.css.min ├── bug-preservetoken-calc.css ├── bug-preservetoken-calc.css.min ├── bug2527974.css ├── bug2527974.css.min ├── bug2527991.css ├── bug2527991.css.min ├── bug2527998.css ├── bug2527998.css.min ├── bug2528034.css ├── bug2528034.css.min ├── charset-media.css ├── charset-media.css.min ├── color-keyword.css ├── color-keyword.css.min ├── color-simple.css ├── color-simple.css.min ├── color.css ├── color.css.min ├── comment.css ├── comment.css.min ├── concat-charset.css ├── concat-charset.css.min ├── dataurl-base64-doublequotes.css ├── dataurl-base64-doublequotes.css.min ├── dataurl-base64-eof.css ├── dataurl-base64-eof.css.min ├── dataurl-base64-linebreakindata.css ├── dataurl-base64-linebreakindata.css.min ├── dataurl-base64-noquotes.css ├── dataurl-base64-noquotes.css.min ├── dataurl-base64-singlequotes.css ├── dataurl-base64-singlequotes.css.min ├── dataurl-base64-twourls.css ├── dataurl-base64-twourls.css.min ├── dataurl-dbquote-font.css ├── dataurl-dbquote-font.css.min ├── dataurl-nonbase64-doublequotes.css ├── dataurl-nonbase64-doublequotes.css.min ├── dataurl-nonbase64-noquotes.css ├── dataurl-nonbase64-noquotes.css.min ├── dataurl-nonbase64-singlequotes.css ├── dataurl-nonbase64-singlequotes.css.min ├── dataurl-noquote-multiline-font.css ├── dataurl-noquote-multiline-font.css.min ├── dataurl-realdata-doublequotes.css ├── dataurl-realdata-doublequotes.css.min ├── dataurl-realdata-noquotes.css ├── dataurl-realdata-noquotes.css.min ├── dataurl-realdata-singlequotes.css ├── dataurl-realdata-singlequotes.css.min ├── dataurl-realdata-yuiapp.css ├── dataurl-realdata-yuiapp.css.min ├── dataurl-singlequote-font.css ├── dataurl-singlequote-font.css.min ├── dataurl-validity.html ├── decimals.css ├── decimals.css.min ├── dollar-header.css ├── dollar-header.css.min ├── float.js ├── float.js.min ├── font-face.css ├── font-face.css.min ├── hsla-issue81.css.FAIL ├── hsla-issue81.css.min ├── ie-backslash9-hack.css ├── ie-backslash9-hack.css.min ├── ie5mac.css ├── ie5mac.css.min ├── issue-59.css ├── issue-59.css.min ├── issue151.css ├── issue151.css.min ├── issue172.css.FAIL ├── issue172.css.min ├── issue180.css ├── issue180.css.min ├── issue205.css ├── issue205.css.min ├── issue221.css ├── issue221.css.min ├── issue222.css ├── issue222.css.min ├── issue71.js.FAIL ├── issue71.js.min ├── issue86.js ├── issue86.js.min ├── jquery-1.6.4.js ├── jquery-1.6.4.js.min ├── lowercasing.css ├── lowercasing.css.min ├── media-empty-class.css ├── media-empty-class.css.min ├── media-multi.css ├── media-multi.css.min ├── media-test.css ├── media-test.css.min ├── old-ie-filter-matrix.css ├── old-ie-filter-matrix.css.min ├── opacity-filter.css ├── opacity-filter.css.min ├── opera-pixel-ratio.css ├── opera-pixel-ratio.css.min ├── pointzeros.css ├── pointzeros.css.min ├── preserve-case.css ├── preserve-case.css.min ├── preserve-important.css ├── preserve-important.css.min ├── preserve-new-line.css ├── preserve-new-line.css.min ├── preserve-strings.css ├── preserve-strings.css.min ├── promise-catch-finally-issue203.js ├── promise-catch-finally-issue203.js.min ├── pseudo-first.css ├── pseudo-first.css.min ├── pseudo.css ├── pseudo.css.min ├── rgb-issue81.css.FAIL ├── rgb-issue81.css.min ├── special-comments.css ├── special-comments.css.min ├── star-underscore-hacks.css ├── star-underscore-hacks.css.min ├── string-in-comment.css ├── string-in-comment.css.min ├── suite.rhino ├── suite.sh ├── webkit-transform.css ├── webkit-transform.css.min ├── zeros.css └── zeros.css.min └── tools └── cssmin-debugger.html /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build_tmp/ 2 | node_modules 3 | .DS_Store 4 | .*.swp 5 | .svn 6 | CVS/ 7 | # Ignore all backup files 8 | *~ 9 | # Ignore Emacs auto saved files 10 | *#*# 11 | build/classes 12 | build/jar 13 | build/build_tmp 14 | build/yuicompressor*.jar 15 | .project 16 | .classpath 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - openjdk6 4 | install: 5 | - ant 6 | - npm install 7 | script: 8 | - ./tests/suite.sh 9 | - npm test -------------------------------------------------------------------------------- /LICENSE.TXT: -------------------------------------------------------------------------------- 1 | YUI Compressor Copyright License Agreement (BSD License) 2 | 3 | Copyright (c) 2013, Yahoo! Inc. 4 | All rights reserved. 5 | 6 | Redistribution and use of this software in source and binary forms, 7 | with or without modification, are permitted provided that the following 8 | conditions are met: 9 | 10 | * Redistributions of source code must retain the above 11 | copyright notice, this list of conditions and the 12 | following disclaimer. 13 | 14 | * Redistributions in binary form must reproduce the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer in the documentation and/or other 17 | materials provided with the distribution. 18 | 19 | * Neither the name of Yahoo! Inc. nor the names of its 20 | contributors may be used to endorse or promote products 21 | derived from this software without specific prior 22 | written permission of Yahoo! Inc. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 28 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | This software also requires access to software from the following sources: 36 | 37 | The Jarg Library v 1.0 ( http://jargs.sourceforge.net/ ) is available 38 | under a BSD License � Copyright (c) 2001-2003 Steve Purcell, 39 | Copyright (c) 2002 Vidar Holen, Copyright (c) 2002 Michal Ceresna and 40 | Copyright (c) 2005 Ewan Mellor. 41 | 42 | The Rhino Library ( http://www.mozilla.org/rhino/ ) is dually available 43 | under an MPL 1.1/GPL 2.0 license, with portions subject to a BSD license. 44 | 45 | Additionally, this software contains modified versions of the following 46 | component files from the Rhino Library: 47 | 48 | [org/mozilla/javascript/Decompiler.java] 49 | [org/mozilla/javascript/Parser.java] 50 | [org/mozilla/javascript/Token.java] 51 | [org/mozilla/javascript/TokenStream.java] 52 | 53 | The modified versions of these files are distributed under the MPL v 1.1 54 | ( http://www.mozilla.org/MPL/MPL-1.1.html ) 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | YUI Compressor - The Yahoo! JavaScript and CSS Compressor 2 | ========================================================= 3 | 4 | The YUI Compressor is a JavaScript compressor which, in addition to removing 5 | comments and white-spaces, obfuscates local variables using the smallest 6 | possible variable name. This obfuscation is safe, even when using constructs 7 | such as 'eval' or 'with' (although the compression is not optimal in those 8 | cases) Compared to jsmin, the average savings is around 20%. 9 | 10 | The YUI Compressor is also able to safely compress CSS files. The decision 11 | on which compressor is being used is made on the file extension (js or css) 12 | 13 | Building 14 | -------- 15 | 16 | ant 17 | 18 | Testing 19 | ------- 20 | 21 | ./tests/suite.sh 22 | 23 | 24 | Node.js Package 25 | --------------- 26 | 27 | You can require compressor in a Node.js package and compress files and strings in async. 28 | _It still uses Java under the hood_ 29 | 30 | npm i yuicompressor 31 | 32 | ```javascript 33 | 34 | var compressor = require('yuicompressor'); 35 | 36 | compressor.compress('/path/to/file or String of JS', { 37 | //Compressor Options: 38 | charset: 'utf8', 39 | type: 'js', 40 | nomunge: true, 41 | 'line-break': 80 42 | }, function(err, data, extra) { 43 | //err If compressor encounters an error, it's stderr will be here 44 | //data The compressed string, you write it out where you want it 45 | //extra The stderr (warnings are printed here in case you want to echo them 46 | }); 47 | 48 | ``` 49 | 50 | Options: 51 | * `charset` // defaults to 'utf8' 52 | * `type` // defaults to 'js' 53 | * `line-break` 54 | * `nomunge` 55 | * `preserve-semi` 56 | * `disable-optimizations` 57 | 58 | 59 | TODO 60 | ---- 61 | 62 | * Better Docs 63 | * Help Pages 64 | 65 | Build Status 66 | ------------ 67 | 68 | [![Build Status](https://secure.travis-ci.org/yui/yuicompressor.svg?branch=master)](http://travis-ci.org/yui/yuicompressor) 69 | 70 | 71 | Global Options 72 | -------------- 73 | 74 | -h, --help 75 | Prints help on how to use the YUI Compressor 76 | 77 | --line-break 78 | Some source control tools don't like files containing lines longer than, 79 | say 8000 characters. The linebreak option is used in that case to split 80 | long lines after a specific column. It can also be used to make the code 81 | more readable, easier to debug (especially with the MS Script Debugger) 82 | Specify 0 to get a line break after each semi-colon in JavaScript, and 83 | after each rule in CSS. 84 | 85 | --type js|css 86 | The type of compressor (JavaScript or CSS) is chosen based on the 87 | extension of the input file name (.js or .css) This option is required 88 | if no input file has been specified. Otherwise, this option is only 89 | required if the input file extension is neither 'js' nor 'css'. 90 | 91 | --charset character-set 92 | If a supported character set is specified, the YUI Compressor will use it 93 | to read the input file. Otherwise, it will assume that the platform's 94 | default character set is being used. The output file is encoded using 95 | the same character set. 96 | 97 | -o outfile 98 | 99 | Place output in file outfile. If not specified, the YUI Compressor will 100 | default to the standard output, which you can redirect to a file. 101 | Supports a filter syntax for expressing the output pattern when there are 102 | multiple input files. ex: 103 | java -jar yuicompressor.jar -o '.css$:-min.css' *.css 104 | ... will minify all .css files and save them as -min.css 105 | 106 | -v, --verbose 107 | Display informational messages and warnings. 108 | 109 | JavaScript Only Options 110 | ----------------------- 111 | 112 | --nomunge 113 | Minify only. Do not obfuscate local symbols. 114 | 115 | --preserve-semi 116 | Preserve unnecessary semicolons (such as right before a '}') This option 117 | is useful when compressed code has to be run through JSLint (which is the 118 | case of YUI for example) 119 | 120 | --disable-optimizations 121 | Disable all the built-in micro optimizations. 122 | 123 | Notes 124 | ----- 125 | 126 | * If no input file is specified, it defaults to stdin. 127 | 128 | * Supports wildcards for specifying multiple input files. 129 | 130 | * The YUI Compressor requires Java version >= 1.5. 131 | 132 | * It is possible to prevent a local variable, nested function or function 133 | argument from being obfuscated by using "hints". A hint is a string that 134 | is located at the very beginning of a function body like so: 135 | 136 | ``` 137 | function fn (arg1, arg2, arg3) { 138 | "arg2:nomunge, localVar:nomunge, nestedFn:nomunge"; 139 | 140 | ... 141 | var localVar; 142 | ... 143 | 144 | function nestedFn () { 145 | .... 146 | } 147 | 148 | ... 149 | } 150 | ``` 151 | The hint itself disappears from the compressed file. 152 | 153 | * C-style comments starting with `/*!` are preserved. This is useful with 154 | comments containing copyright/license information. As of 2.4.8, the '!' 155 | is no longer dropped by YUICompressor. For example: 156 | 157 | ``` 158 | /*! 159 | * TERMS OF USE - EASING EQUATIONS 160 | * Open source under the BSD License. 161 | * Copyright 2001 Robert Penner All rights reserved. 162 | */ 163 | ``` 164 | 165 | remains in the output, untouched by YUICompressor. 166 | 167 | Modified Rhino Files 168 | -------------------- 169 | 170 | YUI Compressor uses a modified version of the Rhino library 171 | (http://www.mozilla.org/rhino/) The changes were made to support 172 | JScript conditional comments, preserved comments, unescaped slash 173 | characters in regular expressions, and to allow for the optimization 174 | of escaped quotes in string literals. 175 | 176 | Copyright And License 177 | --------------------- 178 | 179 | Copyright (c) 2013 Yahoo! Inc. All rights reserved. 180 | The copyrights embodied in the content of this file are licensed 181 | by Yahoo! Inc. under the BSD (revised) open source license. 182 | -------------------------------------------------------------------------------- /ant.properties: -------------------------------------------------------------------------------- 1 | src.dir = src 2 | lib.dir = lib 3 | doc.dir = doc 4 | build.dir = build 5 | product.name = yuicompressor 6 | version.number = 2.4.9 7 | jar.name = ${product.name}-${version.number}.jar 8 | dist.package.name = ${product.name}-${version.number} 9 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /doc/CHANGELOG: -------------------------------------------------------------------------------- 1 | YUI Compressor 2.4.8 2 | -------------------- 3 | + Fix "important" and conditional comment processing 4 | + Fix a bug in the support for JS 1.7 style getters/setters 5 | + Better compliance and results in CSS compression (@danbeam, 6 | @faisalman, @killsaw, @ademey) 7 | + Now minifies "border-left" in CSS (@sbertrang) 8 | + Include filename in warning and error output (@danielbeardsley) 9 | + Many improvements to parameter parsing and batch modes (@bmouw, 10 | @bandesz, @ryansully) 11 | + Include jQuery as part of our test suite (@apm) 12 | + Trim trailing commas where possible (@nlalevee) 13 | 14 | YUI Compressor 2.4.7 15 | -------------------- 16 | + Handle data urls without blowing up Java memory (regex) 17 | + Updated docs to reflect Java >= 1.5 required for CssCompressor 18 | + Fixed issue where we were breaking #AABBCC id selectors, with the 19 | #AABBCC -> #ABC color compression. 20 | 21 | YUI Compressor 2.4.6 22 | -------------------- 23 | + Show usage information when started without arguments. 24 | 25 | YUI Compressor 2.4.5 26 | -------------------- 27 | + Default file encoding changed from system default to UTF-8. 28 | + Errors/messages/usage info all are sent to stderr. 29 | + Removed unnecessary warning about short undeclared global symbols. 30 | + Added support for processing multiple files with a single invokation 31 | + $ in CSS files doesn't throw exceptions 32 | + white space in ! important comments preserved in CSS 33 | + fix in greedy empty CSS declaration blocks removal 34 | + safe handling of strings and comments in CSS files 35 | + shorter alpha opacity CSS filers 36 | + shorter Mac/IE5 hack -> /*\*/ hack {mac: 1} /**/ 37 | + JS port of the CSS minifier 38 | + safe @media queries handling 39 | + stripping the trailing ; in CSS declaration blocks 40 | + shorter border:none->0 where applicable 41 | + fixed transform-origin: 0 0 [bug 2528060] 42 | + tests++ 43 | 44 | YUI Compressor 2.4.4 45 | -------------------- 46 | + Interim 2.4.5 release 47 | 48 | YUI Compressor 2.4.3 49 | -------------------- 50 | + Changed custodian to ci-tools@ 51 | 52 | YUI Compressor 2.4.2 53 | -------------------------------- 54 | + Preserved comments shouldn't prevent obfuscation (Thanks to Matjaz Lipus) 55 | 56 | 57 | YUI Compressor 2.4.1 58 | -------------------- 59 | 60 | + Use preferentially lower case letters for obfuscated variable names. 61 | Since JavaScript keywords use lower case letters most often, this 62 | improves the efficiency of any compression algorithm (gzipping) 63 | used after minification. 64 | + Don't append a semi-colon at the end of a JavaScript file when the 65 | last token is a special comment. 66 | 67 | YUI Compressor 2.4 68 | ------------------ 69 | 70 | + Allowed the YUI Compressor (which uses a modified version of Rhino) 71 | to work alongside the original (unmodified) rhino library by using 72 | a custom class loader. 73 | + Added all that's necessary to build the YUI Compressor to the 74 | downloable package. 75 | + Fixed unnecessary white space after return / typeof when possible. 76 | 77 | YUI Compressor 2.3.6 78 | -------------------- 79 | 80 | + Fixed a few minor bugs with the CSS compressor 81 | + Changed packaging. The original Rhino library, which is used to build the 82 | YUI Compressor, is not part of the downloadable archive. Too many people 83 | put it in their classpath, generating a lot of invalid bugs. 84 | 85 | YUI Compressor 2.3.5 86 | -------------------- 87 | 88 | + Added a warning when more than one 'var' statement is used in a single scope. 89 | Automatic coalescence is extremely complicated, and would be unsafe if not 90 | done properly. 91 | 92 | YUI Compressor 2.3.4 93 | -------------------- 94 | 95 | + Expanded the list of reserved words used by isValidIdentifier() 96 | 97 | YUI Compressor 2.3.3 98 | -------------------- 99 | 100 | + C-style comments starting with /*! are preserved. This is especially 101 | useful with comments containing copyright/license information. 102 | 103 | YUI Compressor 2.3.2 104 | -------------------- 105 | 106 | + Compressing an empty JS file throws an error [SourceForge bug #1884207] 107 | + When a string is the first token in a function body, it was removed from 108 | the compressed file [SourceForge bug #1884314] 109 | 110 | YUI Compressor 2.3.1 111 | -------------------- 112 | 113 | + Added test against list of reserved words in method isValidIdentifier. 114 | 115 | YUI Compressor 2.3 116 | ------------------ 117 | 118 | + Always output a ';' at the end of a minified JavaScript file. This allows 119 | the concatenating of several minified files without the fear of introducing 120 | a syntax error. 121 | + Removed all System.exit() statements. Throw exceptions instead. This is 122 | especially useful when running the compressor from within a J2EE container. 123 | [SourceForge bug #1834750] 124 | + Transform obj["foo"] into obj.foo whenever possible, saving 3 bytes. 125 | + Transform 'foo': ... into foo: ... whenever possible, saving 2 bytes. 126 | + Added support for multi-line string literals [SourceForge bug #1871453] 127 | + Added support for unescaped slashes inside character classes in regexp. 128 | + Minor performance improvements. 129 | + Preserve the escaping for an octal representation of a character in string 130 | literals [SourceForge bug #1844894] 131 | 132 | var a = '\001'; 133 | 134 | + CSS: Preserve comments that hide CSS rules from IE Mac: 135 | 136 | /* Hides from IE-mac \*/ 137 | ... 138 | /* End hide from IE-mac */ 139 | 140 | + CSS: Added support for box model hack [SourceForge bug #1862107] 141 | 142 | div.content { 143 | width:400px; 144 | voice-family: "\"}\""; 145 | voice-family:inherit; 146 | width:300px; 147 | } 148 | 149 | YUI Compressor 2.2.5 150 | -------------------- 151 | 152 | + Remove line terminator after escape in string literals. 153 | 154 | YUI Compressor 2.2.4 155 | -------------------- 156 | 157 | + Fixed the way quote characters are counted in string literals 158 | [SourceForge bug #1804576] 159 | + Do not use a regular expression using non-greedy matching to remove CSS 160 | comments (if the comment is more than 800 characters long or so, a stack 161 | overflow exception gets thrown) Instead, use good old parsing... 162 | + Fix unnecessary quote escaping in string literals. 163 | 164 | YUI Compressor 2.2.3 165 | -------------------- 166 | 167 | + Transform <'+'/script>' completely useless. 185 | + When converting decimal rgb color values to hexadecimal color values, 186 | prepend a '0' if the value is less than 16. Otherwise, rgb(0,124,114) 187 | for instance becomes #07c72, which is incorrect. 188 | + In CSS files, do not change color names into their corresponding color 189 | codes (and vice-versa) due to the high potential of introducing bugs 190 | (rolled back from 2.2.1) 191 | 192 | YUI Compressor 2.2.1 193 | -------------------- 194 | 195 | + Optimize quote escaping in JavaScript string literals by using the best quote 196 | character (' or " depending on the occurrence of this character in the string) 197 | + Fixed minor bug in the CSS compressor. Colors should not be shortened in 198 | filter: chroma(color="#FFFFFF"); 199 | Otherwise, it makes the filter break in Internet Explorer. 200 | + In CSS files, change color names into their corresponding color codes 201 | (and vice-versa) if that change yields any savings. 202 | 203 | YUI Compressor 2.2 204 | ------------------ 205 | 206 | + Don't obfuscate function argument named $super if it is the first function 207 | argument listed. This is to support Prototype 1.6's heretic implementation. 208 | + Added support for stdin/stdout (see README for more info) 209 | + Shorten colors from rgb(51,102,153) to #336699 in CSS files. 210 | + Shorten values from 0.8em to .8em in CSS files. 211 | + Added support for Internet Explorer's conditional comments in JavaScript 212 | files. Note that the presence of a conditional comment inside a function 213 | (i.e. not in the global scope) will reduce the level of compression for the 214 | same reason the use of 'eval' or 'with' reduces the level of compression 215 | (conditional comments, which do not get parsed, may refer to local variables, 216 | which get obfuscated) In any case, the use of Internet Explorer's conditional 217 | comment is to be avoided. 218 | 219 | YUI Compressor 2.1.2 220 | -------------------- 221 | 222 | + Added --preserve-semi option 223 | + Modified --line-break option 224 | 225 | YUI Compressor 2.1.1 226 | -------------------- 227 | 228 | + Fixed missing space in CSS background:url('foo.png')no-repeat 229 | causing a background not to appear on Internet Explorer. 230 | 231 | YUI Compressor 2.1 232 | ------------------ 233 | 234 | + Pass the --line-break option to the CSS compressor. 235 | + Allow the output file to overwrite the input file (with version 2.0, 236 | in this case, the output file was always empty) 237 | + Remove spaces before and after '(' and ')' as in background:url('xxx'); 238 | + Merge (if possible) string literals that are appended in JavaScript files. 239 | This not only makes the code smaller, it makes the code faster, 240 | but allows you to maintain some readability in your source code. 241 | + Handle constructs such as a + ++ b or a + + "1" (in which case the 242 | space between the operators must be kept!) and other similar cases... 243 | + Pass ErrorReporter instance to the constructor of class JavaScriptCompressor 244 | (as suggested by David Bernard for his integration of the YUI Compressor 245 | as a maven plugin) 246 | 247 | YUI Compressor 2.0 248 | ------------------ 249 | 250 | + Switched from Rhino 1.6R6 to Rhino 1.6R7 251 | + Integrated Isaac Schlueter's CSS compressor. 252 | + Refactored code to make it easier to use the compressor from a servlet 253 | environment or another Java app (no need to pass in file names anymore) 254 | + Output a white-space character after 'throw' only when necessary. 255 | + Output a white-space character after 'break' and 'continue' when followed 256 | by a label. 257 | 258 | YUI Compressor 1.1 259 | ------------------ 260 | 261 | + Java source now in package com.yahoo.platform.yui.compressor 262 | + Added --line-break option that adds a line feed character after each 263 | semi-colon character (may help debugging with the MS Script debugger) 264 | + Added support for missing JavaScript features (get, set, const) 265 | + Do not show the entire stack trace when the input file cannot be found. 266 | + Removed the randomization of obfuscated symbols. When compressed code is 267 | checked in CVS, unchanged files would otherwise end up being versioned. 268 | + Added web-based front-end to the YUI Compressor as part of the dist package. 269 | + Added a public entry point that makes the YUI Compressor easy to integrate 270 | with an already existing Java application. 271 | + Simplified code by using the same parsing routines used to build the symbol 272 | tree while looking for undeclared symbols. 273 | + Count how many times each identifier is used, and display a warning when an 274 | identifier seems to be unused (code cannot safely be removed automatically) 275 | + Remove ';' when followed by a '}'. This yields an additional ~1.5% savings 276 | on yahoo-dom-event.js compared to the JSMin version. 277 | + Output a white-space character after 'return' and 'case' only when necessary. 278 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | YUI Compressor Docs 2 | =================== 3 | 4 | 5 | These docs are what powers http://yui.github.com/yuicompressor 6 | 7 | They are powered by [Selleck](http://yui.github.com/selleck). 8 | 9 | ```terminal 10 | $ npm -g install selleck 11 | ``` 12 | 13 | How to build them 14 | ----------------- 15 | 16 | ```terminal 17 | $ git clone git://github.com/yui/yuicompressor.git 18 | $ git clone git://github.com/yui/yuicompressor.git yuicompressor-pages 19 | 20 | cd yuicompressor-pages 21 | git fetch 22 | git checkout -t gh-pages 23 | ``` 24 | 25 | This should pull the `gh-pages` branch locally. 26 | 27 | ```terminal 28 | cd ../yuicompressor/docs/ 29 | selleck -o ../../yuicompressor-pages/ 30 | ``` 31 | 32 | Done! 33 | -------------------------------------------------------------------------------- /docs/css.mustache: -------------------------------------------------------------------------------- 1 |

2 | This document describes how the CSS minification part of the YUICompressor works. 3 |

4 |

CSS minifications

5 | 6 |

7 | This section describes the various ways that YUICompressor makes your CSS smaller. 8 |

9 | 10 |

Stripping comments and white space

11 |

12 | YUICompressor strips all the comments and white space that are not required 13 | for the CSS to work. 14 |

15 | 16 |

Before the minification:

17 | 18 | ``` 19 | /***** 20 | Multi-line comment 21 | before a new class name 22 | *****/ 23 | .classname { 24 | /* comment in declaration block */ 25 | font-weight: normal; 26 | } 27 | ``` 28 |

After the minification:

29 | 30 | ``` 31 | .classname{font-weight:normal} 32 | ``` 33 |

Special comments

34 | 35 |

36 | Stripping comments is not always acceptable. 37 | Sometimes you need to retain copyright information. 38 | You can use ! at the beginning of the comment to mark the comment as special 39 | and it will be preserved. 40 |

41 | 42 |

Before:

43 | 44 | ``` 45 | /*! 46 | (c) Very Important Comment 47 | */ 48 | .classname { 49 | /* comment in declaration block */ 50 | font-weight: normal; 51 | } 52 | ``` 53 |

After:

54 | 55 | ``` 56 | /*! 57 | (c) Very Important Comment 58 | */.classname{font-weight:normal} 59 | ``` 60 | 61 |

62 | The ! character itself is also preserved. This way you can safely double-minify the same file (probably by mistake). 63 | That also allows when reviewing the code (manually or with tools) to see ! 64 | and conclude that this comment is there intentionally, not because you forgot to minify the CSS. 65 |

66 | 67 |

Striping last semi-colon

68 | 69 |

70 | The last semi-colon in a declaration block is not needed. 71 | You can keep it in your source for maintenance purposes and 72 | let the minifier take care of stripping it out before the site goes live. 73 |

74 | 75 |

Before:

76 | 77 | ``` 78 | .classname { 79 | border-top: 1px; 80 | border-bottom: 2px; 81 | } 82 | ``` 83 | 84 |

After:

85 | 86 | ``` 87 | .classname{border-top:1px;border-bottom:2px} 88 | ``` 89 | 90 | 91 |

Extra semi-colons

92 | 93 |

Only one semi-colon is required to separate rules, so the minifier will strip an accidentally added one.

94 | 95 |

Before:

96 | 97 | ``` 98 | .classname { 99 | border-top: 1px; ; 100 | border-bottom: 2px;;; 101 | } 102 | ``` 103 | 104 |

After:

105 | 106 | ``` 107 | .classname{border-top:1px;border-bottom:2px} 108 | ``` 109 | 110 |

No empty declarations

111 | 112 |

113 | Empty declaration blocks don't contribute to the way the stylesheets work, 114 | so they can safely be removed. 115 |

116 | 117 |

Before:

118 | 119 | ``` 120 | .empty { ;} 121 | .nonempty {border: 0;} 122 | ``` 123 | 124 |

After:

125 | 126 | ``` 127 | .nonempty{border:0} 128 | ``` 129 | 130 |

Zero values

131 | 132 |

133 | When using zero values, the units of measure are not required, so the YUICompressor will strip them. 134 | Additionally, when you have two, three of four zeros in margins and paddings, they can be reduced to one. 135 |

136 | 137 |

Before:

138 | ``` 139 | a { 140 | margin: 0px 0pt 0em 0%; 141 | background-position: 0 0ex; 142 | padding: 0in 0cm 0mm 0pc 143 | } 144 | ``` 145 | 146 |

After:

147 | 148 | 149 | ``` 150 | a{margin:0;background-position:0 0;padding:0} 151 | ``` 152 | 153 |

Floats

154 | 155 |

156 | When a value is using a floating point number smaller than 1, the leading 0 is not required. 157 |

158 | 159 |

Before:

160 | 161 | ``` 162 | .classname { 163 | margin: 0.6px 0.333pt 1.2em 8.8cm; 164 | } 165 | ``` 166 | 167 |

After:

168 | 169 | ``` 170 | .classname{margin:.6px .333pt 1.2em 8.8cm} 171 | ``` 172 | 173 |

Colors values

174 | 175 |

176 | RGB color values are easier to read, but the hex values are shorter, so YUICompressor will use the 177 | more concise form. 178 | 179 | Addiotionally, colors that follow the pattern #AABBCC can be reduced to #ABC, except when used 180 | in IE filter values. 181 | 182 |

Before:

183 | 184 | ``` 185 | .color-me { 186 | color: rgb(123, 123, 123); 187 | border-color: #ffeedd; 188 | background: none repeat scroll 0 0 rgb(255, 0,0); 189 | } 190 | ``` 191 | 192 |

After:

193 | 194 | ``` 195 | .color-me{color:#7b7b7b;border-color:#fed;background:none repeat scroll 0 0 #f00} 196 | ``` 197 | 198 |

Before:

199 | 200 | ``` 201 | .cantouch { 202 | color: rgba(1, 2, 3, 4); 203 | filter: chroma(color="#FFFFFF"); 204 | } 205 | ``` 206 | 207 |

After (no color minification):

208 | 209 | ``` 210 | .cantouch{color:rgba(1,2,3,4);filter:chroma(color="#FFFFFF")} 211 | ``` 212 | 213 |

Single charsets

214 | 215 |

216 | Only one charset declaration is allowed per stylesheet, but sometimes when automatically merging 217 | stylesheets into one to reduce HTTP requests, 218 | you may end up with more than one charset. 219 | YUICompressor will keep only the first. 220 |

221 | 222 |

Before:

223 | 224 | ``` 225 | @charset "utf-8"; 226 | #foo { 227 | border-width: 1px; 228 | } 229 | 230 | /* second css, merged */ 231 | @charset "another one"; 232 | #bar { 233 | border-width: 10px; 234 | } 235 | ``` 236 | 237 |

After:

238 | 239 | ``` 240 | @charset "utf-8";#foo{border-width:1px}#bar{border-width:10px} 241 | ``` 242 | 243 | 244 |

Alpha opacity

245 | 246 |

247 | The opacity filter in IE has a verbose syntax, 248 | which can be shortened using the IE4 syntax 249 |

250 | 251 |

Before:

252 | 253 | ``` 254 | .classname { 255 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE 8 */ 256 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); /* IE < 8 */ 257 | } 258 | ``` 259 |

After:

260 | 261 | ``` 262 | .classname{-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)} 263 | ``` 264 | 265 |

Shorter `none` values

266 | 267 |

268 | For some properties `none` and `0` 269 | have the same meaning. Instances of "none" are converted to 0 where 270 | applicable and safe to do so. 271 |

272 | 273 |

Before:

274 | 275 | ``` 276 | .classname { 277 | border: none; 278 | background: none; 279 | outline: none; 280 | } 281 | ``` 282 | 283 |

After:

284 | 285 | ``` 286 | .classname{border:0;background:0;outline:0} 287 | ``` 288 | 289 |

CSS hacks tolerance

290 | 291 |

292 | When stripping comments and performing other minification tasks, 293 | the YUICompressor keeps an eye on preserving common CSS hacks. 294 | CSS hacks often use parsing glitches in browsers to provide some extra declarations 295 | (or hide some) from specific browser versions. 296 |

297 | 298 |

299 | This section describes the hacks that are tolerated by the YUICompressor. 300 |

301 | 302 | 303 |

Underscore/star hack

304 | 305 |

306 | Using _ and * to prefix CSS properties is a simple way to target IE6 and IE7. 307 |

308 | 309 |

310 | Since YUICompressor uses a regular expression based CSS minifier and doesn't validate CSS properties, 311 | it can accept pretty much any property. Therefore this hack is preserved. 312 |

313 | 314 |

Before:

315 | 316 | ``` 317 | #element { 318 | width: 1px; 319 | *width: 2px; 320 | _width: 3px; 321 | } 322 | ``` 323 | 324 |

After:

325 | 326 | ``` 327 | #element{width:1px;*width:3pt;_width:2em} 328 | ``` 329 | 330 |

Child selector hack

331 | 332 |

The child selector hack allows developers to hide declarations from IE7 and below using an empty comment.

333 | 334 |

335 | YUICompressor strips comments but will make an exception and retain empty comments that 336 | immediately follow the `>` character. 337 |

338 | 339 |

Before:

340 | 341 | ``` 342 | html >/**/ body p { 343 | color: blue; 344 | } 345 | ``` 346 | 347 |

After:

348 | 349 | ``` 350 | html>/**/body p{color:blue} 351 | ``` 352 | 353 |

IE5/Mac hack

354 | 355 |

356 | There is a hack that targets IE5/Mac using a bug when parsing comments. 357 |

358 | 359 |

360 | YUICompressor retains comments that look like they are using this hack, but it minifies the comments needed by the hack. 361 |

362 | 363 |

Before:

364 | 365 | ``` 366 | /* Ignore the next rule in IE mac \*/ 367 | .selector { 368 | color: khaki; 369 | } 370 | /* Stop ignoring in IE mac */ 371 | ``` 372 | 373 |

After:

374 | 375 | ``` 376 | /*\*/.selector{color:khaki}/**/ 377 | ``` 378 | 379 |

Box model hack

380 | 381 |

This hack uses valid CSS and there's no special use of comments so it's retained.

382 | 383 |

Before:

384 | 385 | ``` 386 | #elem { 387 | width: 100px; /* IE */ 388 | voice-family: "\"}\""; 389 | voice-family:inherit; 390 | width: 200px; /* others */ 391 | } 392 | html>body #elem { 393 | width: 200px; /* others */ 394 | } 395 | ``` 396 | 397 |

After:

398 | 399 | ``` 400 | #elem{width:100px;voice-family:"\"}\"";voice-family:inherit;width:200px}html>body #elem{width:200px} 401 | ``` 402 | 403 | 404 |

Running and contributing tests

405 | 406 |

407 | When reporting bugs, it's greatly appreciated if you can provide a test case. 408 | In order to create a test you can use your version of the compressor or build it from source. 409 |

410 | 411 |
    412 |
  1. 413 | Checkout or download the code from http://github.com/yui/yuicompressor/. 414 | You need the code even if you don't intend to build the tool yourself, because that's where the tests 415 | and the test runner are. 416 |
  2. 417 |
  3. Navigate to the root `yuicompressor/` directory
  4. 418 |
  5. Type `ant` and hit enter
  6. 419 |
420 |

421 | In order for this to work you need a recent Java SDK installed (at least 1.4) and 422 | also Ant running. 423 | (On the Mac, you can simply do `port install apache-ant` to get Ant)

424 | 425 |

426 | There are a number of tests in the `tests/` directory, 427 | you can run them with the suite script:

428 | 429 | ```terminal 430 | cd tests/ 431 | ./suite.sh 432 | ``` 433 | 434 |

435 | This command will also run the tests using the JavaScript port of the minifier. 436 | Since the compressor is using Mozilla's Rhino (slightly modified), 437 | Rhino is part of the code. 438 | So it can be used as a JavaScript interpreter to run the JavaScript port.

439 | 440 |

The procedure to write new tests is as follows:

441 |
    442 |
  1. Create source CSS file in the `tests/` directory, e.g. `new-test.css`
  2. 443 |
  3. Create a new file with the expected result and name it with a `.min` extension, e.g. `new-test.css.min`
  4. 444 |
445 | 446 |

JavaScript port

447 | 448 |

449 | The YUICompressor is written in Java, however there's a JavaScript port of the CSS minification part, 450 | which is available separately. 451 |

452 | 453 |

454 | There is a Node.js module for cssmin using the JavaScript port of our minifier. 455 | It can be installed with: 456 |

457 | 458 | ```terminal 459 | $ npm install cssmin 460 | ``` 461 | -------------------------------------------------------------------------------- /docs/index.mustache: -------------------------------------------------------------------------------- 1 |

2 | According to Yahoo!'s Exceptional Performance Team, 3 | 40% to 60% of Yahoo!'s users have an empty cache experience and about 20% of all page views are done with an empty cache 4 | (see this article by Tenni Theurer on the YUIBlog for more 5 | information on browser cache usage). This fact outlines the importance of keeping web pages as lightweight as possible. 6 | Improving the engineering design of a page or a web application usually yields the biggest savings and that should always be a primary strategy. With the right design in place, there are many secondary strategies for improving performance such as minification of the code, HTTP compression, using CSS sprites, etc. 7 |

8 |

9 | In terms of code minification, the most widely used tools to minify JavaScript code are Douglas Crockford's 10 | JSMIN, 11 | the Dojo compressor and Dean Edwards' 12 | Packer. Each of these tools, however, has drawbacks. 13 | JSMIN, for example, does not yield optimal savings (due to its simple algorithm, it must leave many line feed characters in 14 | the code in order not to introduce any new bugs).

15 |

16 | The goal of JavaScript and CSS minification is always to preserve the operational qualities of the code while reducing its overall byte footprint (both in raw terms and after gzipping, as most JavaScript and CSS served from production web servers is gzipped as part of the HTTP protocol). The YUI Compressor is JavaScript minifier designed to be 100% safe and yield a higher compression ratio than most other tools. Tests on the YUI Library have shown savings of over 20% compared to JSMin (becoming 10% after HTTP compression). 17 | The YUI Compressor is also able to compress CSS files by using a port of Isaac Schlueter's regular-expression-based CSS minifier. 18 |

19 | 20 |

Quick Links

21 | 28 | 29 |

Video: Yahoo engineer Julien Lecomte introduces the YUI Compressor

30 | 31 |

32 | 33 |

How does the YUI Compressor work?

34 | 35 |

36 | The YUI Compressor is written in Java (requires Java >= 1.4) 37 | and relies on Rhino to tokenize the source JavaScript file. 38 | It starts by analyzing the source JavaScript file to understand how it is structured. It then prints out the token stream, 39 | omitting as many white space characters as possible, and replacing all local symbols by a 1 (or 2, or 3) letter symbol 40 | wherever such a substitution is appropriate (in the face of 41 | evil features such as eval or 42 | with, the YUI Compressor takes a defensive approach by not obfuscating any of the scopes containing the evil 43 | statement) The CSS compression algorithm uses a set of finely tuned regular expressions to compress the source CSS file. 44 | The YUI Compressor is open-source, so don't hesitate to look at the code to understand exactly how it works. 45 |

46 | 47 |

Using the YUI Compressor from the command line

48 | 49 | ```terminal 50 | $ java -jar yuicompressor-x.y.z.jar 51 | Usage: java -jar yuicompressor-x.y.z.jar [options] [input file] 52 | 53 | Global Options 54 | -h, --help Displays this information 55 | --type <js|css> Specifies the type of the input file 56 | --charset <charset> Read the input file using <charset> 57 | --line-break <column> Insert a line break after the specified column number 58 | -v, --verbose Display informational messages and warnings 59 | -o <file> Place the output into or a file pattern. 60 | Defaults to stdout. 61 | 62 | JavaScript Options 63 | --nomunge Minify only, do not obfuscate 64 | --preserve-semi Preserve all semicolons 65 | --disable-optimizations Disable all micro optimizations 66 | 67 | GLOBAL OPTIONS 68 | 69 | -h, --help 70 | Prints help on how to use the YUI Compressor 71 | 72 | --line-break 73 | Some source control tools don't like files containing lines longer than, 74 | say 8000 characters. The linebreak option is used in that case to split 75 | long lines after a specific column. It can also be used to make the code 76 | more readable, easier to debug (especially with the MS Script Debugger) 77 | Specify 0 to get a line break after each semi-colon in JavaScript, and 78 | after each rule in CSS. 79 | 80 | --type js|css 81 | The type of compressor (JavaScript or CSS) is chosen based on the 82 | extension of the input file name (.js or .css) This option is required 83 | if no input file has been specified. Otherwise, this option is only 84 | required if the input file extension is neither 'js' nor 'css'. 85 | 86 | --charset character-set 87 | If a supported character set is specified, the YUI Compressor will use it 88 | to read the input file. Otherwise, it will assume that the platform's 89 | default character set is being used. The output file is encoded using 90 | the same character set. 91 | 92 | -o outfile 93 | 94 | Place output in file outfile. If not specified, the YUI Compressor will 95 | default to the standard output, which you can redirect to a file. 96 | Supports a filter syntax for expressing the output pattern when there are 97 | multiple input files. ex: 98 | java -jar yuicompressor.jar -o '.css$:-min.css' *.css 99 | ... will minify all .css files and save them as -min.css 100 | 101 | -v, --verbose 102 | Display informational messages and warnings. 103 | 104 | JAVASCRIPT ONLY OPTIONS 105 | 106 | --nomunge 107 | Minify only. Do not obfuscate local symbols. 108 | 109 | --preserve-semi 110 | Preserve unnecessary semicolons (such as right before a '}') This option 111 | is useful when compressed code has to be run through JSLint (which is the 112 | case of YUI for example) 113 | 114 | --disable-optimizations 115 | Disable all the built-in micro optimizations. 116 | ``` 117 | 118 |

Note: If no input file is specified, it defaults to stdin.

119 | 120 |

The following command line (x.y.z represents the version number):

121 | 122 | ```terminal 123 | $ java -jar yuicompressor-x.y.z.jar myfile.js -o myfile-min.js 124 | ``` 125 | 126 |

will minify the file `myfile.js` and output the file `myfile-min.js`. 127 | For more information on how to use the YUI Compressor, please refer to the documentation 128 | included in the archive.

129 | 130 |

The charset parameter isn't always required, but the compressor may throw an error 131 | if the file's encoding is incompatible with the system's default encoding. In particular, 132 | if your file is encoded in utf-8, you should supply the parameter.

133 | 134 | ```terminal 135 | $ java -jar yuicompressor-x.y.z.jar myfile.js -o myfile-min.js --charset utf-8 136 | ``` 137 | 138 |

Additional notes

139 | 140 | 153 | 154 |

Support & Community

155 |

The YUI Library and related topics are discussed on the on the YUILibrary.com forums.

156 | 157 |

Also be sure to check out YUIBlog for updates and articles about the YUI Library written by the library's developers.

158 | 159 |

Filing Bugs & Feature Requests

160 | 161 |

YUICompressor uses Github Issues to track issues.

162 | 163 |

More Reading about JavaScript/CSS minification and the YUI Compressor

164 | 175 | -------------------------------------------------------------------------------- /docs/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "YUI Compressor" 3 | } 4 | -------------------------------------------------------------------------------- /lib/jargs-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yui/yuicompressor/cf0497e53fffe4ddbd50e71518c40e0c07d120de/lib/jargs-1.0.jar -------------------------------------------------------------------------------- /lib/rhino-1.7R2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yui/yuicompressor/cf0497e53fffe4ddbd50e71518c40e0c07d120de/lib/rhino-1.7R2.jar -------------------------------------------------------------------------------- /maven_central/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.4.9 4 | 1.7R2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Done. Upload the bundle in build/ to https://oss.sonatype.org 51 | 52 | 53 | -------------------------------------------------------------------------------- /maven_central/template/pom.xml.template: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 4.0.0 8 | com.yahoo.platform.yui 9 | yuicompressor 10 | @YUI_VERSION@ 11 | jar 12 | 13 | yui compressor 14 | http://developer.yahoo.com/yui/compressor/ 15 | 16 | 17 | The YUI Compressor is a JavaScript compressor which, in addition to removing 18 | comments and white-spaces, obfuscates local variables using the smallest 19 | possible variable name. This obfuscation is safe, even when using constructs 20 | such as 'eval' or 'with' (although the compression is not optimal is those 21 | cases) Compared to jsmin, the average savings is around 20%. 22 | 23 | 24 | 25 | 26 | BSD License 27 | http://developer.yahoo.com/yui/license.html 28 | repo 29 | 30 | 31 | 32 | 33 | 34 | yui-compressor-forum 35 | http://yuilibrary.com/forum/viewforum.php?f=94/ 36 | 37 | 38 | 39 | 40 | scm:git:git://github.com/yui/yuicompressor.git 41 | http://github.com/yui/yuicompressor 42 | 43 | 44 | 45 | 46 | julienlecomte 47 | Julien Lecomte 48 | 49 | 50 | isaacs 51 | Isaac Z. Schlueter 52 | 53 | 54 | 55 | 56 | 57 | rhino 58 | js 59 | @RHINO_VERSION@ 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /nodejs/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Just a simple nodejs wrapper around the .jar file 5 | for easy CLI use 6 | */ 7 | 8 | var kexec = require('kexec'), 9 | fs = require('fs'), 10 | compressor = require('./index'), 11 | args = process.argv.slice(2); 12 | 13 | args.unshift(compressor.jar); 14 | args.unshift('-jar'); 15 | args.unshift('java'); 16 | kexec(args.join(' ')); 17 | -------------------------------------------------------------------------------- /nodejs/index.js: -------------------------------------------------------------------------------- 1 | 2 | var spawn = require('child_process').spawn, 3 | fs = require('fs'), 4 | path = require('path'), 5 | jar, 6 | exists = fs.exists || path.exists, 7 | lists = fs.readdirSync(path.join(__dirname, '../build')); 8 | 9 | lists.some(function(item) { 10 | if (path.extname(item) === '.jar') { 11 | jar = path.join(__dirname, '../build/', item); 12 | return true; 13 | } 14 | }); 15 | 16 | exports.jar = jar; 17 | 18 | var defaultOptions = { 19 | charset: 'utf8', 20 | type: 'js' 21 | }; 22 | 23 | var validOptions = { 24 | charset: 1, 25 | type: 1, 26 | 'line-break': 1, 27 | nomunge: 1, 28 | 'preserve-semi': 1, 29 | 'disable-optimizations': 1 30 | }; 31 | 32 | var getString = function(str, callback, options) { 33 | exists(str, function(y) { 34 | if (y) { 35 | var ext = (path.extname(str)).replace('.', ''); 36 | fs.readFile(str, 'utf8', function(err, data) { 37 | //Set the type from the file name 38 | options.type = ext; 39 | callback(err, data, options); 40 | }); 41 | } else { 42 | callback(null, str, options); 43 | } 44 | }); 45 | }; 46 | 47 | 48 | var filterOptions = function(options) { 49 | Object.keys(options).forEach(function(key) { 50 | if (!validOptions[key]) { 51 | delete options[key]; 52 | } 53 | }); 54 | 55 | options.type = options.type || 'js'; 56 | options.charset = options.charset || 'utf8'; 57 | return options; 58 | }; 59 | 60 | var compressString = function(str, options, callback) { 61 | //Now we have a string, spawn and pipe it in. 62 | 63 | options = filterOptions(options); 64 | 65 | var args = [ 66 | '-jar', 67 | exports.jar 68 | ], buffer = '', errBuffer = '', child; 69 | 70 | Object.keys(options).forEach(function(key) { 71 | args.push('--' + key); 72 | if (options[key] && options[key] !== true) { 73 | args.push(options[key]); 74 | } 75 | }); 76 | 77 | child = spawn('java', args, { 78 | stdio: ['pipe', 'pipe', 'pipe'] 79 | }); 80 | 81 | child.stdin.write(str); 82 | child.stdin.end(); 83 | 84 | child.stdout.on('data', function(chunk) { 85 | buffer += chunk; 86 | }); 87 | child.stderr.on('data', function(chunk) { 88 | errBuffer += chunk; 89 | }); 90 | 91 | child.on('exit', function() { 92 | var err = null; 93 | if (errBuffer.indexOf('[ERROR]') > -1) { 94 | err = errBuffer; 95 | } 96 | callback(err, buffer, errBuffer); 97 | }); 98 | }; 99 | 100 | var compress = function(str, options, callback) { 101 | if (typeof options === 'function') { 102 | callback = options; 103 | options = defaultOptions; 104 | } 105 | 106 | getString(str, function(err, str, options) { 107 | 108 | compressString(str, options, callback); 109 | 110 | }, options); 111 | }; 112 | 113 | exports.compress = compress; 114 | exports.compressString = compressString; 115 | -------------------------------------------------------------------------------- /nodejs_tests/tests.js: -------------------------------------------------------------------------------- 1 | var YUITest = require('yuitest'), 2 | Assert = YUITest.Assert, 3 | suite = new YUITest.TestSuite('YUICompressor Tests'), 4 | path = require('path'), 5 | fs = require('fs'), 6 | compressor = require('../nodejs/index'), 7 | exists = fs.existsSync || path.existsSync; 8 | 9 | 10 | var base = path.join(__dirname, '../tests'); 11 | var files = fs.readdirSync(base); 12 | var testFiles = []; 13 | 14 | files.forEach(function(file) { 15 | var ext = path.extname(file); 16 | if (ext === '.js' || ext === '.css') { 17 | var comp = path.join(base, file + '.min'); 18 | if (exists(comp)) { 19 | testFiles.push({ 20 | type: ext.replace('.', ''), 21 | test: file, 22 | result: (fs.readFileSync(path.join(base, file + '.min'), 'utf8')).trim() 23 | }); 24 | } 25 | } 26 | }); 27 | 28 | testFiles.forEach(function(item) { 29 | suite.add(new YUITest.TestCase({ 30 | name: item.test, 31 | 'test: compress': function() { 32 | var test = this; 33 | compressor.compress(path.join(base, item.test), { 34 | type: item.type, 35 | charset: 'utf8' 36 | }, function(err, out) { 37 | test.resume(function() { 38 | Assert.isNull(err, 'error object should be null'); 39 | Assert.areEqual(out, item.result, 'Failed to properly compress'); 40 | }); 41 | }); 42 | test.wait(); 43 | } 44 | })); 45 | 46 | }); 47 | 48 | suite.add(new YUITest.TestCase({ 49 | name: 'Others', 50 | 'test: error no file': function() { 51 | var test = this; 52 | compressor.compress('/path/to/no/file', function(err, data) { 53 | test.resume(function() { 54 | Assert.areEqual(data, '', 'should not return data'); 55 | Assert.isTrue(err.indexOf('[ERROR]') > -1, 'should have [ERROR] in string'); 56 | }); 57 | }); 58 | test.wait(); 59 | }, 60 | 'test: string to compress': function() { 61 | var test = this, 62 | given = 'var x = (function() { var foo = 1, bar = 2; return (foo + bar) }())', 63 | expected = 'var x=(function(){var b=1,a=2;return(b+a)}());'; 64 | compressor.compress(given, function(err, data) { 65 | test.resume(function() { 66 | Assert.isNull(err, 'error object should be null'); 67 | Assert.areEqual(data, expected, 'failed to compress string'); 68 | }); 69 | }); 70 | test.wait(); 71 | } 72 | })); 73 | 74 | var expectedYUI = fs.readFileSync(path.join(__dirname, 'files', 'yui.js.min'), 'utf8'); 75 | 76 | suite.add(new YUITest.TestCase({ 77 | name: 'Large file support', 78 | 'test compress yui.js as file': function() { 79 | var test = this; 80 | compressor.compress(path.join(__dirname, 'files', 'yui.js'), function(err, data) { 81 | test.resume(function() { 82 | Assert.isNull(err, 'error object should be null'); 83 | Assert.areEqual(data, expectedYUI, 'failed to minify a large file'); 84 | }); 85 | }); 86 | test.wait(); 87 | }, 88 | 'test compress yui.js as string': function() { 89 | var test = this, 90 | given = fs.readFileSync(path.join(__dirname, 'files', 'yui.js'), 'utf8'); 91 | 92 | compressor.compress(given, function(err, data) { 93 | test.resume(function() { 94 | Assert.isNull(err, 'error object should be null'); 95 | Assert.areEqual(data, expectedYUI, 'failed to minify a large file'); 96 | }); 97 | }); 98 | test.wait(); 99 | } 100 | })); 101 | 102 | YUITest.TestRunner.add(suite); 103 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yuicompressor", 3 | "description": "YUICompressor CLI and Node.js require", 4 | "version": "2.4.9", 5 | "author": "Julien Lecomte ", 6 | "contributors": [ 7 | { 8 | "name" : "Dav Glass", 9 | "email" : "davglass@gmail.com" 10 | }, { 11 | "name" : "Joey Smith", 12 | "email" : "joeysmith@gmail.com" 13 | }, { 14 | "name" : "Stoyan Stefanov", 15 | "email" : "assttoo@ymail.com" 16 | }, { 17 | "name" : "Eric Arnol-Martin", 18 | "email" : "earnolmartin@gmail.com" 19 | } 20 | ], 21 | "bugs": { "url" : "http://yuilibrary.com/projects/yuicompressor/newticket" }, 22 | "dependencies": { 23 | "kexec": "~0.2.0" 24 | }, 25 | "devDependencies": { 26 | "yuitest": "*" 27 | }, 28 | "keywords": [ 29 | "yui", "compressor", "munger", "cssmin", "minify", "minification" 30 | ], 31 | "main": "./nodejs/index.js", 32 | "bin": { 33 | "yuicompressor": "./nodejs/cli.js" 34 | }, 35 | "files": [ 36 | "build/*.jar", 37 | "nodejs" 38 | ], 39 | "scripts": { 40 | "test": "yuitest ./nodejs_tests/tests.js" 41 | }, 42 | "licenses":[ 43 | { 44 | "type" : "BSD", 45 | "url" : "http://yuilibrary.com/license/" 46 | } 47 | ], 48 | "repository": { 49 | "type":"git", 50 | "url":"https://github.com/yui/yuicompressor" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/com/yahoo/platform/yui/compressor/Bootstrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * YUI Compressor 3 | * http://developer.yahoo.com/yui/compressor/ 4 | * Author: Julien Lecomte - http://www.julienlecomte.net/ 5 | * Copyright (c) 2011 Yahoo! Inc. All rights reserved. 6 | * The copyrights embodied in the content of this file are licensed 7 | * by Yahoo! Inc. under the BSD (revised) open source license. 8 | */ 9 | 10 | package com.yahoo.platform.yui.compressor; 11 | 12 | import java.lang.reflect.Method; 13 | 14 | public class Bootstrap { 15 | 16 | public static void main(String args[]) throws Exception { 17 | ClassLoader loader = new JarClassLoader(); 18 | Thread.currentThread().setContextClassLoader(loader); 19 | Class c = loader.loadClass(YUICompressor.class.getName()); 20 | Method main = c.getMethod("main", new Class[]{String[].class}); 21 | main.invoke(null, new Object[]{args}); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/com/yahoo/platform/yui/compressor/JarClassLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * YUI Compressor 3 | * http://developer.yahoo.com/yui/compressor/ 4 | * Author: Julien Lecomte - http://www.julienlecomte.net/ 5 | * Copyright (c) 2011 Yahoo! Inc. All rights reserved. 6 | * The copyrights embodied in the content of this file are licensed 7 | * by Yahoo! Inc. under the BSD (revised) open source license. 8 | */ 9 | package com.yahoo.platform.yui.compressor; 10 | 11 | import java.io.ByteArrayOutputStream; 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.io.OutputStream; 15 | import java.util.Enumeration; 16 | import java.util.jar.JarEntry; 17 | import java.util.jar.JarFile; 18 | 19 | public class JarClassLoader extends ClassLoader { 20 | 21 | private static String jarPath; 22 | 23 | public Class loadClass(String name) throws ClassNotFoundException { 24 | 25 | // First check if the class is already loaded 26 | Class c = findLoadedClass(name); 27 | if (c == null) { 28 | c = findClass(name); 29 | } 30 | 31 | if (c == null) { 32 | c = ClassLoader.getSystemClassLoader().loadClass(name); 33 | } 34 | 35 | return c; 36 | } 37 | 38 | private static String getJarPath() { 39 | 40 | if (jarPath != null) { 41 | return jarPath; 42 | } 43 | 44 | String classname = JarClassLoader.class.getName().replace('.', '/') + ".class"; 45 | String classpath = System.getProperty("java.class.path"); 46 | String classpaths[] = classpath.split(System.getProperty("path.separator")); 47 | 48 | for (int i = 0; i < classpaths.length; i++) { 49 | 50 | String path = classpaths[i]; 51 | JarFile jarFile = null; 52 | JarEntry jarEntry = null; 53 | 54 | try { 55 | jarFile = new JarFile(path); 56 | jarEntry = findJarEntry(jarFile, classname); 57 | } catch (IOException ioe) { 58 | /* ignore */ 59 | } finally { 60 | if (jarFile != null) { 61 | try { 62 | jarFile.close(); 63 | } catch (IOException ioe) { 64 | /* ignore */ 65 | } 66 | } 67 | } 68 | 69 | if (jarEntry != null) { 70 | jarPath = path; 71 | break; 72 | } 73 | } 74 | 75 | return jarPath; 76 | } 77 | 78 | private static JarEntry findJarEntry(JarFile jarFile, String entryName) { 79 | 80 | Enumeration entries = jarFile.entries(); 81 | 82 | while (entries.hasMoreElements()) { 83 | JarEntry entry = (JarEntry) entries.nextElement(); 84 | if (entry.getName().equals(entryName)) { 85 | return entry; 86 | } 87 | } 88 | 89 | return null; 90 | } 91 | 92 | protected Class findClass(String name) { 93 | 94 | Class c = null; 95 | String jarPath = getJarPath(); 96 | 97 | if (jarPath != null) { 98 | JarFile jarFile = null; 99 | try { 100 | jarFile = new JarFile(jarPath); 101 | c = loadClassData(jarFile, name); 102 | } catch (IOException ioe) { 103 | /* ignore */ 104 | } finally { 105 | if (jarFile != null) { 106 | try { 107 | jarFile.close(); 108 | } catch (IOException ioe) { 109 | /* ignore */ 110 | } 111 | } 112 | } 113 | } 114 | 115 | return c; 116 | } 117 | 118 | private Class loadClassData(JarFile jarFile, String className) { 119 | 120 | String entryName = className.replace('.', '/') + ".class"; 121 | JarEntry jarEntry = findJarEntry(jarFile, entryName); 122 | if (jarEntry == null) { 123 | return null; 124 | } 125 | 126 | // Create the necessary package if needed... 127 | int index = className.lastIndexOf('.'); 128 | if (index >= 0) { 129 | String packageName = className.substring(0, index); 130 | if (getPackage(packageName) == null) { 131 | definePackage(packageName, "", "", "", "", "", "", null); 132 | } 133 | } 134 | 135 | // Read the Jar File entry and define the class... 136 | Class c = null; 137 | InputStream is = null; 138 | try { 139 | is = jarFile.getInputStream(jarEntry); 140 | ByteArrayOutputStream os = new ByteArrayOutputStream(); 141 | copy(is, os); 142 | byte[] bytes = os.toByteArray(); 143 | c = defineClass(className, bytes, 0, bytes.length); 144 | } catch (IOException ioe) { 145 | /* ignore */ 146 | } finally { 147 | if (is != null) { 148 | try { is.close(); } catch(Exception e) {} 149 | } 150 | } 151 | 152 | return c; 153 | } 154 | 155 | private void copy(InputStream in, OutputStream out) throws IOException { 156 | byte[] buf = new byte[1024]; 157 | while (true) { 158 | int len = in.read(buf); 159 | if (len < 0) break; 160 | out.write(buf, 0, len); 161 | } 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /src/com/yahoo/platform/yui/compressor/JavaScriptIdentifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * YUI Compressor 3 | * http://developer.yahoo.com/yui/compressor/ 4 | * Author: Julien Lecomte - http://www.julienlecomte.net/ 5 | * Copyright (c) 2011 Yahoo! Inc. All rights reserved. 6 | * The copyrights embodied in the content of this file are licensed 7 | * by Yahoo! Inc. under the BSD (revised) open source license. 8 | */ 9 | package com.yahoo.platform.yui.compressor; 10 | 11 | import org.mozilla.javascript.Token; 12 | 13 | /** 14 | * JavaScriptIdentifier represents a variable/function identifier. 15 | */ 16 | class JavaScriptIdentifier extends JavaScriptToken { 17 | 18 | private int refcount = 0; 19 | private String mungedValue; 20 | private ScriptOrFnScope declaredScope; 21 | private boolean markedForMunging = true; 22 | 23 | JavaScriptIdentifier(String value, ScriptOrFnScope declaredScope) { 24 | super(Token.NAME, value); 25 | this.declaredScope = declaredScope; 26 | } 27 | 28 | ScriptOrFnScope getDeclaredScope() { 29 | return declaredScope; 30 | } 31 | 32 | void setMungedValue(String value) { 33 | mungedValue = value; 34 | } 35 | 36 | String getMungedValue() { 37 | return mungedValue; 38 | } 39 | 40 | void preventMunging() { 41 | markedForMunging = false; 42 | } 43 | 44 | boolean isMarkedForMunging() { 45 | return markedForMunging; 46 | } 47 | 48 | void incrementRefcount() { 49 | refcount++; 50 | } 51 | 52 | int getRefcount() { 53 | return refcount; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/com/yahoo/platform/yui/compressor/JavaScriptToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | * YUI Compressor 3 | * http://developer.yahoo.com/yui/compressor/ 4 | * Author: Julien Lecomte - http://www.julienlecomte.net/ 5 | * Copyright (c) 2011 Yahoo! Inc. All rights reserved. 6 | * The copyrights embodied in the content of this file are licensed 7 | * by Yahoo! Inc. under the BSD (revised) open source license. 8 | */ 9 | package com.yahoo.platform.yui.compressor; 10 | 11 | public class JavaScriptToken { 12 | 13 | private int type; 14 | private String value; 15 | 16 | JavaScriptToken(int type, String value) { 17 | this.type = type; 18 | this.value = value; 19 | } 20 | 21 | int getType() { 22 | return type; 23 | } 24 | 25 | String getValue() { 26 | return value; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/com/yahoo/platform/yui/compressor/ScriptOrFnScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * YUI Compressor 3 | * http://developer.yahoo.com/yui/compressor/ 4 | * Author: Julien Lecomte - http://www.julienlecomte.net/ 5 | * Copyright (c) 2011 Yahoo! Inc. All rights reserved. 6 | * The copyrights embodied in the content of this file are licensed 7 | * by Yahoo! Inc. under the BSD (revised) open source license. 8 | */ 9 | package com.yahoo.platform.yui.compressor; 10 | 11 | import java.util.*; 12 | 13 | class ScriptOrFnScope { 14 | 15 | private int braceNesting; 16 | private ScriptOrFnScope parentScope; 17 | private ArrayList subScopes; 18 | private Hashtable identifiers = new Hashtable(); 19 | private Hashtable hints = new Hashtable(); 20 | private boolean markedForMunging = true; 21 | private int varcount = 0; 22 | 23 | ScriptOrFnScope(int braceNesting, ScriptOrFnScope parentScope) { 24 | this.braceNesting = braceNesting; 25 | this.parentScope = parentScope; 26 | this.subScopes = new ArrayList(); 27 | if (parentScope != null) { 28 | parentScope.subScopes.add(this); 29 | } 30 | } 31 | 32 | int getBraceNesting() { 33 | return braceNesting; 34 | } 35 | 36 | ScriptOrFnScope getParentScope() { 37 | return parentScope; 38 | } 39 | 40 | JavaScriptIdentifier declareIdentifier(String symbol) { 41 | JavaScriptIdentifier identifier = (JavaScriptIdentifier) identifiers.get(symbol); 42 | if (identifier == null) { 43 | identifier = new JavaScriptIdentifier(symbol, this); 44 | identifiers.put(symbol, identifier); 45 | } 46 | return identifier; 47 | } 48 | 49 | JavaScriptIdentifier getIdentifier(String symbol) { 50 | return (JavaScriptIdentifier) identifiers.get(symbol); 51 | } 52 | 53 | void addHint(String variableName, String variableType) { 54 | hints.put(variableName, variableType); 55 | } 56 | 57 | void preventMunging() { 58 | if (parentScope != null) { 59 | // The symbols in the global scope don't get munged, 60 | // but the sub-scopes it contains do get munged. 61 | markedForMunging = false; 62 | } 63 | } 64 | 65 | private ArrayList getUsedSymbols() { 66 | ArrayList result = new ArrayList(); 67 | Enumeration elements = identifiers.elements(); 68 | while (elements.hasMoreElements()) { 69 | JavaScriptIdentifier identifier = (JavaScriptIdentifier) elements.nextElement(); 70 | String mungedValue = identifier.getMungedValue(); 71 | if (mungedValue == null) { 72 | mungedValue = identifier.getValue(); 73 | } 74 | result.add(mungedValue); 75 | } 76 | return result; 77 | } 78 | 79 | private ArrayList getAllUsedSymbols() { 80 | ArrayList result = new ArrayList(); 81 | ScriptOrFnScope scope = this; 82 | while (scope != null) { 83 | result.addAll(scope.getUsedSymbols()); 84 | scope = scope.parentScope; 85 | } 86 | return result; 87 | } 88 | 89 | int incrementVarCount() { 90 | varcount++; 91 | return varcount; 92 | } 93 | 94 | public void getFullMapping(StringBuffer outBuffer, String mungedPrefix) { 95 | Enumeration elements = identifiers.elements(); 96 | while (elements.hasMoreElements()) { 97 | JavaScriptIdentifier identifier = (JavaScriptIdentifier) elements.nextElement(); 98 | String mungedValue = identifier.getMungedValue(); 99 | if (mungedValue == null) { 100 | mungedValue = identifier.getValue(); 101 | } 102 | outBuffer.append(mungedPrefix + mungedValue); 103 | outBuffer.append(": "); 104 | outBuffer.append(identifier.getValue() + "\n"); 105 | } 106 | 107 | for (int i = 0; i < subScopes.size(); i++) { 108 | ScriptOrFnScope scope = (ScriptOrFnScope) subScopes.get(i); 109 | scope.getFullMapping(outBuffer, "\t"+mungedPrefix); 110 | } 111 | } 112 | 113 | void munge() { 114 | 115 | if (!markedForMunging) { 116 | // Stop right here if this scope was flagged as unsafe for munging. 117 | return; 118 | } 119 | 120 | int pickFromSet = 1; 121 | 122 | // Do not munge symbols in the global scope! 123 | if (parentScope != null) { 124 | 125 | LinkedHashSet freeSymbols = new LinkedHashSet(); 126 | 127 | freeSymbols.addAll(JavaScriptCompressor.ones); 128 | freeSymbols.removeAll(getAllUsedSymbols()); 129 | if (freeSymbols.size() == 0) { 130 | pickFromSet = 2; 131 | freeSymbols.addAll(JavaScriptCompressor.twos); 132 | freeSymbols.removeAll(getAllUsedSymbols()); 133 | } 134 | if (freeSymbols.size() == 0) { 135 | pickFromSet = 3; 136 | freeSymbols.addAll(JavaScriptCompressor.threes); 137 | freeSymbols.removeAll(getAllUsedSymbols()); 138 | } 139 | if (freeSymbols.size() == 0) { 140 | throw new IllegalStateException("The YUI Compressor ran out of symbols. Aborting..."); 141 | } 142 | 143 | Enumeration elements = identifiers.elements(); 144 | while (elements.hasMoreElements()) { 145 | if (freeSymbols.size() == 0) { 146 | pickFromSet++; 147 | if (pickFromSet == 2) { 148 | freeSymbols.addAll(JavaScriptCompressor.twos); 149 | } else if (pickFromSet == 3) { 150 | freeSymbols.addAll(JavaScriptCompressor.threes); 151 | } else { 152 | throw new IllegalStateException("The YUI Compressor ran out of symbols. Aborting..."); 153 | } 154 | // It is essential to remove the symbols already used in 155 | // the containing scopes, or some of the variables declared 156 | // in the containing scopes will be redeclared, which can 157 | // lead to errors. 158 | freeSymbols.removeAll(getAllUsedSymbols()); 159 | } 160 | 161 | String mungedValue; 162 | JavaScriptIdentifier identifier = (JavaScriptIdentifier) elements.nextElement(); 163 | if (identifier.isMarkedForMunging()) { 164 | Iterator freeSymIt = freeSymbols.iterator(); 165 | mungedValue = (String) freeSymIt.next(); 166 | freeSymIt.remove(); 167 | } else { 168 | mungedValue = identifier.getValue(); 169 | } 170 | identifier.setMungedValue(mungedValue); 171 | } 172 | } 173 | 174 | for (int i = 0; i < subScopes.size(); i++) { 175 | ScriptOrFnScope scope = (ScriptOrFnScope) subScopes.get(i); 176 | scope.munge(); 177 | } 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /src/com/yahoo/platform/yui/compressor/YUICompressor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * YUI Compressor 3 | * http://developer.yahoo.com/yui/compressor/ 4 | * Author: Julien Lecomte - http://www.julienlecomte.net/ 5 | * Copyright (c) 2011 Yahoo! Inc. All rights reserved. 6 | * The copyrights embodied in the content of this file are licensed 7 | * by Yahoo! Inc. under the BSD (revised) open source license. 8 | */ 9 | package com.yahoo.platform.yui.compressor; 10 | 11 | import jargs.gnu.CmdLineParser; 12 | import org.mozilla.javascript.ErrorReporter; 13 | import org.mozilla.javascript.EvaluatorException; 14 | 15 | import java.io.*; 16 | import java.nio.charset.Charset; 17 | 18 | public class YUICompressor { 19 | 20 | public static void main(String args[]) { 21 | 22 | CmdLineParser parser = new CmdLineParser(); 23 | CmdLineParser.Option typeOpt = parser.addStringOption("type"); 24 | CmdLineParser.Option versionOpt = parser.addBooleanOption('V', "version"); 25 | CmdLineParser.Option verboseOpt = parser.addBooleanOption('v', "verbose"); 26 | CmdLineParser.Option nomungeOpt = parser.addBooleanOption("nomunge"); 27 | CmdLineParser.Option linebreakOpt = parser.addStringOption("line-break"); 28 | CmdLineParser.Option preserveSemiOpt = parser.addBooleanOption("preserve-semi"); 29 | CmdLineParser.Option disableOptimizationsOpt = parser.addBooleanOption("disable-optimizations"); 30 | CmdLineParser.Option helpOpt = parser.addBooleanOption('h', "help"); 31 | CmdLineParser.Option charsetOpt = parser.addStringOption("charset"); 32 | CmdLineParser.Option outputFilenameOpt = parser.addStringOption('o', "output"); 33 | CmdLineParser.Option mungemapFilenameOpt = parser.addStringOption('m', "mungemap"); 34 | CmdLineParser.Option preserveUnknownHintsOpt = parser.addBooleanOption('p', "preservehints"); 35 | 36 | Reader in = null; 37 | Writer out = null; 38 | Writer mungemap = null; 39 | 40 | try { 41 | 42 | parser.parse(args); 43 | 44 | Boolean help = (Boolean) parser.getOptionValue(helpOpt); 45 | if (help != null && help.booleanValue()) { 46 | usage(); 47 | System.exit(0); 48 | } 49 | 50 | Boolean version = (Boolean) parser.getOptionValue(versionOpt); 51 | if (version != null && version.booleanValue()) { 52 | version(); 53 | System.exit(0); 54 | } 55 | 56 | boolean verbose = parser.getOptionValue(verboseOpt) != null; 57 | 58 | String charset = (String) parser.getOptionValue(charsetOpt); 59 | if (charset == null || !Charset.isSupported(charset)) { 60 | // charset = System.getProperty("file.encoding"); 61 | // if (charset == null) { 62 | // charset = "UTF-8"; 63 | // } 64 | 65 | // UTF-8 seems to be a better choice than what the system is reporting 66 | charset = "UTF-8"; 67 | 68 | 69 | if (verbose) { 70 | System.err.println("\n[INFO] Using charset " + charset); 71 | } 72 | } 73 | 74 | int linebreakpos = -1; 75 | String linebreakstr = (String) parser.getOptionValue(linebreakOpt); 76 | if (linebreakstr != null) { 77 | try { 78 | linebreakpos = Integer.parseInt(linebreakstr, 10); 79 | } catch (NumberFormatException e) { 80 | usage(); 81 | System.exit(1); 82 | } 83 | } 84 | 85 | String typeOverride = (String) parser.getOptionValue(typeOpt); 86 | if (typeOverride != null && !typeOverride.equalsIgnoreCase("js") && !typeOverride.equalsIgnoreCase("css")) { 87 | usage(); 88 | System.exit(1); 89 | } 90 | 91 | boolean munge = parser.getOptionValue(nomungeOpt) == null; 92 | boolean preserveAllSemiColons = parser.getOptionValue(preserveSemiOpt) != null; 93 | boolean disableOptimizations = parser.getOptionValue(disableOptimizationsOpt) != null; 94 | boolean preserveUnknownHints = parser.getOptionValue(preserveUnknownHintsOpt) != null; 95 | 96 | String[] fileArgs = parser.getRemainingArgs(); 97 | java.util.List files = java.util.Arrays.asList(fileArgs); 98 | if (files.isEmpty()) { 99 | if (typeOverride == null) { 100 | usage(); 101 | System.exit(1); 102 | } 103 | files = new java.util.ArrayList(); 104 | files.add("-"); // read from stdin 105 | } 106 | 107 | String output = (String) parser.getOptionValue(outputFilenameOpt); 108 | String pattern[]; 109 | if(output == null) { 110 | pattern = new String[0]; 111 | } else if (output.matches("(?i)^[a-z]\\:\\\\.*")){ // if output is with something like c:\ dont split it 112 | pattern = new String[]{output}; 113 | } else { 114 | pattern = output.split(":"); 115 | } 116 | 117 | try { 118 | String mungemapFilename = (String) parser.getOptionValue(mungemapFilenameOpt); 119 | if (mungemapFilename != null) { 120 | mungemap = new OutputStreamWriter(new FileOutputStream(mungemapFilename), charset); 121 | } 122 | } catch (IOException e) { 123 | e.printStackTrace(); 124 | System.exit(1); 125 | } 126 | 127 | java.util.Iterator filenames = files.iterator(); 128 | while(filenames.hasNext()) { 129 | String inputFilename = (String)filenames.next(); 130 | String type = null; 131 | try { 132 | if (inputFilename.equals("-")) { 133 | 134 | in = new InputStreamReader(System.in, charset); 135 | type = typeOverride; 136 | 137 | } else { 138 | 139 | if ( typeOverride != null ) { 140 | type = typeOverride; 141 | } 142 | else { 143 | int idx = inputFilename.lastIndexOf('.'); 144 | if (idx >= 0 && idx < inputFilename.length() - 1) { 145 | type = inputFilename.substring(idx + 1); 146 | } 147 | } 148 | 149 | if (type == null || !type.equalsIgnoreCase("js") && !type.equalsIgnoreCase("css")) { 150 | usage(); 151 | System.exit(1); 152 | } 153 | 154 | in = new InputStreamReader(new FileInputStream(inputFilename), charset); 155 | } 156 | 157 | String outputFilename = output; 158 | // if a substitution pattern was passed in 159 | if (pattern.length > 1 && files.size() > 0) { 160 | outputFilename = inputFilename.replaceFirst(pattern[0], pattern[1]); 161 | } 162 | 163 | if (type.equalsIgnoreCase("js")) { 164 | 165 | try { 166 | final String localFilename = inputFilename; 167 | 168 | JavaScriptCompressor compressor = new JavaScriptCompressor(in, new ErrorReporter() { 169 | 170 | public void warning(String message, String sourceName, 171 | int line, String lineSource, int lineOffset) { 172 | System.err.println("\n[WARNING] in " + localFilename); 173 | if (line < 0) { 174 | System.err.println(" " + message); 175 | } else { 176 | System.err.println(" " + line + ':' + lineOffset + ':' + message); 177 | } 178 | } 179 | 180 | public void error(String message, String sourceName, 181 | int line, String lineSource, int lineOffset) { 182 | System.err.println("[ERROR] in " + localFilename); 183 | if (line < 0) { 184 | System.err.println(" " + message); 185 | } else { 186 | System.err.println(" " + line + ':' + lineOffset + ':' + message); 187 | } 188 | } 189 | 190 | public EvaluatorException runtimeError(String message, String sourceName, 191 | int line, String lineSource, int lineOffset) { 192 | error(message, sourceName, line, lineSource, lineOffset); 193 | return new EvaluatorException(message); 194 | } 195 | }); 196 | 197 | // Close the input stream first, and then open the output stream, 198 | // in case the output file should override the input file. 199 | in.close(); in = null; 200 | 201 | if (outputFilename == null) { 202 | out = new OutputStreamWriter(System.out, charset); 203 | } else { 204 | out = new OutputStreamWriter(new FileOutputStream(outputFilename), charset); 205 | if (mungemap != null) { 206 | mungemap.write("\n\nFile: "+outputFilename+"\n\n"); 207 | } 208 | } 209 | 210 | compressor.compress(out, mungemap, linebreakpos, munge, verbose, 211 | preserveAllSemiColons, disableOptimizations, preserveUnknownHints); 212 | 213 | } catch (EvaluatorException e) { 214 | 215 | e.printStackTrace(); 216 | // Return a special error code used specifically by the web front-end. 217 | System.exit(2); 218 | 219 | } 220 | 221 | } else if (type.equalsIgnoreCase("css")) { 222 | 223 | CssCompressor compressor = new CssCompressor(in); 224 | 225 | // Close the input stream first, and then open the output stream, 226 | // in case the output file should override the input file. 227 | in.close(); in = null; 228 | 229 | if (outputFilename == null) { 230 | out = new OutputStreamWriter(System.out, charset); 231 | } else { 232 | out = new OutputStreamWriter(new FileOutputStream(outputFilename), charset); 233 | } 234 | 235 | compressor.compress(out, linebreakpos); 236 | } 237 | 238 | } catch (IOException e) { 239 | 240 | e.printStackTrace(); 241 | System.exit(1); 242 | 243 | } finally { 244 | 245 | if (in != null) { 246 | try { 247 | in.close(); 248 | } catch (IOException e) { 249 | e.printStackTrace(); 250 | } 251 | } 252 | 253 | if (out != null) { 254 | try { 255 | out.close(); 256 | } catch (IOException e) { 257 | e.printStackTrace(); 258 | } 259 | } 260 | } 261 | } 262 | } catch (CmdLineParser.OptionException e) { 263 | 264 | usage(); 265 | System.exit(1); 266 | } finally { 267 | if (mungemap !=null) { 268 | try { 269 | mungemap.close(); 270 | } catch (IOException e) { 271 | e.printStackTrace(); 272 | } 273 | } 274 | } 275 | } 276 | 277 | private static void version() { 278 | System.err.println("@VERSION@"); 279 | } 280 | private static void usage() { 281 | System.err.println( 282 | "YUICompressor Version: @VERSION@\n" 283 | 284 | + "\nUsage: java -jar yuicompressor-@VERSION@.jar [options] [input file]\n" 285 | + "\n" 286 | + "Global Options\n" 287 | + " -V, --version Print version information\n" 288 | + " -h, --help Displays this information\n" 289 | + " --type Specifies the type of the input file\n" 290 | + " --charset Read the input file using \n" 291 | + " --line-break Insert a line break after the specified column number\n" 292 | + " -v, --verbose Display informational messages and warnings\n" 293 | + " -p, --preservehints Don't elide unrecognized compiler hints (e.g. \"use strict\", \"use asm\")\n" 294 | + " -m Place a mapping of munged identifiers to originals in this file\n\n" 295 | + " -o Place the output into . Defaults to stdout.\n" 296 | + " Multiple files can be processed using the following syntax:\n" 297 | + " java -jar yuicompressor.jar -o '.css$:-min.css' *.css\n" 298 | + " java -jar yuicompressor.jar -o '.js$:-min.js' *.js\n\n" 299 | 300 | + "JavaScript Options\n" 301 | + " --nomunge Minify only, do not obfuscate\n" 302 | + " --preserve-semi Preserve all semicolons\n" 303 | + " --disable-optimizations Disable all micro optimizations\n\n" 304 | 305 | + "If no input file is specified, it defaults to stdin. In this case, the 'type'\n" 306 | + "option is required. Otherwise, the 'type' option is required only if the input\n" 307 | + "file extension is neither 'js' nor 'css'."); 308 | } 309 | } 310 | -------------------------------------------------------------------------------- /src/org/mozilla/javascript/Token.java.orig: -------------------------------------------------------------------------------- 1 | /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 | * 3 | * ***** BEGIN LICENSE BLOCK ***** 4 | * Version: MPL 1.1/GPL 2.0 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 7 | * 1.1 (the "License"); you may not use this file except in compliance with 8 | * the License. You may obtain a copy of the License at 9 | * http://www.mozilla.org/MPL/ 10 | * 11 | * Software distributed under the License is distributed on an "AS IS" basis, 12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 | * for the specific language governing rights and limitations under the 14 | * License. 15 | * 16 | * The Original Code is Rhino code, released 17 | * May 6, 1999. 18 | * 19 | * The Initial Developer of the Original Code is 20 | * Netscape Communications Corporation. 21 | * Portions created by the Initial Developer are Copyright (C) 1997-1999 22 | * the Initial Developer. All Rights Reserved. 23 | * 24 | * Contributor(s): 25 | * Roger Lawrence 26 | * Mike McCabe 27 | * Igor Bukanov 28 | * Bob Jervis 29 | * Milen Nankov 30 | * 31 | * Alternatively, the contents of this file may be used under the terms of 32 | * the GNU General Public License Version 2 or later (the "GPL"), in which 33 | * case the provisions of the GPL are applicable instead of those above. If 34 | * you wish to allow use of your version of this file only under the terms of 35 | * the GPL and not to allow others to use your version of this file under the 36 | * MPL, indicate your decision by deleting the provisions above and replacing 37 | * them with the notice and other provisions required by the GPL. If you do 38 | * not delete the provisions above, a recipient may use your version of this 39 | * file under either the MPL or the GPL. 40 | * 41 | * ***** END LICENSE BLOCK ***** */ 42 | 43 | package org.mozilla.javascript; 44 | 45 | /** 46 | * This class implements the JavaScript scanner. 47 | * 48 | * It is based on the C source files jsscan.c and jsscan.h 49 | * in the jsref package. 50 | * 51 | * @see org.mozilla.javascript.Parser 52 | * 53 | * @author Mike McCabe 54 | * @author Brendan Eich 55 | */ 56 | 57 | public class Token 58 | { 59 | 60 | // debug flags 61 | public static final boolean printTrees = false; 62 | static final boolean printICode = false; 63 | static final boolean printNames = printTrees || printICode; 64 | 65 | /** 66 | * Token types. These values correspond to JSTokenType values in 67 | * jsscan.c. 68 | */ 69 | 70 | public final static int 71 | // start enum 72 | ERROR = -1, // well-known as the only code < EOF 73 | EOF = 0, // end of file token - (not EOF_CHAR) 74 | EOL = 1, // end of line 75 | 76 | // Interpreter reuses the following as bytecodes 77 | FIRST_BYTECODE_TOKEN = 2, 78 | 79 | ENTERWITH = 2, 80 | LEAVEWITH = 3, 81 | RETURN = 4, 82 | GOTO = 5, 83 | IFEQ = 6, 84 | IFNE = 7, 85 | SETNAME = 8, 86 | BITOR = 9, 87 | BITXOR = 10, 88 | BITAND = 11, 89 | EQ = 12, 90 | NE = 13, 91 | LT = 14, 92 | LE = 15, 93 | GT = 16, 94 | GE = 17, 95 | LSH = 18, 96 | RSH = 19, 97 | URSH = 20, 98 | ADD = 21, 99 | SUB = 22, 100 | MUL = 23, 101 | DIV = 24, 102 | MOD = 25, 103 | NOT = 26, 104 | BITNOT = 27, 105 | POS = 28, 106 | NEG = 29, 107 | NEW = 30, 108 | DELPROP = 31, 109 | TYPEOF = 32, 110 | GETPROP = 33, 111 | SETPROP = 34, 112 | GETELEM = 35, 113 | SETELEM = 36, 114 | CALL = 37, 115 | NAME = 38, 116 | NUMBER = 39, 117 | STRING = 40, 118 | NULL = 41, 119 | THIS = 42, 120 | FALSE = 43, 121 | TRUE = 44, 122 | SHEQ = 45, // shallow equality (===) 123 | SHNE = 46, // shallow inequality (!==) 124 | REGEXP = 47, 125 | BINDNAME = 48, 126 | THROW = 49, 127 | RETHROW = 50, // rethrow caught execetion: catch (e if ) use it 128 | IN = 51, 129 | INSTANCEOF = 52, 130 | LOCAL_LOAD = 53, 131 | GETVAR = 54, 132 | SETVAR = 55, 133 | CATCH_SCOPE = 56, 134 | ENUM_INIT_KEYS = 57, 135 | ENUM_INIT_VALUES = 58, 136 | ENUM_NEXT = 59, 137 | ENUM_ID = 60, 138 | THISFN = 61, 139 | RETURN_RESULT = 62, // to return prevoisly stored return result 140 | ARRAYLIT = 63, // array literal 141 | OBJECTLIT = 64, // object literal 142 | GET_REF = 65, // *reference 143 | SET_REF = 66, // *reference = something 144 | DEL_REF = 67, // delete reference 145 | REF_CALL = 68, // f(args) = something or f(args)++ 146 | REF_SPECIAL = 69, // reference for special properties like __proto 147 | 148 | // For XML support: 149 | DEFAULTNAMESPACE = 70, // default xml namespace = 150 | ESCXMLATTR = 71, 151 | ESCXMLTEXT = 72, 152 | REF_MEMBER = 73, // Reference for x.@y, x..y etc. 153 | REF_NS_MEMBER = 74, // Reference for x.ns::y, x..ns::y etc. 154 | REF_NAME = 75, // Reference for @y, @[y] etc. 155 | REF_NS_NAME = 76; // Reference for ns::y, @ns::y@[y] etc. 156 | 157 | // End of interpreter bytecodes 158 | public final static int 159 | LAST_BYTECODE_TOKEN = REF_NS_NAME, 160 | 161 | TRY = 77, 162 | SEMI = 78, // semicolon 163 | LB = 79, // left and right brackets 164 | RB = 80, 165 | LC = 81, // left and right curlies (braces) 166 | RC = 82, 167 | LP = 83, // left and right parentheses 168 | RP = 84, 169 | COMMA = 85, // comma operator 170 | 171 | ASSIGN = 86, // simple assignment (=) 172 | ASSIGN_BITOR = 87, // |= 173 | ASSIGN_BITXOR = 88, // ^= 174 | ASSIGN_BITAND = 89, // |= 175 | ASSIGN_LSH = 90, // <<= 176 | ASSIGN_RSH = 91, // >>= 177 | ASSIGN_URSH = 92, // >>>= 178 | ASSIGN_ADD = 93, // += 179 | ASSIGN_SUB = 94, // -= 180 | ASSIGN_MUL = 95, // *= 181 | ASSIGN_DIV = 96, // /= 182 | ASSIGN_MOD = 97; // %= 183 | 184 | public final static int 185 | FIRST_ASSIGN = ASSIGN, 186 | LAST_ASSIGN = ASSIGN_MOD, 187 | 188 | HOOK = 98, // conditional (?:) 189 | COLON = 99, 190 | OR = 100, // logical or (||) 191 | AND = 101, // logical and (&&) 192 | INC = 102, // increment/decrement (++ --) 193 | DEC = 103, 194 | DOT = 104, // member operator (.) 195 | FUNCTION = 105, // function keyword 196 | EXPORT = 106, // export keyword 197 | IMPORT = 107, // import keyword 198 | IF = 108, // if keyword 199 | ELSE = 109, // else keyword 200 | SWITCH = 110, // switch keyword 201 | CASE = 111, // case keyword 202 | DEFAULT = 112, // default keyword 203 | WHILE = 113, // while keyword 204 | DO = 114, // do keyword 205 | FOR = 115, // for keyword 206 | BREAK = 116, // break keyword 207 | CONTINUE = 117, // continue keyword 208 | VAR = 118, // var keyword 209 | WITH = 119, // with keyword 210 | CATCH = 120, // catch keyword 211 | FINALLY = 121, // finally keyword 212 | VOID = 122, // void keyword 213 | RESERVED = 123, // reserved keywords 214 | 215 | EMPTY = 124, 216 | 217 | /* types used for the parse tree - these never get returned 218 | * by the scanner. 219 | */ 220 | 221 | BLOCK = 125, // statement block 222 | LABEL = 126, // label 223 | TARGET = 127, 224 | LOOP = 128, 225 | EXPR_VOID = 129, // expression statement in functions 226 | EXPR_RESULT = 130, // expression statement in scripts 227 | JSR = 131, 228 | SCRIPT = 132, // top-level node for entire script 229 | TYPEOFNAME = 133, // for typeof(simple-name) 230 | USE_STACK = 134, 231 | SETPROP_OP = 135, // x.y op= something 232 | SETELEM_OP = 136, // x[y] op= something 233 | LOCAL_BLOCK = 137, 234 | SET_REF_OP = 138, // *reference op= something 235 | 236 | // For XML support: 237 | DOTDOT = 139, // member operator (..) 238 | COLONCOLON = 140, // namespace::name 239 | XML = 141, // XML type 240 | DOTQUERY = 142, // .() -- e.g., x.emps.emp.(name == "terry") 241 | XMLATTR = 143, // @ 242 | XMLEND = 144, 243 | 244 | // Optimizer-only-tokens 245 | TO_OBJECT = 145, 246 | TO_DOUBLE = 146, 247 | 248 | GET = 147, // JS 1.5 get pseudo keyword 249 | SET = 148, // JS 1.5 set pseudo keyword 250 | CONST = 149, 251 | SETCONST = 150, 252 | SETCONSTVAR = 151, 253 | LAST_TOKEN = 152; 254 | 255 | public static String name(int token) 256 | { 257 | if (!printNames) { 258 | return String.valueOf(token); 259 | } 260 | switch (token) { 261 | case ERROR: return "ERROR"; 262 | case EOF: return "EOF"; 263 | case EOL: return "EOL"; 264 | case ENTERWITH: return "ENTERWITH"; 265 | case LEAVEWITH: return "LEAVEWITH"; 266 | case RETURN: return "RETURN"; 267 | case GOTO: return "GOTO"; 268 | case IFEQ: return "IFEQ"; 269 | case IFNE: return "IFNE"; 270 | case SETNAME: return "SETNAME"; 271 | case BITOR: return "BITOR"; 272 | case BITXOR: return "BITXOR"; 273 | case BITAND: return "BITAND"; 274 | case EQ: return "EQ"; 275 | case NE: return "NE"; 276 | case LT: return "LT"; 277 | case LE: return "LE"; 278 | case GT: return "GT"; 279 | case GE: return "GE"; 280 | case LSH: return "LSH"; 281 | case RSH: return "RSH"; 282 | case URSH: return "URSH"; 283 | case ADD: return "ADD"; 284 | case SUB: return "SUB"; 285 | case MUL: return "MUL"; 286 | case DIV: return "DIV"; 287 | case MOD: return "MOD"; 288 | case NOT: return "NOT"; 289 | case BITNOT: return "BITNOT"; 290 | case POS: return "POS"; 291 | case NEG: return "NEG"; 292 | case NEW: return "NEW"; 293 | case DELPROP: return "DELPROP"; 294 | case TYPEOF: return "TYPEOF"; 295 | case GETPROP: return "GETPROP"; 296 | case SETPROP: return "SETPROP"; 297 | case GETELEM: return "GETELEM"; 298 | case SETELEM: return "SETELEM"; 299 | case CALL: return "CALL"; 300 | case NAME: return "NAME"; 301 | case NUMBER: return "NUMBER"; 302 | case STRING: return "STRING"; 303 | case NULL: return "NULL"; 304 | case THIS: return "THIS"; 305 | case FALSE: return "FALSE"; 306 | case TRUE: return "TRUE"; 307 | case SHEQ: return "SHEQ"; 308 | case SHNE: return "SHNE"; 309 | case REGEXP: return "OBJECT"; 310 | case BINDNAME: return "BINDNAME"; 311 | case THROW: return "THROW"; 312 | case RETHROW: return "RETHROW"; 313 | case IN: return "IN"; 314 | case INSTANCEOF: return "INSTANCEOF"; 315 | case LOCAL_LOAD: return "LOCAL_LOAD"; 316 | case GETVAR: return "GETVAR"; 317 | case SETVAR: return "SETVAR"; 318 | case CATCH_SCOPE: return "CATCH_SCOPE"; 319 | case ENUM_INIT_KEYS: return "ENUM_INIT_KEYS"; 320 | case ENUM_INIT_VALUES: return "ENUM_INIT_VALUES"; 321 | case ENUM_NEXT: return "ENUM_NEXT"; 322 | case ENUM_ID: return "ENUM_ID"; 323 | case THISFN: return "THISFN"; 324 | case RETURN_RESULT: return "RETURN_RESULT"; 325 | case ARRAYLIT: return "ARRAYLIT"; 326 | case OBJECTLIT: return "OBJECTLIT"; 327 | case GET_REF: return "GET_REF"; 328 | case SET_REF: return "SET_REF"; 329 | case DEL_REF: return "DEL_REF"; 330 | case REF_CALL: return "REF_CALL"; 331 | case REF_SPECIAL: return "REF_SPECIAL"; 332 | case DEFAULTNAMESPACE:return "DEFAULTNAMESPACE"; 333 | case ESCXMLTEXT: return "ESCXMLTEXT"; 334 | case ESCXMLATTR: return "ESCXMLATTR"; 335 | case REF_MEMBER: return "REF_MEMBER"; 336 | case REF_NS_MEMBER: return "REF_NS_MEMBER"; 337 | case REF_NAME: return "REF_NAME"; 338 | case REF_NS_NAME: return "REF_NS_NAME"; 339 | case TRY: return "TRY"; 340 | case SEMI: return "SEMI"; 341 | case LB: return "LB"; 342 | case RB: return "RB"; 343 | case LC: return "LC"; 344 | case RC: return "RC"; 345 | case LP: return "LP"; 346 | case RP: return "RP"; 347 | case COMMA: return "COMMA"; 348 | case ASSIGN: return "ASSIGN"; 349 | case ASSIGN_BITOR: return "ASSIGN_BITOR"; 350 | case ASSIGN_BITXOR: return "ASSIGN_BITXOR"; 351 | case ASSIGN_BITAND: return "ASSIGN_BITAND"; 352 | case ASSIGN_LSH: return "ASSIGN_LSH"; 353 | case ASSIGN_RSH: return "ASSIGN_RSH"; 354 | case ASSIGN_URSH: return "ASSIGN_URSH"; 355 | case ASSIGN_ADD: return "ASSIGN_ADD"; 356 | case ASSIGN_SUB: return "ASSIGN_SUB"; 357 | case ASSIGN_MUL: return "ASSIGN_MUL"; 358 | case ASSIGN_DIV: return "ASSIGN_DIV"; 359 | case ASSIGN_MOD: return "ASSIGN_MOD"; 360 | case HOOK: return "HOOK"; 361 | case COLON: return "COLON"; 362 | case OR: return "OR"; 363 | case AND: return "AND"; 364 | case INC: return "INC"; 365 | case DEC: return "DEC"; 366 | case DOT: return "DOT"; 367 | case FUNCTION: return "FUNCTION"; 368 | case EXPORT: return "EXPORT"; 369 | case IMPORT: return "IMPORT"; 370 | case IF: return "IF"; 371 | case ELSE: return "ELSE"; 372 | case SWITCH: return "SWITCH"; 373 | case CASE: return "CASE"; 374 | case DEFAULT: return "DEFAULT"; 375 | case WHILE: return "WHILE"; 376 | case DO: return "DO"; 377 | case FOR: return "FOR"; 378 | case BREAK: return "BREAK"; 379 | case CONTINUE: return "CONTINUE"; 380 | case VAR: return "VAR"; 381 | case WITH: return "WITH"; 382 | case CATCH: return "CATCH"; 383 | case FINALLY: return "FINALLY"; 384 | case RESERVED: return "RESERVED"; 385 | case EMPTY: return "EMPTY"; 386 | case BLOCK: return "BLOCK"; 387 | case LABEL: return "LABEL"; 388 | case TARGET: return "TARGET"; 389 | case LOOP: return "LOOP"; 390 | case EXPR_VOID: return "EXPR_VOID"; 391 | case EXPR_RESULT: return "EXPR_RESULT"; 392 | case JSR: return "JSR"; 393 | case SCRIPT: return "SCRIPT"; 394 | case TYPEOFNAME: return "TYPEOFNAME"; 395 | case USE_STACK: return "USE_STACK"; 396 | case SETPROP_OP: return "SETPROP_OP"; 397 | case SETELEM_OP: return "SETELEM_OP"; 398 | case LOCAL_BLOCK: return "LOCAL_BLOCK"; 399 | case SET_REF_OP: return "SET_REF_OP"; 400 | case DOTDOT: return "DOTDOT"; 401 | case COLONCOLON: return "COLONCOLON"; 402 | case XML: return "XML"; 403 | case DOTQUERY: return "DOTQUERY"; 404 | case XMLATTR: return "XMLATTR"; 405 | case XMLEND: return "XMLEND"; 406 | case TO_OBJECT: return "TO_OBJECT"; 407 | case TO_DOUBLE: return "TO_DOUBLE"; 408 | case GET: return "GET"; 409 | case SET: return "SET"; 410 | case CONST: return "CONST"; 411 | case SETCONST: return "SETCONST"; 412 | } 413 | 414 | // Token without name 415 | throw new IllegalStateException(String.valueOf(token)); 416 | } 417 | } 418 | -------------------------------------------------------------------------------- /tests/README: -------------------------------------------------------------------------------- 1 | To add a test: 2 | 3 | 1. Create a "blah.css" or "blah.js" file. 4 | 2. Create a "blah.css.min" or "blah.js.min" file, containing the expected minified output. 5 | 6 | That's all! -------------------------------------------------------------------------------- /tests/_munge.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var w = window; 3 | 4 | w.hello = function(a, abc) { 5 | "a:nomunge"; 6 | w.alert("Hello, " + a); 7 | }; 8 | })(); 9 | -------------------------------------------------------------------------------- /tests/_munge.js.min: -------------------------------------------------------------------------------- 1 | (function(){var a=window;a.hello=function(a,b){a.alert("Hello, "+a)}})(); -------------------------------------------------------------------------------- /tests/_string_combo.js: -------------------------------------------------------------------------------- 1 | function test(){ 2 | var a = "a" + 3 | "b" + 4 | "c"; 5 | } 6 | -------------------------------------------------------------------------------- /tests/_string_combo.js.min: -------------------------------------------------------------------------------- 1 | function test(){var b="abc"}; -------------------------------------------------------------------------------- /tests/_string_combo2.js: -------------------------------------------------------------------------------- 1 | function test(){ 2 | var a = "a" + 3 | "b".toUpperCase(); 4 | } 5 | -------------------------------------------------------------------------------- /tests/_string_combo2.js.min: -------------------------------------------------------------------------------- 1 | function test(){var b="a"+"b".toUpperCase()}; 2 | -------------------------------------------------------------------------------- /tests/_string_combo3.js: -------------------------------------------------------------------------------- 1 | function test(){ 2 | for ( var i = 0; i < 3; i++ ) { 3 | var a = "a" + "bcd"[i]; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/_string_combo3.js.min: -------------------------------------------------------------------------------- 1 | function test(){for(var c=0;c<3;c++){var b="a"+"bcd"[c]}}; 2 | -------------------------------------------------------------------------------- /tests/_syntax_error.js: -------------------------------------------------------------------------------- 1 | 2 | window.$ = $telerik.$; 3 | $(document).ready(function() { 4 | movePageElements(); 5 | 6 | var text = $('textarea').val(); 7 | 8 | if (text != "") 9 | $('textarea').attr("style", "display: block;"); 10 | else 11 | $('textarea').attr("style", "display: none;"); 12 | 13 | //cleanup 14 | text = null; 15 | }); 16 | 17 | function movePageElements() { 18 | var num = null; 19 | var pagenum = $(".pagecontrolscontainer"); 20 | if (pagenum.length > 0) { 21 | var num = pagenum.attr("pagenumber"); 22 | if ((num > 5) && (num < 28)) { 23 | var x = $('div#commentbutton'); 24 | $("div.buttonContainer").prepend(x); 25 | } 26 | else { 27 | $('div#commentbutton').attr("style", "display: none;"); 28 | } 29 | } 30 | 31 | //Add in dropshadowing 32 | if ((num > 5) && (num < 28)) { 33 | var top = $('.dropshadow-top'); 34 | var middle = $('#dropshadow'); 35 | var bottom = $('.dropshadow-bottom'); 36 | $('#page').prepend(top); 37 | $('#topcontainer').after(middle); 38 | middle.append($('#topcontainer')); 39 | middle.after(bottom); 40 | } 41 | 42 | //cleanup 43 | num = null; 44 | pagenum = null; 45 | top = null; 46 | middle = null; 47 | bottom=null; 48 | } 49 | 50 | function expandCollapseDiv(id) { 51 | $telerik.$(id).slideToggle("slow"); 52 | } 53 | 54 | function expandCollapseHelp() { 55 | $('.helpitems').slideToggle("slow"); 56 | 57 | //Add in dropshadowing 58 | if ($('#helpcontainer').length) { 59 | $('#help-dropshadow-bot').insertAfter('#helpcontainer'); 60 | $('#help-dropshadow-bot').removeAttr("style"); 61 | } 62 | } 63 | 64 | function expandCollapseComments() { 65 | var style = $('textarea').attr("style"); 66 | if (style == "display: none;") 67 | $('textarea').fadeIn().focus(); 68 | else 69 | $('textarea').fadeOut(); 70 | 71 | //cleanup 72 | style = null; 73 | } 74 | -------------------------------------------------------------------------------- /tests/_syntax_error.js.min: -------------------------------------------------------------------------------- 1 | window.$=$telerik.$;$(document).ready(function(){movePageElements();var a=$("textarea").val();if(a!=""){$("textarea").attr("style","display: block;")}else{$("textarea").attr("style","display: none;")}a=null});function movePageElements(){var e=null;var b=$(".pagecontrolscontainer");if(b.length>0){var e=b.attr("pagenumber");if((e>5)&&(e<28)){var a=$("div#commentbutton");$("div.buttonContainer").prepend(a)}else{$("div#commentbutton").attr("style","display: none;")}}if((e>5)&&(e<28)){var f=$(".dropshadow-top");var d=$("#dropshadow");var c=$(".dropshadow-bottom");$("#page").prepend(f);$("#topcontainer").after(d);d.append($("#topcontainer"));d.after(c)}e=null;b=null;f=null;d=null;c=null}function expandCollapseDiv(a){$telerik.$(a).slideToggle("slow")}function expandCollapseHelp(){$(".helpitems").slideToggle("slow");if($("#helpcontainer").length){$("#help-dropshadow-bot").insertAfter("#helpcontainer");$("#help-dropshadow-bot").removeAttr("style")}}function expandCollapseComments(){var a=$("textarea").attr("style");if(a=="display: none;"){$("textarea").fadeIn().focus()}else{$("textarea").fadeOut()}a=null}; -------------------------------------------------------------------------------- /tests/background-position.css: -------------------------------------------------------------------------------- 1 | a {background-position: 0 0 0 0;} 2 | b {BACKGROUND-POSITION: 0 0;} -------------------------------------------------------------------------------- /tests/background-position.css.min: -------------------------------------------------------------------------------- 1 | a{background-position:0 0}b{background-position:0 0} -------------------------------------------------------------------------------- /tests/border-none.css: -------------------------------------------------------------------------------- 1 | a { 2 | border: none; 3 | } 4 | b {BACKGROUND:none} 5 | s { 6 | border-top: none; 7 | border-right: none; 8 | border-bottom:none; 9 | border-left: none 10 | } -------------------------------------------------------------------------------- /tests/border-none.css.min: -------------------------------------------------------------------------------- 1 | a{border:0}b{background:0}s{border-top:0;border-right:0;border-bottom:0;border-left:0} -------------------------------------------------------------------------------- /tests/box-model-hack.css: -------------------------------------------------------------------------------- 1 | #elem { 2 | width: 100px; 3 | voice-family: "\"}\""; 4 | voice-family:inherit; 5 | width: 200px; 6 | } 7 | html>body #elem { 8 | width: 200px; 9 | } 10 | -------------------------------------------------------------------------------- /tests/box-model-hack.css.min: -------------------------------------------------------------------------------- 1 | #elem{width:100px;voice-family:"\"}\"";voice-family:inherit;width:200px}html>body #elem{width:200px} -------------------------------------------------------------------------------- /tests/bug-flex.css: -------------------------------------------------------------------------------- 1 | .flex-text{ 2 | flex:0 0; 3 | } 4 | -------------------------------------------------------------------------------- /tests/bug-flex.css.min: -------------------------------------------------------------------------------- 1 | .flex-text{flex:0 0} 2 | -------------------------------------------------------------------------------- /tests/bug-nested-pseudoclass.css: -------------------------------------------------------------------------------- 1 | :first-child :last-child{ 2 | background-color:red 3 | } 4 | -------------------------------------------------------------------------------- /tests/bug-nested-pseudoclass.css.min: -------------------------------------------------------------------------------- 1 | :first-child :last-child{background-color:red} 2 | -------------------------------------------------------------------------------- /tests/bug-preservetoken-calc.css: -------------------------------------------------------------------------------- 1 | /* test for not breaking class names with preserved tokens */ 2 | .calculate-classname-test { 3 | width: calc(10% + 100px); 4 | } 5 | 6 | .background-url-test { 7 | content: '/foo/bar'; 8 | } -------------------------------------------------------------------------------- /tests/bug-preservetoken-calc.css.min: -------------------------------------------------------------------------------- 1 | .calculate-classname-test{width:calc(10% + 100px)}.background-url-test{content:'/foo/bar'} -------------------------------------------------------------------------------- /tests/bug2527974.css: -------------------------------------------------------------------------------- 1 | /* this file contains no css, it exists purely to put the revision number into the 2 | combined css before uploading it to SiteManager. The exclaimation at the start 3 | of the comment informs yuicompressor not to strip the comment out */ 4 | 5 | /*! $LastChangedRevision: 81 $ $LastChangedDate: 2009-05-27 17:41:02 +0100 (Wed, 27 May 2009) $ */ 6 | 7 | body { 8 | yo: cats; 9 | } 10 | ul[id$=foo] label:hover {yo: yo;} -------------------------------------------------------------------------------- /tests/bug2527974.css.min: -------------------------------------------------------------------------------- 1 | /*! $LastChangedRevision: 81 $ $LastChangedDate: 2009-05-27 17:41:02 +0100 (Wed, 27 May 2009) $ */body{yo:cats}ul[id$=foo] label:hover{yo:yo} -------------------------------------------------------------------------------- /tests/bug2527991.css: -------------------------------------------------------------------------------- 1 | @media screen and/*!YUI-Compresser */(-webkit-min-device-pixel-ratio:0) { 2 | a{ 3 | b: 1; 4 | } 5 | } 6 | 7 | 8 | @media screen and/*! */ /*! */(-webkit-min-device-pixel-ratio:0) { 9 | a{ 10 | b: 1; 11 | } 12 | } 13 | 14 | 15 | @media -webkit-min-device-pixel-ratio:0 { 16 | a{ 17 | b: 1; 18 | } 19 | } -------------------------------------------------------------------------------- /tests/bug2527991.css.min: -------------------------------------------------------------------------------- 1 | @media screen and/*!YUI-Compresser */(-webkit-min-device-pixel-ratio:0){a{b:1}}@media screen and/*! *//*! */(-webkit-min-device-pixel-ratio:0){a{b:1}}@media -webkit-min-device-pixel-ratio:0{a{b:1}} -------------------------------------------------------------------------------- /tests/bug2527998.css: -------------------------------------------------------------------------------- 1 | /*! special */ 2 | body { 3 | 4 | } 5 | -------------------------------------------------------------------------------- /tests/bug2527998.css.min: -------------------------------------------------------------------------------- 1 | /*! special */ -------------------------------------------------------------------------------- /tests/bug2528034.css: -------------------------------------------------------------------------------- 1 | a[href$="/test/"] span:first-child { b:1; } 2 | a[href$="/test/"] span:first-child { } 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/bug2528034.css.min: -------------------------------------------------------------------------------- 1 | a[href$="/test/"] span:first-child{b:1} -------------------------------------------------------------------------------- /tests/charset-media.css: -------------------------------------------------------------------------------- 1 | /* re: 2495387 */ 2 | @charset 'utf-8'; 3 | @media all { 4 | body { 5 | } 6 | body { 7 | background-color: gold; 8 | } 9 | } -------------------------------------------------------------------------------- /tests/charset-media.css.min: -------------------------------------------------------------------------------- 1 | @charset 'utf-8';@media all{body{background-color:gold}} -------------------------------------------------------------------------------- /tests/color-keyword.css: -------------------------------------------------------------------------------- 1 | .c1{color:#FF0000}.c2{color:#000080}.c3{color:#808080}.c4{color:#808000}.c5{color:#800080}.c6{color:#C0C0C0}.c7{color:#008080}.c8{color:#FFA500}.c9{color:#800000} 2 | -------------------------------------------------------------------------------- /tests/color-keyword.css.min: -------------------------------------------------------------------------------- 1 | .c1{color:red}.c2{color:navy}.c3{color:gray}.c4{color:olive}.c5{color:purple}.c6{color:silver}.c7{color:teal}.c8{color:orange}.c9{color:maroon} 2 | -------------------------------------------------------------------------------- /tests/color-simple.css: -------------------------------------------------------------------------------- 1 | .foo, #AABBCC { 2 | background-color:#aabbcc; 3 | border-color:#Ee66aA #ABCDEF #FeAb2C; 4 | filter:chroma(color = #FFFFFF ); 5 | filter:chroma(color="#AABBCC"); 6 | filter:chroma(color='#BBDDEE'); 7 | color:#112233 8 | } -------------------------------------------------------------------------------- /tests/color-simple.css.min: -------------------------------------------------------------------------------- 1 | .foo,#AABBCC{background-color:#abc;border-color:#e6a #abcdef #feab2c;filter:chroma(color = #FFFFFF);filter:chroma(color="#AABBCC");filter:chroma(color='#BBDDEE');color:#123} 2 | -------------------------------------------------------------------------------- /tests/color.css: -------------------------------------------------------------------------------- 1 | .color { 2 | me: rgb(123, 123, 123); 3 | test-overflow: rgb(1000, 500, 300); 4 | impressed: #FfEedD; 5 | again: #ABCDEF; 6 | andagain:#aa66cc; 7 | background-color:#aa66ccc; 8 | filter: chroma(color="#FFFFFF"); 9 | background: none repeat scroll 0 0 rgb(255, 0,0); 10 | alpha: rgba(1, 2, 3, 4); 11 | border-color: RGBA(1,2,3,4); /* tests uppercase RGBA() */ 12 | color:#1122aa 13 | } 14 | 15 | #AABBCC { 16 | background-color:#ffee11; 17 | filter: chroma(color = #FFFFFF ); 18 | color:#441122; 19 | foo:#00fF11 #ABC #AABbCc #123344; 20 | border-color:#aa66ccC 21 | } 22 | 23 | .foo #AABBCC { 24 | background-color:#fFEe11; 25 | color:#441122; 26 | border-color:#AbC; 27 | filter: chroma(color= #FFFFFF) 28 | } 29 | 30 | .bar, #AABBCC { 31 | background-color:#FFee11; 32 | border-color:#00fF11 #ABCDEF; 33 | filter: chroma(color=#11FFFFFF); 34 | color:#441122; 35 | } 36 | 37 | .foo, #AABBCC.foobar { 38 | background-color:#ffee11; 39 | border-color:#00fF11 #ABCDEF #AABbCc; 40 | color:#441122; 41 | } 42 | 43 | @media screen { 44 | .bar, #AABBCC { 45 | background-color:#ffEE11; 46 | color:#441122 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tests/color.css.min: -------------------------------------------------------------------------------- 1 | .color{me:#7b7b7b;test-overflow:#fff;impressed:#fed;again:#abcdef;andagain:#a6c;background-color:#aa66ccc;filter:chroma(color="#FFFFFF");background:none repeat scroll 0 0 red;alpha:rgba(1,2,3,4);border-color:rgba(1,2,3,4);color:#12a}#AABBCC{background-color:#fe1;filter:chroma(color = #FFFFFF);color:#412;foo:#0f1 #ABC #abc #123344;border-color:#aa66ccC}.foo #AABBCC{background-color:#fe1;color:#412;border-color:#AbC;filter:chroma(color= #FFFFFF)}.bar,#AABBCC{background-color:#fe1;border-color:#0f1 #abcdef;filter:chroma(color=#11FFFFFF);color:#412}.foo,#AABBCC.foobar{background-color:#fe1;border-color:#0f1 #abcdef #abc;color:#412}@media screen{.bar,#AABBCC{background-color:#fe1;color:#412}} 2 | -------------------------------------------------------------------------------- /tests/comment.css: -------------------------------------------------------------------------------- 1 | html >/**/ body p { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /tests/comment.css.min: -------------------------------------------------------------------------------- 1 | html>/**/body p{color:blue} -------------------------------------------------------------------------------- /tests/concat-charset.css: -------------------------------------------------------------------------------- 1 | /* This is invalid CSS, but frequently happens as a result of concatenation. */ 2 | @CHARSET "utf-8"; 3 | #foo { 4 | border-width:1px; 5 | } 6 | /* 7 | Note that this is erroneous! 8 | The actual CSS file can only have a single charset. 9 | However, this is the job of the author/application. 10 | The compressor should not get involved. 11 | */ 12 | @charset "another one"; 13 | #bar { 14 | border-width:10px; 15 | } 16 | -------------------------------------------------------------------------------- /tests/concat-charset.css.min: -------------------------------------------------------------------------------- 1 | @charset "utf-8";#foo{border-width:1px}#bar{border-width:10px} -------------------------------------------------------------------------------- /tests/dataurl-base64-eof.css: -------------------------------------------------------------------------------- 1 | div.base64-singlequotes { 2 | width:100px; 3 | height:100px; 4 | background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t%2FAAAACXBIWXMAAA3WAAAN1gGQb3mcAAAFrUlEQVRYw%2B2Xz28kRxXHP%2B9Vdc8vj2fG9uIkm2yUeFGEhNCKQwBpj1yRUBAnpJU4ceZP4MxfkBxy2GO45bQXuEGQohUKigQ%2BsBBE1sbYXv8Yz%2FRMd9fjUN09PV5nFZA4kZZa79W3quu9er%2FqNfy%2FPwJgZty%2Ffz%2FZ29vrpmmqhlWTgmFg1UpbfWhYhG6Yq2cFi%2FNrj9nJyWnx%2BPHjeafbMTEzPvjVB9%2B6d%2B%2FezweDwV1BfHubivkC3lZya%2F4m7Np8UZYXhweHH7733rvvC0Kyv7%2F%2F7p07d34qIjyvr63RNb4l4CbsRUrNrq6OfvfRRz%2FxDx486A%2F6g7vXhX9ZIf%2Bp4JomaToZj8d7Pk1SFRFXb1aWodq09l%2F9YZu%2FCWMVL9e%2FaVFVQVUREEG8r3VUEZ4cX%2FHL30%2B5shRtAhFq4wggNb6GrXgVa2K2jYtACIHv7Sz54TfHjWWagBOBy0Xgt%2BcjLtwQxVCpNwURQat1DdYaT7pwdwKDFA6ncHgFizJmSb3WLPDa7PMIVlb2daqZxdONUnAetEojEdBGiXXhTmAjhZ0%2B3N6AlzeEROH1TXiWGf%2BcwmkWZYnAfAkdx1pq%2BhUbT9z3IElUJlVhI4WsgCLUyggi4MQYd4VXNmCYRqXOspV7UoHbQ3hpEMeLAk5mkFYRYlWI%2BHZ6CTDwkKSQqrA7gFeHMF3C6VyYLmFZGiKCE6GrMFsaWb7yuVOh66N1FkUUpBJ3TyvFovToBl9XMbNY2bZ70BsKfW94hbyErosmXpQwy4VgkCjMizjvRRik0EtiLNwagBf465lwOqtkETEn60XT1%2BlTazrpKlR%2BKkooy3Xfb3Wj3wGWJRQhnni7B53q5FqZ4%2FUR7PYhGMxyuMwgWVqTxrYWAwZYQX78J5i8ie9txSAkoOqqQAqk3pBgKLDhlY5XVKPCi3w97YRoKSFaceCgF2hqSXRBPQAIOcXRH8hP%2F0y6%2BRpWLrEyg3SbS9tmzggzJQSLQZo4xoOE8UbCsJfQ7zi6iaIizZ5OBVfXDKPireWC%2BvAYWOBqeszl9Jg03afbH6OqGH%2FBSUrqbrFIXiHoiEDC%2FPySi2d9nnZHJE7opY7dcY%2FdcZej84zpPGfY9Uw2ErYGCf2O4mUVEzELWtqUxZKjf3zK2cURzicMRy%2BzvbuH8ylFPqXIPqNczClKY1mUZFcnSDKkv%2FUNuptbWG%2BLw%2FMh%2FzrYpKBHKV3ONOXzYxeV20z49qhs7gaMWIjqQQiBxVXB4irg05yz4u%2FMpieoJuTLjDJfUJYBzBAFUUHkhMvLvzFPuvQ2JvQ3duh0R%2FjuiDQdIn6MJdvkxTafZUPuaN6UaOo6UNtgNl9weboguwqoA5fCjEusNCzE8LJQFRuNrzpQD%2BrmZNM55%2F4A5z1J2iHtDEg6fZK0j0uHlDrh2N4i3Ptuc%2BH5tjp5HliWQmmOUAhlYe0rqUqWSEOhcZ05AvE1UdColSQJaHWlSUYgJy%2FO2fFfo%2F34piphFOZ4OrvNdL5EJZbcmE8OQzFxIJEGEgIeE1%2FhrjJLxZcOrIVpVC7TW00WmLWyAMDEs%2Bi9wVJDtG17Y21vVmNxLKqIOkQqqoq2qHORmgj9UQcza7mgFm4GmiDjO5C72DSoQ6uPVTW%2BzuFUcQ2teKd4pzhd8b6Nu6jg7vZsrb1rClEIxhu7Q37x47fIy3j%2Fi8iqqlUuEWTFN%2FOrMU3fEEuhUM8FIPDqZgcRIVhsAXxtjGDGS5M%2BP%2Fv%2Bm7yopVrRVsPabsW%2BYG1T%2Fy3KahqSg6cHRb5cTmt5ZXhxQ7nS6yZsVWOajDFbw2JSCSGEIsuyC%2F%2Fo0aPp%2Fv7%2Br9NO5%2F5gMOhJLNn%2FpQLrLfw6tkKKorCDg4NPP%2Fnkjx%2FLOz96h2enzyZvf%2BftH9za2fm6qLrnO9tGk2vY86f%2FMliWZRdPnjz5zcOHDz%2B%2B%2Fifimorzv31C9X718G%2FYrCYSNJa5LgAAACJ6VFh0U29mdHdhcmUAAHjaKy8v18vMyy5OTixI1csvSgcANtgGWBBTylwAAAAASUVORK5CYII%3D'); 5 | background-position:center center; 6 | border:1px solid #00aa00; 7 | } 8 | div.otherdataurl { 9 | background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwqwjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWiiBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOMhWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtTvICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYmyeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDiQonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BWrozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OBGjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2FupH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC"); 10 | } -------------------------------------------------------------------------------- /tests/dataurl-base64-eof.css.min: -------------------------------------------------------------------------------- 1 | div.base64-singlequotes{width:100px;height:100px;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t%2FAAAACXBIWXMAAA3WAAAN1gGQb3mcAAAFrUlEQVRYw%2B2Xz28kRxXHP%2B9Vdc8vj2fG9uIkm2yUeFGEhNCKQwBpj1yRUBAnpJU4ceZP4MxfkBxy2GO45bQXuEGQohUKigQ%2BsBBE1sbYXv8Yz%2FRMd9fjUN09PV5nFZA4kZZa79W3quu9er%2FqNfy%2FPwJgZty%2Ffz%2FZ29vrpmmqhlWTgmFg1UpbfWhYhG6Yq2cFi%2FNrj9nJyWnx%2BPHjeafbMTEzPvjVB9%2B6d%2B%2FezweDwV1BfHubivkC3lZya%2F4m7Np8UZYXhweHH7733rvvC0Kyv7%2F%2F7p07d34qIjyvr63RNb4l4CbsRUrNrq6OfvfRRz%2FxDx486A%2F6g7vXhX9ZIf%2Bp4JomaToZj8d7Pk1SFRFXb1aWodq09l%2F9YZu%2FCWMVL9e%2FaVFVQVUREEG8r3VUEZ4cX%2FHL30%2B5shRtAhFq4wggNb6GrXgVa2K2jYtACIHv7Sz54TfHjWWagBOBy0Xgt%2BcjLtwQxVCpNwURQat1DdYaT7pwdwKDFA6ncHgFizJmSb3WLPDa7PMIVlb2daqZxdONUnAetEojEdBGiXXhTmAjhZ0%2B3N6AlzeEROH1TXiWGf%2BcwmkWZYnAfAkdx1pq%2BhUbT9z3IElUJlVhI4WsgCLUyggi4MQYd4VXNmCYRqXOspV7UoHbQ3hpEMeLAk5mkFYRYlWI%2BHZ6CTDwkKSQqrA7gFeHMF3C6VyYLmFZGiKCE6GrMFsaWb7yuVOh66N1FkUUpBJ3TyvFovToBl9XMbNY2bZ70BsKfW94hbyErosmXpQwy4VgkCjMizjvRRik0EtiLNwagBf465lwOqtkETEn60XT1%2BlTazrpKlR%2BKkooy3Xfb3Wj3wGWJRQhnni7B53q5FqZ4%2FUR7PYhGMxyuMwgWVqTxrYWAwZYQX78J5i8ie9txSAkoOqqQAqk3pBgKLDhlY5XVKPCi3w97YRoKSFaceCgF2hqSXRBPQAIOcXRH8hP%2F0y6%2BRpWLrEyg3SbS9tmzggzJQSLQZo4xoOE8UbCsJfQ7zi6iaIizZ5OBVfXDKPireWC%2BvAYWOBqeszl9Jg03afbH6OqGH%2FBSUrqbrFIXiHoiEDC%2FPySi2d9nnZHJE7opY7dcY%2FdcZej84zpPGfY9Uw2ErYGCf2O4mUVEzELWtqUxZKjf3zK2cURzicMRy%2BzvbuH8ylFPqXIPqNczClKY1mUZFcnSDKkv%2FUNuptbWG%2BLw%2FMh%2FzrYpKBHKV3ONOXzYxeV20z49qhs7gaMWIjqQQiBxVXB4irg05yz4u%2FMpieoJuTLjDJfUJYBzBAFUUHkhMvLvzFPuvQ2JvQ3duh0R%2FjuiDQdIn6MJdvkxTafZUPuaN6UaOo6UNtgNl9weboguwqoA5fCjEusNCzE8LJQFRuNrzpQD%2BrmZNM55%2F4A5z1J2iHtDEg6fZK0j0uHlDrh2N4i3Ptuc%2BH5tjp5HliWQmmOUAhlYe0rqUqWSEOhcZ05AvE1UdColSQJaHWlSUYgJy%2FO2fFfo%2F34piphFOZ4OrvNdL5EJZbcmE8OQzFxIJEGEgIeE1%2FhrjJLxZcOrIVpVC7TW00WmLWyAMDEs%2Bi9wVJDtG17Y21vVmNxLKqIOkQqqoq2qHORmgj9UQcza7mgFm4GmiDjO5C72DSoQ6uPVTW%2BzuFUcQ2teKd4pzhd8b6Nu6jg7vZsrb1rClEIxhu7Q37x47fIy3j%2Fi8iqqlUuEWTFN%2FOrMU3fEEuhUM8FIPDqZgcRIVhsAXxtjGDGS5M%2BP%2Fv%2Bm7yopVrRVsPabsW%2BYG1T%2Fy3KahqSg6cHRb5cTmt5ZXhxQ7nS6yZsVWOajDFbw2JSCSGEIsuyC%2F%2Fo0aPp%2Fv7%2Br9NO5%2F5gMOhJLNn%2FpQLrLfw6tkKKorCDg4NPP%2Fnkjx%2FLOz96h2enzyZvf%2BftH9za2fm6qLrnO9tGk2vY86f%2FMliWZRdPnjz5zcOHDz%2B%2B%2Fifimorzv31C9X718G%2FYrCYSNJa5LgAAACJ6VFh0U29mdHdhcmUAAHjaKy8v18vMyy5OTixI1csvSgcANtgGWBBTylwAAAAASUVORK5CYII%3D');background-position:center center;border:1px solid #0a0}div.otherdataurl{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwqwjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWiiBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOMhWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtTvICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYmyeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDiQonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BWrozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OBGjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2FupH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC")} -------------------------------------------------------------------------------- /tests/dataurl-base64-linebreakindata.css: -------------------------------------------------------------------------------- 1 | .yui3-skin-night .yui3-dial-ring-vml, 2 | .yui3-skin-night .yui3-dial-center-button-vml, 3 | .yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min, 4 | .yui3-skin-night v\:oval.yui3-dial-marker-max-min, 5 | .yui3-skin-night .yui3-dial-marker-vml, 6 | .yui3-skin-night .yui3-dial-handle-vml { 7 | background: none; 8 | opacity:1; 9 | } 10 | 11 | div.base64-doublequotes { 12 | width:100px; 13 | height:100px; 14 | background-image:url( "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwq 15 | wjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWi 16 | iBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv 17 | 1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOM 18 | hWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtT 19 | vICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYm 20 | yeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDi 21 | QonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BW 22 | rozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OB 23 | GjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2Fu 24 | pH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6 25 | EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC" ); 26 | background-position:center center; 27 | border:1px solid #00aa00; 28 | } 29 | 30 | .yui-skin-sam .yui-h-slider { 31 | background: url(bg-h.gif) no-repeat 5px 0; 32 | height: 28px; 33 | width: 228px; 34 | } 35 | -------------------------------------------------------------------------------- /tests/dataurl-base64-linebreakindata.css.min: -------------------------------------------------------------------------------- 1 | .yui3-skin-night .yui3-dial-ring-vml,.yui3-skin-night .yui3-dial-center-button-vml,.yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min,.yui3-skin-night v\:oval.yui3-dial-marker-max-min,.yui3-skin-night .yui3-dial-marker-vml,.yui3-skin-night .yui3-dial-handle-vml{background:0;opacity:1}div.base64-doublequotes{width:100px;height:100px;background-image:url("data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwqwjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWiiBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOMhWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtTvICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYmyeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDiQonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BWrozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OBGjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2FupH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC");background-position:center center;border:1px solid #0a0}.yui-skin-sam .yui-h-slider{background:url(bg-h.gif) no-repeat 5px 0;height:28px;width:228px} -------------------------------------------------------------------------------- /tests/dataurl-base64-twourls.css: -------------------------------------------------------------------------------- 1 | .yui3-skin-night .yui3-dial-ring-vml, 2 | .yui3-skin-night .yui3-dial-center-button-vml, 3 | .yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min, 4 | .yui3-skin-night v\:oval.yui3-dial-marker-max-min, 5 | .yui3-skin-night .yui3-dial-marker-vml, 6 | .yui3-skin-night .yui3-dial-handle-vml { 7 | background: none; 8 | opacity:1; 9 | } 10 | 11 | div.base64-singlequotes { 12 | width:100px; 13 | height:100px; 14 | background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t%2FAAAACXBIWXMAAA3WAAAN1gGQb3mcAAAFrUlEQVRYw%2B2Xz28kRxXHP%2B9Vdc8vj2fG9uIkm2yUeFGEhNCKQwBpj1yRUBAnpJU4ceZP4MxfkBxy2GO45bQXuEGQohUKigQ%2BsBBE1sbYXv8Yz%2FRMd9fjUN09PV5nFZA4kZZa79W3quu9er%2FqNfy%2FPwJgZty%2Ffz%2FZ29vrpmmqhlWTgmFg1UpbfWhYhG6Yq2cFi%2FNrj9nJyWnx%2BPHjeafbMTEzPvjVB9%2B6d%2B%2FezweDwV1BfHubivkC3lZya%2F4m7Np8UZYXhweHH7733rvvC0Kyv7%2F%2F7p07d34qIjyvr63RNb4l4CbsRUrNrq6OfvfRRz%2FxDx486A%2F6g7vXhX9ZIf%2Bp4JomaToZj8d7Pk1SFRFXb1aWodq09l%2F9YZu%2FCWMVL9e%2FaVFVQVUREEG8r3VUEZ4cX%2FHL30%2B5shRtAhFq4wggNb6GrXgVa2K2jYtACIHv7Sz54TfHjWWagBOBy0Xgt%2BcjLtwQxVCpNwURQat1DdYaT7pwdwKDFA6ncHgFizJmSb3WLPDa7PMIVlb2daqZxdONUnAetEojEdBGiXXhTmAjhZ0%2B3N6AlzeEROH1TXiWGf%2BcwmkWZYnAfAkdx1pq%2BhUbT9z3IElUJlVhI4WsgCLUyggi4MQYd4VXNmCYRqXOspV7UoHbQ3hpEMeLAk5mkFYRYlWI%2BHZ6CTDwkKSQqrA7gFeHMF3C6VyYLmFZGiKCE6GrMFsaWb7yuVOh66N1FkUUpBJ3TyvFovToBl9XMbNY2bZ70BsKfW94hbyErosmXpQwy4VgkCjMizjvRRik0EtiLNwagBf465lwOqtkETEn60XT1%2BlTazrpKlR%2BKkooy3Xfb3Wj3wGWJRQhnni7B53q5FqZ4%2FUR7PYhGMxyuMwgWVqTxrYWAwZYQX78J5i8ie9txSAkoOqqQAqk3pBgKLDhlY5XVKPCi3w97YRoKSFaceCgF2hqSXRBPQAIOcXRH8hP%2F0y6%2BRpWLrEyg3SbS9tmzggzJQSLQZo4xoOE8UbCsJfQ7zi6iaIizZ5OBVfXDKPireWC%2BvAYWOBqeszl9Jg03afbH6OqGH%2FBSUrqbrFIXiHoiEDC%2FPySi2d9nnZHJE7opY7dcY%2FdcZej84zpPGfY9Uw2ErYGCf2O4mUVEzELWtqUxZKjf3zK2cURzicMRy%2BzvbuH8ylFPqXIPqNczClKY1mUZFcnSDKkv%2FUNuptbWG%2BLw%2FMh%2FzrYpKBHKV3ONOXzYxeV20z49qhs7gaMWIjqQQiBxVXB4irg05yz4u%2FMpieoJuTLjDJfUJYBzBAFUUHkhMvLvzFPuvQ2JvQ3duh0R%2FjuiDQdIn6MJdvkxTafZUPuaN6UaOo6UNtgNl9weboguwqoA5fCjEusNCzE8LJQFRuNrzpQD%2BrmZNM55%2F4A5z1J2iHtDEg6fZK0j0uHlDrh2N4i3Ptuc%2BH5tjp5HliWQmmOUAhlYe0rqUqWSEOhcZ05AvE1UdColSQJaHWlSUYgJy%2FO2fFfo%2F34piphFOZ4OrvNdL5EJZbcmE8OQzFxIJEGEgIeE1%2FhrjJLxZcOrIVpVC7TW00WmLWyAMDEs%2Bi9wVJDtG17Y21vVmNxLKqIOkQqqoq2qHORmgj9UQcza7mgFm4GmiDjO5C72DSoQ6uPVTW%2BzuFUcQ2teKd4pzhd8b6Nu6jg7vZsrb1rClEIxhu7Q37x47fIy3j%2Fi8iqqlUuEWTFN%2FOrMU3fEEuhUM8FIPDqZgcRIVhsAXxtjGDGS5M%2BP%2Fv%2Bm7yopVrRVsPabsW%2BYG1T%2Fy3KahqSg6cHRb5cTmt5ZXhxQ7nS6yZsVWOajDFbw2JSCSGEIsuyC%2F%2Fo0aPp%2Fv7%2Br9NO5%2F5gMOhJLNn%2FpQLrLfw6tkKKorCDg4NPP%2Fnkjx%2FLOz96h2enzyZvf%2BftH9za2fm6qLrnO9tGk2vY86f%2FMliWZRdPnjz5zcOHDz%2B%2B%2Fifimorzv31C9X718G%2FYrCYSNJa5LgAAACJ6VFh0U29mdHdhcmUAAHjaKy8v18vMyy5OTixI1csvSgcANtgGWBBTylwAAAAASUVORK5CYII%3D'); 15 | background-position:center center; 16 | border:1px solid #00aa00; 17 | } 18 | 19 | div.otherdataurl { 20 | background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwqwjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWiiBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOMhWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtTvICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYmyeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDiQonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BWrozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OBGjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2FupH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC"); 21 | } 22 | 23 | .yui-skin-sam .yui-h-slider { 24 | background: url(bg-h.gif) no-repeat 5px 0; 25 | height: 28px; 26 | width: 228px; 27 | } -------------------------------------------------------------------------------- /tests/dataurl-base64-twourls.css.min: -------------------------------------------------------------------------------- 1 | .yui3-skin-night .yui3-dial-ring-vml,.yui3-skin-night .yui3-dial-center-button-vml,.yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min,.yui3-skin-night v\:oval.yui3-dial-marker-max-min,.yui3-skin-night .yui3-dial-marker-vml,.yui3-skin-night .yui3-dial-handle-vml{background:0;opacity:1}div.base64-singlequotes{width:100px;height:100px;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t%2FAAAACXBIWXMAAA3WAAAN1gGQb3mcAAAFrUlEQVRYw%2B2Xz28kRxXHP%2B9Vdc8vj2fG9uIkm2yUeFGEhNCKQwBpj1yRUBAnpJU4ceZP4MxfkBxy2GO45bQXuEGQohUKigQ%2BsBBE1sbYXv8Yz%2FRMd9fjUN09PV5nFZA4kZZa79W3quu9er%2FqNfy%2FPwJgZty%2Ffz%2FZ29vrpmmqhlWTgmFg1UpbfWhYhG6Yq2cFi%2FNrj9nJyWnx%2BPHjeafbMTEzPvjVB9%2B6d%2B%2FezweDwV1BfHubivkC3lZya%2F4m7Np8UZYXhweHH7733rvvC0Kyv7%2F%2F7p07d34qIjyvr63RNb4l4CbsRUrNrq6OfvfRRz%2FxDx486A%2F6g7vXhX9ZIf%2Bp4JomaToZj8d7Pk1SFRFXb1aWodq09l%2F9YZu%2FCWMVL9e%2FaVFVQVUREEG8r3VUEZ4cX%2FHL30%2B5shRtAhFq4wggNb6GrXgVa2K2jYtACIHv7Sz54TfHjWWagBOBy0Xgt%2BcjLtwQxVCpNwURQat1DdYaT7pwdwKDFA6ncHgFizJmSb3WLPDa7PMIVlb2daqZxdONUnAetEojEdBGiXXhTmAjhZ0%2B3N6AlzeEROH1TXiWGf%2BcwmkWZYnAfAkdx1pq%2BhUbT9z3IElUJlVhI4WsgCLUyggi4MQYd4VXNmCYRqXOspV7UoHbQ3hpEMeLAk5mkFYRYlWI%2BHZ6CTDwkKSQqrA7gFeHMF3C6VyYLmFZGiKCE6GrMFsaWb7yuVOh66N1FkUUpBJ3TyvFovToBl9XMbNY2bZ70BsKfW94hbyErosmXpQwy4VgkCjMizjvRRik0EtiLNwagBf465lwOqtkETEn60XT1%2BlTazrpKlR%2BKkooy3Xfb3Wj3wGWJRQhnni7B53q5FqZ4%2FUR7PYhGMxyuMwgWVqTxrYWAwZYQX78J5i8ie9txSAkoOqqQAqk3pBgKLDhlY5XVKPCi3w97YRoKSFaceCgF2hqSXRBPQAIOcXRH8hP%2F0y6%2BRpWLrEyg3SbS9tmzggzJQSLQZo4xoOE8UbCsJfQ7zi6iaIizZ5OBVfXDKPireWC%2BvAYWOBqeszl9Jg03afbH6OqGH%2FBSUrqbrFIXiHoiEDC%2FPySi2d9nnZHJE7opY7dcY%2FdcZej84zpPGfY9Uw2ErYGCf2O4mUVEzELWtqUxZKjf3zK2cURzicMRy%2BzvbuH8ylFPqXIPqNczClKY1mUZFcnSDKkv%2FUNuptbWG%2BLw%2FMh%2FzrYpKBHKV3ONOXzYxeV20z49qhs7gaMWIjqQQiBxVXB4irg05yz4u%2FMpieoJuTLjDJfUJYBzBAFUUHkhMvLvzFPuvQ2JvQ3duh0R%2FjuiDQdIn6MJdvkxTafZUPuaN6UaOo6UNtgNl9weboguwqoA5fCjEusNCzE8LJQFRuNrzpQD%2BrmZNM55%2F4A5z1J2iHtDEg6fZK0j0uHlDrh2N4i3Ptuc%2BH5tjp5HliWQmmOUAhlYe0rqUqWSEOhcZ05AvE1UdColSQJaHWlSUYgJy%2FO2fFfo%2F34piphFOZ4OrvNdL5EJZbcmE8OQzFxIJEGEgIeE1%2FhrjJLxZcOrIVpVC7TW00WmLWyAMDEs%2Bi9wVJDtG17Y21vVmNxLKqIOkQqqoq2qHORmgj9UQcza7mgFm4GmiDjO5C72DSoQ6uPVTW%2BzuFUcQ2teKd4pzhd8b6Nu6jg7vZsrb1rClEIxhu7Q37x47fIy3j%2Fi8iqqlUuEWTFN%2FOrMU3fEEuhUM8FIPDqZgcRIVhsAXxtjGDGS5M%2BP%2Fv%2Bm7yopVrRVsPabsW%2BYG1T%2Fy3KahqSg6cHRb5cTmt5ZXhxQ7nS6yZsVWOajDFbw2JSCSGEIsuyC%2F%2Fo0aPp%2Fv7%2Br9NO5%2F5gMOhJLNn%2FpQLrLfw6tkKKorCDg4NPP%2Fnkjx%2FLOz96h2enzyZvf%2BftH9za2fm6qLrnO9tGk2vY86f%2FMliWZRdPnjz5zcOHDz%2B%2B%2Fifimorzv31C9X718G%2FYrCYSNJa5LgAAACJ6VFh0U29mdHdhcmUAAHjaKy8v18vMyy5OTixI1csvSgcANtgGWBBTylwAAAAASUVORK5CYII%3D');background-position:center center;border:1px solid #0a0}div.otherdataurl{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwqwjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWiiBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOMhWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtTvICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYmyeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDiQonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BWrozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OBGjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2FupH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC")}.yui-skin-sam .yui-h-slider{background:url(bg-h.gif) no-repeat 5px 0;height:28px;width:228px} -------------------------------------------------------------------------------- /tests/dataurl-dbquote-font.css: -------------------------------------------------------------------------------- 1 | /*csslint fontfamily: true*/ 2 | 3 | /** 4 | * Foo 5 | */ 6 | 7 | .y-ff-1 { 8 | font-family:"Foo Bar",Helvetica,Arial; 9 | text-rendering: optimizeLegibility; 10 | } 11 | 12 | .ua-op .y-ff-1 { 13 | /* Some Comment */ 14 | font-family:Helvetica,Arial; 15 | } 16 | 17 | /* 18 | Foo 19 | 20 | Bar 21 | */ 22 | 23 | @font-face { 24 | font-family: "Foo Bar"; 25 | src: url("data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA") format("truetype"), 26 | url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg"); 27 | font-weight: normal; 28 | font-style: normal; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/dataurl-dbquote-font.css.min: -------------------------------------------------------------------------------- 1 | .y-ff-1{font-family:"Foo Bar",Helvetica,Arial;text-rendering:optimizeLegibility}.ua-op .y-ff-1{font-family:Helvetica,Arial}@font-face{font-family:"Foo Bar";src:url("data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA") format("truetype"),url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg");font-weight:normal;font-style:normal} 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/dataurl-nonbase64-doublequotes.css: -------------------------------------------------------------------------------- 1 | div.nonbase64-doublequotes { 2 | width:100px; 3 | height:100px; 4 | background-image:url( 5 | "data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0'''%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh)))%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3(((%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82" 6 | ); 7 | border:1px solid #00aa00; 8 | } 9 | 10 | span.othercss { 11 | font-family:"Times New Roman"; 12 | font-weight:inherit; 13 | } 14 | -------------------------------------------------------------------------------- /tests/dataurl-nonbase64-doublequotes.css.min: -------------------------------------------------------------------------------- 1 | div.nonbase64-doublequotes{width:100px;height:100px;background-image:url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0'''%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh)))%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3(((%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82");border:1px solid #0a0}span.othercss{font-family:"Times New Roman";font-weight:inherit} 2 | -------------------------------------------------------------------------------- /tests/dataurl-nonbase64-noquotes.css: -------------------------------------------------------------------------------- 1 | div.nonbase64-noquotes { 2 | width:100px; 3 | height:100px; 4 | background-image:url( data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0\'\'\'%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh\)\)\)%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3\(\(\(%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82 ); 5 | border:1px solid red; 6 | } 7 | 8 | span.othercss { 9 | font-family:"Times New Roman"; 10 | font-weight:inherit; 11 | } 12 | -------------------------------------------------------------------------------- /tests/dataurl-nonbase64-noquotes.css.min: -------------------------------------------------------------------------------- 1 | div.nonbase64-noquotes{width:100px;height:100px;background-image:url(data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0\'\'\'%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh\)\)\)%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3\(\(\(%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82);border:1px solid red}span.othercss{font-family:"Times New Roman";font-weight:inherit} 2 | -------------------------------------------------------------------------------- /tests/dataurl-nonbase64-singlequotes.css: -------------------------------------------------------------------------------- 1 | /* Some Comment */ 2 | 3 | div.nonbase64-singlequotes { 4 | width:100px; 5 | height:100px; 6 | background-image:url('data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0\'\'\'%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh)))%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3(((%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82'); 7 | border:1px solid #0000aa; 8 | } 9 | 10 | /* Some Other Comment */ 11 | 12 | span.othercss { 13 | font-family:"Times New Roman"; 14 | font-weight:inherit; 15 | } 16 | -------------------------------------------------------------------------------- /tests/dataurl-nonbase64-singlequotes.css.min: -------------------------------------------------------------------------------- 1 | div.nonbase64-singlequotes{width:100px;height:100px;background-image:url('data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0\'\'\'%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh)))%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3(((%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82');border:1px solid #00a}span.othercss{font-family:"Times New Roman";font-weight:inherit} 2 | 3 | -------------------------------------------------------------------------------- /tests/dataurl-noquote-multiline-font.css: -------------------------------------------------------------------------------- 1 | /*csslint fontfamily: true*/ 2 | 3 | /** 4 | * Foo 5 | */ 6 | 7 | .y-ff-1 { 8 | font-family:"Foo Bar",Helvetica,Arial; 9 | text-rendering: optimizeLegibility; 10 | } 11 | 12 | .ua-op .y-ff-1 { 13 | /* Some Comment */ 14 | font-family:Helvetica,Arial; 15 | } 16 | 17 | /* 18 | Foo 19 | 20 | Bar 21 | */ 22 | 23 | @font-face { 24 | font-family: "Foo Bar"; 25 | src: url( 26 | data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA) format("truetype"), 27 | url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg"); 28 | font-weight: normal; 29 | font-style: normal; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /tests/dataurl-noquote-multiline-font.css.min: -------------------------------------------------------------------------------- 1 | .y-ff-1{font-family:"Foo Bar",Helvetica,Arial;text-rendering:optimizeLegibility}.ua-op .y-ff-1{font-family:Helvetica,Arial}@font-face{font-family:"Foo Bar";src:url(data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA) format("truetype"),url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg");font-weight:normal;font-style:normal} 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/dataurl-realdata-doublequotes.css: -------------------------------------------------------------------------------- 1 | .yui3-skin-sam .yui3-scrollview-scrollbar { 2 | -webkit-transform: translate3d(0, 0, 0); 3 | -moz-transform: translate(0, 0); 4 | } 5 | 6 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first, 7 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle, 8 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last { 9 | border-radius:3px; 10 | -webkit-border-radius: 3px; 11 | -moz-border-radius: 3px; 12 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg=="); 13 | } 14 | 15 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first, 16 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last { 17 | border-bottom-right-radius:0; 18 | border-bottom-left-radius:0; 19 | 20 | -webkit-border-bottom-right-radius:0; 21 | -webkit-border-bottom-left-radius:0; 22 | 23 | -moz-border-radius-bottomright:0; 24 | -moz-border-radius-bottomleft:0; 25 | } 26 | 27 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last { 28 | border-radius:0; 29 | border-bottom-right-radius:3px; 30 | border-bottom-left-radius:3px; 31 | 32 | -webkit-border-radius:0; 33 | -webkit-border-bottom-right-radius:3px; 34 | -webkit-border-bottom-left-radius:3px; 35 | -webkit-transform: translate3d(0, 0, 0); 36 | 37 | -moz-border-radius:0; 38 | -moz-border-radius-bottomright:3px; 39 | -moz-border-radius-bottomleft:3px; 40 | -moz-transform: translate(0, 0); 41 | } 42 | 43 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle { 44 | border-radius:0; 45 | -webkit-border-radius: 0; 46 | -moz-border-radius: 0; 47 | 48 | -webkit-transform: translate3d(0,0,0) scaleY(1); 49 | -webkit-transform-origin-y: 0; 50 | 51 | -moz-transform: translate(0,0) scaleY(1); 52 | -moz-transform-origin: 0 0; 53 | } 54 | 55 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first, 56 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last { 57 | border-top-right-radius: 0; 58 | border-bottom-left-radius: 3px; 59 | 60 | -webkit-border-top-right-radius: 0; 61 | -webkit-border-bottom-left-radius: 3px; 62 | 63 | -moz-border-radius-topright: 0; 64 | -moz-border-radius-bottomleft: 3px; 65 | } 66 | 67 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last { 68 | border-bottom-left-radius: 0; 69 | border-top-right-radius: 3px; 70 | 71 | -webkit-border-bottom-left-radius: 0; 72 | -webkit-border-top-right-radius: 3px; 73 | 74 | -moz-border-radius-bottomleft: 0; 75 | -moz-border-radius-topright: 3px; 76 | } 77 | 78 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle { 79 | -webkit-transform: translate3d(0,0,0) scaleX(1); 80 | -webkit-transform-origin: 0 0; 81 | 82 | -moz-transform: translate(0,0) scaleX(1); 83 | -moz-transform-origin: 0 0; 84 | } 85 | 86 | .yui3-skin-sam .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child, 87 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child { 88 | background-color: #aaa; 89 | background-image: none; 90 | } -------------------------------------------------------------------------------- /tests/dataurl-realdata-doublequotes.css.min: -------------------------------------------------------------------------------- 1 | .yui3-skin-sam .yui3-scrollview-scrollbar{-webkit-transform:translate3d(0,0,0);-moz-transform:translate(0,0)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==")}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-bottom-right-radius:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px;-webkit-border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;-webkit-transform:translate3d(0,0,0);-moz-border-radius:0;-moz-border-radius-bottomright:3px;-moz-border-radius-bottomleft:3px;-moz-transform:translate(0,0)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-webkit-transform:translate3d(0,0,0) scaleY(1);-webkit-transform-origin-y:0;-moz-transform:translate(0,0) scaleY(1);-moz-transform-origin:0 0}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-top-right-radius:0;border-bottom-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:3px;-moz-border-radius-topright:0;-moz-border-radius-bottomleft:3px}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-bottom-left-radius:0;border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-top-right-radius:3px;-moz-border-radius-bottomleft:0;-moz-border-radius-topright:3px}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle{-webkit-transform:translate3d(0,0,0) scaleX(1);-webkit-transform-origin:0 0;-moz-transform:translate(0,0) scaleX(1);-moz-transform-origin:0 0}.yui3-skin-sam .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child,.yui3-skin-sam .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child{background-color:#aaa;background-image:none} 2 | -------------------------------------------------------------------------------- /tests/dataurl-realdata-noquotes.css: -------------------------------------------------------------------------------- 1 | .yui3-skin-sam .yui3-scrollview-scrollbar { 2 | -webkit-transform: translate3d(0, 0, 0); 3 | -moz-transform: translate(0, 0); 4 | } 5 | 6 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first, 7 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle, 8 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last { 9 | border-radius:3px; 10 | -webkit-border-radius: 3px; 11 | -moz-border-radius: 3px; 12 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==); 13 | } 14 | 15 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first, 16 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last { 17 | border-bottom-right-radius:0; 18 | border-bottom-left-radius:0; 19 | 20 | -webkit-border-bottom-right-radius:0; 21 | -webkit-border-bottom-left-radius:0; 22 | 23 | -moz-border-radius-bottomright:0; 24 | -moz-border-radius-bottomleft:0; 25 | } 26 | 27 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last { 28 | border-radius:0; 29 | border-bottom-right-radius:3px; 30 | border-bottom-left-radius:3px; 31 | 32 | -webkit-border-radius:0; 33 | -webkit-border-bottom-right-radius:3px; 34 | -webkit-border-bottom-left-radius:3px; 35 | -webkit-transform: translate3d(0, 0, 0); 36 | 37 | -moz-border-radius:0; 38 | -moz-border-radius-bottomright:3px; 39 | -moz-border-radius-bottomleft:3px; 40 | -moz-transform: translate(0, 0); 41 | } 42 | 43 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle { 44 | border-radius:0; 45 | -webkit-border-radius: 0; 46 | -moz-border-radius: 0; 47 | 48 | -webkit-transform: translate3d(0,0,0) scaleY(1); 49 | -webkit-transform-origin-y: 0; 50 | 51 | -moz-transform: translate(0,0) scaleY(1); 52 | -moz-transform-origin: 0 0; 53 | } 54 | 55 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first, 56 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last { 57 | border-top-right-radius: 0; 58 | border-bottom-left-radius: 3px; 59 | 60 | -webkit-border-top-right-radius: 0; 61 | -webkit-border-bottom-left-radius: 3px; 62 | 63 | -moz-border-radius-topright: 0; 64 | -moz-border-radius-bottomleft: 3px; 65 | } 66 | 67 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last { 68 | border-bottom-left-radius: 0; 69 | border-top-right-radius: 3px; 70 | 71 | -webkit-border-bottom-left-radius: 0; 72 | -webkit-border-top-right-radius: 3px; 73 | 74 | -moz-border-radius-bottomleft: 0; 75 | -moz-border-radius-topright: 3px; 76 | } 77 | 78 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle { 79 | -webkit-transform: translate3d(0,0,0) scaleX(1); 80 | -webkit-transform-origin: 0 0; 81 | 82 | -moz-transform: translate(0,0) scaleX(1); 83 | -moz-transform-origin: 0 0; 84 | } 85 | 86 | .yui3-skin-sam .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child, 87 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child { 88 | background-color: #aaa; 89 | background-image: none; 90 | } -------------------------------------------------------------------------------- /tests/dataurl-realdata-noquotes.css.min: -------------------------------------------------------------------------------- 1 | .yui3-skin-sam .yui3-scrollview-scrollbar{-webkit-transform:translate3d(0,0,0);-moz-transform:translate(0,0)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-bottom-right-radius:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px;-webkit-border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;-webkit-transform:translate3d(0,0,0);-moz-border-radius:0;-moz-border-radius-bottomright:3px;-moz-border-radius-bottomleft:3px;-moz-transform:translate(0,0)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-webkit-transform:translate3d(0,0,0) scaleY(1);-webkit-transform-origin-y:0;-moz-transform:translate(0,0) scaleY(1);-moz-transform-origin:0 0}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-top-right-radius:0;border-bottom-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:3px;-moz-border-radius-topright:0;-moz-border-radius-bottomleft:3px}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-bottom-left-radius:0;border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-top-right-radius:3px;-moz-border-radius-bottomleft:0;-moz-border-radius-topright:3px}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle{-webkit-transform:translate3d(0,0,0) scaleX(1);-webkit-transform-origin:0 0;-moz-transform:translate(0,0) scaleX(1);-moz-transform-origin:0 0}.yui3-skin-sam .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child,.yui3-skin-sam .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child{background-color:#aaa;background-image:none} -------------------------------------------------------------------------------- /tests/dataurl-realdata-singlequotes.css: -------------------------------------------------------------------------------- 1 | .yui3-skin-sam .yui3-scrollview-scrollbar { 2 | -webkit-transform: translate3d(0, 0, 0); 3 | -moz-transform: translate(0, 0); 4 | } 5 | 6 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first, 7 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle, 8 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last { 9 | border-radius:3px; 10 | -webkit-border-radius: 3px; 11 | -moz-border-radius: 3px; 12 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg=='); 13 | } 14 | 15 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first, 16 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last { 17 | border-bottom-right-radius:0; 18 | border-bottom-left-radius:0; 19 | 20 | -webkit-border-bottom-right-radius:0; 21 | -webkit-border-bottom-left-radius:0; 22 | 23 | -moz-border-radius-bottomright:0; 24 | -moz-border-radius-bottomleft:0; 25 | } 26 | 27 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last { 28 | border-radius:0; 29 | border-bottom-right-radius:3px; 30 | border-bottom-left-radius:3px; 31 | 32 | -webkit-border-radius:0; 33 | -webkit-border-bottom-right-radius:3px; 34 | -webkit-border-bottom-left-radius:3px; 35 | -webkit-transform: translate3d(0, 0, 0); 36 | 37 | -moz-border-radius:0; 38 | -moz-border-radius-bottomright:3px; 39 | -moz-border-radius-bottomleft:3px; 40 | -moz-transform: translate(0, 0); 41 | } 42 | 43 | .yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle { 44 | border-radius:0; 45 | -webkit-border-radius: 0; 46 | -moz-border-radius: 0; 47 | 48 | -webkit-transform: translate3d(0,0,0) scaleY(1); 49 | -webkit-transform-origin-y: 0; 50 | 51 | -moz-transform: translate(0,0) scaleY(1); 52 | -moz-transform-origin: 0 0; 53 | } 54 | 55 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first, 56 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last { 57 | border-top-right-radius: 0; 58 | border-bottom-left-radius: 3px; 59 | 60 | -webkit-border-top-right-radius: 0; 61 | -webkit-border-bottom-left-radius: 3px; 62 | 63 | -moz-border-radius-topright: 0; 64 | -moz-border-radius-bottomleft: 3px; 65 | } 66 | 67 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last { 68 | border-bottom-left-radius: 0; 69 | border-top-right-radius: 3px; 70 | 71 | -webkit-border-bottom-left-radius: 0; 72 | -webkit-border-top-right-radius: 3px; 73 | 74 | -moz-border-radius-bottomleft: 0; 75 | -moz-border-radius-topright: 3px; 76 | } 77 | 78 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle { 79 | -webkit-transform: translate3d(0,0,0) scaleX(1); 80 | -webkit-transform-origin: 0 0; 81 | 82 | -moz-transform: translate(0,0) scaleX(1); 83 | -moz-transform-origin: 0 0; 84 | } 85 | 86 | .yui3-skin-sam .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child, 87 | .yui3-skin-sam .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child { 88 | background-color: #aaa; 89 | background-image: none; 90 | } -------------------------------------------------------------------------------- /tests/dataurl-realdata-singlequotes.css.min: -------------------------------------------------------------------------------- 1 | .yui3-skin-sam .yui3-scrollview-scrollbar{-webkit-transform:translate3d(0,0,0);-moz-transform:translate(0,0)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==')}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-bottom-right-radius:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px;-webkit-border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;-webkit-transform:translate3d(0,0,0);-moz-border-radius:0;-moz-border-radius-bottomright:3px;-moz-border-radius-bottomleft:3px;-moz-transform:translate(0,0)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-webkit-transform:translate3d(0,0,0) scaleY(1);-webkit-transform-origin-y:0;-moz-transform:translate(0,0) scaleY(1);-moz-transform-origin:0 0}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-top-right-radius:0;border-bottom-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:3px;-moz-border-radius-topright:0;-moz-border-radius-bottomleft:3px}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-bottom-left-radius:0;border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-top-right-radius:3px;-moz-border-radius-bottomleft:0;-moz-border-radius-topright:3px}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle{-webkit-transform:translate3d(0,0,0) scaleX(1);-webkit-transform-origin:0 0;-moz-transform:translate(0,0) scaleX(1);-moz-transform-origin:0 0}.yui3-skin-sam .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child,.yui3-skin-sam .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child{background-color:#aaa;background-image:none} -------------------------------------------------------------------------------- /tests/dataurl-realdata-yuiapp.css: -------------------------------------------------------------------------------- 1 | html { 2 | background: #fff; 3 | color: #555; 4 | height: 100%; 5 | } 6 | 7 | #hd, #bd, #ft { 8 | padding: 0 50px; 9 | } 10 | 11 | #bd { 12 | padding-bottom: 50px; 13 | border-bottom: 1px solid #006e9c; 14 | } 15 | 16 | #ft { 17 | background: transparent no-repeat 0% 100%; 18 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAAeCAMAAAC/pnaKAAAAwFBMVEUkXIAoYYQoYYQoYYQyao02bpE6cpQ6cpREe51LgqNUiqtUiqtUiqtZj7BckrNlmrtlmrtlmrtroMB3qsp3qsp3qsp+sdCHudiHudiHudiHudiPwN+YyOaYyOaYyOaf0O2g0O6n1vOn1vOn1vOn1vOw3vu45f245f245f3B7f7K9f7K9f7K9f7X/v7X/v7p//7p//79//79//4AAABhAGMAbwBzAC4AcwB0AHIAaQBuAGcAcwABAAAAwIwmGwEAAABQQKFUAAAAQHRSTlP///////////////////////////////////////////////////////////////////8A////////////////0pfSbwAAAdtJREFUOI2NlNGqgzAMhv/ClDlQQcFdKOx4McFCKcH3f7eTtLWr07mFiUvbzz9Nk2LZGRH5937qZTiGyEx0Cr5xQpEd6xzNueCGc9SzUmAzP8cplO1zgRRutBAlM9EhZwknWj1LKXkwbOVojTqMEpKZOfeUD3OnR24VWeJf1OOBTnTgw8zZr3LyOlbdrWrdGlpG6Alz4Ni3RcT4Ldm8wHpOo9Yo5CPsdngM6D3HmLlESrgHD+YvrtEuUeLeMf7x7j23GJVgbJoHs0/cI3B7TNkfON5btsEUrvSdY694U0P9nXMp2mDsdbLmY14CN8XDjtzgo9CuqpYnGoMscDUmn08qsbOn/3Lte6rgP1eM7qQ1YMP+yPhiTmx2laDQspytgJI1MbIzZ7yHfj2/hYYtZ1xMM4dc3iTukjgJyKsrUBEH4uqFXNUh3aXxtWjbC3DpH8LRVPJ8MXLoA8fsz51ue73Q+1z7RkTEF0dWa1o5a8001C6ZbGuzh0bSTo9iS8X+C/NWbfTW5uZ9Vu4QaL20Xv3uhgyrZUXVtI2NfS3fbzgP75dNek/YbrL+k/EykecuZf6ZOzDJYsf9PCV3xhFHq7043mw+H1ylW+5Ab5jpADuPM2Z1P3POLWnUG/sHnIDsqkOjlqoAAAAASUVORK5CYII=); 19 | /* image width: 55px */ 20 | padding: 0 0 40px 0; 21 | margin: 50px; 22 | } 23 | 24 | #hd, #bd { 25 | background: #f9f9f9; 26 | } 27 | 28 | body { 29 | margin: 0; 30 | padding: 0; 31 | font: 12px "Helvetica Nueue", Arial, sans-serif; 32 | } 33 | 34 | #hd { 35 | color: #fff; 36 | padding-top: 50px; 37 | margin: 0; 38 | } 39 | 40 | #hd, h1, h2, p, .color { 41 | margin: auto; 42 | } 43 | 44 | h1, h2, a { 45 | color: #006e9c; 46 | } 47 | 48 | h1, h2 { 49 | margin-top: 0; 50 | } 51 | 52 | h4 .title { 53 | font-weight: bold; 54 | letter-spacing: -2px; 55 | font-size: 47px; 56 | text-shadow: 0 1px 0 #369; 57 | background: #006e9d; 58 | color: #fff; 59 | padding: 0 10px; 60 | } 61 | 62 | h4 { 63 | display: block; 64 | float: right; 65 | margin: 0 0 0 20px; 66 | } 67 | 68 | h4 .what { 69 | display: block; 70 | padding: 4px; 71 | text-align: center; 72 | font-weight: normal; 73 | } 74 | 75 | h4 .version { 76 | font-size: 11px; 77 | color: #ccc; 78 | } 79 | 80 | h2 { 81 | font-size: 40px; 82 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light", 83 | "Helvetica Neue", sans-serif; 84 | font-weight: 300; 85 | } 86 | 87 | h4, p { 88 | padding: 6px 0 6px; 89 | } 90 | 91 | #ft p.fine, #ft p.fine a { 92 | color: #999; 93 | } 94 | 95 | #ft p.intro { 96 | font-size: 12px; 97 | } 98 | 99 | #bd { 100 | font-size: 14px; 101 | color: #666; 102 | } 103 | 104 | #ft p { 105 | font-size: 11px; 106 | } 107 | -------------------------------------------------------------------------------- /tests/dataurl-realdata-yuiapp.css.min: -------------------------------------------------------------------------------- 1 | html{background:#fff;color:#555;height:100%}#hd,#bd,#ft{padding:0 50px}#bd{padding-bottom:50px;border-bottom:1px solid #006e9c}#ft{background:transparent no-repeat 0 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAAeCAMAAAC/pnaKAAAAwFBMVEUkXIAoYYQoYYQoYYQyao02bpE6cpQ6cpREe51LgqNUiqtUiqtUiqtZj7BckrNlmrtlmrtlmrtroMB3qsp3qsp3qsp+sdCHudiHudiHudiHudiPwN+YyOaYyOaYyOaf0O2g0O6n1vOn1vOn1vOn1vOw3vu45f245f245f3B7f7K9f7K9f7K9f7X/v7X/v7p//7p//79//79//4AAABhAGMAbwBzAC4AcwB0AHIAaQBuAGcAcwABAAAAwIwmGwEAAABQQKFUAAAAQHRSTlP///////////////////////////////////////////////////////////////////8A////////////////0pfSbwAAAdtJREFUOI2NlNGqgzAMhv/ClDlQQcFdKOx4McFCKcH3f7eTtLWr07mFiUvbzz9Nk2LZGRH5937qZTiGyEx0Cr5xQpEd6xzNueCGc9SzUmAzP8cplO1zgRRutBAlM9EhZwknWj1LKXkwbOVojTqMEpKZOfeUD3OnR24VWeJf1OOBTnTgw8zZr3LyOlbdrWrdGlpG6Alz4Ni3RcT4Ldm8wHpOo9Yo5CPsdngM6D3HmLlESrgHD+YvrtEuUeLeMf7x7j23GJVgbJoHs0/cI3B7TNkfON5btsEUrvSdY694U0P9nXMp2mDsdbLmY14CN8XDjtzgo9CuqpYnGoMscDUmn08qsbOn/3Lte6rgP1eM7qQ1YMP+yPhiTmx2laDQspytgJI1MbIzZ7yHfj2/hYYtZ1xMM4dc3iTukjgJyKsrUBEH4uqFXNUh3aXxtWjbC3DpH8LRVPJ8MXLoA8fsz51ue73Q+1z7RkTEF0dWa1o5a8001C6ZbGuzh0bSTo9iS8X+C/NWbfTW5uZ9Vu4QaL20Xv3uhgyrZUXVtI2NfS3fbzgP75dNek/YbrL+k/EykecuZf6ZOzDJYsf9PCV3xhFHq7043mw+H1ylW+5Ab5jpADuPM2Z1P3POLWnUG/sHnIDsqkOjlqoAAAAASUVORK5CYII=);padding:0 0 40px 0;margin:50px}#hd,#bd{background:#f9f9f9}body{margin:0;padding:0;font:12px "Helvetica Nueue",Arial,sans-serif}#hd{color:#fff;padding-top:50px;margin:0}#hd,h1,h2,p,.color{margin:auto}h1,h2,a{color:#006e9c}h1,h2{margin-top:0}h4 .title{font-weight:bold;letter-spacing:-2px;font-size:47px;text-shadow:0 1px 0 #369;background:#006e9d;color:#fff;padding:0 10px}h4{display:block;float:right;margin:0 0 0 20px}h4 .what{display:block;padding:4px;text-align:center;font-weight:normal}h4 .version{font-size:11px;color:#ccc}h2{font-size:40px;font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-weight:300}h4,p{padding:6px 0 6px}#ft p.fine,#ft p.fine a{color:#999}#ft p.intro{font-size:12px}#bd{font-size:14px;color:#666}#ft p{font-size:11px} 2 | -------------------------------------------------------------------------------- /tests/dataurl-singlequote-font.css: -------------------------------------------------------------------------------- 1 | /*csslint fontfamily: true*/ 2 | 3 | /** 4 | * Foo 5 | */ 6 | 7 | .y-ff-1 { 8 | font-family:"Foo Bar",Helvetica,Arial; 9 | text-rendering: optimizeLegibility; 10 | } 11 | 12 | .ua-op .y-ff-1 { 13 | /* Some Comment */ 14 | font-family:Helvetica,Arial; 15 | } 16 | 17 | /* 18 | Foo 19 | 20 | Bar 21 | */ 22 | 23 | @font-face { 24 | font-family: "Foo Bar"; 25 | src: URL('data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA') format("truetype"), 26 | url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg"); 27 | font-weight: normal; 28 | font-style: normal; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/dataurl-singlequote-font.css.min: -------------------------------------------------------------------------------- 1 | .y-ff-1{font-family:"Foo Bar",Helvetica,Arial;text-rendering:optimizeLegibility}.ua-op .y-ff-1{font-family:Helvetica,Arial}@font-face{font-family:"Foo Bar";src:url('data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA') format("truetype"),url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg");font-weight:normal;font-style:normal} 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/dataurl-validity.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
non-base64 ("")
22 |
non-base64 ()
23 |
non-base64 ('')
24 | 25 |
base64 ("")
26 |
base64 ()
27 |
base64 ('')
28 | 29 | -------------------------------------------------------------------------------- /tests/decimals.css: -------------------------------------------------------------------------------- 1 | ::selection { 2 | margin: 0.6px 0.333pt 1.2em 8.8cm; 3 | } 4 | -------------------------------------------------------------------------------- /tests/decimals.css.min: -------------------------------------------------------------------------------- 1 | ::selection{margin:.6px .333pt 1.2em 8.8cm} -------------------------------------------------------------------------------- /tests/dollar-header.css: -------------------------------------------------------------------------------- 1 | /*! 2 | $Header: /temp/dirname/filename.css 3 2/02/08 3:37p JSmith $ 3 | */ 4 | 5 | foo { 6 | bar: baz 7 | } 8 | -------------------------------------------------------------------------------- /tests/dollar-header.css.min: -------------------------------------------------------------------------------- 1 | /*! 2 | $Header: /temp/dirname/filename.css 3 2/02/08 3:37p JSmith $ 3 | */foo{bar:baz} -------------------------------------------------------------------------------- /tests/float.js: -------------------------------------------------------------------------------- 1 | obj.css({"float": "left"}); 2 | obj.css({cssFloat:"left"}); -------------------------------------------------------------------------------- /tests/float.js.min: -------------------------------------------------------------------------------- 1 | obj.css({"float":"left"});obj.css({cssFloat:"left"}); -------------------------------------------------------------------------------- /tests/font-face.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'gzipper'; 3 | src: url(yanone.eot); 4 | src: local('gzipper'), 5 | url(yanone.ttf) format('truetype'); 6 | } 7 | -------------------------------------------------------------------------------- /tests/font-face.css.min: -------------------------------------------------------------------------------- 1 | @font-face{font-family:'gzipper';src:url(yanone.eot);src:local('gzipper'),url(yanone.ttf) format('truetype')} -------------------------------------------------------------------------------- /tests/hsla-issue81.css.FAIL: -------------------------------------------------------------------------------- 1 | .color_chip { 2 | color: hsla(27, 0%, 50%, 1); 3 | background: rgba(195, 198, 214, 0.85); 4 | } 5 | -------------------------------------------------------------------------------- /tests/hsla-issue81.css.min: -------------------------------------------------------------------------------- 1 | .color_chip{color:hsl(27,0%,50%);background:rgba(195,198,214,0.85)} 2 | -------------------------------------------------------------------------------- /tests/ie-backslash9-hack.css: -------------------------------------------------------------------------------- 1 | label{padding-left: 4px\9;} 2 | @charset "UTF-8"; -------------------------------------------------------------------------------- /tests/ie-backslash9-hack.css.min: -------------------------------------------------------------------------------- 1 | @charset "UTF-8";label{padding-left:4px\9} 2 | -------------------------------------------------------------------------------- /tests/ie5mac.css: -------------------------------------------------------------------------------- 1 | /* Ignore the next rule in IE mac \*/ 2 | .selector { 3 | color: khaki; 4 | } 5 | /* Stop ignoring in IE mac */ 6 | -------------------------------------------------------------------------------- /tests/ie5mac.css.min: -------------------------------------------------------------------------------- 1 | /*\*/.selector{color:khaki}/**/ -------------------------------------------------------------------------------- /tests/issue-59.css: -------------------------------------------------------------------------------- 1 | .issue-59 { 2 | width:100%; 3 | width: -webkit-calc(100% + 30px); 4 | width: -moz-calc(100% + 30px); 5 | width: calc(100% + 30px); 6 | background-position: calc(65% - (100px - 350px * 0.65)) 0; 7 | } 8 | -------------------------------------------------------------------------------- /tests/issue-59.css.min: -------------------------------------------------------------------------------- 1 | .issue-59{width:100%;width:-webkit-calc(100% + 30px);width:-moz-calc(100% + 30px);width:calc(100% + 30px);background-position:calc(65% - (100px - 350px * 0.65)) 0} 2 | -------------------------------------------------------------------------------- /tests/issue151.css: -------------------------------------------------------------------------------- 1 | @keyframes fadeIn { 2 | 0% { 3 | opacity: 0; 4 | } 5 | 100% { 6 | opacity: 1; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/issue151.css.min: -------------------------------------------------------------------------------- 1 | @keyframes fadeIn{0%{opacity:0}100%{opacity:1}} 2 | -------------------------------------------------------------------------------- /tests/issue172.css.FAIL: -------------------------------------------------------------------------------- 1 | div { 2 | transform-origin: 0; 3 | -ms-transform-origin: 0; 4 | } 5 | -------------------------------------------------------------------------------- /tests/issue172.css.min: -------------------------------------------------------------------------------- 1 | div{transform-origin:0;-ms-transform-origin:0} 2 | -------------------------------------------------------------------------------- /tests/issue180.css: -------------------------------------------------------------------------------- 1 | html { 2 | /*... calculation ... */ 3 | font-size: 16px; 4 | } 5 | body { 6 | /*... calculation ... */ 7 | font-size: 10px; 8 | } 9 | @media all and (min-width: 768px) { 10 | /** 11 | * Needs to be calculated together with margins. 12 | */ 13 | .columns-triple .column { 14 | font-size: 10px; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/issue180.css.min: -------------------------------------------------------------------------------- 1 | html{font-size:16px}body{font-size:10px}@media all and (min-width:768px){.columns-triple .column{font-size:10px}} -------------------------------------------------------------------------------- /tests/issue205.css: -------------------------------------------------------------------------------- 1 | a[id$=_foo] { abc : abc;}; 2 | @charset "utf-8"; 3 | -------------------------------------------------------------------------------- /tests/issue205.css.min: -------------------------------------------------------------------------------- 1 | @charset "utf-8";a[id$=_foo]{abc:abc}; -------------------------------------------------------------------------------- /tests/issue221.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Quicksand'; 3 | font-style: normal; 4 | font-weight: 400; 5 | src: local('Quicksand Regular'), local('Quicksand-Regular'), url(https://fonts.gstatic.com/s/quicksand/v5/sKd0EMYPAh5PYCRKSryvW5Bw1xU1rKptJj_0jans920.woff2) format('woff2'); 6 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; 7 | } 8 | -------------------------------------------------------------------------------- /tests/issue221.css.min: -------------------------------------------------------------------------------- 1 | @font-face{font-family:'Quicksand';font-style:normal;font-weight:400;src:local('Quicksand Regular'),local('Quicksand-Regular'),url(https://fonts.gstatic.com/s/quicksand/v5/sKd0EMYPAh5PYCRKSryvW5Bw1xU1rKptJj_0jans920.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000} 2 | -------------------------------------------------------------------------------- /tests/issue222.css: -------------------------------------------------------------------------------- 1 | @media \0screen { 2 | body { background: red; } 3 | } 4 | -------------------------------------------------------------------------------- /tests/issue222.css.min: -------------------------------------------------------------------------------- 1 | @media \0screen{body{background:red}} 2 | -------------------------------------------------------------------------------- /tests/issue71.js.FAIL: -------------------------------------------------------------------------------- 1 | function foo() { 2 | "use strict"; 3 | alert('hello'); 4 | } -------------------------------------------------------------------------------- /tests/issue71.js.min: -------------------------------------------------------------------------------- 1 | function foo(){"use strict";alert('hello');} -------------------------------------------------------------------------------- /tests/issue86.js: -------------------------------------------------------------------------------- 1 | .0.toString() 2 | 1.3.toString() 3 | -------------------------------------------------------------------------------- /tests/issue86.js.min: -------------------------------------------------------------------------------- 1 | (0).toString();(1.3).toString(); -------------------------------------------------------------------------------- /tests/lowercasing.css: -------------------------------------------------------------------------------- 1 | @CHARSET "UTF-8"; 2 | 3 | @FONT-FACE { 4 | FONT-FAMILY: "YOUR FACE"; 5 | } 6 | 7 | @IMPORT "HTTP://DOMAIN.TLD/OTHER.CSS"; 8 | 9 | @MEDIA print { 10 | BACKGROUND: NONE; 11 | BACKGROUND-POSITION: 0 0; 12 | } 13 | 14 | @PAGE { 15 | CONTENT: ATTR(HREF); 16 | HEIGHT: MAX(0, MIN(10, 20)); 17 | WIDTH: CALC(50% - 10PX); 18 | } 19 | 20 | @NAMESPACE XHTML "HTTP://WWW.W3.ORG/1999/XHTML"; 21 | 22 | /* pseudos */ 23 | a:ACTIVE, 24 | a:AFTER, 25 | a:BEFORE, 26 | a:CHECKED, 27 | a:DISABLED, 28 | a:EMPTY, 29 | a:ENABLED, 30 | a:FIRST-CHILD, 31 | a:FIRST-LETTER, 32 | a:FIRST-LINE, 33 | a:FIRST-OF-TYPE, 34 | a:FOCUS, 35 | a:HOVER, 36 | a:LAST-CHILD, 37 | a:LAST-OF-TYPE, 38 | a:LINK, 39 | a:ONLY-CHILD, 40 | a:ONLY-OF-TYPE, 41 | a:ROOT, 42 | a::SELECTION, 43 | a:TARGET, 44 | a:VISITED, 45 | 46 | /* pseudo functions */ 47 | a:ANY(A, B, I) STRONG, 48 | a:LANG(FR), 49 | a:NOT([HIDDEN]), 50 | a:NTH-CHILD(2), 51 | a:NTH-LAST-CHILD(2), 52 | a:NTH-LAST-OF-TYPE(2), 53 | a:NTH-OF-TYPE(2) { 54 | BACKGROUND: URL(PROTO://DOMAIN.TLD/PATH), 55 | REPEATING-LINEAR-GRADIENT(20DEG, GRAY, GREEN, 20PX, WHITE 40PX), 56 | -ATSC-LINEAR-GRADIENT(LEFT, BLACK, WHITE), 57 | -KHTML-RADIAL-GRADIENT(CENTER 50DEG, CIRCLE CLOSEST-SIDE, BLACK 0, GREEN 100%), 58 | -MOZ-RADIAL-GRADIENT(CENTER 45DEG, CIRCLE CLOSEST-SIDE, ORANGE 0%, RED 100%), 59 | -MS-LINEAR-GRaDiEnT(LEFT, BLUE, BLACK), 60 | -O-REPEATING-RADIAL-GRADIENT(CENTER, CIRCLE CLOSEST-SIDE, PAPAYAWHIP, RED 50%, GAINSBORO), 61 | -WAP-LINEAR-GRADIENT(LEFT, BLACK, WHITE), 62 | -WEBKIT-GRADIENT(LINEAR, LEFT, FROM(WHITE), TO(RGBA(1,2,3,.4))); 63 | } 64 | -------------------------------------------------------------------------------- /tests/lowercasing.css.min: -------------------------------------------------------------------------------- 1 | @charset "UTF-8";@font-face{FONT-FAMILY:"YOUR FACE"}@import "HTTP://DOMAIN.TLD/OTHER.CSS";@media print{background:0;background-position:0 0}@page{CONTENT:attr(HREF);HEIGHT:max(0,min(10,20));WIDTH:calc(50% - 10PX)}@namespace XHTML "HTTP://WWW.W3.ORG/1999/XHTML";a:active,a:after,a:before,a:checked,a:disabled,a:empty,a:enabled,a:first-child,a:first-letter ,a:first-line ,a:first-of-type,a:focus,a:hover,a:last-child,a:last-of-type,a:link,a:only-child,a:only-of-type,a:root,a::selection,a:target,a:visited,a:any(A,B,I) STRONG,a:lang(FR),a:not([HIDDEN]),a:nth-child(2),a:nth-last-child(2),a:nth-last-of-type(2),a:nth-of-type(2){BACKGROUND:url(PROTO://DOMAIN.TLD/PATH),repeating-linear-gradient(20DEG,GRAY,GREEN,20PX,WHITE 40PX),-atsc-linear-gradient(LEFT,BLACK,WHITE),-khtml-radial-gradient(CENTER 50DEG,CIRCLE CLOSEST-SIDE,BLACK 0,GREEN 100%),-moz-radial-gradient(CENTER 45DEG,CIRCLE CLOSEST-SIDE,ORANGE 0,RED 100%),-ms-linear-gradient(LEFT,BLUE,BLACK),-o-repeating-radial-gradient(CENTER,CIRCLE CLOSEST-SIDE,PAPAYAWHIP,RED 50%,GAINSBORO),-wap-linear-gradient(LEFT,BLACK,WHITE),-webkit-gradient(LINEAR,LEFT,from(WHITE),to(rgba(1,2,3,.4)))} 2 | -------------------------------------------------------------------------------- /tests/media-empty-class.css: -------------------------------------------------------------------------------- 1 | /*! preserved */ 2 | emptiness {} 3 | 4 | @import "another.css"; 5 | /* I'm empty - delete me */ 6 | empty { ;} 7 | 8 | @media print { 9 | .noprint { display: none; } 10 | } 11 | 12 | @media screen { 13 | /* this rule should be removed, not simply minified.*/ 14 | .breakme {} 15 | .printonly { display: none; } 16 | } -------------------------------------------------------------------------------- /tests/media-empty-class.css.min: -------------------------------------------------------------------------------- 1 | /*! preserved */@import "another.css";@media print{.noprint{display:none}}@media screen{.printonly{display:none}} -------------------------------------------------------------------------------- /tests/media-multi.css: -------------------------------------------------------------------------------- 1 | @media only all and (max-width:50em), only all and (max-device-width:800px), only all and (max-width:780px) { 2 | some-css : here 3 | } 4 | -------------------------------------------------------------------------------- /tests/media-multi.css.min: -------------------------------------------------------------------------------- 1 | @media only all and (max-width:50em),only all and (max-device-width:800px),only all and (max-width:780px){some-css:here} -------------------------------------------------------------------------------- /tests/media-test.css: -------------------------------------------------------------------------------- 1 | @media screen AND (-webkit-min-device-pixel-ratio:0) { 2 | some-css : here 3 | } 4 | -------------------------------------------------------------------------------- /tests/media-test.css.min: -------------------------------------------------------------------------------- 1 | @media screen and (-webkit-min-device-pixel-ratio:0){some-css:here} -------------------------------------------------------------------------------- /tests/old-ie-filter-matrix.css: -------------------------------------------------------------------------------- 1 | .a { 2 | filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.9914448613738104, M12=-0.13052619222005157, M21=0.13052619222005157, M22=0.9914448613738104, sizingMethod='auto expand'); 3 | } 4 | .b { 5 | display: none; 6 | filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.9914448613738104, M12=-0.13052619222005157, M21=0.13052619222005157, M22=0.9914448613738104, sizingMethod='auto expand'); 7 | vertical-align: bottom; 8 | } 9 | -------------------------------------------------------------------------------- /tests/old-ie-filter-matrix.css.min: -------------------------------------------------------------------------------- 1 | .a{filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.9914448613738104, M12=-0.13052619222005157, M21=0.13052619222005157, M22=0.9914448613738104, sizingMethod='auto expand')}.b{display:none;filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.9914448613738104, M12=-0.13052619222005157, M21=0.13052619222005157, M22=0.9914448613738104, sizingMethod='auto expand');vertical-align:bottom} -------------------------------------------------------------------------------- /tests/opacity-filter.css: -------------------------------------------------------------------------------- 1 | /* example from https://developer.mozilla.org/en/CSS/opacity */ 2 | pre { /* make the box translucent (80% opaque) */ 3 | border: solid red; 4 | opacity: 0.8; /* Firefox, Safari(WebKit), Opera */ 5 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE 8 */ 6 | filter: PROGID:DXImageTransform.Microsoft.Alpha(Opacity=80); /* IE 4-7 */ 7 | zoom: 1; /* set "zoom", "width" or "height" to trigger "hasLayout" in IE 7 and lower */ 8 | } 9 | 10 | /** and again */ 11 | code { 12 | -ms-filter: "PROGID:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE 8 */ 13 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); /* IE 4-7 */ 14 | } -------------------------------------------------------------------------------- /tests/opacity-filter.css.min: -------------------------------------------------------------------------------- 1 | pre{border:solid red;opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80);zoom:1}code{-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)} -------------------------------------------------------------------------------- /tests/opera-pixel-ratio.css: -------------------------------------------------------------------------------- 1 | @media 2 | (-o-min-device-pixel-ratio:10/4), 3 | (-o-max-device-pixel-ratio: 5/4), 4 | (-o-device-pixel-ratio: 1/1), 5 | (-o-device-pixel-ratio: 1/10), 6 | (-o-device-pixel-ratio: 1.25), 7 | (device-pixel-ratio:1.5) { 8 | /* some:prop; */ 9 | /* An empty property with a fraction in query would break previously */ 10 | } 11 | 12 | .something { 13 | foo: bar; 14 | } -------------------------------------------------------------------------------- /tests/opera-pixel-ratio.css.min: -------------------------------------------------------------------------------- 1 | .something{foo:bar} -------------------------------------------------------------------------------- /tests/pointzeros.css: -------------------------------------------------------------------------------- 1 | a { 2 | margin: 0.0px 1.0pt 2.0em 0%; 3 | _padding-top: 2.0ex; 4 | background-position: 0.0 1.0px; 5 | padding: 0.0in 1.0cm .0mm 0pc; 6 | } 7 | -------------------------------------------------------------------------------- /tests/pointzeros.css.min: -------------------------------------------------------------------------------- 1 | a{margin:0 1pt 2em 0;_padding-top:2ex;background-position:0 1px;padding:0 1cm 0 0} 2 | -------------------------------------------------------------------------------- /tests/preserve-case.css: -------------------------------------------------------------------------------- 1 | #AddAddressForm { 2 | padding: 0; 3 | } 4 | #AddAddressForm .messageBoxNeutral { 5 | padding: 0; 6 | } 7 | #FeedbackMailForm{ 8 | padding: 0; 9 | } 10 | #FeedbackMailForm .classe{ 11 | margin: 0; 12 | } 13 | .classes, #FeedBackMailForm { 14 | margin: 0; 15 | } 16 | -------------------------------------------------------------------------------- /tests/preserve-case.css.min: -------------------------------------------------------------------------------- 1 | #AddAddressForm{padding:0}#AddAddressForm .messageBoxNeutral{padding:0}#FeedbackMailForm{padding:0}#FeedbackMailForm .classe{margin:0}.classes,#FeedBackMailForm{margin:0} 2 | -------------------------------------------------------------------------------- /tests/preserve-important.css: -------------------------------------------------------------------------------- 1 | .red { color: red !important; } 2 | -------------------------------------------------------------------------------- /tests/preserve-important.css.min: -------------------------------------------------------------------------------- 1 | .red{color:red !important} -------------------------------------------------------------------------------- /tests/preserve-new-line.css: -------------------------------------------------------------------------------- 1 | #sel-o { 2 | content: "on\"ce upon \ 3 | a time"; 4 | content: 'once upon \ 5 | a ti\'me'; 6 | } -------------------------------------------------------------------------------- /tests/preserve-new-line.css.min: -------------------------------------------------------------------------------- 1 | #sel-o{content:"on\"ce upon \ 2 | a time";content:'once upon \ 3 | a ti\'me'} -------------------------------------------------------------------------------- /tests/preserve-strings.css: -------------------------------------------------------------------------------- 1 | /* preserving strings */ 2 | .sele { 3 | content: "\"keep \" me"; 4 | something: '\\\' . . '; 5 | else: 'empty{}'; 6 | content: "/* test */"; /* <---- this is not a comment, should be be kept */ 7 | } -------------------------------------------------------------------------------- /tests/preserve-strings.css.min: -------------------------------------------------------------------------------- 1 | .sele{content:"\"keep \" me";something:'\\\' . . ';else:'empty{}';content:"/* test */"} -------------------------------------------------------------------------------- /tests/promise-catch-finally-issue203.js: -------------------------------------------------------------------------------- 1 | var p = new Promise(resolve, reject) {}; 2 | p.then(function(res) {}) 3 | .catch(function(err) {}) 4 | .finally(function() {}); 5 | -------------------------------------------------------------------------------- /tests/promise-catch-finally-issue203.js.min: -------------------------------------------------------------------------------- 1 | var p=new Promise(resolve,reject){};p.then(function(a){}).catch(function(a){}).finally(function(){}); 2 | -------------------------------------------------------------------------------- /tests/pseudo-first.css: -------------------------------------------------------------------------------- 1 | /* 2 | because of IE6 first-letter and first-line 3 | must be followed by a space 4 | http://reference.sitepoint.com/css/pseudoelement-firstletter 5 | Thanks: P.Sorokin comment at http://www.phpied.com/cssmin-js/ 6 | */ 7 | p:first-letter{ 8 | buh: hum; 9 | } 10 | p:FIRST-LINE{ 11 | baa: 1; 12 | } 13 | 14 | p:first-line,a,p:first-letter,b{ 15 | color: red; 16 | } 17 | -------------------------------------------------------------------------------- /tests/pseudo-first.css.min: -------------------------------------------------------------------------------- 1 | p:first-letter {buh:hum}p:first-line {baa:1}p:first-line ,a,p:first-letter ,b{color:red} -------------------------------------------------------------------------------- /tests/pseudo.css: -------------------------------------------------------------------------------- 1 | p :link { 2 | ba:zinga;;; 3 | foo: bar;;; 4 | } -------------------------------------------------------------------------------- /tests/pseudo.css.min: -------------------------------------------------------------------------------- 1 | p :link{ba:zinga;foo:bar} -------------------------------------------------------------------------------- /tests/rgb-issue81.css.FAIL: -------------------------------------------------------------------------------- 1 | .color_chip { 2 | color: color: rgb(0%, 50%, 50%); 3 | background: rgba(195, 198, 214, 0.85); 4 | } 5 | -------------------------------------------------------------------------------- /tests/rgb-issue81.css.min: -------------------------------------------------------------------------------- 1 | .color_chip{color: rgb(0%, 50%, 50%);background:rgba(195,198,214,0.85)} 2 | -------------------------------------------------------------------------------- /tests/special-comments.css: -------------------------------------------------------------------------------- 1 | /*!************88**** 2 | Preserving comments 3 | as they are 4 | ******************** 5 | Keep the initial ! 6 | *******************/ 7 | #yo { 8 | ma: "ma"; 9 | } 10 | /*! 11 | I said 12 | pre- 13 | serve! */ -------------------------------------------------------------------------------- /tests/special-comments.css.min: -------------------------------------------------------------------------------- 1 | /*!************88**** 2 | Preserving comments 3 | as they are 4 | ******************** 5 | Keep the initial ! 6 | *******************/#yo{ma:"ma"}/*! 7 | I said 8 | pre- 9 | serve! */ -------------------------------------------------------------------------------- /tests/star-underscore-hacks.css: -------------------------------------------------------------------------------- 1 | #elementarr { 2 | width: 1px; 3 | *width: 3pt; 4 | _width: 2em; 5 | } -------------------------------------------------------------------------------- /tests/star-underscore-hacks.css.min: -------------------------------------------------------------------------------- 1 | #elementarr{width:1px;*width:3pt;_width:2em} -------------------------------------------------------------------------------- /tests/string-in-comment.css: -------------------------------------------------------------------------------- 1 | /* te " st */ 2 | a{a:1} 3 | /*!"preserve" me*/ 4 | b{content: "/**/"} 5 | /* quite " quote ' \' \" */ 6 | /* ie mac \*/ 7 | c {c : 3} 8 | /* end hiding */ -------------------------------------------------------------------------------- /tests/string-in-comment.css.min: -------------------------------------------------------------------------------- 1 | a{a:1}/*!"preserve" me*/b{content:"/**/"}/*\*/c{c:3}/**/ -------------------------------------------------------------------------------- /tests/suite.rhino: -------------------------------------------------------------------------------- 1 | input = readFile(arguments[0]); 2 | load("../ports/js/cssmin.js"); 3 | print(YAHOO.compressor.cssmin(input)); -------------------------------------------------------------------------------- /tests/suite.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd $(dirname $0) 4 | 5 | # Get the jar to use. 6 | jar="$(ls ../build/*.jar | sort | tail -n1)" 7 | echo "jar: $jar" 8 | 9 | runtest () { 10 | testfile="$1" 11 | expected=${testfile/\.FAIL/}.min 12 | expected="$( 13 | cat $expected 14 | )" 15 | filetype="$( 16 | echo $testfile | egrep -o '(cs|j)s' 17 | )" 18 | 19 | actual="$( 20 | java -jar $jar --type $filetype $testfile 21 | )" 22 | 23 | if [ "$expected" == "$actual" ]; then 24 | echo "Passed: $testfile" > /dev/stderr 25 | else 26 | ( 27 | echo "Test failed: $testfile" 28 | echo "" 29 | echo "Expected:" 30 | echo "$expected" 31 | echo "" 32 | echo "Actual:" 33 | echo "$actual" 34 | ) > /dev/stderr 35 | return 1 36 | fi 37 | } 38 | 39 | 40 | ls *.FAIL 2>/dev/null | while read failtest; do 41 | echo "Failing test: " $failtest > /dev/stderr 42 | runtest $failtest && echo "Test passed, please remove the '.FAIL' from the filename" 43 | done 44 | 45 | ls *.{css,js} | while read testfile; do 46 | runtest $testfile || exit 1 47 | done 48 | 49 | exit 0 50 | -------------------------------------------------------------------------------- /tests/webkit-transform.css: -------------------------------------------------------------------------------- 1 | c {-webkit-transform-origin: 0 0;} 2 | d {-MOZ-TRANSFORM-ORIGIN: 0 0 } -------------------------------------------------------------------------------- /tests/webkit-transform.css.min: -------------------------------------------------------------------------------- 1 | c{-webkit-transform-origin:0 0}d{-moz-transform-origin:0 0} -------------------------------------------------------------------------------- /tests/zeros.css: -------------------------------------------------------------------------------- 1 | a { 2 | margin: 0px 0pt 0em 0%; 3 | _padding-top: 0ex; 4 | background-position: 0 0; 5 | padding: 0in 0cm 0mm 0pc; 6 | transition: opacity .0s; 7 | transition-delay: 0.0ms; 8 | transform: rotate3d(0grad, 0rad, 0deg); 9 | pitch: 0KHZ; 10 | pitch: 11 | 0hz; /* intentionally on next line */ 12 | } 13 | -------------------------------------------------------------------------------- /tests/zeros.css.min: -------------------------------------------------------------------------------- 1 | a{margin:0;_padding-top:0;background-position:0 0;padding:0;transition:opacity 0;transition-delay:0;transform:rotate3d(0,0,0);pitch:0;pitch:0} 2 | -------------------------------------------------------------------------------- /tools/cssmin-debugger.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 31 | 32 | 33 | 34 | 35 |

Use This Page to Debug cssmin.js

36 | 37 |

Your browser does not support the local file access apis used by this page.

38 | 39 |

Select a css file to compress. You can then step through the cssmin.js implementation using your browser's script debugger.

40 | 41 |

42 | 43 |

Compressed

44 |

45 | 
46 |         

Original

47 |

48 | 
49 |         
90 |     
91 | 


--------------------------------------------------------------------------------