├── .gitignore ├── Makefile ├── README.md ├── changelog ├── cli ├── cli.php └── test │ ├── a.css │ ├── b.css │ ├── c.css │ ├── dir │ ├── d.css │ └── e.css │ └── result.css ├── demo ├── index.php ├── jquery-1.4.2.js ├── js.js ├── result.css ├── result.php └── styles.css ├── docs ├── CSSCompression.md ├── Cli.md ├── Contribute.md └── Options.md ├── license.txt ├── src ├── CSSCompression.php ├── helpers │ ├── hex2short-colors.json │ ├── hex2short-safe.json │ └── long2hex-colors.json └── lib │ ├── Cleanup.php │ ├── Color.php │ ├── Combine.php │ ├── Combine │ ├── Aural.php │ ├── Background.php │ ├── Border.php │ ├── BorderOutline.php │ ├── BorderRadius.php │ ├── Font.php │ ├── List.php │ └── MarginPadding.php │ ├── Compress.php │ ├── Control.php │ ├── Exception.php │ ├── Format.php │ ├── Individuals.php │ ├── Numeric.php │ ├── Option.php │ ├── Organize.php │ ├── Selectors.php │ ├── Setup.php │ └── Trim.php └── unit ├── benchmark ├── benchmark.php ├── results │ ├── 3.0.json │ └── README └── src │ ├── csszengarden.com.001.css │ ├── csszengarden.com.002.css │ ├── csszengarden.com.003.css │ ├── csszengarden.com.004.css │ ├── csszengarden.com.005.css │ ├── csszengarden.com.006.css │ ├── csszengarden.com.007.css │ ├── csszengarden.com.008.css │ ├── csszengarden.com.009.css │ ├── csszengarden.com.010.css │ ├── csszengarden.com.011.css │ ├── csszengarden.com.012.css │ ├── csszengarden.com.013.css │ ├── csszengarden.com.014.css │ ├── csszengarden.com.015.css │ ├── csszengarden.com.016.css │ ├── csszengarden.com.017.css │ ├── csszengarden.com.018.css │ ├── csszengarden.com.019.css │ ├── csszengarden.com.020.css │ ├── csszengarden.com.021.css │ ├── csszengarden.com.022.css │ ├── csszengarden.com.023.css │ ├── csszengarden.com.024.css │ ├── csszengarden.com.025.css │ ├── csszengarden.com.026.css │ ├── csszengarden.com.027.css │ ├── csszengarden.com.028.css │ ├── csszengarden.com.029.css │ ├── csszengarden.com.030.css │ ├── csszengarden.com.031.css │ ├── csszengarden.com.032.css │ ├── csszengarden.com.033.css │ ├── csszengarden.com.034.css │ ├── csszengarden.com.035.css │ ├── csszengarden.com.036.css │ ├── csszengarden.com.037.css │ ├── csszengarden.com.038.css │ ├── csszengarden.com.039.css │ ├── csszengarden.com.040.css │ ├── csszengarden.com.041.css │ ├── csszengarden.com.042.css │ ├── csszengarden.com.043.css │ ├── csszengarden.com.044.css │ ├── csszengarden.com.045.css │ ├── csszengarden.com.046.css │ ├── csszengarden.com.047.css │ ├── csszengarden.com.048.css │ ├── csszengarden.com.049.css │ ├── csszengarden.com.050.css │ ├── csszengarden.com.051.css │ ├── csszengarden.com.052.css │ ├── csszengarden.com.053.css │ ├── csszengarden.com.054.css │ ├── csszengarden.com.055.css │ ├── csszengarden.com.056.css │ ├── csszengarden.com.057.css │ ├── csszengarden.com.058.css │ ├── csszengarden.com.059.css │ ├── csszengarden.com.060.css │ ├── csszengarden.com.061.css │ ├── csszengarden.com.062.css │ ├── csszengarden.com.063.css │ ├── csszengarden.com.064.css │ ├── csszengarden.com.065.css │ ├── csszengarden.com.066.css │ ├── csszengarden.com.067.css │ ├── csszengarden.com.068.css │ ├── csszengarden.com.069.css │ ├── csszengarden.com.070.css │ ├── csszengarden.com.071.css │ ├── csszengarden.com.072.css │ ├── csszengarden.com.073.css │ ├── csszengarden.com.074.css │ ├── csszengarden.com.075.css │ ├── csszengarden.com.076.css │ ├── csszengarden.com.077.css │ ├── csszengarden.com.078.css │ ├── csszengarden.com.079.css │ ├── csszengarden.com.080.css │ ├── csszengarden.com.081.css │ ├── csszengarden.com.082.css │ ├── csszengarden.com.083.css │ ├── csszengarden.com.084.css │ ├── csszengarden.com.085.css │ ├── csszengarden.com.086.css │ ├── csszengarden.com.087.css │ ├── csszengarden.com.088.css │ ├── csszengarden.com.089.css │ ├── csszengarden.com.090.css │ ├── csszengarden.com.091.css │ ├── csszengarden.com.092.css │ ├── csszengarden.com.093.css │ ├── csszengarden.com.094.css │ ├── csszengarden.com.095.css │ ├── csszengarden.com.096.css │ ├── csszengarden.com.097.css │ ├── csszengarden.com.098.css │ ├── csszengarden.com.099.css │ ├── csszengarden.com.100.css │ ├── csszengarden.com.101.css │ ├── csszengarden.com.102.css │ ├── csszengarden.com.103.css │ ├── csszengarden.com.104.css │ ├── csszengarden.com.105.css │ ├── csszengarden.com.106.css │ ├── csszengarden.com.107.css │ ├── csszengarden.com.109.css │ ├── csszengarden.com.110.css │ ├── csszengarden.com.111.css │ ├── csszengarden.com.112.css │ ├── csszengarden.com.113.css │ ├── csszengarden.com.114.css │ ├── csszengarden.com.115.css │ ├── csszengarden.com.116.css │ ├── csszengarden.com.117.css │ ├── csszengarden.com.118.css │ ├── csszengarden.com.119.css │ ├── csszengarden.com.120.css │ ├── csszengarden.com.121.css │ ├── csszengarden.com.122.css │ ├── csszengarden.com.123.css │ ├── csszengarden.com.124.css │ ├── csszengarden.com.125.css │ ├── csszengarden.com.126.css │ ├── csszengarden.com.127.css │ ├── csszengarden.com.128.css │ ├── csszengarden.com.130.css │ ├── csszengarden.com.131.css │ ├── csszengarden.com.132.css │ ├── csszengarden.com.133.css │ ├── csszengarden.com.134.css │ ├── csszengarden.com.135.css │ ├── csszengarden.com.136.css │ ├── csszengarden.com.137.css │ ├── csszengarden.com.138.css │ ├── csszengarden.com.139.css │ ├── csszengarden.com.140.css │ ├── csszengarden.com.141.css │ ├── csszengarden.com.142.css │ ├── csszengarden.com.143.css │ ├── csszengarden.com.144.css │ ├── csszengarden.com.145.css │ ├── csszengarden.com.146.css │ ├── csszengarden.com.147.css │ ├── csszengarden.com.148.css │ ├── csszengarden.com.149.css │ ├── csszengarden.com.150.css │ ├── csszengarden.com.151.css │ ├── csszengarden.com.152.css │ ├── csszengarden.com.153.css │ ├── csszengarden.com.154.css │ ├── csszengarden.com.155.css │ ├── csszengarden.com.156.css │ ├── csszengarden.com.157.css │ ├── csszengarden.com.158.css │ ├── csszengarden.com.159.css │ ├── csszengarden.com.160.css │ ├── csszengarden.com.161.css │ ├── csszengarden.com.162.css │ ├── csszengarden.com.163.css │ ├── csszengarden.com.164.css │ ├── csszengarden.com.165.css │ ├── csszengarden.com.166.css │ ├── csszengarden.com.167.css │ ├── csszengarden.com.168.css │ ├── csszengarden.com.169.css │ ├── csszengarden.com.170.css │ ├── csszengarden.com.171.css │ ├── csszengarden.com.172.css │ ├── csszengarden.com.173.css │ ├── csszengarden.com.174.css │ ├── csszengarden.com.175.css │ ├── csszengarden.com.176.css │ ├── csszengarden.com.177.css │ ├── csszengarden.com.178.css │ ├── csszengarden.com.179.css │ ├── csszengarden.com.180.css │ ├── csszengarden.com.181.css │ ├── csszengarden.com.182.css │ ├── csszengarden.com.184.css │ ├── csszengarden.com.185.css │ ├── csszengarden.com.186.css │ ├── csszengarden.com.187.css │ ├── csszengarden.com.188.css │ ├── csszengarden.com.189.css │ ├── csszengarden.com.190.css │ ├── csszengarden.com.191.css │ ├── csszengarden.com.192.css │ ├── csszengarden.com.193.css │ ├── csszengarden.com.194.css │ ├── csszengarden.com.195.css │ ├── csszengarden.com.196.css │ ├── csszengarden.com.197.css │ ├── csszengarden.com.198.css │ ├── csszengarden.com.199.css │ ├── csszengarden.com.200.css │ ├── csszengarden.com.201.css │ ├── csszengarden.com.202.css │ ├── csszengarden.com.203.css │ ├── csszengarden.com.204.css │ ├── csszengarden.com.205.css │ ├── csszengarden.com.206.css │ ├── csszengarden.com.207.css │ ├── csszengarden.com.208.css │ ├── csszengarden.com.209.css │ ├── csszengarden.com.210.css │ ├── csszengarden.com.211.css │ ├── csszengarden.com.212.css │ ├── csszengarden.com.213.css │ └── license.txt ├── clean.sh ├── errors └── README.md ├── file.php ├── focus.php ├── sandbox ├── Cleanup.json ├── Color.json ├── Combine.Aural.json ├── Combine.Background.json ├── Combine.Border.json ├── Combine.BorderOutline.json ├── Combine.BorderRadius.json ├── Combine.Combine.json ├── Combine.Font.json ├── Combine.List.json ├── Combine.MarginPadding.json ├── Individuals.json ├── Numeric.json ├── Organize.json ├── Selectors.json ├── Setup.json └── Trim.json ├── sheets ├── README.md ├── expected │ ├── border-none.css │ ├── border-radius.css │ ├── box-model.css │ ├── charset-media.css │ ├── class.css │ ├── color.css │ ├── comment-ie5-mac.css │ ├── concat-charset.css │ ├── decimals.css │ ├── empty-selector.css │ ├── escapables.css │ ├── font-face.css │ ├── id.css │ ├── intros.css │ ├── media-empty-class.css │ ├── media-multi.css │ ├── media-test.css │ ├── opacity-filter.css │ ├── pit.css │ ├── preserve-newline.css │ ├── preserve-strings.css │ ├── pseudo-first.css │ ├── pseudo.css │ ├── star-underscore-hacks.css │ ├── webkit-transform.css │ └── zeros.css └── original │ ├── border-none.css │ ├── border-radius.css │ ├── box-model.css │ ├── charset-media.css │ ├── class.css │ ├── color.css │ ├── comment-ie5-mac.css │ ├── concat-charset.css │ ├── decimals.css │ ├── empty-selector.css │ ├── escapables.css │ ├── font-face.css │ ├── id.css │ ├── intros.css │ ├── media-empty-class.css │ ├── media-multi.css │ ├── media-test.css │ ├── opacity-filter.css │ ├── pit.css │ ├── preserve-newline.css │ ├── preserve-strings.css │ ├── pseudo-first.css │ ├── pseudo.css │ ├── star-underscore-hacks.css │ ├── webkit-transform.css │ └── zeros.css ├── src ├── Color.php ├── Core.php ├── File.php ├── Focus.php ├── Sandbox.php └── Sheets.php └── start.php /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore all temporary files 2 | *.swp 3 | 4 | # test generated files 5 | unit/errors/*.css 6 | 7 | # Benchmark generated files 8 | unit/benchmark/dist/ 9 | unit/benchmark/results/temp-* 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # CSS Compressor [VERSION] 3 | # [DATE] 4 | # Corey Hart @ http://www.codenothing.com 5 | # 6 | .PHONY: benchmark test 7 | VERSION=temp 8 | 9 | all: 10 | @echo "\n\x1B[1;31mPC_LOAD_LETTER\x1B[0m\n" 11 | 12 | test: 13 | @php unit/start.php 14 | 15 | test-all: 16 | @php unit/start.php all 17 | 18 | test-focus: 19 | @php unit/focus.php 20 | 21 | test-file: 22 | @php unit/file.php 23 | 24 | test-regression: 25 | @php unit/benchmark/benchmark.php $(VERSION) 26 | 27 | test-cli: 28 | @php cli/cli.php -i cli/test/a.css > cli/test/result.css 29 | 30 | benchmark: 31 | @php unit/benchmark/benchmark.php 32 | 33 | clean: 34 | @sh unit/clean.sh 35 | -------------------------------------------------------------------------------- /changelog: -------------------------------------------------------------------------------- 1 | # 2 | # CSS Compression [VERSION] Change Log 3 | # [DATE] 4 | # Corey Hart @ http://www.codenothing.com 5 | # 6 | 7 | # Compressor Additions 8 | - Configuration Modes 9 | - pseduo-space, add space between pseduo selectors and comma/brace for ie6 10 | - removing leading 0 of a decimal, 0.633px -> .633px 11 | - handling all At Rules (charsets,media,imports,font-family,etc..) 12 | - handling ms filter paths 13 | - More css hacks support, including box-modal hack 14 | - attr2selector, Convert id=blah and class=blah attributes to their selector counterparts 15 | - strict-id, removes all selectors up to the last id 16 | - add-unknown, adds unknown blocks to top of output in a comment 17 | 18 | # Codebase Changes 19 | - Converted to subclass architecture, more modular. 20 | - Using JSON based sandbox specs for focused unit tests. 21 | - Helper conversion definitions(long2hex, hex2short) are now in JSON based files. 22 | - Added benchmark/regression testing 23 | -------------------------------------------------------------------------------- /cli/test/a.css: -------------------------------------------------------------------------------- 1 | /* Clean Includes */ 2 | @import "b.css"; 3 | @import url(../test/b.css); 4 | @import url("dir/../b.css"); 5 | @import url('./b.css'); 6 | 7 | /* Nested Includes */ 8 | @import "c.css"; 9 | 10 | /* Absolutes should not be resolved */ 11 | @import "http://example.com/a.css"; 12 | @import url('/abs/path/man.css'); 13 | @import url("/abs/path/man.css"); 14 | -------------------------------------------------------------------------------- /cli/test/b.css: -------------------------------------------------------------------------------- 1 | a { color: red; } 2 | -------------------------------------------------------------------------------- /cli/test/c.css: -------------------------------------------------------------------------------- 1 | @import "dir/d.css"; 2 | @import "dir/e.css"; 3 | 4 | div { content: "c.css" } 5 | -------------------------------------------------------------------------------- /cli/test/dir/d.css: -------------------------------------------------------------------------------- 1 | div { content: "d.css" } 2 | -------------------------------------------------------------------------------- /cli/test/dir/e.css: -------------------------------------------------------------------------------- 1 | div { content: 'e.css' } 2 | -------------------------------------------------------------------------------- /cli/test/result.css: -------------------------------------------------------------------------------- 1 | @import "http://example.com/a.css";@import '/abs/path/man.css';@import '/abs/path/man.css';a{color:red}a{color:red}a{color:red}a{color:red}div{content:"d.css"}div{content:'e.css'}div{content:"c.css"} -------------------------------------------------------------------------------- /demo/js.js: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | */ 6 | jQuery(function(){ 7 | var options = jQuery('div.options input'), select = jQuery("select[name=mode]"), modes = window.CSSCompressionModes; 8 | 9 | // Style the options 10 | jQuery("div.options label:odd").addClass('odd'); 11 | 12 | // Only open them in custom mode 13 | select.change(function(){ 14 | var mode = jQuery( this ).val(); 15 | if ( mode != 'custom' ) { 16 | options.each(function(){ 17 | this.checked = ! modes[ mode ].hasOwnProperty( this.name ); 18 | }); 19 | select.val( mode ); 20 | } 21 | }); 22 | 23 | // Switch to custom on any option change 24 | options.change(function(){ 25 | select.val('custom'); 26 | }); 27 | 28 | // Show framed results after submit 29 | jQuery("form").one( 'submit', function(){ 30 | jQuery('iframe').slideDown(); 31 | }); 32 | 33 | // Trigger option change to first one 34 | select.trigger('change'); 35 | }); 36 | -------------------------------------------------------------------------------- /demo/result.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | */ 6 | body { 7 | background: #E8DCFF; 8 | padding-top: 10px; 9 | padding-left: 10px; 10 | padding-right: 10px; 11 | font-size: 14px; 12 | } 13 | 14 | textarea { 15 | width: 100%; 16 | border: 1px solid #989898; 17 | height: 275px; 18 | font-size: 8pt; 19 | } 20 | 21 | table { 22 | margin-bottom: 20px; 23 | min-width: 400px; 24 | } 25 | 26 | th, td { 27 | padding: 5px; 28 | text-align: center; 29 | } 30 | 31 | th { 32 | background-color: #d1d1d1; 33 | } 34 | 35 | td { 36 | background-color: #f1f1f1; 37 | } 38 | -------------------------------------------------------------------------------- /demo/result.php: -------------------------------------------------------------------------------- 1 | $value ) { 11 | if ( $key == 'readability' ) { 12 | continue; 13 | } 14 | $_POST[ $key ] = isset( $_POST[ $key ] ) && $_POST[ $key ] == 'on' ? true : false; 15 | } 16 | 17 | // Setup the instance and run the compression 18 | $options = $_POST['mode'] == 'custom' ? $_POST : $_POST['mode']; 19 | $CSSC = new CSSCompression( '', $options ); 20 | $CSSC->option( 'readability', $_POST['readability'] ); 21 | $CSSC->compress( $_POST['css'] ); 22 | 23 | 24 | // Size display 25 | function size( $size ) { 26 | $original = " (${size}B)"; 27 | $ext = array( 'B', 'K', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ); 28 | for ( $c = 0; $size > 1024; $c++ ) { 29 | $size /= 1024; 30 | } 31 | return round( $size, 2 ) . $ext[ $c ] . $original; 32 | } 33 | 34 | // Stats 35 | $stats = $CSSC->stats; 36 | $before = $stats['before']; 37 | $after = $stats['after']; 38 | 39 | // Custom size handling 40 | $size = array( 41 | 'before' => size( $before['size'] ), 42 | 'after' => size( $after['size'] ), 43 | 'final' => size( $before['size'] - $after['size'] ) . ' ' 44 | . number_format( $after['size'] / ( $before['size'] < 1 ? 1 : $before['size'] ) * 100, 2 ) 45 | . '%' 46 | ); 47 | 48 | ?> 49 | 50 | 51 | 52 | CSS Compressor [VERSION] 53 | 54 | 55 | 56 | 57 | 58 |
59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 |
 BeforeAfterCompresssion
Time--ms
Selectors
Properties
Size
91 |

92 |
93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /demo/styles.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | */ 6 | body { 7 | font-size: 10pt; 8 | } 9 | 10 | table{ 11 | width: 100%; 12 | font-size: 9pt; 13 | } 14 | 15 | h2{ 16 | margin: 2px; 17 | } 18 | 19 | input[type='checkbox'] { 20 | font-size: 8pt; 21 | } 22 | 23 | label { 24 | display: block; 25 | padding: 5px 2px; 26 | } 27 | 28 | label.odd { 29 | background: #EEEDED; 30 | } 31 | 32 | textarea{ 33 | width: 100%; 34 | height: 450px; 35 | font-size: 8pt; 36 | } 37 | 38 | iframe { 39 | display: none; 40 | width: 85%; 41 | height: 475px; 42 | margin: 10px auto; 43 | } 44 | 45 | button.compress { 46 | float: right; 47 | padding: 2px 5px; 48 | } 49 | 50 | span.example { 51 | display: block; 52 | padding-left: 25px; 53 | font-style: italic; 54 | } 55 | 56 | div.control { 57 | background: #DADAE7; 58 | border: 1px solid #0f2852; 59 | padding: 5px; 60 | margin-top: 1px; 61 | } 62 | 63 | div.options { 64 | height: 420px; 65 | overflow: auto; 66 | border-right: 1px solid #0f2852; 67 | border-left: 1px solid #0f2852; 68 | border-bottom: 1px solid #0f2852; 69 | } 70 | 71 | #results { 72 | width: 1000px; 73 | background: #E8DCFF; 74 | margin: 20px 40px; 75 | padding: 20px; 76 | border: 1px solid #989898; 77 | } 78 | -------------------------------------------------------------------------------- /docs/Cli.md: -------------------------------------------------------------------------------- 1 | cli.php 2 | ======= 3 | 4 | CSSCompression comes with a basic cli script to run the compressor from the command line. 5 | 6 | 7 | Usage 8 | ----- 9 | 10 | php cli.php [options] [files] 11 | 12 | 13 | options 14 | ------- 15 | 16 | The cli script itself only has a single option "imports", which tells the class to get relative stylesheets defined in import statements 17 | 18 | php cli.php -i styles.css 19 | php cli.php --imports styles.css 20 | 21 | It can also take a mode, but only in long-hand notation. 22 | 23 | php cli.php --mode=sane styles.css 24 | 25 | And lastly, all CSSCompression options can be passed in longhand notation 26 | 27 | php cli.php --organize=true styles.css 28 | -------------------------------------------------------------------------------- /docs/Contribute.md: -------------------------------------------------------------------------------- 1 | Contribute 2 | ========== 3 | 4 | This project is always in dire need of help in any form, I only have 2 rules: 5 | 6 | - All sandboxed tests must pass. 7 | 8 | For nix users: From the root directory, run 'make test' 9 | For windows users: Run 'php unit/start.php' 10 | 11 | - Tab character indentations 12 | 13 | I don't care if you like 2,3,4,8,16 spaced indentation, just make sure it's a tab character and not spaces. 14 | 15 | 16 | make test 17 | --------- 18 | 19 | This command will run all sandboxed tests to check that most functions run the way they should. 20 | 21 | 22 | make test-focus 23 | --------------- 24 | 25 | This command runs a focused test on a single function for development. Open up unit/focus.php for configuration. 26 | 27 | 28 | make test-file 29 | -------------- 30 | 31 | This command runs a focused test on a single file. Make sure the original resides in unit/sheets/original/ and the expected 32 | output resides in unit/sheets/expected/. Open up unit/file.php for configuration 33 | 34 | 35 | make test-all 36 | ------------- 37 | 38 | This command runs all sandboxed tests, as well as double compressions on any stylesheets in benchmark src. Doesn't always pass, 39 | but is a helpful check to see that most compression is done the first time around. 40 | 41 | 42 | make test-regression [ VERSION=temp ] 43 | -------------------------------- 44 | 45 | The regression command takes an optional assignment which will do testing against the given version. Defaults is to the last run test. 46 | 47 | 48 | make benchmark 49 | -------------- 50 | 51 | This command runs the benchmark process. This will create a new temp directory for regression testing and comparison. 52 | 53 | 54 | make clean 55 | ---------- 56 | 57 | This command removes all generated files used for comparisons and benchmarks. 58 | 59 | 60 | unit/sandbox/ 61 | ------------- 62 | 63 | The sandbox directory contains json files for focused tests used in unit testing. 64 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2011 Corey Hart 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/helpers/hex2short-colors.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | */ 6 | { 7 | "#f0ffff":"azure", 8 | "#f5f5dc":"beige", 9 | "#ffe4c4":"bisque", 10 | "#a52a2a":"brown", 11 | "#ff7f50":"coral", 12 | "#ffd700":"gold", 13 | "#808080":"gray", 14 | "#008000":"green", 15 | "#4b0082":"indigo", 16 | "#fffff0":"ivory", 17 | "#f0e68c":"khaki", 18 | "#faf0e6":"linen", 19 | "#800000":"maroon", 20 | "#000080":"navy", 21 | "#808000":"olive", 22 | "#ffa500":"orange", 23 | "#da70d6":"orchid", 24 | "#cd853f":"peru", 25 | "#ffc0cb":"pink", 26 | "#dda0dd":"plum", 27 | "#800080":"purple", 28 | "#ff0000":"red", 29 | "#fa8072":"salmon", 30 | "#a0522d":"sienna", 31 | "#c0c0c0":"silver", 32 | "#fffafa":"snow", 33 | "#d2b48c":"tan", 34 | "#008080":"teal", 35 | "#ff6347":"tomato", 36 | "#ee82ee":"violet", 37 | "#f5deb3":"wheat", 38 | "#f00":"red" 39 | } 40 | -------------------------------------------------------------------------------- /src/helpers/hex2short-safe.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | */ 6 | { 7 | "#808080":"gray", 8 | "#008000":"green", 9 | "#800000":"maroon", 10 | "#000080":"navy", 11 | "#808000":"olive", 12 | "#ff0000":"red", 13 | "#c0c0c0":"silver", 14 | "#008080":"teal", 15 | "#f00":"red" 16 | } 17 | -------------------------------------------------------------------------------- /src/helpers/long2hex-colors.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | */ 6 | { 7 | "aliceblue":"#f0f8ff", 8 | "antiquewhite":"#faebd7", 9 | "aquamarine":"#7fffd4", 10 | "bisque":"#ffe4c4", 11 | "black":"#000000", 12 | "blanchedalmond":"#ffebcd", 13 | "blueviolet":"#8a2be2", 14 | "burlywood":"#deb887", 15 | "cadetblue":"#5f9ea0", 16 | "chartreuse":"#7fff00", 17 | "chocolate":"#d2691e", 18 | "coral":"#ff7f50", 19 | "cornflowerblue":"#6495ed", 20 | "cornsilk":"#fff8dc", 21 | "crimson":"#dc143c", 22 | "cyan":"#00ffff", 23 | "darkblue":"#00008b", 24 | "darkcyan":"#008b8b", 25 | "darkgoldenrod":"#b8860b", 26 | "darkgray":"#a9a9a9", 27 | "darkgreen":"#006400", 28 | "darkkhaki":"#bdb76b", 29 | "darkmagenta":"#8b008b", 30 | "darkolivegreen":"#556b2f", 31 | "darkorange":"#ff8c00", 32 | "darkorchid":"#9932cc", 33 | "darkred":"#8b0000", 34 | "darksalmon":"#e9967a", 35 | "darkseagreen":"#8fbc8f", 36 | "darkslateblue":"#483d8b", 37 | "darkslategray":"#2f4f4f", 38 | "darkturquoise":"#00ced1", 39 | "darkviolet":"#9400d3", 40 | "deeppink":"#ff1493", 41 | "deepskyblue":"#00bfff", 42 | "dimgray":"#696969", 43 | "dodgerblue":"#1e90ff", 44 | "firebrick":"#b22222", 45 | "floralwhite":"#fffaf0", 46 | "forestgreen":"#228b22", 47 | "fuchsia":"#ff00ff", 48 | "gainsboro":"#dcdcdc", 49 | "ghostwhite":"#f8f8ff", 50 | "goldenrod":"#daa520", 51 | "greenyellow":"#adff2f", 52 | "honeydew":"#f0fff0", 53 | "hotpink":"#ff69b4", 54 | "indianred ":"#cd5c5c", 55 | "indigo ":"#4b0082", 56 | "lavender":"#e6e6fa", 57 | "lavenderblush":"#fff0f5", 58 | "lawngreen":"#7cfc00", 59 | "lemonchiffon":"#fffacd", 60 | "lightblue":"#add8e6", 61 | "lightcoral":"#f08080", 62 | "lightcyan":"#e0ffff", 63 | "lightgoldenrodyellow":"#fafad2", 64 | "lightgrey":"#d3d3d3", 65 | "lightgreen":"#90ee90", 66 | "lightpink":"#ffb6c1", 67 | "lightsalmon":"#ffa07a", 68 | "lightseagreen":"#20b2aa", 69 | "lightskyblue":"#87cefa", 70 | "lightslategray":"#778899", 71 | "lightsteelblue":"#b0c4de", 72 | "lightyellow":"#ffffe0", 73 | "lime":"#00ff00", 74 | "limegreen":"#32cd32", 75 | "magenta":"#ff00ff", 76 | "maroon":"#800000", 77 | "mediumaquamarine":"#66cdaa", 78 | "mediumblue":"#0000cd", 79 | "mediumorchid":"#ba55d3", 80 | "mediumpurple":"#9370d8", 81 | "mediumseagreen":"#3cb371", 82 | "mediumslateblue":"#7b68ee", 83 | "mediumspringgreen":"#00fa9a", 84 | "mediumturquoise":"#48d1cc", 85 | "mediumvioletred":"#c71585", 86 | "midnightblue":"#191970", 87 | "mintcream":"#f5fffa", 88 | "mistyrose":"#ffe4e1", 89 | "moccasin":"#ffe4b5", 90 | "navajowhite":"#ffdead", 91 | "oldlace":"#fdf5e6", 92 | "olivedrab":"#6b8e23", 93 | "orange":"#ffa500", 94 | "orangered":"#ff4500", 95 | "orchid":"#da70d6", 96 | "palegoldenrod":"#eee8aa", 97 | "palegreen":"#98fb98", 98 | "paleturquoise":"#afeeee", 99 | "palevioletred":"#d87093", 100 | "papayawhip":"#ffefd5", 101 | "peachpuff":"#ffdab9", 102 | "powderblue":"#b0e0e6", 103 | "purple":"#800080", 104 | "rosybrown":"#bc8f8f", 105 | "royalblue":"#4169e1", 106 | "saddlebrown":"#8b4513", 107 | "salmon":"#fa8072", 108 | "sandybrown":"#f4a460", 109 | "seagreen":"#2e8b57", 110 | "seashell":"#fff5ee", 111 | "sienna":"#a0522d", 112 | "silver":"#c0c0c0", 113 | "skyblue":"#87ceeb", 114 | "slateblue":"#6a5acd", 115 | "slategray":"#708090", 116 | "springgreen":"#00ff7f", 117 | "steelblue":"#4682b4", 118 | "thistle":"#d8bfd8", 119 | "tomato":"#ff6347", 120 | "turquoise":"#40e0d0", 121 | "violet":"#ee82ee", 122 | "white":"#ffffff", 123 | "whitesmoke":"#f5f5f5", 124 | "yellow":"#ffff00", 125 | "yellowgreen":"#9acd32" 126 | } 127 | -------------------------------------------------------------------------------- /src/lib/Combine/Aural.php: -------------------------------------------------------------------------------- 1 | Control = $control; 29 | $this->Combine = $combine; 30 | } 31 | 32 | /** 33 | * Combines Aural properties (currently being depreciated in W3C Standards) 34 | * 35 | * @param (string) val: Rule Set 36 | */ 37 | public function combine( $val ) { 38 | $storage = $this->storage( $val ); 39 | $pos = 0; 40 | 41 | // Replace first occurance with it's prop, and remove all following occurances 42 | while ( preg_match( $this->raural, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 43 | $prop = $match[ 2 ][ 0 ]; 44 | if ( isset( $storage[ $prop ] ) ) { 45 | $colon = strlen( $match[ 1 ][ 0 ] ); 46 | $val = substr_replace( $val, $storage[ $prop ], $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon ); 47 | $pos = $match[ 0 ][ 1 ] + strlen( $storage[ $prop ] ) - $colon - 1; 48 | $storage[ $prop ] = ''; 49 | } 50 | else { 51 | $pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1; 52 | } 53 | } 54 | 55 | // Return converted val 56 | return $val; 57 | } 58 | 59 | /** 60 | * Builds a storage object for iteration 61 | * 62 | * @param (string) val: Rule Set 63 | */ 64 | private function storage( $val ) { 65 | $storage = array(); 66 | 67 | // Find all possible occurences and build the replacement 68 | $pos = 0; 69 | while ( preg_match( $this->raural, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 70 | if ( ! isset( $storage[ $match[ 2 ][ 0 ] ] ) ) { 71 | $storage[ $match[ 2 ][ 0 ] ] = array( $match[ 3 ][ 0 ] => $match[ 4 ][ 0 ] ); 72 | } 73 | 74 | // Override double written properties 75 | $storage[ $match[ 2 ][ 0 ] ][ $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ]; 76 | $pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1; 77 | } 78 | 79 | // Go through each tag for possible combination 80 | foreach ( $storage as $tag => $arr ) { 81 | // All three have to be defined 82 | if ( count( $arr ) == 2 && ! $this->Combine->checkUncombinables( $arr ) ) { 83 | $storage[ $tag ] = "$tag:" . $arr['before'] . ' ' . $arr['after'] . ';'; 84 | } 85 | else { 86 | unset( $storage[ $tag ] ); 87 | } 88 | } 89 | 90 | return $storage; 91 | } 92 | 93 | /** 94 | * Access to private methods for testing 95 | * 96 | * @param (string) method: Method to be called 97 | * @param (array) args: Array of paramters to be passed in 98 | */ 99 | public function access( $method, $args ) { 100 | if ( method_exists( $this, $method ) ) { 101 | return call_user_func_array( array( $this, $method ), $args ); 102 | } 103 | else { 104 | throw new CSSCompression_Exception( "Unknown method in Aural Class - " . $method ); 105 | } 106 | } 107 | }; 108 | 109 | ?> 110 | -------------------------------------------------------------------------------- /src/lib/Combine/Background.php: -------------------------------------------------------------------------------- 1 | Control = $control; 51 | $this->Combine = $combine; 52 | } 53 | 54 | /** 55 | * Combines multiple background props into single definition 56 | * 57 | * @param (string) val: Rule Set 58 | */ 59 | public function combine( $val ) { 60 | $storage = array(); 61 | 62 | // Find all possible occurences and build the replacement 63 | $pos = 0; 64 | while ( preg_match( $this->rbackground, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 65 | $storage[ $match[ 2 ][ 0 ] ] = $match[ 3 ][ 0 ]; 66 | $pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1; 67 | } 68 | 69 | // Run background checks and get replacement str 70 | foreach ( $this->groupings as $props ) { 71 | if ( $replace = $this->Combine->searchDefinitions( 'background', $storage, $props ) ) { 72 | break; 73 | } 74 | } 75 | 76 | // If replacement string found, run it on all declarations 77 | if ( $replace ) { 78 | $pos = 0; 79 | while ( preg_match( $this->rbackground, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 80 | $colon = strlen( $match[ 1 ][ 0 ] ); 81 | $val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon ); 82 | $pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1; 83 | $replace = ''; 84 | } 85 | } 86 | 87 | // Return converted val 88 | return $val; 89 | } 90 | 91 | /** 92 | * Access to private methods for testing 93 | * 94 | * @param (string) method: Method to be called 95 | * @param (array) args: Array of paramters to be passed in 96 | */ 97 | public function access( $method, $args ) { 98 | if ( method_exists( $this, $method ) ) { 99 | return call_user_func_array( array( $this, $method ), $args ); 100 | } 101 | else { 102 | throw new CSSCompression_Exception( "Unknown method in Background Class - " . $method ); 103 | } 104 | } 105 | }; 106 | 107 | ?> 108 | -------------------------------------------------------------------------------- /src/lib/Combine/Border.php: -------------------------------------------------------------------------------- 1 | Control = $control; 29 | $this->Combine = $combine; 30 | } 31 | 32 | /** 33 | * Combines multiple border properties into single definition 34 | * 35 | * @param (string) val: Rule Set 36 | */ 37 | public function combine( $val ) { 38 | if ( ( $replace = $this->replace( $val ) ) === false ) { 39 | return $val; 40 | } 41 | 42 | // Rebuild the rule set with the combinations found 43 | $pos = 0; 44 | while ( preg_match( $this->rborder, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 45 | $colon = strlen( $match[ 1 ][ 0 ] ); 46 | $val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon ); 47 | $pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1; 48 | $replace = ''; 49 | } 50 | 51 | // Return converted val 52 | return $val; 53 | } 54 | 55 | /** 56 | * Builds a replacement string 57 | * 58 | * @param (string) val: Rule Set 59 | */ 60 | private function replace( $val ) { 61 | $storage = array(); 62 | 63 | // Find all possible occurences and build the replacement 64 | $pos = 0; 65 | while ( preg_match( $this->rborder, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 66 | // Override double written properties 67 | $storage[ $match[ 2 ][ 0 ] ] = $match[ 3 ][ 0 ]; 68 | $pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1; 69 | } 70 | 71 | // All 4 have to be defined 72 | if ( count( $storage ) == 4 && 73 | $storage['top'] == $storage['bottom'] && 74 | $storage['left'] == $storage['right'] && 75 | $storage['top'] == $storage['right'] ) { 76 | return "border:" . $storage['top'] . ';'; 77 | } 78 | 79 | return false; 80 | } 81 | 82 | /** 83 | * Access to private methods for testing 84 | * 85 | * @param (string) method: Method to be called 86 | * @param (array) args: Array of paramters to be passed in 87 | */ 88 | public function access( $method, $args ) { 89 | if ( method_exists( $this, $method ) ) { 90 | return call_user_func_array( array( $this, $method ), $args ); 91 | } 92 | else { 93 | throw new CSSCompression_Exception( "Unknown method in Border Class - " . $method ); 94 | } 95 | } 96 | }; 97 | 98 | ?> 99 | -------------------------------------------------------------------------------- /src/lib/Combine/BorderOutline.php: -------------------------------------------------------------------------------- 1 | Control = $control; 29 | $this->Combine = $combine; 30 | } 31 | 32 | /** 33 | * Combines color/style/width of border/outline properties 34 | * 35 | * @param (string) val: Rule Set 36 | */ 37 | public function combine( $val ) { 38 | $storage = $this->storage( $val ); 39 | $pos = 0; 40 | 41 | // Now rebuild the string replacing all instances 42 | while ( preg_match( $this->rcsw, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 43 | $prop = $match[ 2 ][ 0 ]; 44 | if ( isset( $storage[ $prop ] ) ) { 45 | $colon = strlen( $match[ 1 ][ 0 ] ); 46 | $val = substr_replace( $val, $storage[ $prop ], $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon ); 47 | $pos = $match[ 0 ][ 1 ] + strlen( $storage[ $prop ] ) - $colon - 1; 48 | $storage[ $prop ] = ''; 49 | } 50 | else { 51 | $pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1; 52 | } 53 | } 54 | 55 | // Return converted val 56 | return $val; 57 | } 58 | 59 | /** 60 | * Builds a storage object for iteration 61 | * 62 | * @param (string) val: Rule Set 63 | */ 64 | private function storage( $val ) { 65 | $storage = array(); 66 | $pos = 0; 67 | 68 | // Find all possible occurences and build the replacement 69 | while ( preg_match( $this->rcsw, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 70 | if ( ! isset( $storage[ $match[ 2 ][ 0 ] ] ) ) { 71 | $storage[ $match[ 2 ][ 0 ] ] = array( $match[ 3 ][ 0 ] => $match[ 4 ][ 0 ] ); 72 | } 73 | 74 | // Override double written properties 75 | $storage[ $match[ 2 ][ 0 ] ][ $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ]; 76 | $pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1; 77 | } 78 | 79 | // Go through each tag for possible combination 80 | foreach ( $storage as $tag => $arr ) { 81 | // All three have to be defined 82 | if ( count( $arr ) == 3 && ! $this->Combine->checkUncombinables( $arr ) ) { 83 | $storage[ $tag ] = "$tag:" . $arr['width'] . ' ' . $arr['style'] . ' ' . $arr['color'] . ';'; 84 | } 85 | else { 86 | unset( $storage[ $tag ] ); 87 | } 88 | } 89 | 90 | return $storage; 91 | } 92 | 93 | /** 94 | * Access to private methods for testing 95 | * 96 | * @param (string) method: Method to be called 97 | * @param (array) args: Array of paramters to be passed in 98 | */ 99 | public function access( $method, $args ) { 100 | if ( method_exists( $this, $method ) ) { 101 | return call_user_func_array( array( $this, $method ), $args ); 102 | } 103 | else { 104 | throw new CSSCompression_Exception( "Unknown method in BorderOutline Class - " . $method ); 105 | } 106 | } 107 | }; 108 | 109 | ?> 110 | -------------------------------------------------------------------------------- /src/lib/Combine/Font.php: -------------------------------------------------------------------------------- 1 | Control = $control; 48 | $this->Combine = $combine; 49 | } 50 | 51 | /** 52 | * Combines multiple font-definitions into single definition 53 | * 54 | * @param (string) val: Rule Set 55 | */ 56 | public function combine( $val ) { 57 | $storage = $this->storage( $val ); 58 | 59 | // Loop through each property check and see if they can be replaced 60 | foreach ( $this->groupings as $props ) { 61 | if ( $replace = $this->Combine->searchDefinitions( 'font', $storage, $props ) ) { 62 | break; 63 | } 64 | } 65 | 66 | // If replacement string found, run it on all declarations 67 | if ( $replace ) { 68 | $pos = 0; 69 | while ( preg_match( $this->rfont, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 70 | if ( ! isset( $storage['line-height'] ) && stripos( $match[ 0 ][ 0 ], 'line-height') === 0 ) { 71 | $pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1; 72 | continue; 73 | } 74 | $colon = strlen( $match[ 1 ][ 0 ] ); 75 | $val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon ); 76 | $pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1; 77 | $replace = ''; 78 | } 79 | } 80 | 81 | // Return converted val 82 | return $val; 83 | } 84 | 85 | /** 86 | * Builds a storage object for iteration 87 | * 88 | * @param (string) val: Rule Set 89 | */ 90 | private function storage( $val ) { 91 | $storage = array(); 92 | 93 | // Find all possible occurences and build the replacement 94 | $pos = 0; 95 | while ( preg_match( $this->rfont, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 96 | $storage[ $match[ 2 ][ 0 ] . '-' . $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ]; 97 | $pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1; 98 | } 99 | 100 | // Combine font-size & line-height if possible 101 | if ( isset( $storage['font-size'] ) && isset( $storage['line-height'] ) ) { 102 | $storage['size/height'] = $storage['font-size'] . '/' . $storage['line-height']; 103 | unset( $storage['font-size'], $storage['line-height'] ); 104 | } 105 | 106 | return $storage; 107 | } 108 | 109 | /** 110 | * Access to private methods for testing 111 | * 112 | * @param (string) method: Method to be called 113 | * @param (array) args: Array of paramters to be passed in 114 | */ 115 | public function access( $method, $args ) { 116 | if ( method_exists( $this, $method ) ) { 117 | return call_user_func_array( array( $this, $method ), $args ); 118 | } 119 | else { 120 | throw new CSSCompression_Exception( "Unknown method in Font Class - " . $method ); 121 | } 122 | } 123 | }; 124 | 125 | ?> 126 | -------------------------------------------------------------------------------- /src/lib/Combine/List.php: -------------------------------------------------------------------------------- 1 | Control = $control; 39 | $this->Combine = $combine; 40 | } 41 | 42 | /** 43 | * Combines multiple list style props into single definition 44 | * 45 | * @param (string) val: Rule Set 46 | */ 47 | public function combine( $val ) { 48 | // If replacement string found, run it on all declarations 49 | if ( ( $replace = $this->replace( $val ) ) !== false ) { 50 | $pos = 0; 51 | while ( preg_match( $this->rlist, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 52 | $colon = strlen( $match[ 1 ][ 0 ] ); 53 | $val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon ); 54 | $pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1; 55 | $replace = ''; 56 | } 57 | } 58 | 59 | // Return converted val 60 | return $val; 61 | } 62 | 63 | /** 64 | * Build the replacement string for list props 65 | * 66 | * @param (string) val: Rule Set 67 | */ 68 | private function replace( $val ) { 69 | $storage = array(); 70 | $pos = 0; 71 | 72 | // Find all possible occurences and build the replacement 73 | while ( preg_match( $this->rlist, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) { 74 | $storage[ $match[ 2 ][ 0 ] ] = $match[ 3 ][ 0 ]; 75 | $pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1; 76 | } 77 | 78 | // Run background checks and get replacement str 79 | foreach ( $this->groupings as $props ) { 80 | if ( $replace = $this->Combine->searchDefinitions( 'list-style', $storage, $props ) ) { 81 | return $replace; 82 | } 83 | } 84 | 85 | return false; 86 | } 87 | 88 | /** 89 | * Access to private methods for testing 90 | * 91 | * @param (string) method: Method to be called 92 | * @param (array) args: Array of paramters to be passed in 93 | */ 94 | public function access( $method, $args ) { 95 | if ( method_exists( $this, $method ) ) { 96 | return call_user_func_array( array( $this, $method ), $args ); 97 | } 98 | else { 99 | throw new CSSCompression_Exception( "Unknown method in List Class - " . $method ); 100 | } 101 | } 102 | }; 103 | 104 | ?> 105 | -------------------------------------------------------------------------------- /src/lib/Exception.php: -------------------------------------------------------------------------------- 1 | code . "] " . $this->message . "\n"; 29 | } 30 | }; 31 | 32 | ?> 33 | -------------------------------------------------------------------------------- /src/lib/Numeric.php: -------------------------------------------------------------------------------- 1 | Control = $control; 32 | $this->options = &$control->Option->options; 33 | } 34 | 35 | /** 36 | * Runs all numeric operations 37 | * 38 | * @param (string) str: Unit string 39 | */ 40 | public function numeric( $str ) { 41 | $str = $this->decimal( $str ); 42 | $str = $this->zeroes( $str ); 43 | $str = $this->units( $str ); 44 | return $str; 45 | } 46 | 47 | /** 48 | * Remove's unecessary decimal, ie 13.0px => 13px 49 | * 50 | * @param (string) str: Unit string 51 | */ 52 | private function decimal( $str ) { 53 | if ( preg_match( $this->rdecimal, $str, $match ) ) { 54 | $str = ( $match[ 1 ] == '-' ? '-' : '' ) . floatval( $match[ 2 ] ) . $match[ 3 ]; 55 | } 56 | 57 | return $str; 58 | } 59 | 60 | /** 61 | * Removes suffix from 0 unit, ie 0px; => 0; 62 | * 63 | * @param (string) str: Unit string 64 | */ 65 | private function units( $str ) { 66 | if ( preg_match( $this->runit, $str, $match ) ) { 67 | $str = '0'; 68 | } 69 | 70 | return $str; 71 | } 72 | 73 | 74 | /** 75 | * Removes leading zero in decimal, ie 0.33px => .33px 76 | * 77 | * @param (string) str: Unit string 78 | */ 79 | private function zeroes( $str ) { 80 | if ( preg_match( $this->rzero, $str, $match ) ) { 81 | $str = ( isset( $match[ 1 ] ) && $match[ 1 ] == '-' ? '-' : '' ) . $match[ 2 ] . ( isset( $match[ 3 ] ) ? $match[ 3 ] : '' ); 82 | } 83 | 84 | return $str; 85 | } 86 | 87 | /** 88 | * Access to private methods for testing 89 | * 90 | * @param (string) method: Method to be called 91 | * @param (array) args: Array of paramters to be passed in 92 | */ 93 | public function access( $method, $args ) { 94 | if ( method_exists( $this, $method ) ) { 95 | return call_user_func_array( array( $this, $method ), $args ); 96 | } 97 | else { 98 | throw new CSSCompression_Exception( "Unknown method in Numeric Class - " . $method ); 99 | } 100 | } 101 | }; 102 | 103 | ?> 104 | -------------------------------------------------------------------------------- /src/lib/Option.php: -------------------------------------------------------------------------------- 1 | Control = $control; 28 | $this->options = CSSCompression::$defaults; 29 | $control->mode = $this->custom; 30 | } 31 | 32 | /** 33 | * Maintainable access to the options array 34 | * 35 | * - Passing no arguments returns the entire options array 36 | * - Passing a single name argument returns the value for the option 37 | * - Passing both a name and value, sets the value to the name key, and returns the value 38 | * - Passing an array will merge the options with the array passed, for object like extension 39 | * 40 | * @param (mixed) name: The key name of the option 41 | * @param (mixed) value: Value to set the option 42 | */ 43 | public function option( $name = NULL, $value = NULL ) { 44 | if ( $name === NULL ) { 45 | return $this->options; 46 | } 47 | else if ( is_array( $name ) ) { 48 | return $this->merge( $name ); 49 | } 50 | else if ( $value === NULL ) { 51 | return isset( $this->options[ $name ] ) ? $this->options[ $name ] : NULL; 52 | } 53 | else { 54 | // Readability doesn't signify custom settings 55 | if ( $name != 'readability' ) { 56 | $this->Control->mode = $this->custom; 57 | } 58 | 59 | return ( $this->options[ $name ] = $value ); 60 | } 61 | } 62 | 63 | /** 64 | * Reset's the default options 65 | * 66 | * @params none; 67 | */ 68 | public function reset(){ 69 | // Reset and return the new options 70 | return $this->options = CSSCompression::$defaults; 71 | } 72 | 73 | /** 74 | * Extend like function to merge an array of preferences into 75 | * the options array. 76 | * 77 | * @param (mixed) options: Array of preferences to merge into options 78 | */ 79 | public function merge( $options = array() ) { 80 | $modes = CSSCompression::modes(); 81 | if ( $options && is_array( $options ) && count( $options ) ) { 82 | $this->Control->mode = $this->custom; 83 | foreach ( $this->options as $key => $value ) { 84 | if ( ! isset( $options[ $key ] ) ) { 85 | continue; 86 | } 87 | else if ( strtolower( $options[ $key ] ) == 'on' ) { 88 | $this->options[ $key ] = true; 89 | } 90 | else if ( strtolower( $options[ $key ] ) == 'off' ) { 91 | $this->options[ $key ] = false; 92 | } 93 | else { 94 | $this->options[ $key ] = intval( $options[ $key ] ); 95 | } 96 | } 97 | } 98 | else if ( $options && is_string( $options ) && array_key_exists( $options, $modes ) ) { 99 | $this->Control->mode = $options; 100 | 101 | // Default all to true, the mode has to force false 102 | foreach ( $this->options as $key => $value ) { 103 | if ( $key != 'readability' ) { 104 | $this->options[ $key ] = true; 105 | } 106 | } 107 | 108 | // Merge mode into options 109 | foreach ( $modes[ $options ] as $key => $value ) { 110 | $this->options[ $key ] = $value; 111 | } 112 | } 113 | 114 | return $this->options; 115 | } 116 | 117 | /** 118 | * Access to private methods for testing 119 | * 120 | * @param (string) method: Method to be called 121 | * @param (array) args: Array of paramters to be passed in 122 | */ 123 | public function access( $method, $args ) { 124 | if ( method_exists( $this, $method ) ) { 125 | return call_user_func_array( array( $this, $method ), $args ); 126 | } 127 | else { 128 | throw new CSSCompression_Exception( "Unknown method in Option Class - " . $method ); 129 | } 130 | } 131 | }; 132 | 133 | ?> 134 | -------------------------------------------------------------------------------- /unit/benchmark/results/README: -------------------------------------------------------------------------------- 1 | This directory contains benchmark results in json format. 2 | -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.004.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 004 - 'arch4.20' by Dave Shea - http://www.mezzoblue.com/ */ 2 | /* css released under Creative Commons ShareAlike License v1.0 - http://creativecommons.org/licenses/sa/1.0/ */ 3 | /* All associated graphics copyright 2003, Dave Shea */ 4 | /* Added: May 7th, 2003 */ 5 | 6 | 7 | /* IMPORTANT */ 8 | /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. */ 9 | /* The CSS itself may freely be used for anything you wish, but the associated graphics belong to the designer. */ 10 | /* What you may use - .css files. What you may not use - .jpg, .gif, and .png files. */ 11 | 12 | 13 | /* The photo was taken inside the Vancouver Public Library. It has been mentioned the colours have a vaguely 14 | MetaFilter-like feel. I suppose they do... Unintentional. */ 15 | 16 | 17 | /* basic elements */ 18 | body { 19 | font: 11px tahoma, verdana, sans-serif; 20 | color: #fff; 21 | background: #005D87 url(bg1.gif) top left repeat-x; 22 | margin: 0px; 23 | } 24 | p { 25 | font: 11px/14px verdana, sans-serif; 26 | text-align: justify; 27 | margin-top: 0px; 28 | } 29 | h3 { 30 | font: bold 13px verdana, sans-serif; 31 | margin-bottom: 0px; 32 | } 33 | acronym { 34 | border-bottom: dotted 1px #fff; 35 | } 36 | a:link { 37 | font-weight: bold; 38 | text-decoration: none; 39 | color: #8AF44F; 40 | } 41 | a:visited { 42 | font-weight: bold; 43 | text-decoration: none; 44 | color: #55AB26; 45 | } 46 | a:active, a:hover { 47 | color: #8AF44F; 48 | text-decoration: underline; 49 | } 50 | 51 | /* specific divs */ 52 | #preamble { 53 | padding: 0px 180px 0px 25px; 54 | } 55 | #supportingText { 56 | padding: 0px 180px 0px 25px; 57 | } 58 | 59 | #pageHeader { 60 | width: 100%; 61 | height: 217px; 62 | background: #fff url(cr1.jpg) top left no-repeat; 63 | margin-top: 47px; 64 | } 65 | #pageHeader h1 { 66 | background: transparent url(h1.gif) no-repeat top left; 67 | width: 296px; 68 | height: 46px; 69 | position: absolute; 70 | top: 185px; 71 | right: 10px; 72 | } 73 | #pageHeader h1 span { 74 | display: none; 75 | } 76 | #pageHeader h2 { 77 | background: transparent url(h2.gif) no-repeat top left; 78 | width: 229px; 79 | height: 16px; 80 | position: absolute; 81 | top: 230px; 82 | right: 12px; 83 | } 84 | #pageHeader h2 span { 85 | display: none; 86 | } 87 | 88 | #quickSummary .p1 { 89 | font: 11px tahoma, verdana, sans-serif; 90 | line-height: 18px; 91 | color: #7799AC; 92 | background-color: #fff; 93 | padding: 2px; 94 | position: absolute; 95 | top: 65px; 96 | right: 10px; 97 | width: 150px; 98 | } 99 | #quickSummary .p2 { 100 | font: 10px tahoma, verdana, sans-serif; 101 | color: #7799AC; 102 | position: absolute; 103 | top: 32px; 104 | right: 5px; 105 | } 106 | #quickSummary .p2 a:link, #quickSummary .p2 a:visited { 107 | color: #7799AC; 108 | text-decoration: underline; 109 | } 110 | #quickSummary .p2 a:active, #quickSummary .p2 a:hover { 111 | color: #8AF44F; 112 | } 113 | 114 | #linkList{ 115 | font: 11px tahoma, verdana, sans-serif; 116 | line-height: 18px; 117 | color: #7799AC; 118 | position: absolute; 119 | top: 285px; 120 | right: 0px; 121 | width: 150px; 122 | } 123 | #linkList2 h3 span { 124 | display: none; 125 | } 126 | #linkList2 h3.select { 127 | background: transparent url(h3.gif) no-repeat top left; 128 | width: 157px; 129 | height: 14px; 130 | } 131 | #linkList2 h3.favorites{ 132 | background: transparent url(h5.gif) no-repeat top left; 133 | width: 157px; 134 | height: 14px; 135 | } 136 | #linkList2 h3.archives{ 137 | background: transparent url(h6.gif) no-repeat top left; 138 | width: 157px; 139 | height: 14px; 140 | } 141 | #linkList2 h3.resources{ 142 | background: transparent url(h4.gif) no-repeat top left; 143 | width: 157px; 144 | height: 14px; 145 | } 146 | #linkList li { 147 | font-size: 10px; 148 | line-height: 2.5ex; 149 | display: block; 150 | padding: 2px 10px 0px 0px; 151 | margin-bottom: 5px; 152 | } 153 | #linkList #lresources li { 154 | margin-bottom: 0px; 155 | } 156 | 157 | #linkList ul { 158 | margin: 0px; 159 | padding: 0px; 160 | } 161 | 162 | #linkList li { 163 | list-style-type: none; 164 | } 165 | 166 | 167 | #footer { 168 | text-align: right; border-top: solid 1px #1E5E82; 169 | padding-top: 10px; 170 | } 171 | #footer a:link, #footer a:visited { 172 | padding: 2px 6px 2px 6px; 173 | } 174 | #footer a:hover { 175 | background: transparent url(bg2.gif) top left repeat-x; 176 | text-decoration: none; 177 | } -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.008.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 008 - 'RPM' by Bruno Cunha, http://www.kaosboy.net/ */ 2 | /* css released under Creative Commons ShareAlike License v1.0 - http://creativecommons.org/licenses/sa/1.0/ */ 3 | /* Main image from http://www.karborn.com/FinalV6Old/Series/RPM/RPMImages.htm */ 4 | 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. */ 8 | /* The CSS itself may freely be used for anything you wish, but the associated graphics belong to the designer. */ 9 | /* What you may use - .css files. What you may not use - .jpg, .gif, and .png files. */ 10 | 11 | 12 | body { 13 | background-image:url(bg.jpg); 14 | background-color:#fff; 15 | font-family:arial, sans serif; 16 | font-size:11px; 17 | line-height:15px; 18 | color:#fff; 19 | margin:0px; 20 | } 21 | 22 | #container { 23 | margin-left:0px; 24 | margin-top:0px; 25 | padding:0px; 26 | width:684px; 27 | z-index:1; 28 | } 29 | 30 | #intro { 31 | width:275px; 32 | position:absolute; 33 | left:88px; 34 | top:902px; 35 | z-index:2; 36 | } 37 | 38 | #supportingText { 39 | width:450px; 40 | position:absolute; 41 | left:411px; 42 | top:535px; 43 | z-index:2; 44 | } 45 | #explanation, #participation, #requirements, #benefits, #footer, #quickSummary, #preamble, #lselect, #lfavorites, #lresources, #larchives { 46 | padding:7px; 47 | margin:5px; 48 | border-left:1px solid #aaa; 49 | border-top:1px solid #aaa; 50 | border-right:1px solid #333; 51 | border-bottom:1px solid #333; 52 | background-image:url(transparent.gif); 53 | } 54 | 55 | #linkList2 { 56 | width:275px; 57 | position:absolute; 58 | left:88px; 59 | top:1244px; 60 | z-index:2; 61 | } 62 | 63 | #extraDiv1 { 64 | background-image:url(tunami2.jpg); 65 | position:absolute; 66 | left:0px; 67 | top:0px; 68 | width:684px; 69 | height:1515px; 70 | z-index:1; 71 | } 72 | #pageHeader { 73 | display:none; 74 | } 75 | h3 { 76 | font-family:arial, sans serif; 77 | color:#fff; 78 | font-size:11px; 79 | font-weight:bold; 80 | margin-top:3px; 81 | margin-bottom:0px; 82 | } 83 | p { 84 | margin:6px; 85 | } 86 | 87 | a { 88 | color:#e2e2e2; 89 | text-decoration:underline; 90 | } 91 | a:link { 92 | color:#e2e2e2; 93 | text-decoration:underline; 94 | } 95 | a:hover { 96 | color:#fff; 97 | font-weight:bold; 98 | text-decoration:underline; 99 | } 100 | a:visited { 101 | color:#e2e2e2; 102 | text-decoration:underline; 103 | } 104 | 105 | #linkList ul { 106 | margin: 0px; 107 | padding: 0px; 108 | } 109 | 110 | #linkList li { 111 | list-style-type: none; 112 | display: inline; 113 | } 114 | -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.024.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 024 - 'Not So Minimal' by Daniel Rubin, http://www.superfluousbanter.org// */ 2 | /* css released under Creative Commons ShareAlike License v1.0 - http://creativecommons.org/licenses/sa/1.0/ */ 3 | /* All associated graphics copyright 2003, Daniel Rubin */ 4 | 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. */ 8 | /* The CSS itself may freely be used for anything you wish, but the associated graphics belong to the designer. */ 9 | /* What you may use - .css files. What you may not use - .jpg, .gif, and .png files. */ 10 | 11 | 12 | /* global ----------------------------------------------- */ body { background: #fff url(bg.gif) no-repeat fixed top left; font-family: verdana, helvetica, arial, sans-serif; margin: 0 20px 0 20px; color: #333; } /* layout ----------------------------------------------- */ #container { position: relative; background: url(header.jpg) no-repeat top left; margin: 0 auto -1px auto; padding-top: 144px; width: 710px; border-bottom: 5px solid #09345f; } #pageHeader { display: none; } #quickSummary { width: 100%; text-align: right; } #quickSummary p.p1 { display: none; } #quickSummary p.p2 { margin-top: 0; padding-right: 5px; } #preamble { margin: 22px 0 0 176px; width: 529px; } #explanation, #participation, #benefits, #requirements { margin: 25px 0 0 176px; width: 529px; } #footer { margin: 0 0 5px 0; padding: 10px 0 0 0; width: 100%; text-align: center; } #linkList { position: absolute; width: 150px; top: 166px; left: 5px; } /* text ----------------------------------------------- */ p { font-size: 12px; } #preamble p.p1, #supportingText p.p1 { margin-top: 10px; } #preamble p, #supportingText p { line-height: 18px; } #quickSummary p.p2 { font-size: 9px; color: #999; } #footer { font-size: 9px; } /* lists ----------------------------------------------- */ #linkList ul { font-size: 10px; list-style:none; margin: 5px 0 0 0; padding: 0 0 0 0; } #linkList ul li { background: url(bullet_single.gif) no-repeat 7px 4px; margin: 0; padding: 0 0 0 17px; line-height: 14px; color: #ccc; } #linkList #lselect li { background: url(bullet_double.gif) no-repeat 5px 2px; font-size: 9px; } #linkList #lselect a:link, #linkList #lselect a:visited { display: block; } #linkList #lselect a.c:link, #linkList #lselect a.c:visited { display:inline; } #larchives li, #lresources li { text-transform: lowercase; } /* links ----------------------------------------------- */ a, a:link, a:visited { color: #999; } a:hover { color: #333; } #quickSummary a, #quickSummary a:link, #quickSummary a:visited { font-weight: bold; text-transform: uppercase; text-decoration: none; } #quickSummary a:hover { text-decoration: underline; } #linkList a, #linkList a:link, #linkList a:visited { color: #666; text-decoration: none; } #linkList a:hover { text-decoration: underline; color: #333; } #linkList a.c, #linkList a.c:link, #linkList a.c:visited { color: #999; text-decoration: none; } #linkList a.c:hover { text-decoration: underline; color: #333; } #linkList #lselect a { font-size: 10px; } #linkList #lselect a.c { font-size: 9px; text-transform: lowercase; } #footer a, #footer a:link, #footer a:visited { font-weight: bold; text-transform: uppercase; text-decoration: none; } #footer a:hover { text-decoration: underline; } /* headings ----------------------------------------------- */ h3 { margin-bottom: 0px; } h3 span { display: none; } #supportingText h3 { width: 529px; height: 15px; } #linkList h3 { width: 150px; height: 20px; margin-top: 20px; } #preamble h3 { background: transparent url(h3_theroadtoenlightenment.gif) no-repeat top left; width: 529px; height: 26px; } #explanation h3 { background: transparent url(h3_sowhatisthisabout.gif) no-repeat top left; } #participation h3 { background: transparent url(h3_participation.gif) no-repeat top left; } #benefits h3 { background: transparent url(h3_benefits.gif) no-repeat top left; } #requirements h3 { background: transparent url(h3_requirements.gif) no-repeat top left; } #lselect h3 { background: transparent url(h3_selectadesign.gif) no-repeat top left; margin-top: 10px; } #lfavorites h3 { background: transparent url(h3_favorites.gif) no-repeat top left; } #larchives h3 { background: transparent url(h3_archives.gif) no-repeat top left; } #lresources h3 { background: transparent url(h3_resources.gif) no-repeat top left; } /* misc --------------------------------- */ acronym { border-width: 0; } -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.030.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 030 - 'Entomology' by Jon Hicks, http://exp.hicksdesign.co.uk/ */ 2 | /* css released under Creative Commons ShareAlike License v1.0 - http://creativecommons.org/licenses/sa/1.0/ */ 3 | /* All associated graphics copyright 2003, Jon Hicks */ 4 | 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. */ 8 | /* The CSS itself may freely be used for anything you wish, but the associated graphics belong to the designer. */ 9 | /* What you may use - .css files. What you may not use - .jpg, .gif, and .png files. */ 10 | 11 | 12 | 13 | 14 | /* basic elements */ 15 | 16 | body { 17 | background: #B61E3D url(bkgd.jpg); 18 | font: 12px/16px Georgia, "Times New Roman", Times, serif; 19 | color: #390404; 20 | margin: 0px; 21 | } 22 | p { 23 | margin-top: -0.8em; 24 | } 25 | p+p { 26 | text-indent: 15px; 27 | } 28 | 29 | h3 { 30 | font-size: 13px; 31 | text-transform: uppercase; 32 | letter-spacing: 0.3em; 33 | margin-top: 2em; 34 | } 35 | 36 | a:link, 37 | a:visited { 38 | font-style: italic; 39 | text-decoration: none; 40 | color: #039; 41 | } 42 | a:visited { 43 | font-style: normal; 44 | } 45 | a:hover, a:active { 46 | background: #ffe699; 47 | } 48 | 49 | 50 | /* main text divs */ 51 | #container { 52 | background: #ffc url(mid.jpg) repeat-y center; 53 | position: absolute; 54 | left: 50%; 55 | width: 760px; 56 | margin-left: -380px; 57 | } 58 | #intro { 59 | margin: 0px; 60 | background: url(top.jpg) no-repeat center top; 61 | padding-top: 186px; 62 | } 63 | #pageHeader h1 span, 64 | #pageHeader h2 span { 65 | display:none 66 | } 67 | #quickSummary p.p1:first-line { 68 | text-transform: uppercase; 69 | } 70 | #quickSummary { 71 | margin-top: 30px; 72 | } 73 | #quickSummary p { 74 | font-size: 13px; 75 | line-height: 22px; 76 | } 77 | #quickSummary, 78 | #preamble, 79 | #supportingText { 80 | margin-right: 80px; 81 | margin-left: 300px; 82 | } 83 | #supportingText p.p5{ 84 | background: url(line.jpg) no-repeat center bottom; 85 | margin-right: -80px; 86 | margin-left: -300px; 87 | margin-top: 30px; 88 | height: 30px; 89 | text-align: center; 90 | } 91 | #footer { 92 | background: url(bot.jpg) no-repeat center bottom; 93 | margin-right: -80px; 94 | margin-left: -300px; 95 | height: 110px; 96 | text-align: center; 97 | } 98 | #footer a:link, #footer a:visited { 99 | font-size: 15px; 100 | color: #390404; 101 | } 102 | 103 | 104 | /* sidelinks styles */ 105 | #linkList { 106 | background: url(b5.jpg) no-repeat center bottom; 107 | padding-bottom: 150px; 108 | width: 195px; 109 | position: absolute; 110 | left: 90px; 111 | top: 200px; 112 | border-right: 1px dotted #930; 113 | } 114 | #linkList h3 { 115 | text-align: center; 116 | font-style: italic; 117 | text-transform: lowercase; 118 | letter-spacing: 0.1em; 119 | } 120 | #linkList h3.select { 121 | background: url(b1.jpg) no-repeat center top; 122 | padding-top: 110px; 123 | font-style: italic; 124 | text-transform: lowercase; 125 | margin-top: 0px; 126 | } 127 | linkList h3.favorites { 128 | margin-top: 30px; 129 | background: url(b2.jpg) no-repeat center top; 130 | padding-top: 110px; 131 | } 132 | #linkList h3.archives { 133 | margin-top: 30px; 134 | background: url(b3.jpg) no-repeat center top; 135 | padding-top: 110px; 136 | } 137 | #linkList h3.resources { 138 | margin-top: 30px; 139 | background: url(b4.jpg) no-repeat center top; 140 | padding-top: 105px; 141 | } 142 | #linkList ul { 143 | margin: -0.5em 0 0 0; 144 | padding: 0px; 145 | list-style-type: none; 146 | text-align: center; 147 | } 148 | #linkList li { 149 | background: url(listline.gif) no-repeat center bottom; 150 | padding-bottom: 15px; 151 | } 152 | #linkList #lselect a { 153 | display: block; 154 | font-style: normal; 155 | text-transform: uppercase; 156 | letter-spacing: 0.1em; 157 | } 158 | #linkList #lselect a.c{ 159 | display: inline; 160 | margin-bottom: -1em; 161 | font-style: italic; 162 | text-transform: none; 163 | letter-spacing: 0em; 164 | } 165 | #linkList #lselect li{ 166 | font-style: italic; 167 | } 168 | 169 | 170 | /* CSS 2 pseudo elements - not essential but nice in browsers that support it */ 171 | 172 | h3:first-letter { 173 | font-size: 16px; 174 | } 175 | #linkList h3 :before { 176 | content: "("; 177 | } 178 | #linkList h3 :after { 179 | content: ")"; 180 | } 181 | #footer a:before { 182 | content: "{ "; 183 | } 184 | #footer a:after { 185 | content: " }"; 186 | } 187 | -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.038.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 038 - 'Creepy Crawly' by Luke Redpath - www.sonicdeath.co.uk */ 2 | /* css released under Creative Commons ShareAlike License v1.0 - http://creativecommons.org/licenses/sa/1.0/ */ 3 | /* All other graphics copyright 2003, Luke Redpath */ 4 | 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. */ 8 | /* The CSS itself may freely be used for anything you wish, but the associated graphics belong to the designer. */ 9 | /* What you may use - .css files. What you may not use - .jpg, .gif, and .png files. */ 10 | 11 | 12 | 13 | /* Define main areas */ 14 | body { 15 | margin: 0; 16 | padding: 0; 17 | background: #97B661 url(body_bground.gif) repeat-y; 18 | } 19 | #container { 20 | width: 760px; 21 | background-color: #6E7F71; 22 | } 23 | 24 | /* Main Headers */ 25 | #pageHeader h1 { 26 | width: 760px; 27 | height: 150px; 28 | margin: 0; 29 | padding: 0; 30 | text-indent: -100em; 31 | overflow: hidden; 32 | background-image: url(h1_mainheader.jpg); 33 | } 34 | #pageHeader h2 { 35 | width: 760px; 36 | height: 123px; 37 | margin: 0; 38 | padding: 0; 39 | text-indent: -100em; 40 | overflow: hidden; 41 | background-image: url(h2_mainheader.jpg); 42 | } 43 | 44 | /* Main content */ 45 | #quickSummary { 46 | margin-left: 289px; 47 | background-image: url(summary_background.jpg); 48 | background-repeat: no-repeat; 49 | } 50 | #preamble, 51 | #supportingText { 52 | margin-left: 289px; 53 | } 54 | #quickSummary p, 55 | #preamble p, 56 | #supportingText p { 57 | margin: 0 30px 20px 20px;; 58 | padding: 0; 59 | font-family: Georgia, serif; 60 | font-size: 12px; 61 | line-height: 1.6; 62 | color: #DCEBDF; 63 | } 64 | 65 | /* Paragraph headers */ 66 | #preamble h3 { 67 | height: 36px; 68 | padding: 0; 69 | margin: 0 0 10px 0; 70 | text-indent: -100em; 71 | overflow: hidden; 72 | background: url(headers/preamble.gif) no-repeat; 73 | } 74 | #explanation h3 { 75 | height: 36px; 76 | padding: 0; 77 | margin: 0 0 10px 0; 78 | text-indent: -100em; 79 | overflow: hidden; 80 | background: url(headers/explanation.gif) no-repeat; 81 | } 82 | #participation h3 { 83 | height: 36px; 84 | padding: 0; 85 | margin: 0 0 10px 0; 86 | text-indent: -100em; 87 | overflow: hidden; 88 | background: url(headers/participation.gif) no-repeat; 89 | } 90 | #benefits h3 { 91 | height: 36px; 92 | padding: 0; 93 | margin: 0 0 10px 0; 94 | text-indent: -100em; 95 | overflow: hidden; 96 | background: url(headers/benefits.gif) no-repeat; 97 | } 98 | #requirements h3 { 99 | height: 36px; 100 | padding: 0; 101 | margin: 0 0 10px 0; 102 | text-indent: -100em; 103 | overflow: hidden; 104 | background: url(headers/requirements.gif) no-repeat; 105 | } 106 | 107 | /* Links */ 108 | #linkList { 109 | position: absolute; 110 | top: 273px; 111 | left: 0; 112 | width: 289px; 113 | margin: 0; 114 | padding: 0 0 0 32px; 115 | background-image: url(linklist_background.jpg); 116 | background-repeat: no-repeat; 117 | } 118 | #linkList2 { 119 | margin-right: 38px; 120 | } 121 | #linkList h3 { 122 | font-family: Georgia, serif; 123 | font-size: 15px; 124 | color: #DCEBDF; 125 | padding: 0; 126 | margin: 0 0 20px 0; 127 | } 128 | #linkList ul { 129 | margin: 0 0 20px 0; 130 | padding: 0 32px 0 0; 131 | list-style-type: none; 132 | font-family: Georgia, serif; 133 | font-size: 12px; 134 | color: #DCEBDF; 135 | } 136 | #linkList li { 137 | margin: 0 0 5px 0; 138 | padding: 0 0 20px 0; 139 | background: url(list_divider.gif) no-repeat; 140 | background-position: bottom center; 141 | text-align: center; 142 | } 143 | #lselect li a { 144 | display: block; 145 | text-transform: uppercase; 146 | } 147 | #lselect li a.c { 148 | display: inline; 149 | text-transform: none; 150 | } 151 | 152 | /* Link styles */ 153 | a:link { 154 | color: #E9EEDD; 155 | } 156 | a:hover { 157 | color: #FFF; 158 | } 159 | a:visited { 160 | color: #AAA; 161 | } 162 | 163 | /* Site footer */ 164 | #footer { 165 | text-align: right; 166 | padding: 40px 20px 20px 0; 167 | font-size: 11px; 168 | } -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.047.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 047 - 'dusk' by Jon Hicks, http://exp.hicksdesign.co.uk/ */ 2 | /* css released under Creative Commons ShareAlike License v1.0 - http://creativecommons.org/licenses/sa/1.0/ */ 3 | /* All associated graphics copyright 2003, Jon Hicks */ 4 | 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. */ 8 | /* The CSS itself may freely be used for anything you wish, but the associated graphics belong to the designer. */ 9 | /* What you may use - .css files. What you may not use - .jpg, .gif, and .png files. */ 10 | 11 | 12 | /* basic elements */ 13 | body { 14 | background: #fff url(border.gif) repeat-y 20px 0px; 15 | margin: 0; 16 | padding: 0; 17 | font: 10px/1.4em Arial, Helvetica, sans-serif; 18 | color: #666; 19 | letter-spacing: 0.01em; 20 | } 21 | p { 22 | margin: 0 0 0.5em 0; 23 | } 24 | 25 | ul { 26 | list-style: none; 27 | margin: 0; 28 | padding: 0; 29 | } 30 | 31 | a, 32 | a:link 33 | a:active { 34 | color: #690; 35 | text-decoration:none; 36 | } 37 | 38 | a:visited { 39 | color: #666; 40 | } 41 | 42 | a:hover { 43 | background-color: #690; 44 | color: #fff; 45 | } 46 | 47 | 48 | /* main divs - in order of appearance */ 49 | /* ------------------------------------------------------------ */ 50 | 51 | /* big grey stripe */ 52 | #extraDiv1 { 53 | background: #666 url(end_block.gif) no-repeat right top; 54 | position: absolute; 55 | left: 10px; 56 | top: 30px; 57 | width: 780px; 58 | height: 230px; 59 | z-index: 1; 60 | } 61 | 62 | /* top left corner image of big grey stripe */ 63 | #extraDiv1 span{ 64 | display: block; 65 | background: url(corner.gif) no-repeat left top; 66 | width: 360px; 67 | height: 60px; 68 | } 69 | 70 | #container { 71 | margin-left: 358px; 72 | margin-top: 260px; 73 | width: 550px; 74 | } 75 | 76 | #pageHeader { 77 | background: transparent url(logo.gif) no-repeat left top; 78 | position: absolute; 79 | left: 10px; 80 | top: 137px; 81 | height: 229px; 82 | width: 730px; 83 | text-indent: -1000em; 84 | z-index: 2; 85 | } 86 | 87 | #preamble { 88 | color: #eee; 89 | position: absolute; 90 | height: 190px; 91 | width: 380px; 92 | left: 357px; 93 | top: 70px; 94 | padding-right: 20px; 95 | z-index: 2; 96 | overflow: auto; 97 | } 98 | #preamble h3 { 99 | background: url(road.gif) no-repeat left top; 100 | height: 19px; 101 | width: 216px; 102 | margin: 0 0 8px 0; 103 | } 104 | 105 | #preamble h3 span { 106 | display: none; 107 | } 108 | 109 | #quickSummary { 110 | position: absolute; 111 | left: 52px; 112 | top: 365px; 113 | height: 200px; 114 | width: 230px; 115 | color: #666; 116 | z-index: 2; 117 | line-height: 2em; 118 | } 119 | 120 | #quickSummary p.p2{ 121 | padding-top: 10px; 122 | } 123 | 124 | 125 | /* This is the bit that screws up in Opera 6 */ 126 | 127 | #supportingText { 128 | width: 375px; 129 | height: 150px; 130 | overflow: auto; 131 | padding: 0 20px 30px 5px; 132 | z-index: 10; 133 | border-left: solid 1px #999; 134 | } 135 | 136 | #supportingText h3 { 137 | font-size: 13px; 138 | color: #7fbb09; 139 | border-bottom: 1px solid #ccc; 140 | margin: 1.6em 0 0.8em 0; 141 | } 142 | #supportingText h3 span { 143 | border-bottom: 5px solid #ccc; 144 | } 145 | 146 | #footer { 147 | padding-bottom: 10px; 148 | padding-top: 10px; 149 | } 150 | 151 | 152 | /* links lists */ 153 | #linkList { 154 | width: 550px; 155 | } 156 | 157 | #linkList li{ 158 | padding-left: 2px; 159 | } 160 | #linkList h3 { 161 | text-indent: -1000em; 162 | margin-bottom: 3px; 163 | width: 116px; 164 | height: 18px; 165 | } 166 | 167 | /* links titles */ 168 | h3.select {background: url(select.gif) no-repeat left top;} 169 | h3.archives {background: url(archives.gif) no-repeat left top;} 170 | h3.favourites {background: url(favourites.gif) no-repeat left top;} 171 | h3.resources {background: url(resources.gif) no-repeat left top;} 172 | 173 | 174 | 175 | div#lselect, 176 | div#lfavorites, 177 | div#larchives, 178 | div#lresources { 179 | float: left; 180 | border-left: solid 1px #999; 181 | margin-right: 20px; 182 | padding-top: 20px; 183 | } 184 | -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.048.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codenothing/css-compressor/9821e0bbcb067f5112bd22735781d77958068f97/unit/benchmark/src/csszengarden.com.048.css -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.057.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codenothing/css-compressor/9821e0bbcb067f5112bd22735781d77958068f97/unit/benchmark/src/csszengarden.com.057.css -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.073.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 073 - 'Emmakade' by Alexander Christiaan Jacob (ACJ) - http://acjs.net/ */ 2 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 3 | /* All associated graphics copyright 2003, ACJ */ 4 | /* Added: January 18th, 2003 */ 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the 8 | designer's written permission. However, feel free to study the CSS and use 9 | techniques you learn from it elsewhere. */ 10 | 11 | 12 | :link, :visited { background-color: transparent; color: #9296A2; font-weight: bold; text-decoration: underline } 13 | [title] { border-bottom: 1px dotted; cursor: help } 14 | :link:hover, :visited:hover { background-color: #9296A2; color: #373B46; text-decoration: none } 15 | body { font: normal 70% Verdana, Georgia, Times, serif } 16 | body { background: #9296A2 url(a_img.gif) repeat; color: #000000; margin: 0em; padding: 0em } 17 | h1, h2, h3, h4 { margin: 0em; overflow: hidden; padding: 0em } 18 | h1 { background: #9296A2 url(h1_v2.jpg) no-repeat; height: 430px } 19 | h2 { background: #9296A2 url(h2.gif) no-repeat; height: 360px; margin-left: -62px; position: absolute; top: 0px; width: 60px } 20 | * > h2 { position: fixed } 21 | h3 span { margin-left: -2000px } 22 | p { color: #9296A2; margin: 0em; padding: 0em 0em 1em 0em } 23 | p:hover { color: #E7E7F1 } 24 | p * { color: #9296A2 } 25 | p:hover * { color: #E7E7F1 } 26 | ul { background-color: transparent; color: #9296A2; margin: 0em; padding: 0em; padding-bottom: 20px } 27 | ul li { list-style: square; margin: 0em 0em 0em 2em; padding: 0em } 28 | ul li a { font-weight: normal } 29 | #container { background: #373B46 url(container.jpg) bottom no-repeat; border: 2px solid #000; border-width: 0px 2px; color: #E7E7F1; margin-left: -321px; padding-bottom: 500px; position: absolute; left: 50%; width: 642px } 30 | #pageHeader { background-color: #373B46 } 31 | #pageHeader h1 span { margin-left: -2000px } 32 | #pageHeader h2 span { margin-left: -2000px } 33 | #quickSummary { margin-top: -10px } 34 | #quickSummary, #preamble { margin-left: 290px; text-align: justify; width: 270px } 35 | #preamble h3 { background: #373B46 url(h3_preamble.gif) no-repeat; height: 60px; width: 330px } 36 | #supportingText { margin-left: 24px; width: 440px } 37 | p { border-left: 1px dotted #9296A2; margin-left: 10px; padding-left: 10px; text-align: justify } 38 | #explanation h3 { background: #373B46 url(h3_explanation.gif) no-repeat; height: 60px; width: 330px } 39 | #participation h3 { background: #373B46 url(h3_participation.gif) no-repeat; height: 60px; width: 330px } 40 | #benefits h3 { background: #373B46 url(h3_benefits.gif) no-repeat; height: 60px; width: 330px } 41 | #requirements h3 { background: #373B46 url(h3_requirements.gif) no-repeat; height: 60px; width: 330px } 42 | #linkList { left: 12px; position: absolute; top: 400px; width: 256px } 43 | #linkList h3 { height: 30px; width: 200px } 44 | #linkList h3.select { background: #373B46 url(h3.select.gif) no-repeat } 45 | #linkList h3.favorites { background: #373B46 url(h3.favorites.gif) no-repeat } 46 | #linkList h3.archives { background: #373B46 url(h3.archives.gif) no-repeat } 47 | #linkList h3.resources { background: #373B46 url(h3.resources.gif) no-repeat } 48 | #footer { bottom: 400px; position: absolute; right: 36px; text-align: right } 49 | #extraDiv1 { background: #9296A2 url(thingy.gif) no-repeat; bottom: 0px; float: right; height: 36px; position: fixed; right: 0px; width: 36px } -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.079.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 079 - 'Green Tea' by Amy Rae Som, http://www.avisualmind.com */ 2 | /* css released under Creative Commons ShareAlike License v1.0 - http://creativecommons.org/licenses/sa/1.0/ */ 3 | /* All associated graphics and photos copyright 2004, Amy Rae Som */ 4 | /* Added: February 15th, 2004 */ 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. */ 8 | /* The CSS itself may freely be used for anything you wish, but the associated graphics belong to the designer. */ 9 | /* What you may use - .css files. What you may not use - .jpg, .gif, and .png files. */ 10 | 11 | 12 | 13 | body {background:#a2c4a3 url(flower_bg.jpg) repeat-x;font-family:"Trebuchet MS", Arial, Geneva, sans-serif;font-size:70%;color:#030;} 14 | #pageHeader {position:absolute;left:20px;top:39px;width:222px;height:63px;background:url(cssZenGarden.gif) no-repeat;} 15 | #pageHeader span {margin-left:-1000px;} 16 | #quickSummary .p1 {position:absolute;left:0;top:114px;width:750px;height:16px;background:url(an_example.gif) no-repeat;} 17 | #quickSummary .p1 span {margin-left:-1000em;} 18 | #quickSummary .p2 {position:absolute;left:116px;top:528px;width:88px;height:42px;font-weight:bold;} 19 | #preamble {position:absolute;left:20px;top:145px;width:222px;height:298px;overflow:auto;} 20 | h3 {background:transparent;font:italic normal 1.4em "Times New Roman",Times,serif;margin:0;border-bottom:1px solid #a2c4a3;color:#603;} 21 | p {margin:0 0 6px 0; line-height:1.5em;} 22 | div {margin:0;} 23 | a {background:transparent;color:#060;} 24 | #supportingText {position:absolute;left:268px;top:145px;width:63%;height:297px;padding-right:4px;overflow:auto;} 25 | #linkList {position:absolute;left:268px;top:459px;width:63%;} 26 | #linkList a {color:#030;} 27 | #linkList a.c {text-decoration:none;} 28 | #linkList a.c:hover {text-decoration:underline;} 29 | #linkList h3 {background:transparent;font-size:1.3em;margin:0.6em 0 0;border-bottom:1px solid #82B084;} 30 | #linkList ul {margin:0;padding:0.2em 0;} 31 | #linkList li {list-style-type:none;display:inline;background:url(greenarrow.gif) 0% 50% no-repeat;margin:0;padding:0 0 0 1.3em;} -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.083.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codenothing/css-compressor/9821e0bbcb067f5112bd22735781d77958068f97/unit/benchmark/src/csszengarden.com.083.css -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.099.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codenothing/css-compressor/9821e0bbcb067f5112bd22735781d77958068f97/unit/benchmark/src/csszengarden.com.099.css -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.100.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 100 - '15 Petals', by Eric Meyer and Dave Shea, 2 | http://www.meyerweb.com/ and http://www.mezzoblue.com/ */ 3 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 4 | /* All photos copyright 2004, Eric Meyer */ 5 | /* All other graphics copyright 2004, Dave Shea */ 6 | /* Added: April 14th, 2004 */ 7 | 8 | /* IMPORTANT */ 9 | /* This design is not a template. You may not reproduce it elsewhere without the 10 | designer's written permission. However, feel free to study the CSS and use 11 | techniques you learn from it elsewhere. */ 12 | 13 | 14 | /* 15 | This design built specifically for 'More Eric Meyer on CSS'. 16 | http://more.ericmeyeroncss.com/ 17 | 18 | Don't miss chapter 10, "Designing in the Garden", which explores step by 19 | step the creation of this CSS Zen Garden design. 20 | */ 21 | 22 | body {margin: 0; padding: 0; text-align: center; 23 | color: #000; background: #FFF;} 24 | acronym {border: none;} 25 | a {text-decoration: none;} 26 | a:link {color: rgb(179,63,96);} 27 | a:visited {color: rgb(90,32,48);} 28 | a:hover {text-decoration: underline;} 29 | 30 | #container {width: 647px; margin: 75px auto 0; padding: 0; 31 | position: relative; text-align: left;} 32 | 33 | #pageHeader {background: url(pageHeader2.jpg) 0 0 no-repeat; 34 | height: 157px; width: auto; position: relative; z-index: 10;} 35 | #pageHeader h1 {background: url(ph-flower.gif) 0 0 no-repeat; 36 | height: 330px; width: 250px; position: absolute; z-index: 101; 37 | top: -95px; right: -80px; margin: 0;} 38 | html>body #pageHeader h1 {background-image: url(ph-flower2.png);} 39 | 40 | 41 | #pageHeader h1 span {visibility: hidden; font-size: 1px;} 42 | #pageHeader h2 {position: absolute; z-index: 102; 43 | top: 134px; right: 140px; margin: 0; padding: 0; 44 | color: rgb(91,131,104); 45 | text-transform: lowercase; letter-spacing: 0.2em; 46 | font: bold italic 1.1em/1em Times, serif; text-align: right;} 47 | #pageHeader acronym {text-transform: uppercase;} 48 | 49 | #quickSummary {font: italic 1em/2 Times, "Times New Roman", serif; 50 | color: rgb(42,92,42); 51 | background: rgb(94%,98%,96%) url(quickSummary.jpg) 0 100% no-repeat; 52 | margin: 1px 0; padding: 1em 180px 1.5em 1.5em;} 53 | #quickSummary p {display: inline;} 54 | 55 | #preamble, #supportingText {padding-right: 217px;} 56 | #preamble {background: url(side.jpg) 100% 100% repeat-y;} 57 | #supportingText {background: url(side.jpg) 100% 0 repeat-y;} 58 | 59 | #preamble, #explanation, #participation, #benefits, #requirements { 60 | border-left: 1px solid rgb(184,214,194); 61 | padding-top: 1px; padding-bottom: 1px;} 62 | #preamble {border-top: 1px solid rgb(184,214,194); padding-top: 0.5em;} 63 | #preamble p, #supportingText p {font-size: 90%; line-height: 1.66em; 64 | margin: 0 1.5em; padding: 0.5em 0;} 65 | #preamble h3, #supportingText h3 {letter-spacing: 0.1em; 66 | font: italic 1.2em Times, "Times New Roman", serif; 67 | color: rgb(107,153,139); margin: 1em 0 0.5em 0.5em;} 68 | #requirements {border-bottom: 1px solid rgb(184,214,194); padding-bottom: 100px; 69 | background: url(main.jpg) 0 100% no-repeat;} 70 | 71 | #footer {background: #FFF url(footer.jpg) 0 1px no-repeat; 72 | margin: 0 -217px 0 4px; height: 123px; 73 | padding: 60px 1em 0 0.5em;} 74 | html>body #footer {margin-left: 0;} 75 | #footer a {color: rgb(207,216,214); line-height: 1em; 76 | font-size: 1.25em; font-weight: 100;} 77 | 78 | #linkList {position: absolute; z-index: 11; 79 | width: 216px; top: 157px; right: 0; 80 | margin-top: 8.6em;} 81 | #linkList a {color: rgb(99,131,101); 82 | font: italic 1.15em Times, serif; 83 | text-transform: lowercase;} 84 | #linkList ul {margin: 0.5em 1em 0 2em; padding: 0;} 85 | #linkList li {list-style: none;} 86 | 87 | #linkList h3 {margin: 1em 0 0; width: 216px; height: 35px; 88 | background: url(resources.gif) 10px 50% no-repeat;} 89 | #lselect h3 {background-image: url(design-list.gif);} 90 | #larchives h3 {background-image: url(archives.gif);} 91 | #linkList h3 span {display: none;} 92 | 93 | #lselect li {font-size: 85%; margin-bottom: 1.5em;} 94 | #lselect li a {display: block; 95 | font: bold italic 1.15em Times, serif; 96 | letter-spacing: 0.2em; text-transform: lowercase;} 97 | #lselect li a.c {display: inline; 98 | font: bold 1em Times, serif; 99 | letter-spacing: 0; text-transform: none;} 100 | 101 | #larchives li, #lresources li {margin-bottom: 0.5em;} 102 | #larchives li a, #lresources li a {color: rgb(126,164,139);} -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.104.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 104 - 'Invitation', by Brad Dailey, http://bradleyboy.com/ */ /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ /* All associated graphics copyright 2004, Brad Dailey */ /* Added: May 31st, 2004 */ /* IMPORTANT */ /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. However, feel free to study the CSS and use techniques you learn from it elsewhere. */ body { background:#968354 url(zen_bg.gif) repeat-y center; margin:0; padding:0; font: 13px/15px georgia; text-align:center; } .p1 { margin-top:0px; } p { margin-left:15px; } a { color:#968354; } a:hover { color:#7e7e7e; } h1 { background:#ffffff url(head.gif); width:710px; height:200px; margin:10px 0 0 0; padding:0; } h1 span, h2 { display:none; } #container { position:relative; width:710px; margin:0 auto 0; padding:0; text-align:justify; } #quickSummary { text-align:center; font-style:italic; color:#7e7e7e; width:500px; margin:0 105px 0; font-size:11px; } #quickSummary a { color:#7e7e7e; } #quickSummary a:hover { color:#333333; } #quickSummary .p1 { margin-top:8px; margin-bottom:0; } #quickSummary .p2 { margin-top: 5px; } #quickSummary p { margin-left:0; } #preamble { width:450px; margin-top:20px; } #preamble h3 { background:transparent url(1.gif) no-repeat; height:35px; margin:0; padding:0; } #preamble h3 span { display:none; } #explanation h3 { background:transparent url(2.gif) no-repeat; height:35px; margin:0; padding:0; } #explanation h3 span { display:none; } #supportingText { width:450px; margin-top:15px; } #participation h3 { background:transparent url(3.gif) no-repeat; height:35px; margin:0; padding:0; } #participation h3 span { display:none; } #benefits h3 { background:transparent url(4.gif) no-repeat; height:35px; margin:0; padding:0; } #benefits h3 span { display:none; } #requirements h3 { background:transparent url(5.gif) no-repeat; height:35px; margin:0; padding:0; } #requirements h3 span { display:none; } #linkList { position:absolute; top:310px; left:50%; margin-left:112px; width:240px; background: url(side_02.gif) repeat-y; text-align:left; } #lselect h3 { background:transparent url(side_01.gif) no-repeat center; height:51px; margin:0; padding:0; } #lselect h3 span { display:none; } #lselect ul, #larchives ul, #lresources ul { list-style:none; margin:12px 0 0 0; padding:0 18px 0 18px; } #lselect ul li, #larchives ul li, #lresources ul li { padding:0 0 0 16px; margin: 0 0 12px 5px; background: url(bull.gif) no-repeat 0 2px; } #larchives a, #lresources a { font-weight:bold; } #lselect a:hover, #larchives a:hover, #lresources a:hover { color:#000; } #lselect a { display:block; margin-bottom:5px; font-weight:bold; } #lselect a.c { display:inline; text-decoration:none; color:#7e7e7e; border:0; font-weight:normal; } #lselect a.c:hover { color:#333333; text-decoration:none; border:0; } #lresources { background: url(side_03.gif) no-repeat bottom right; padding-bottom:10px; } #lresources h3 { background:transparent url(res.gif) no-repeat center; height:40px; margin:0; padding:0; } #lresources h3 span { display:none; } #larchives h3 { display:none; } #footer { text-align:center; padding-bottom:10px; } #footer a { text-decoration:none; font-weight:bold; } #footer a:hover { text-decoration:underline; color:#000; } #extraDiv1 { position:absolute; top:1325px; width:240px; height:174px; background-image: url(env.jpg); left:50%; margin-left:112px } -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.116.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codenothing/css-compressor/9821e0bbcb067f5112bd22735781d77958068f97/unit/benchmark/src/csszengarden.com.116.css -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.120.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codenothing/css-compressor/9821e0bbcb067f5112bd22735781d77958068f97/unit/benchmark/src/csszengarden.com.120.css -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.125.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 125 - 'Beccah', by Chris Morrell, http://www.cmorrell.com/ */ 2 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 3 | /* All associated graphics copyright 2004, Chris Morrell */ 4 | /* Added: Sept. 16th, 2004 */ 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the 8 | designer's written permission. However, feel free to study the CSS and use 9 | techniques you learn from it elsewhere. */ 10 | 11 | 12 | 13 | 14 | /* General Styles */ 15 | html, body { margin: 0; padding: 0; } 16 | body { background: #eee; font: 76% Verdana, Arial, Helvetica, sans-serif; } 17 | p, div { font-size: 1em; } 18 | a:link { color: #900; } 19 | a:hover { color: #f00; } 20 | a:visited { color: #303; } 21 | acronym { cursor: default; } 22 | .accesskey { text-decoration: underline; } 23 | #container { position: relative; background: url(header.jpg) no-repeat; padding: 170px 10px 10px 10px; width: 770px; } 24 | 25 | /* Page Header Styles */ 26 | #pageHeader { display: none; } 27 | 28 | /* Navigation Bar Styles */ 29 | #linkList { position: absolute; top: 173px; left: 550px; background: url(sidebar.jpg) no-repeat; padding: 20px 25px 0 25px; width: 213px; voice-family: "\"}\""; voice-family: inherit; width: 182px; } 30 | html>body #linkList { width: 192px; } 31 | #linkList ul, #linkList li { list-style-type: none; margin: 0; padding: 0; } 32 | 33 | /* "Select a Design" Styles */ 34 | #lselect { margin: 100px 0 0 0; } 35 | #lselect li { margin-bottom: 5px; } 36 | #lselect a { font: bold 1em Georgia, "Times New Roman", Times, serif; display: block; font-variant: small-caps; text-decoration: none; letter-spacing: .3em; } 37 | #lselect a.c { font: 1em Verdana, Arial, Helvetica, sans-serif; display: inline; text-transform: none; letter-spacing: normal; } 38 | #lselect a.c:link { text-decoration: none; color: #000; } 39 | #lselect a.c:hover { text-decoration: underline; color: #f00; } 40 | h3.select { margin: 0; padding: 0; background: url(select-a-design.jpg) no-repeat; position: absolute; width: 399px; height: 225px; left: 0px; top: -130px; } 41 | h3.archives { margin: 0; padding: 0; position: relative; width: 209px; height: 68px; background: url(archives.gif) no-repeat; } 42 | h3 span { display: none; } 43 | 44 | /* "Archives" Styles */ 45 | #larchives li, #lresources li { border-bottom: 1px solid #ddd; margin-bottom: 7px; } 46 | #larchives a, #lresources a { text-decoration: none; } 47 | 48 | /* "Resources" Styles */ 49 | h3.resources { margin: 0; padding: 0; position: relative; width: 209px; height: 68px; background: url(resources.gif) no-repeat; } 50 | 51 | /* Main Content Styles */ 52 | #intro, #supportingText { margin: 0 230px 0 0; } 53 | #intro h3, #supportingText h3 { background-repeat: no-repeat; margin: 0; padding: 0; height: 50px; width: 475px; } 54 | #intro p, #supportingText p { margin-left: 20px; } 55 | #preamble, #supportingText { background: url(background.jpg) repeat-y; font: 1.3em Georgia, "Times New Roman", Times, serif; } 56 | #participation p, #benefits p { width: 730px; } 57 | 58 | /* Headings */ 59 | #explanation h3 { background-image: url(explanation.gif); } 60 | #participation h3 { background-image: url(participation.gif); } 61 | #benefits h3 { background-image: url(benefits.gif); } 62 | #requirements h3 { background-image: url(requirements.gif); } 63 | 64 | /* Quick Summary */ 65 | #quickSummary { cursor: default; font: 1.35em "Courier New", Courier, mono; margin: 0; padding: 71px 45px 3px 35px; position: relative; top: -34px; left: -10px; background: url(summary.jpg) no-repeat; color: #600; } 66 | 67 | /* Preamble */ 68 | #preamble { margin: 0; } 69 | #preamble h3 { background-image: url(preamble.gif); } 70 | 71 | /* Requirements */ 72 | #requirements p { width: 640px; } 73 | #requirements p.p1, #requirements p.p2, #requirements p.p3, #requirements p.p4 { background-repeat: no-repeat; padding-left: 90px; } 74 | #requirements p.p1 { background-image: url(1.gif); } 75 | #requirements p.p2 { background-image: url(2.gif); } 76 | #requirements p.p3 { background-image: url(3.gif); } 77 | #requirements p.p4 { background-image: url(4.gif); } 78 | 79 | /* Footer */ 80 | #requirements p.p5, #footer { color: #aaa; text-align: center; width: 770px; } 81 | #requirements p.p5 { border-top: 1px solid #ccc; padding: 15px 0 0 0; margin: 100px 0 0 0; } 82 | #footer { margin: 0 0 30px 0; } 83 | #requirements p.p5 a, #footer a { color: #aaa; } 84 | 85 | -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.139.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 139 - 'Neat & Tidy', by Oli Dale, http://www.designerstalk.com/ */ 2 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 3 | /* All associated graphics copyright 2004, Oli Dale */ 4 | /* Added: Nov. 29th, 2004 */ 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the 8 | designer's written permission. However, feel free to study the CSS and use 9 | techniques you learn from it elsewhere. */ 10 | 11 | 12 | 13 | body{ 14 | background-image: url(images/main_bg.jpg); 15 | background-position: center; 16 | background-position: top; 17 | background-repeat: no-repeat; 18 | background-color: #000000; 19 | margin:0px; 20 | padding:0px; 21 | color:#ffffff; 22 | font-family: Georgia,"Times New Roman", Times, serif; 23 | font-size: 11px; 24 | text-align: center; 25 | } 26 | h1{display: none;} 27 | h2{display: none;} 28 | h3{display: none;} 29 | a{color:#B00707;text-decoration: underline;} 30 | a:visited{color:#B00707;text-decoration: underline;} 31 | a:hover {color:#D6BD15; text-decoration: none;} 32 | a:active {color:#D6BD15; text-decoration: none;} 33 | 34 | acronym { border: none; cursor: help; 35 | font-style: italic;} 36 | 37 | #container{ 38 | width:600px; 39 | position: relative; 40 | text-align: justify; 41 | padding:0px; 42 | margin: 0 auto; 43 | height:1641px; 44 | 45 | } 46 | 47 | #preamble{ 48 | background-image: url(images/quicksumary_header.gif); 49 | background-repeat: no-repeat; 50 | position: absolute; top: 165px; left: 5px; 51 | padding-top:35px; 52 | width:375px; 53 | } 54 | #preamble h3{ 55 | display:none; 56 | } 57 | 58 | #explanation{ 59 | background-image: url(images/explanation_header.gif); 60 | background-repeat: no-repeat; 61 | position: absolute; top: 390px; left: 5px; 62 | width:375px; 63 | padding-top:35px; 64 | 65 | } 66 | #explanation h3{display: none;} 67 | 68 | #participation{ 69 | background-image: url(images/participation_header.gif); 70 | background-repeat: no-repeat; 71 | position: absolute; top: 665px; left: 5px; 72 | width:375px; 73 | padding-top:35px; 74 | } 75 | 76 | #participation h3{display: none;} 77 | 78 | #benefits{ 79 | background-image: url(images/benefits_header.gif); 80 | background-repeat: no-repeat; 81 | position: absolute; top: 980px; left: 5px; 82 | width:375px; 83 | padding-top:35px; 84 | } 85 | #benefits h3{display: none;} 86 | 87 | #requirements{ 88 | background-image: url(images/requirements_header.gif); 89 | background-repeat: no-repeat; 90 | position: absolute; top: 1115px; left: 5px; 91 | width:375px; 92 | padding-top:35px; 93 | } 94 | 95 | #requirements h3{display: none;} 96 | 97 | #footer{ 98 | position: absolute; top: 1590px; left: 5px; 99 | width:375px; 100 | } 101 | 102 | 103 | 104 | #intro{ 105 | width:375px; 106 | } 107 | 108 | #pageHeader{ 109 | background-image: url(images/logo.gif); 110 | background-repeat: no-repeat; 111 | width:279px; 112 | height:170px; 113 | 114 | } 115 | 116 | #lselect{ 117 | text-align: left; 118 | position: absolute; top:950px; right: 0px; 119 | width:189px; 120 | background-image: url(images/selecter_header.gif); 121 | background-repeat: no-repeat; 122 | padding-top:35px; 123 | } 124 | 125 | 126 | #quickSummary{ 127 | width:185px; 128 | position: absolute; top: 540px; right: 0px; 129 | background-image: url(images/select_header.gif); 130 | background-repeat: no-repeat; 131 | padding-top:35px; 132 | } 133 | 134 | #larchives{ 135 | position: absolute; top: 850px; right: 0px; 136 | width:185px; 137 | padding-top:10px; 138 | background-image: url(images/archives_header.gif); 139 | background-repeat: no-repeat; 140 | padding-top:35px; 141 | } 142 | 143 | 144 | 145 | #lresources{ 146 | position: absolute; top: 720px; right: 0px; 147 | width:185px; 148 | padding-top:0px; 149 | background-image: url(images/resources_header.gif); 150 | background-repeat: no-repeat; 151 | padding-top:35px; 152 | } 153 | 154 | 155 | 156 | li{list-style-type: none;} 157 | ul{padding-top:0px; 158 | padding-left:0px; 159 | padding-right:0px; 160 | padding:0px; 161 | margin:0px; 162 | } 163 | 164 | -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.141.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 141 - 'Golden Cut', by Petr Stanciek, http://www.pixy.cz/ */ 2 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 3 | /* All associated graphics copyright 2004, Petr Stanciek */ 4 | /* Added: Dec. 16th, 2004 */ 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the 8 | designer's written permission. However, feel free to study the CSS and use 9 | techniques you learn from it elsewhere. */ 10 | 11 | 12 | 13 | 14 | body { 15 | margin:0; 16 | padding:0; 17 | background: #819EFF url("bkgr1.jpg") 7px 0 repeat; 18 | color: #333; 19 | font: 100%/1.67 "palatino linotype", palatino, serif; 20 | } 21 | 22 | a { color: #819EFF; text-decoration:underline; } 23 | a:visited { color: #8A8D99; } 24 | a:hover { color: #01228D; } 25 | 26 | abbr, acronym { 27 | color:#B36D00; 28 | font-style:italic; 29 | cursor:help; 30 | } 31 | a abbr, a acronym { color:inherit } 32 | 33 | #container { 34 | position:relative; 35 | width: 770px; 36 | margin: 30px auto 2.5em 7px; padding: 0; 37 | background: url("strips.jpg") 474px 0 repeat-y; 38 | border-left:1px solid #FFD99E; 39 | border-bottom:1px solid #819EFF; 40 | } 41 | /*FFDAA0*/ 42 | 43 | /* INTRO */ 44 | 45 | #intro { 46 | width:474px; 47 | margin: 0; padding:340px 0 0 0; 48 | background: white url("header.jpg") top left no-repeat; 49 | } 50 | #pageHeader { display:none } 51 | #quickSummary .p1 { display:none } 52 | #quickSummary .p2 { 53 | position:absolute; top: 195px; left: 474px; z-index:10; 54 | width:296px; margin:0; 55 | font-size:70%; 56 | line-height: 1.1; 57 | text-align:center; 58 | color:white; 59 | } 60 | #quickSummary .p2 a { 61 | white-space: nowrap; 62 | color: #FFF5D9; 63 | } 64 | #quickSummary .p2 a:hover { color: #01228D; } 65 | 66 | #preamble, #explanation, #participation, #benefits, #requirements { 67 | padding: 0 1em 1px 2em; 68 | /* 1px bottom padding due to margin-collpasing bug in Opera */ 69 | } 70 | 71 | #intro h3, #supportingText h3 { 72 | margin: 1.5em 0 1em 0; padding:0; 73 | height: 30px; 74 | background: url("ttls.gif") 0 0 no-repeat; 75 | } 76 | #intro h3 span, #supportingText h3 span { display:none } 77 | 78 | #preamble h3 { margin-top:0; } 79 | #explanation h3 { background-position: 0 -50px; } 80 | #participation h3 { background-position: 0 -100px; } 81 | #benefits h3 { background-position: 0 -150px; } 82 | #requirements h3 { background-position: 0 -200px; } 83 | 84 | #intro p, #supportingText p { 85 | margin: 0.7em 0; 86 | font-size:90%; 87 | } 88 | 89 | /* TEXT */ 90 | 91 | #supportingText { 92 | width:475px; 93 | margin: 0; padding:1px 0 1em 0; 94 | background: white; 95 | } 96 | 97 | #footer { 98 | position:absolute; bottom: -1.5em; right: 0; 99 | font: 75%/1 sans-serif; 100 | white-space:nowrap; 101 | } 102 | #footer a { 103 | padding:0.2em 0.3em; 104 | background:#819EFF; 105 | color:white; 106 | text-decoration:none; 107 | font-weight:bold; 108 | } 109 | #footer a:hover { color:white; background: #01228D; } 110 | 111 | /* LINKS */ 112 | 113 | #linkList { 114 | position:absolute; top: -20px; left: 474px; 115 | width:296px; 116 | padding-top:290px; 117 | font-size: 85%; 118 | line-height: 1.5; 119 | background: url("boy.jpg") 0 0 no-repeat; 120 | } 121 | 122 | #linkList h3 { 123 | margin: 3em 0 1em 27px; padding:0; 124 | height: 20px; 125 | background: url("ttls2.gif") 0 0 no-repeat; 126 | } 127 | #linkList h3 span { display:none } 128 | #lselect h3 { margin-top:0; } 129 | #larchives h3 { background-position: 0 -50px; } 130 | #lresources h3 { background-position: 0 -100px; } 131 | 132 | #linkList ul { 133 | list-style-type:none; 134 | margin:0; padding:0; 135 | } 136 | #linkList li { 137 | list-style-type:none; 138 | margin:0.5em 0 0.5em 120px; padding:0; 139 | } 140 | 141 | #linkList li a { 142 | display:block; 143 | margin: 0 0 0 -25px; padding: 0 0 0 25px; 144 | font-weight:bold; 145 | font-size:100%; 146 | color:#666; 147 | background: url("bull.gif") left center no-repeat; 148 | } 149 | #linkList li a.c { 150 | display: inline; margin:0; padding:0; 151 | background: transparent; 152 | font-size:100%; 153 | font-weight:normal; 154 | font-style:italic; 155 | font-variant:small-caps; 156 | color:#819EFF; 157 | } 158 | #linkList li a:hover { color: #01228D; } 159 | -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.146.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 146 - 'Urban', by Matt, Kim & Nicole, http://www.learnnewmedia.ca/ */ 2 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 3 | /* All associated graphics copyright 2004, Matt, Kim & Nicole */ 4 | /* Added: Dec. 16th, 2004 */ 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the 8 | designer's written permission. However, feel free to study the CSS and use 9 | techniques you learn from it elsewhere. */ 10 | 11 | 12 | 13 | /* Originally from Session 3 of the Zen Garden student gallery, 14 | http://www.mezzoblue.dev/zengarden/alldesigns/student/ */ 15 | 16 | 17 | /* basic elements */ 18 | a:hover, a:active {color: #FFF; background: #ccc;} 19 | a:visited {color: #559999; text-decoration:none; font-weight:bolder;} 20 | a:hover {color: #ffffff; background: #ccc;} 21 | a:link {color: #FACD56; text-decoration:none; font-weight:bolder;} 22 | p {font: normal 10px/16px Tahoma, Verdana, Arial, sans-serif; text-align: justify; text-decoration:none;} 23 | #quickSummary p.p2 {position:absolute; z-index:3; text-align:center; left: 158px; top: 244px; width: 216px; height: 20px;} 24 | h3 {font: normal 10px/16px Tahoma, Verdana, Arial, sans-serif; letter-spacing: 1px; color: #7D775C;} 25 | /* start of body of text */ 26 | #preamble {top: 330px; height: 207px;} 27 | #supportingText {top: 540px; height: 1100px;} 28 | #supportingText, #preamble {text-decoration:none; width:355px;z-index:2; position:absolute; left: 334px;} 29 | /* end of body of text */ 30 | /* specific divs */ 31 | #css-zen-garden{background-color: #FFF;} 32 | #container {position: relative; width:765px; margin: 0 auto; text-align: left;} 33 | #footer a {text-decoration:none; text-align:right; text-transform:uppercase; color: #559999; font-weight:bolder; font-size:12px;} 34 | /* start of navagation */ 35 | #linkList {background: transparent url("final.gif") no-repeat top left; z-index:1; position: absolute; height:1650px; top: 244px; right: 0px; left: -10px; width: 778px; font-size:12px;} 36 | #linkList2 {font: 10px tahoma, verdana, sans-serif; width: 130px;} 37 | #linkList h3.select {width: 97px; height: 16px;} 38 | #linkList h3.favorites span {display:none;} 39 | #linkList h3.archives {width:57px; height: 14px; text-decoration:none;} 40 | #linkList li a:link {color: #FACD56; text-decoration:none; font-weight:bolder;} 41 | #linkList li a:visited {color: #000; text-decoration:none;} 42 | #linkList li a:hover {color: #ffffff; background: #ccc;} 43 | #linkList ul a.c {color: #ccddcb; display: inline; font-weight: normal;} 44 | #lselect ul a {line-height: 3.5ex; display: block; font-weight: bold;} 45 | #linkList li {color:#ccddcb; list-style-type: none; z-index:3; text-align:center; list-style-type: none;} 46 | #lselect {height: 239px; width: 150px; left: 134px; top: 37px;} 47 | #larchives {height: 35px; width: 168px; text-align:center; left: 125px; top: 534px;} 48 | #lresources {text-align:center; width: 150px; height: 30px; left: 132px; top: 423px;} 49 | #lresources, #larchives, #lselect {position:absolute; font-size:10px;} 50 | /* end of navagation */ 51 | /* using an image to replace text in an h1. This trick courtesy Douglas Bowman, http://www.stopdesign.com/articles/css/replace-text/ */ 52 | #pageHeader h1 {background-image:url("title.gif"); background-repeat:no-repeat; height:245px;} 53 | #linkList h3.select span {display:none;} 54 | #linkList h3.archives span {display:none;} 55 | #linkList h3.resources span {display:none;} 56 | #pageHeader h1 span {display:none;} 57 | #pageHeader h2 span {display:none;} 58 | #quickSummary p.p1{width: 202px;} 59 | #quickSummary p.p2{width: 118px;} 60 | #quickSummary p.p2 a:visited {color:#FFFFFF;} 61 | #preamble h3 span {display:none;} 62 | #explanation h3 span {display:none;} 63 | #explanation h3 {background-image:url("what.gif"); background-repeat:no-repeat; height:20px; padding-top:10px;} 64 | #participation h3 span {display:none;} 65 | #participation h3 {background-image:url("part.gif"); background-repeat:no-repeat; height:27px;} 66 | #benefits h3 span {display:none;} 67 | #benefits h3 {background-image:url("benefits.gif"); background-repeat:no-repeat; height:27px;} 68 | #requirements h3 span {display:none;} 69 | #requirements h3 {background-image:url("require.gif"); background-repeat:no-repeat; height:27px;} 70 | #quickSummary p.p1 {display:none;} 71 | #extraDiv1 {background-image:url("background2.gif"); height:1617px; float:right; width:345px; z-index:0; background-repeat:no-repeat; margin-top:10px;} -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.155.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 154 - 'Butterfly Effect', by Alen Grakalic, http://www.pixelpusher.biz/ */ 2 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 3 | /* All associated graphics copyright 2005, Alen Grakalic */ 4 | /* Added: Mar. 7th, 2005 */ 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the 8 | designer's written permission. However, feel free to study the CSS and use 9 | techniques you learn from it elsewhere. */ 10 | 11 | 12 | 13 | 14 | /* 15 | css by Alen Grakalic of Pixelpusher.biz 16 | Thanks for taking the time to go through my code. 17 | Central photo was taken by me. It is a fountain in my home town Rijeka, Croatia. 18 | I made several photo calendars and it inspired me to make this Css Zen Garden entry 19 | that I call "November". 20 | 21 | */ 22 | 23 | body { 24 | background: #2F3027 url(back.jpg) no-repeat; 25 | font:0.7em Tahoma, Arial, Verdana, sans-serif; 26 | color:#666; 27 | margin:0; 28 | padding:0; 29 | } 30 | a{ 31 | color:#BD8100; 32 | text-decoration:none; 33 | } 34 | a:hover{ 35 | background:#BD8100; 36 | color:#FFF; 37 | } 38 | h3{ 39 | margin:0; 40 | padding:0; 41 | } 42 | h3 span{ 43 | display:none; 44 | } 45 | acronym{ 46 | border-bottom:1px dotted; 47 | } 48 | .accesskey{ 49 | text-decoration:underline; 50 | } 51 | ul{ 52 | margin: 0; 53 | padding:10px 0px 10px 10px; 54 | list-style: none; 55 | } 56 | 57 | li{ 58 | padding-right: 12px; 59 | padding-bottom: 0.6em; 60 | background:url(li_bullet.gif) no-repeat 100% 2px; 61 | } 62 | #container { 63 | margin:0; 64 | padding:0; 65 | } 66 | /* Intro */ 67 | #intro{ 68 | width:467px; 69 | } 70 | #pageHeader h1{ 71 | margin:0 0 0 16px; 72 | height:367px; 73 | background:url(page_header.gif) no-repeat; 74 | text-indent:-2000px; 75 | } 76 | #pageHeader h2, 77 | #quickSummary .p1{ 78 | display:none; 79 | } 80 | #quickSummary .p2{ 81 | margin:0 0 0 16px; 82 | padding-left:343px; 83 | font-size:6px; 84 | height:82px; 85 | background:url(quicksummary_back.gif) no-repeat; 86 | white-space:no-wrap; 87 | } 88 | #quickSummary .p2 span{ 89 | visibility:hidden; 90 | } 91 | #quickSummary .p2 a{ 92 | width:36px; 93 | height:20px; 94 | float:left; 95 | visibility:visible; 96 | text-indent:-2000px; 97 | margin:-7px 17px 0 0; 98 | padding:0; 99 | } 100 | #quickSummary .p2 a:hover{ 101 | background:none; 102 | } 103 | #preamble{ 104 | margin:0 0 0 16px; 105 | padding:0; 106 | background:url(txt_back.gif) repeat-y; 107 | } 108 | #preamble h3{ 109 | height:69px; 110 | background:url(theroad_back.gif) no-repeat; 111 | } 112 | #preamble p{ 113 | line-height:1.4em; 114 | padding:19px 19px 5px 19px; 115 | margin:0; 116 | } 117 | /* Supporting Text */ 118 | #supportingText{ 119 | width:467px; 120 | background:url(txt_back.gif) repeat-y 16px; 121 | } 122 | #supportingText p{ 123 | font-size:11px; 124 | line-height:1.4em; 125 | padding:19px 19px 5px 19px; 126 | margin:0; 127 | } 128 | #supportingText h3{ 129 | margin:0; 130 | padding:0; 131 | height:107px; 132 | } 133 | #explanation, 134 | #participation, 135 | #benefits, 136 | #requirements{ 137 | margin:0 0 0 16px; 138 | } 139 | #explanation h3{ 140 | background:url(explanation_back.gif) no-repeat; 141 | } 142 | #participation h3{ 143 | background:url(participation_back.gif) no-repeat; 144 | } 145 | #benefits h3{ 146 | background:url(benefits_back.gif) no-repeat; 147 | } 148 | #requirements h3{ 149 | background:url(requirements_back.gif) no-repeat; 150 | } 151 | #footer{ 152 | margin:0 0 0 16px; 153 | padding-top:58px; 154 | padding-bottom:20px; 155 | background:url(footer_back.gif) no-repeat; 156 | text-align:center; 157 | } 158 | #footer a{ 159 | margin:3px; 160 | padding:2px 5px; 161 | font-weight:bold; 162 | } 163 | /* Link List */ 164 | #linkList { 165 | position:absolute; 166 | top:64px; 167 | left:467px; 168 | width:226px; 169 | background:url(linklist_back.gif) no-repeat; 170 | padding-top:62px; 171 | text-align:right; 172 | } 173 | #linkList acronym{ 174 | border:none; 175 | } 176 | .select{ 177 | background:url(select_back.gif) no-repeat 100% 0; 178 | height:30px; 179 | } 180 | .archives{ 181 | background:url(archives_back.gif) no-repeat 100% 0; 182 | height:27px; 183 | } 184 | .resources{ 185 | background:url(resources_back.gif) no-repeat 100% 0; 186 | height:27px; 187 | } 188 | -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.157.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 157 - 'Bugs', by Zohar Arad, http://www.captainserious.co.uk/ */ /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ /* All associated graphics copyright 2005, Zohar Arad */ /* Added: Mar. 7th, 2005 */ /* IMPORTANT */ /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. However, feel free to study the CSS and use techniques you learn from it elsewhere. */ /* General Styles */ body{ color:#000; font: normal 11px Times, serif; line-height:1.4em; letter-spacing: 1pt; margin:0 0 20px 0; padding:0; text-align:center; } a{font-weight:bold;color: #8B3C12;text-decoration:none} a:hover{text-decoration:underline;} a:active, a:visited{color: #B07D03;} h3{margin:0; padding:0;} /* General DIV Styles */ #container{ background:transparent url(header.gif) no-repeat top left; margin:0 auto; padding: 330px 0 0 0; position:relative; width:685px; text-align:left; } #container p{margin: 0 20px; padding: 5px 0} .p1:first-letter{font-size: 18px;} #intro, #supportingText{width:415px; background-color:#FBD1BC; padding:0; margin:0} #pageHeader{display:none} #quickSummary{position:absolute; top: 310px; margin:0 0 0 115px; padding:0} #quickSummary p{margin:0; padding:0;} #quickSummary p.p1{display:none} #footer{margin:-25px 0 0 0;width: 415px;text-align:center;} #footer a{color:#FFFFFF} /* headings replacement styles */ #preamble h3{ display:block; background: transparent url(heading1.gif) no-repeat center left; height: 161px; width: 415px; } #preamble h3 span{display:none;} #explanation h3{ display:block; background: transparent url(so.gif) no-repeat center center; height: 45px; width: 415px; } #explanation h3 span{display:none;} #participation h3{ display:block; background: transparent url(heading2.gif) no-repeat center left; height: 173px; width: 415px; } #participation h3 span{display:none;} #benefits h3{ display:block; background: transparent url(benefits.gif) no-repeat center center; height: 45px; width: 415px; } #benefits h3 span{display:none;} #requirements{ background: transparent url(footer.gif) no-repeat bottom center; padding-bottom:70px; } #requirements h3{ display:block; background: transparent url(heading3.gif) no-repeat center left; height: 173px; width: 415px; } #requirements h3 span{display:none;} /* Navigation Styles */ #linkList{ position:absolute; top: 330px; margin-left: 445px; padding-bottom: 360px; background: #EEFFC5 url(link_footer.gif) no-repeat bottom center; width:200px; } #linkList ul{ list-style-type:none; margin:0 20px; padding:30px 0 20px 0; } #linkList li{ background: transparent url(leaf.gif) no-repeat top left; padding:0 0 0 28px; margin-bottom: 10px; } #lselect a{ display:block; padding: 0; margin:0; } #lselect a.c{ display:inline; color:#2B7F01; } #larchives ul{ padding:30px 0 5px 0; } #lresources ul{ padding:20px 0; } #lselect h3{ display:block; background: transparent url(choose.gif) no-repeat center left; height: 112px; width: 200px; } #lselect h3 span{display:none;} #larchives h3{ display:block; background: transparent url(archive.gif) no-repeat center left; height: 96px; width: 200px; } #larchives h3 span{display:none;} #lresources h3{ display:block; background: transparent url(resources.gif) no-repeat center center; height: 25px; width: 200px; } #lresources h3 span{display:none;} /* Original images used in this design were downloaded from morguefile.com and manipulated for the purpose of this design only. This style sheet was created to symbolise the endless bugs Web artists have to deal with on a daily basis and give hope (as well as a good laugh) to all those who work hard to make the Web a better and bug-free environment Style Sheet by Zohar Arad */ -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.164.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 164 - 'Chien', by Alex Miller, http://www.pixul.net/ */ 2 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 3 | /* All associated graphics copyright 2005, Alex Miller */ 4 | /* Added: Apr. 15th, 2005 */ 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the 8 | designer's written permission. However, feel free to study the CSS and use 9 | techniques you learn from it elsewhere. */ 10 | 11 | 12 | 13 | /* You may notice this CSS file has no IE hacks. This is because I think hacks are messy, and I don't care if my page screws up for some people. It's their fault for using Internet Explorer in the first place. If everyone didn't include hacks, more people would not use IE! */ 14 | 15 | body { 16 | background-image: url(background.gif); 17 | font-family: verdana, arial, serif; 18 | font-size: 11px; 19 | text-align: center; 20 | padding: 0; 21 | margin: 0; 22 | line-height: 16px; 23 | color: #333; 24 | } 25 | 26 | #container { 27 | width: 633px; 28 | margin: auto; 29 | border-top: 1px solid #000; 30 | background-image: url(containerbackground.gif); 31 | text-align: left; 32 | padding: 0 0 0 29px; 33 | position: relative; 34 | top: -1px; 35 | } 36 | 37 | #pageHeader { 38 | background-image: url(top.gif); 39 | width: 605px; 40 | height: 332px; 41 | margin-top: 0; 42 | } 43 | 44 | #pageHeader h1, h2 { 45 | display: none; 46 | } 47 | 48 | #preamble, #supportingText { 49 | margin: 0 0 0 8px; 50 | width: 389px; 51 | } 52 | 53 | #preamble h3, #supportingText h3 { 54 | margin-top: 0; 55 | } 56 | 57 | #preamble p, #supportingText p, #quickSummary p { 58 | margin: 10px 15px 10px 15px; 59 | } 60 | 61 | #quickSummary, #linkList { 62 | position: absolute; 63 | left: 435px; 64 | width: 192px; 65 | } 66 | 67 | #quickSummary { 68 | top: 332px; 69 | background: url(summary.gif) no-repeat; 70 | padding-top: 46px; 71 | color: #000; 72 | } 73 | 74 | #linkList { 75 | top: 526px; 76 | } 77 | 78 | 79 | #footer { 80 | text-align: center; 81 | width: 100%; 82 | padding-bottom: 10px; 83 | } 84 | 85 | 86 | #preamble h3 { 87 | background-image: url(title1.gif); 88 | width: 389px; 89 | height: 46px; 90 | } 91 | 92 | #preamble h3 span { 93 | display: none; 94 | } 95 | 96 | #explanation h3 { 97 | background-image: url(title2.gif); 98 | width: 389px; 99 | height: 46px; 100 | } 101 | 102 | #explanation h3 span { 103 | display: none; 104 | } 105 | 106 | #participation h3 { 107 | background-image: url(title3.gif); 108 | width: 389px; 109 | height: 46px; 110 | } 111 | 112 | #participation h3 span { 113 | display: none; 114 | } 115 | 116 | #benefits h3 { 117 | background-image: url(title4.gif); 118 | width: 389px; 119 | height: 46px; 120 | } 121 | 122 | #benefits h3 span { 123 | display: none; 124 | } 125 | 126 | #requirements h3 { 127 | background-image: url(title5.gif); 128 | width: 389px; 129 | height: 46px; 130 | } 131 | 132 | #requirements h3 span { 133 | display: none; 134 | } 135 | 136 | h3.select { 137 | background-image: url(designs.gif); 138 | width: 192px; 139 | height: 45px; 140 | } 141 | 142 | h3.select span { 143 | display: none; 144 | } 145 | 146 | h3.archives { 147 | background-image: url(archives.gif); 148 | width: 192px; 149 | height: 45px; 150 | } 151 | 152 | h3.archives span { 153 | display: none; 154 | } 155 | 156 | h3.resources { 157 | background-image: url(resources.gif); 158 | width: 192px; 159 | height: 45px; 160 | } 161 | 162 | h3.resources span { 163 | display: none; 164 | } 165 | 166 | 167 | li { 168 | padding: 0 0 6px 0; 169 | text-transform: capitalize; 170 | } 171 | 172 | #lselect a:link.c, #lselect a:visited.c { 173 | display: inline; 174 | } 175 | 176 | #lselect a { 177 | display: block; 178 | } 179 | 180 | #lselect ul li { 181 | list-style-image: url(paperfolded.gif); 182 | } 183 | 184 | #larchives ul li, #lresources ul li { 185 | list-style-image: url(paper.gif); 186 | } 187 | 188 | a:LINK { 189 | text-decoration: none; 190 | color: #CC0000; 191 | } 192 | 193 | a:VISITED { 194 | text-decoration: none; 195 | color: #CC6666; 196 | } 197 | 198 | a:HOVER { 199 | text-decoration: underline; 200 | color: #CC0000; 201 | } 202 | 203 | #footer { 204 | border-top: 1px solid #999; 205 | padding: 6px 0 6px 0; 206 | background-color: #FFF; 207 | } 208 | #footer a { 209 | font-weight: bold; 210 | } 211 | -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.173.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 173 - 'Red Stars', by Shafiq Rizwan, http://www.1988online.net/ */ 2 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 3 | /* All associated graphics copyright 2005, Shafiq Rizwan */ 4 | /* Added: July 9th, 2005 */ 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the 8 | designer's written permission. However, feel free to study the CSS and use 9 | techniques you learn from it elsewhere. */ 10 | 11 | 12 | 13 | body { font: 8pt/16pt georgia; color: #fffafa; background: #fff url(blossoms.jpg) no-repeat bottom right; margin: 0px; text-align: center; } 14 | p { font: 8pt/16pt georgia; margin-top: 0px; text-align: justify; } 15 | h3 { margin-bottom: 0px; } 16 | a:link { font-weight: bold; text-decoration: none; color: #B7A5DF; } 17 | a:visited { font-weight: bold; text-decoration: none; color: #D4CDDC; } 18 | a:hover, a:active { text-decoration: underline; color: #9685BA; } 19 | 20 | #container { margin: 0 auto; width: 619px; background: url(bg.jpg) repeat-y; text-align:left; } 21 | #intro { background: url(intro.jpg) no-repeat; } 22 | 23 | #pageHeader { position:absolute; width:55px; } 24 | #pageHeader h1 { background: transparent url(header.gif) no-repeat; text-indent: -5000px; width: 46px; height: 254px; } 25 | #pageHeader h1 span { display:none } 26 | #pageHeader h2 { text-indent: -5000px; } 27 | #pageHeader h2 span { display:none } 28 | 29 | #quickSummary { position:absolute; margin-top:90px; margin-left:322px; height:90px; width:260px; } 30 | #quickSummary p { font: 10px arial; text-align:center; color : #FFF; } 31 | 32 | #preamble { padding: 205px 0 0 62px; width:335px; } 33 | #preamble h3 { text-indent:-5000px; background: url(road.jpg) no-repeat; width:344px; height:50px; } 34 | #preamble p { font-style: italic; margin:0 5px 0 30px; } 35 | 36 | #supportingText { padding-left: 73px; width:330px; } 37 | #supportingText p { margin:0 10px 0 20px; } 38 | #supportingText h3 { margin:0 0 0 7px; } 39 | 40 | #explanation, #participation, #benefits, #requirements { margin: 10px 0 0 0; } 41 | #explanation h3 { background: url(what.jpg) no-repeat; text-indent:-5000px; width:324px; height:40px; } 42 | #participation h3 { background: url(participation.jpg) no-repeat; text-indent:-5000px; width:324px; height:40px; } 43 | 44 | #benefits h3 { background: url(benefits.jpg) no-repeat; text-indent:-5000px; width:324px; height:40px; } 45 | 46 | #requirements h3 { background: url(requirements.jpg) no-repeat; text-indent:-5000px; width:324px; height:40px; } 47 | 48 | #footer { background: url(footerbg.jpg) no-repeat; text-align: center; padding:10px; height:28px; } 49 | #footer a:link, #footer a:visited { margin-right: 20px; } 50 | 51 | #linkList { position:absolute; top:197px; margin:0 0 0 400px; width:200px; } 52 | #linkList2 { font: 10px verdana, sans-serif; background: transparent url(paper-bg.jpg) top left repeat-y; padding: 10px; width: 130px; text-align:left; } 53 | 54 | #linkList h3.select { background: url(select.jpg) no-repeat; margin: 10px 0px 5px 0px; width: 177px; height: 40px; } 55 | #linkList h3.select span { display:none } 56 | #linkList h3.archives { background: transparent url(archives.jpg) no-repeat; margin: 25px 0px 5px 0px; width:177px; height: 40px; } 57 | #linkList h3.archives span { display:none } 58 | #linkList h3.resources { background: transparent url(resources.jpg) no-repeat; margin: 25px 0px 5px 0px; width:177px; height: 40px; } 59 | #linkList h3.resources span { display:none } 60 | 61 | #linkList ul { margin: 0px; padding: 0px; } 62 | #linkList li { list-style-type: none; border:1px #761C1C none; width:170px; padding-left:7px; } 63 | #linkList #lselect li { height:30px; padding-top:5px; } 64 | #linkList #larchives li, #linkList #lresources li { height:15px; padding-top:3px; } 65 | 66 | #linkList a { display:block; } 67 | #linkList a.c { display:inline; font-weight: normal; color: #FFF; border-bottom: 1px #FFF none; } 68 | #linkList a.c:hover { text-decoration: none; border-bottom: 1px #FFF dotted; } 69 | #linkList li:hover { background: url(lbg.jpg) #8F2323 repeat-x; border:1px #761C1C solid; } -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.176.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 176 - 'Kelmscott', by Bronwen Hodgkinson, http://www.cdevision.com/ */ 2 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 3 | /* All associated graphics copyright 2005, Bronwen Hodgkinson */ 4 | /* Added: July 9th, 2005 */ 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the 8 | designer's written permission. However, feel free to study the CSS and use 9 | techniques you learn from it elsewhere. */ 10 | 11 | 12 | 13 | /* basic elements */ 14 | body {font:8pt georgia, serif; color:#333; background:#fff url(bground.gif); margin:0; border:1px solid #000;} 15 | 16 | p {font:8pt georgia, serif; margin:0 0 12px 0; text-align:justify;} 17 | h3 {font:bold 12pt georgia, serif; margin-bottom:0;} 18 | acronym {font-weight:bold; border-bottom: none;} 19 | 20 | a:link, a:visited {text-decoration:none; color:#900;} 21 | a:hover, a:active {text-decoration:underline; color:#c00;} 22 | 23 | /* specific divs */ 24 | #container {width:604px; padding:0; margin:80px auto 80px 80px; border:2px solid #333; 25 | position:relative; background:#f8f8f8 url(bottomBorder.gif) 2px 100% no-repeat;} 26 | 27 | #intro {background:url(header.gif) no-repeat; width:600px;} 28 | #pageHeader {margin-bottom:0; height:30px;} 29 | #pageHeader h1, #pageHeader h2 {margin:17px 0 0 0; padding:0; height:30px;} 30 | #pageHeader h1 {background:transparent url(h1.gif) no-repeat; width:223px; float:left;} 31 | #pageHeader h2 {background:transparent url(h2.gif) no-repeat; width:377px; float:right;} 32 | #pageHeader h1 span, #pageHeader h2 span {display:none} 33 | #quickSummary {clear:both; margin:0 0 6px 0; width:600px; height:73px; background:url(summary.gif) 0 0 no-repeat;} 34 | #quickSummary p.p1 {display:none;} 35 | #quickSummary p.p2 {position:absolute; top:129px; left:430px; padding:0; font-size:8pt; z-index:10; font-weight:bold; width:150px; text-align:left;} 36 | #preamble {padding:210px 0 0 20px; margin:0 188px 0 0; background:url(mainImage.gif) 13px 0 no-repeat; width:392px;} 37 | #preamble h3 {background:url(preAmble.gif) -9px 0 no-repeat; height:41px; width:392px; margin:0; padding:0;} 38 | #preamble h3 span {display:none;} 39 | 40 | #supportingText {margin:0 8px 50px 20px; width:390px;} 41 | #supportingText h3 span {display:none;} 42 | #supportingText h3 {height:41px; width:392px;} 43 | #explanation h3 {background:url(explanation.gif) -9px 0 no-repeat;} 44 | #participation h3 {background:url(participation.gif) -9px 0 no-repeat;} 45 | #benefits h3 {background:url(benefits.gif) -9px 0 no-repeat;} 46 | #requirements h3 {background:url(requirements.gif) -9px 0 no-repeat;} 47 | 48 | #linkList {width:170px; position:absolute; top:170px; left:422px; background:url(linklistBottom.gif) 0 100% no-repeat; padding-bottom:200px; font:7.5pt georgia, serif; padding-left:7px;} 49 | #linkList h3 span {display:none} 50 | #linkList h3 {width:165px; height:15px; margin:0;} 51 | #linkList h3.select {background:url(select.gif) no-repeat;} 52 | #linkList h3.archives {background:url(archives.gif) no-repeat;} 53 | #linkList h3.resources {background:url(resources.gif) no-repeat;} 54 | #linkList ul {margin:0 0 17px 0; padding:0;} 55 | #linkList li {line-height:1.2em; list-style-type:none; display:block; padding-top:5px; margin-left:0;} 56 | 57 | 58 | -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.182.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 182 - '45 RPM', by Thomas Michaud, http://www.ivfx.com/ */ /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ /* All associated graphics copyright 2005, Thomas Michaud */ /* Added: September 1st, 2005 */ /* IMPORTANT */ /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. However, feel free to study the CSS and use techniques you learn from it elsewhere. */ /* --HTML and BODY Information-- */ html { margin: 0px; padding: 0px; } body { font-family: "Trebuchet MS", "Times New Roman", serif; font-size: 12px; color: #83986D; background: #E0E8B6 url(sidegraphic.gif) no-repeat fixed; margin: 0px; padding: 0px; line-height: 17px; font-weight: normal; } /* --Typography and Links-- */ p { text-align: justify; width: 380px; margin: 0px; } h1,h2,h3 { margin: 0px; } acronym { color: #706D32; font-weight: bold; font-style: oblique; border: 0px; } a:link { color: #83986d; text-decoration: none; font-weight: bold; } a:visited{ color: #83986d; text-decoration: none; } a:hover, a:active { color: #DB7762; border-bottom: 1px dotted #e6ad6c; } /*End Links*/ /* --Container-- */ #container { width: 560px; margin-left: 100px; padding-left: 5px; } #quickSummary{ padding: 0px 0px 0px 5px; margin: 0px 1px 10px 0px; background-image: url(bar.gif); background-repeat: no-repeat; width: 325px; height: 30px; } /* --Hide the Text for Logo-- */ #pageHeader h1 span, h2 span { display: none; } /* --Hide quicksummary Text-- */ #quickSummary .p1 span{ display: none; } #quickSummary .p2 { text-transform: uppercase; font-size: 12px; } #pageHeader { background-image: url(preamble.gif); background-repeat: no-repeat; height: 455px; width: 552px; margin: 0px; padding: 0px; } /* --Hide Header3 Text for image replacement-- */ #preamble h3 span { display: none; } #explanation h3 span { display: none; } #participation h3 span { display: none; } #benefits h3 span { display: none; } #requirements h3 span { display: none; } /* --Image Replacement for each h3 subject-- */ #preamble h3 { background-image: url(01.gif); background-repeat: no-repeat; background-position: left top; height: 60px; width: 400px; } #explanation h3 { background-image: url(02.gif); background-repeat: no-repeat; background-position: left top; height: 60px; width: 400px; } #participation h3 { background-image: url(03.gif); background-repeat: no-repeat; background-position: left top; height: 60px; width: 325px; } #benefits h3 { background-image: url(04.gif); background-repeat: no-repeat; background-position: left top; height: 60px; width: 325px; } #requirements h3 { background-image: url(05.gif); background-repeat: no-repeat; background-position: left top; height: 60px; width: 325px; } /* --Link Menu Position on Right-- */ #linkList { position: absolute; top: 300px; margin-left: 400px; width:240px; } #linkList a{ display: inline; } #linkList2 { font-size: 12px; padding: 10px; margin-top: 150px; width:240px; } #linkList h3.select { background: url(playlist.gif) no-repeat top left; margin: 0px 0px 5px 0px; width: 195px; height: 30px; } #linkList h3.select span { display:none } #linkList h3.archives { background: url(goldenoldies.gif) no-repeat top left; margin: 15px 0px 5px 0px; width: 195px; height: 30px; } #linkList h3.archives span { display:none } #linkList h3.resources { background: url(resources.gif) no-repeat top left; margin: 15px 0px 5px 0px; width: 195px; height: 30px; } #linkList h3.resources span { display:none } #linkList ul { margin: 0px; padding: 0px; } #linkList li { line-height: 2ex; list-style-type: none; display: block; padding-top: 5px; margin-bottom: 5px; } #linkList li a:link { color: #83986D; } #linkList li a:hover { color: #706D32; } #linkList li a:visited { color: #B6BB68; } #linkList li a.c{ color: #DB7762; font-size: 12px; font-weight: normal; } /* --Footer Information to Close everything out-- */ #footer { background-image: url(footer.gif); background-repeat: no-repeat; background-position: left top; height: 100px; width: 400px; margin: 10px 35px 10px; text-align: center; } #footer a { cursor: help; font: 0.8em "Trebuchet MS", "Times New Roman", serif; text-transform: uppercase; color: #83986D; font-weight: bold; } #footer a:hover { color: #DB7762; border: 0px; font-weight: bold; } /* --Fini-- */ -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.199.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission 199 - 'Zen Army', by Carl Desmond, http://www.niceguy.com/ */ /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ /* All associated graphics copyright 2006, Carl Desmond */ /* Added: December 5th, 2006 */ /* IMPORTANT */ /* This design is not a template. You may not reproduce it elsewhere without the designer's written permission. However, feel free to study the CSS and use techniques you learn from it elsewhere. */ html { margin: 0px; padding: 0px; min-width:764px; background: url(topgrnd.jpg) repeat-x top; background-color:#E7D8AF; } body { font: 10pt/18pt "Trebuchet MS", Arial, Verdana, sans-serif; color: #000; margin: 0px; background: url(btmgrnd.jpg) no-repeat bottom left; height:2200px; width:764px; } p { font: 10pt/18pt "Trebuchet MS", Arial, Verdana, sans-serif; margin-top: 0px; text-align: left; } h3 { font: italic normal 12pt georgia; letter-spacing: 1px; margin-bottom: 0px; color: #7D775C; } a:link { font-weight: bold; text-decoration: none; color: red; } a:visited { font-weight: bold; text-decoration: none; color: red; } a:hover, a:active { text-decoration: underline; color: #3B6132; } #container { position:absolute; left:50%; width: 750px; margin-left: -380px; } #intro { min-width: 764px; } #pageHeader { margin-bottom: 20px; } #pageHeader h1 { background: transparent url(header.jpg) no-repeat top center; margin-top: 0px; width: 764px; height: 380px; } #pageHeader h1 span { display:none } #pageHeader h2 { } #pageHeader h2 span { display:none; } #quickSummary { position:absolute; top:365px; left:30px; } #quickSummary p.p1 span { display:none; } #preamble { position: absolute; top:400px; left:250px; } #preamble h3 { background:url(h1_road.gif) no-repeat; width:400px; height:43px; } #preamble h3 span{ display:none; } #explanation h3 { background:url(h1_sowhat.gif) no-repeat; width:400px; height:43px; } #explanation h3 span{ display:none; } #participation h3 { background:url(h1_participate.gif) no-repeat; width:400px; height:43px; } #participation h3 span{ display:none; } #benefits h3 { background:url(h1_benefit.gif) no-repeat; width:400px; height:43px; } #benefits h3 span{ display:none; } #requirements h3 { background:url(h1_requirements.gif) no-repeat; width:400px; height:43px; } #requirements h3 span{ display:none; } #supportingText { position: absolute; left:250px; top: 680px; padding-left: 0px; margin-bottom: 0px; } #linkList { position: absolute; top: 385px; } #linkList li{ text-align:left; padding-left: 45px; } #linkList2 { font: 10pt "Trebuchet MS", Arial, Verdana, sans-serif; line-height:12px; background-image:url(linklist_bk.gif); background-repeat:repeat-y; background-position:left; width: 222px; } #linkList h3.select { background: url(selectdesign.jpg) no-repeat top left; width: 222px; height: 169px; } #linkList h3.select span { display:none; } #linkList h3.favorites { } #linkList h3.favorites span { display:none } #linkList h3.archives { background: transparent url(archives.jpg) no-repeat top left; margin: 0px 0px 0px 0px; width:222px; height: 191px; } #linkList h3.archives span { display:none } #linkList h3.resources { background: transparent url(resources.jpg) no-repeat top left; width:222px; height: 202px; } #linkList h3.resources span { display:none } #linkList ul { margin: 0px; padding: 0px; padding-bottom:5px; } #linkList li { background: url(hrzline.gif) no-repeat top right; display: block; padding-top: 10px; } #linkList li a:link { color: red; } #linkList li a:visited { color: #3B6132; } #lresources { padding-bottom:10px; } #lselect li a { font-size: 12px; } #lselect li a:hover{ color: #3B6132; } #lselect .c { font-size: 10px; } #lselect a { display: block; font-weight: bold; } #lselect a.c { display: inline; color: #3B6132; } #footer { text-align: right; } #footer a:link, #footer a:visited { margin-right: 20px; } -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.202.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codenothing/css-compressor/9821e0bbcb067f5112bd22735781d77958068f97/unit/benchmark/src/csszengarden.com.202.css -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.207.css: -------------------------------------------------------------------------------- 1 | /* css Zen Garden submission - 'Kyoto Forest', by John Politowski, http://rpmdesignfactory.com/ */ 2 | /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */ 3 | /* All associated graphics copyright 2007, John Politowski */ 4 | 5 | 6 | /* IMPORTANT */ 7 | /* This design is not a template. You may not reproduce it elsewhere without the 8 | designer's written permission. However, feel free to study the CSS and use 9 | techniques you learn from it elsewhere. */ 10 | 11 | 12 | /* basic elements */ 13 | 14 | html { 15 | margin: 0; 16 | padding: 0; 17 | } 18 | 19 | body { 20 | font-family:Arial, Helvetica, sans-serif; 21 | line-height:18px; 22 | font-size:12px; 23 | color: #06185c; 24 | background: #e6fad6 url(body_bg.jpg) no-repeat top center; 25 | margin: 0; 26 | padding: 0; 27 | } 28 | 29 | body a:link, a:active, a:visited{ 30 | text-decoration:none; 31 | color:#720a0b; 32 | } 33 | 34 | body a:hover{ 35 | text-decoration:underline; 36 | } 37 | 38 | p{ 39 | margin: 10px; 40 | padding: 0; 41 | } 42 | 43 | h3 { 44 | display:none; 45 | } 46 | 47 | ul { 48 | list-style-type: none; 49 | padding-left: 0; 50 | margin-left: 0; 51 | } 52 | 53 | li { 54 | background: url(bullet.gif) left center no-repeat; 55 | padding-left: 7px; 56 | margin-bottom: 5px; 57 | } 58 | 59 | acronym { 60 | border-bottom: none; 61 | } 62 | 63 | /* content div's */ 64 | 65 | #container { 66 | margin: auto; 67 | width:892px; 68 | background:url(content_bg_top.jpg) no-repeat top center; 69 | position:relative; 70 | } 71 | 72 | #intro{ 73 | width:892px; 74 | height:451px; 75 | } 76 | 77 | #pageHeader { 78 | background:url(header_what_about.gif) no-repeat top center; 79 | height:34px; 80 | overflow:hidden; 81 | position:absolute; 82 | top:462px; 83 | left:205px; 84 | width:587px; 85 | } 86 | 87 | #pageHeader span{ 88 | display:none; 89 | } 90 | 91 | #quickSummary { 92 | display:none; 93 | } 94 | 95 | #preamble{ 96 | padding:240px 100px 0 205px; 97 | } 98 | 99 | #preamble p.p1{ 100 | margin-top: 20px; 101 | } 102 | 103 | #supportingText{ 104 | background-image:url(content_tile.jpg); 105 | height:100%; 106 | } 107 | 108 | #explanation { 109 | padding:50px 100px 30px 205px; 110 | background:url(content_bg_bottom.jpg) top no-repeat; 111 | height:100%; 112 | } 113 | 114 | #participation { 115 | margin:20px 100px 30px 205px; 116 | padding-top:40px; 117 | background: url(header_participation.gif) no-repeat top center; 118 | height:100%; 119 | } 120 | 121 | #benefits { 122 | margin:65px 100px 30px 205px; 123 | padding-top:40px; 124 | background: url(header_benefits.gif) no-repeat top center; 125 | height:100%; 126 | } 127 | 128 | #requirements{ 129 | margin:65px 100px 30px 205px; 130 | padding:40px 0 15px 0; 131 | background: url(header_requirements.gif) no-repeat top center; 132 | border-bottom:1px solid #720a0b; 133 | height:100%; 134 | } 135 | 136 | #footer{ 137 | padding:10px; 138 | text-align:center; 139 | } 140 | 141 | /* link list and extra div's */ 142 | 143 | #linkList { 144 | position:absolute; 145 | width:150px; 146 | top:603px; 147 | z-index:5; 148 | color: #666666; 149 | font-size:10px; 150 | left: 25px; 151 | height:550px; 152 | line-height:13px; 153 | } 154 | 155 | #linkList a:link, a:active, a:visited { 156 | color:#113c05; 157 | text-decoration:none; 158 | } 159 | 160 | #linkList a:hover{ 161 | text-decoration: underline; 162 | } 163 | 164 | #lselect{ 165 | background:url(header_select_design.gif) top left no-repeat; 166 | margin: 5px 0 0 0; 167 | padding: 20px 0 0 0; 168 | width:150px; 169 | } 170 | 171 | #larchives{ 172 | background:url(header_archives.gif) top left no-repeat; 173 | margin: 10px 0 0 0; 174 | padding: 30px 0 0 0; 175 | width:150px; 176 | } 177 | 178 | #lresources{ 179 | background:url(header_resources.gif) top left no-repeat; 180 | margin: 15px 0 0 0; 181 | padding: 30px 0 0 0; 182 | width:150px; 183 | } -------------------------------------------------------------------------------- /unit/benchmark/src/csszengarden.com.212.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codenothing/css-compressor/9821e0bbcb067f5112bd22735781d77958068f97/unit/benchmark/src/csszengarden.com.212.css -------------------------------------------------------------------------------- /unit/clean.sh: -------------------------------------------------------------------------------- 1 | cd `dirname $0` 2 | 3 | # Drop all error files 4 | ls -1 errors/*.css > /dev/null 2>&1 5 | if [ "$?" = "0" ]; then 6 | rm errors/*.css 7 | fi 8 | 9 | 10 | # Drop all dist directorys 11 | ls -1 benchmark/dist/temp-* > /dev/null 2>&1 12 | if [ "$?" = "0" ]; then 13 | rm -rf benchmark/dist/temp-* 14 | fi 15 | 16 | 17 | # Remove temp json files 18 | ls -1 benchmark/results/temp-* > /dev/null 2>&1 19 | if [ "$?" = "0" ]; then 20 | rm benchmark/results/temp-* 21 | fi 22 | 23 | 24 | # Remove last run file 25 | if [ -e benchmark/dist/lastrun.txt ]; then 26 | rm benchmark/dist/lastrun.txt 27 | fi 28 | -------------------------------------------------------------------------------- /unit/errors/README.md: -------------------------------------------------------------------------------- 1 | This is a housing directory to store tested files that should be diffed. 2 | -------------------------------------------------------------------------------- /unit/file.php: -------------------------------------------------------------------------------- 1 | 'id.css', 21 | 'mode' => 'sane', 22 | 'options' => array( 23 | ), 24 | )); 25 | 26 | ?> 27 | -------------------------------------------------------------------------------- /unit/focus.php: -------------------------------------------------------------------------------- 1 | 'Combine.BorderRadius', 24 | 'method' => 'combine', 25 | 'mode' => 'small', 26 | 'options' => array( 27 | ), 28 | 'params' => array( 29 | "border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;", 30 | ), 31 | 'expect' => "border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;", 32 | )); 33 | 34 | ?> 35 | -------------------------------------------------------------------------------- /unit/sandbox/Cleanup.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Cleanup 7 | */ 8 | { 9 | // Removes definitions defined twice, usually injected by the compressor itself 10 | "removeMultipleDefinitions": { 11 | "simple": { 12 | "params": [ "margin-left:10px;color:blue;margin-left:10px;color:blue;" ], 13 | "expect": "margin-left:10px;color:blue;" 14 | } 15 | }, 16 | 17 | // Escaped character removal 18 | "removeInjections": { 19 | "multiple": { 20 | "params": [ "background:url(http\\://www.codenothing.com/random.php?foo=bar\\;&colon=te\\:st\\;)" ], 21 | "expect": "background:url(http://www.codenothing.com/random.php?foo=bar;&colon=te:st;)" 22 | }, 23 | "single": { 24 | "params": [ "color:blue\\;" ], 25 | "expect": "color:blue\\;" 26 | } 27 | }, 28 | 29 | // last semi-colon 30 | "removeUnnecessarySemicolon": { 31 | "1": { 32 | "params": [ "color:red;font-size:12pt;" ], 33 | "expect": "color:red;font-size:12pt" 34 | }, 35 | "2": { 36 | "params": [ "background:white;" ], 37 | "expect": "background:white" 38 | } 39 | }, 40 | 41 | // Cleanup has it's own special test handler 42 | "cleanup": { 43 | "_special": "details", 44 | "params": [ 45 | "color:blue;font-size:12pt;color:blue;font-size:12pt;", 46 | "color:blue;background:red url(http\\://www.example.com?a=someitem\\;);color:blue;" 47 | ], 48 | "expect": [ 49 | "color:blue;font-size:12pt", 50 | "color:blue;background:red url(http\\://www.example.com?a=someitem\\;)" 51 | ] 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /unit/sandbox/Color.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Color 7 | */ 8 | { 9 | // RGB Conversions 10 | "rgb2hex": { 11 | "single numeric": { 12 | "params": [ "rgb(145)" ], 13 | "expect": "#919191" 14 | }, 15 | "numeric": { 16 | "params": [ "rgb(145,123,16)" ], 17 | "expect": "#917b10" 18 | }, 19 | "single percentage": { 20 | "params": [ "rgb(50%)" ], 21 | "expect": "#7f7f7f" 22 | }, 23 | "percentage": { 24 | "params": [ "rgb(50%,50%,50%)" ], 25 | "expect": "#7f7f7f" 26 | } 27 | }, 28 | 29 | // Long color names to hex codes 30 | "color2hex": { 31 | "aliceblue": { 32 | "params": [ "aliceblue" ], 33 | "expect": "#f0f8ff" 34 | }, 35 | "darkgoldenrod": { 36 | "params": [ "darkgoldenrod" ], 37 | "expect": "#b8860b" 38 | }, 39 | "lightgoldenrodyellow": { 40 | "params": [ "lightgoldenrodyellow" ], 41 | "expect": "#fafad2" 42 | }, 43 | "red": { 44 | "params": [ "red" ], 45 | "expect": "red" 46 | } 47 | }, 48 | 49 | // Long hex to short name conversions 50 | "hex2color": { 51 | "azure": { 52 | "params": [ "#f0ffff" ], 53 | "expect": "azure" 54 | }, 55 | "peru": { 56 | "params": [ "#cd853f" ], 57 | "expect": "peru" 58 | }, 59 | "no change": { 60 | "params": [ "#cd8599" ], 61 | "expect": "#cd8599" 62 | } 63 | }, 64 | 65 | // Long hex to short name conversions 66 | "hex2safe": { 67 | "green": { 68 | "params": [ "#008000" ], 69 | "expect": "green" 70 | }, 71 | "olive": { 72 | "params": [ "#808000" ], 73 | "expect": "olive" 74 | }, 75 | "peru (not safe)": { 76 | "params": [ "#cd853f" ], 77 | "expect": "#cd853f" 78 | }, 79 | "no change": { 80 | "params": [ "#cd8599" ], 81 | "expect": "#cd8599" 82 | } 83 | }, 84 | 85 | // Long hex to short hex conversions 86 | "hex2short": { 87 | // Long hex to short hex conversions 88 | "#a60": { 89 | "params": [ "#aa6600" ], 90 | "expect": "#a60" 91 | }, 92 | "#736": { 93 | "params": [ "#773366" ], 94 | "expect": "#736" 95 | }, 96 | "#772213": { 97 | "params": [ "#772213" ], 98 | "expect": "#772213" 99 | } 100 | }, 101 | 102 | // Main color handler, runs all of the tests above 103 | "color": { 104 | "peru": { 105 | "params": [ "#cd853f" ], 106 | "expect": "peru" 107 | }, 108 | "aliceblue": { 109 | "params": [ "aliceblue" ], 110 | "expect": "#f0f8ff" 111 | }, 112 | "red": { 113 | "params": [ "#FF0000" ], 114 | "expect": "red" 115 | }, 116 | "Lowercase Hex Codes short": { 117 | "params": [ "#ABC" ], 118 | "expect": "#abc" 119 | }, 120 | "Lowercase Hex Codes": { 121 | "params": [ "#ABCABC" ], 122 | "expect": "#abcabc" 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /unit/sandbox/Combine.Aural.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Combine.Aural 7 | */ 8 | { 9 | "combine": { 10 | "cue": { 11 | "params": [ "cue-before:url(sound.wav);color:red;cue-after:url(after.wav);" ], 12 | "expect": "cue:url(sound.wav) url(after.wav);color:red;" 13 | }, 14 | "pause": { 15 | "params": [ "color:white;pause-before:2s;pause-after:3s" ], 16 | "expect": "color:white;pause:2s 3s;" 17 | }, 18 | "do nothing": { 19 | "params": [ "pause-before:2s;color:red;" ], 20 | "expect": "pause-before:2s;color:red;" 21 | } 22 | }, 23 | 24 | "storage": { 25 | "_special": "storage", 26 | "cue": { 27 | "params": [ "cue-before:url(sound.wav);color:red;cue-after:url(after.wav);" ], 28 | "expect": { 29 | "cue": "cue:url(sound.wav) url(after.wav);" 30 | } 31 | }, 32 | "pause": { 33 | "params": [ "color:white;pause-before:2s;pause-after:3s" ], 34 | "expect": { 35 | "pause": "pause:2s 3s;" 36 | } 37 | }, 38 | "pause important": { 39 | "params": [ "color:white;pause-before:2s!important;pause-after:3s;" ], 40 | "expect": {} 41 | }, 42 | "nothing": { 43 | "params": [ "pause-before:2s;color:red;" ], 44 | "expect": {} 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /unit/sandbox/Combine.Background.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Combine.Background 7 | */ 8 | { 9 | "combine": { 10 | "1": { 11 | "paramjoin": "", 12 | "params": [ 13 | "background-color:green;", 14 | "background-image:url(images/img.gif);", 15 | "background-repeat:no-repeat;", 16 | "background-attachment:scroll;", 17 | "background-position:center" 18 | ], 19 | "expect": "background:green url(images/img.gif) no-repeat scroll center;" 20 | }, 21 | "2": { 22 | "paramjoin": "", 23 | "params": [ 24 | "background-color:green;", 25 | "background-image:url(images/img.gif);", 26 | "background-attachment:scroll;", 27 | "background-position:center;" 28 | ], 29 | "expect": "background:green url(images/img.gif) scroll center;" 30 | }, 31 | "3": { 32 | "paramjoin": "", 33 | "params": [ 34 | "background-color:green;", 35 | "background-image:url(images/img.gif);", 36 | "background-repeat:no-repeat;", 37 | "background-position:center;" 38 | ], 39 | "expect": "background:green url(images/img.gif) no-repeat center;" 40 | }, 41 | "4": { 42 | "paramjoin": "", 43 | "params": [ 44 | "background-color:green;", 45 | "background-image:url(images/img.gif);", 46 | "background-repeat:no-repeat;", 47 | "background-attachment:scroll;" 48 | ], 49 | "expect": "background:green url(images/img.gif) no-repeat scroll;" 50 | }, 51 | "5": { 52 | "params": [ "background-color:green;background-image:url(images/img.gif);background-repeat:no-repeat" ], 53 | "expect": "background:green url(images/img.gif) no-repeat;" 54 | }, 55 | "6": { 56 | "params": [ "background-color:green;background-image:url(images/img.gif);background-attachment:scroll;" ], 57 | "expect": "background:green url(images/img.gif) scroll;" 58 | }, 59 | "7": { 60 | "params": [ "background-color:green;background-image:url(images/img.gif);background-position:center;" ], 61 | "expect": "background:green url(images/img.gif) center;" 62 | }, 63 | "8": { 64 | "params": [ "color:red;background-color:green;background-image:url(images/img.gif)" ], 65 | "expect": "color:red;background:green url(images/img.gif);" 66 | }, 67 | "9": { 68 | "params": [ "background-image:url(images/img.gif);background-attachment:scroll;background-position:center;color:red;" ], 69 | "expect": "background:url(images/img.gif) scroll center;color:red;" 70 | }, 71 | "10": { 72 | "params": [ "background-image:url(images/img.gif);color:black;background-repeat:no-repeat;background-position:center;" ], 73 | "expect": "background:url(images/img.gif) no-repeat center;color:black;" 74 | }, 75 | "11": { 76 | "params": [ "background-image:url(images/img.gif);background-repeat:no-repeat;background-attachment:scroll;" ], 77 | "expect": "background:url(images/img.gif) no-repeat scroll;" 78 | }, 79 | "12": { 80 | "params": [ "background-image:url(images/img.gif);background-repeat:no-repeat;" ], 81 | "expect": "background:url(images/img.gif) no-repeat;" 82 | }, 83 | "13": { 84 | "params": [ "background-image:url(images/img.gif);background-attachment:scroll;" ], 85 | "expect": "background:url(images/img.gif) scroll;" 86 | }, 87 | "14": { 88 | "params": [ "background-image:url(images/img.gif);font-size:12pt;" ], 89 | "expect": "background:url(images/img.gif);font-size:12pt;" 90 | }, 91 | "15": { 92 | "params": [ "background-color:green;" ], 93 | "expect": "background:green;" 94 | }, 95 | "no change": { 96 | "params": [ "background-color:green;background-position:center;" ], 97 | "expect": "background-color:green;background-position:center;" 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /unit/sandbox/Combine.Border.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Combine.Border 7 | */ 8 | { 9 | "replace": { 10 | "border": { 11 | "paramjoin": "", 12 | "params": [ 13 | "border-top:1px solid red;", 14 | "color:blue;", 15 | "border-left:1px solid red;", 16 | "border-right:1px solid red;", 17 | "border-bottom:1px solid red" 18 | ], 19 | "expect": "border:1px solid red;" 20 | }, 21 | "border end with semi": { 22 | "paramjoin": "", 23 | "params": [ 24 | "border-top:1px solid red;", 25 | "border-left:1px solid red;", 26 | "border-right:1px solid red;", 27 | "color:blue;", 28 | "border-bottom:1px solid red;" 29 | ], 30 | "expect": "border:1px solid red;" 31 | }, 32 | "nothing": { 33 | "paramjoin": "", 34 | "params": [ 35 | "border-top:1px solid red;", 36 | "color:blue;", 37 | "border-right:1px solid red;", 38 | "border-bottom:1px solid red;" 39 | ], 40 | "expect": false 41 | } 42 | }, 43 | 44 | "combine": { 45 | "border": { 46 | "paramjoin": "", 47 | "params": [ 48 | "border-top:1px solid red;", 49 | "color:blue;", 50 | "border-left:1px solid red;", 51 | "border-right:1px solid red;", 52 | "border-bottom:1px solid red" 53 | ], 54 | "expect": "border:1px solid red;color:blue;" 55 | }, 56 | "do nothing": { 57 | "paramjoin": "", 58 | "params": [ 59 | "border-top:1px solid red;", 60 | "color:blue;", 61 | "border-left:1px solid blue;", 62 | "border-right:1px solid red;", 63 | "border-bottom:1px solid red;" 64 | ], 65 | "expect": [ 66 | "border-top:1px solid red;", 67 | "color:blue;", 68 | "border-left:1px solid blue;", 69 | "border-right:1px solid red;", 70 | "border-bottom:1px solid red;" 71 | ] 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /unit/sandbox/Combine.BorderOutline.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Combine.BorderOutline 7 | */ 8 | { 9 | "storage": { 10 | "_special": "storage", 11 | "border": { 12 | "params": [ "border-color:red;border-style:solid;border-width:2px" ], 13 | "expect": { 14 | "border": "border:2px solid red;" 15 | } 16 | }, 17 | "outline": { 18 | "params": [ "outline-color:blue;outline-style:thin;outline-width:1px;" ], 19 | "expect": { 20 | "outline": "outline:1px thin blue;" 21 | } 22 | }, 23 | "border-bottom": { 24 | "params": [ "border-bottom-color:red;border-bottom-style:solid;border-bottom-width:2px;" ], 25 | "expect": { 26 | "border-bottom": "border-bottom:2px solid red;" 27 | } 28 | }, 29 | "border-top": { 30 | "params": [ "border-top-color:red;border-top-style:solid;border-top-width:2px" ], 31 | "expect": { 32 | "border-top": "border-top:2px solid red;" 33 | } 34 | }, 35 | "border-left": { 36 | "params": [ "border-left-color:red;border-left-style:solid;border-left-width:2px;" ], 37 | "expect": { 38 | "border-left": "border-left:2px solid red;" 39 | } 40 | }, 41 | "border-right": { 42 | "params": [ "border-right-color:red;border-right-style:solid;border-right-width:2px;" ], 43 | "expect": { 44 | "border-right": "border-right:2px solid red;" 45 | } 46 | }, 47 | "many": { 48 | "paramjoin": "", 49 | "params": [ 50 | "outline-color:blue;outline-style:thin;outline-width:1px;", 51 | "border-bottom-color:red;border-bottom-style:solid;border-bottom-width:2px;", 52 | "font-size:12px;", 53 | "border-top-color:red;border-top-style:solid;border-top-width:2px;", 54 | "border-left-color:red;border-left-style:solid;border-left-width:2px;", 55 | "color:red;", 56 | "border-right-color:red;border-right-style:solid;border-right-width:2px" 57 | ], 58 | "expect": { 59 | "outline": "outline:1px thin blue;", 60 | "border-bottom": "border-bottom:2px solid red;", 61 | "border-top": "border-top:2px solid red;", 62 | "border-left": "border-left:2px solid red;", 63 | "border-right": "border-right:2px solid red;" 64 | } 65 | }, 66 | "nothing": { 67 | "params": [ "border-color:red;color:red;border-style:solid;color:white" ], 68 | "expect": {} 69 | } 70 | }, 71 | 72 | "combine": { 73 | "border": { 74 | "params": [ "border-color:red;border-style:solid;border-width:2px;" ], 75 | "expect": "border:2px solid red;" 76 | }, 77 | "outline": { 78 | "params": [ "outline-color:blue;outline-style:thin;outline-width:1px;" ], 79 | "expect": "outline:1px thin blue;" 80 | }, 81 | "border-bottom": { 82 | "params": [ "border-bottom-color:red;border-bottom-style:solid;border-bottom-width:2px;" ], 83 | "expect": "border-bottom:2px solid red;" 84 | }, 85 | "border-top": { 86 | "params": [ "border-top-color:red;border-top-style:solid;border-top-width:2px;font-size:12px" ], 87 | "expect": "border-top:2px solid red;font-size:12px" 88 | }, 89 | "border-left": { 90 | "params": [ "color:white;border-left-color:red;border-left-style:solid;border-left-width:2px" ], 91 | "expect": "color:white;border-left:2px solid red;" 92 | }, 93 | "border-right": { 94 | "params": [ "border-right-color:red;border-right-style:solid;border-right-width:2px;" ], 95 | "expect": "border-right:2px solid red;" 96 | }, 97 | "inbetween": { 98 | "params": [ "border-color:red;color:red;border-style:solid;color:white;border-width:2px;" ], 99 | "expect": "border:2px solid red;color:red;color:white;" 100 | }, 101 | "border style directional": { 102 | "params": [ "border-color:black;border-style:none none solid;border-width:0 0 1;" ], 103 | "expect": "border-color:black;border-style:none none solid;border-width:0 0 1;" 104 | }, 105 | "do nothing": { 106 | "params": [ "border-color:red;color:red;border-style:solid;color:white;" ], 107 | "expect": "border-color:red;color:red;border-style:solid;color:white;" 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /unit/sandbox/Combine.BorderRadius.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Combine.BorderRadius 7 | */ 8 | { 9 | "combine": { 10 | "shorthand regular": { 11 | "params": [ "border-radius:10px 10px 10px 10px" ], 12 | "expect": "border-radius:10px;" 13 | }, 14 | "shorthand moz": { 15 | "params": [ "-moz-border-radius:10px 9px 10px 9px" ], 16 | "expect": "-moz-border-radius:10px 9px;" 17 | }, 18 | "shorthand webkit": { 19 | "params": [ "-webkit-border-radius:10px 9px 8px 9px" ], 20 | "expect": "-webkit-border-radius:10px 9px 8px;" 21 | }, 22 | "shorthand regular": { 23 | "params": [ "border-radius:10px 9px 8px 7px;" ], 24 | "expect": "border-radius:10px 9px 8px 7px;" 25 | }, 26 | "shorthand slash regular": { 27 | "params": [ "border-radius:10px 10px 10px 10px/5px 4px 3px 2px;" ], 28 | "expect": "border-radius:10px/5px 4px 3px 2px;" 29 | }, 30 | "shorthand slash moz": { 31 | "params": [ "-moz-border-radius:5px 4px 5px 4px/5px 5px;" ], 32 | "expect": "-moz-border-radius:5px 4px/5px;" 33 | }, 34 | "shorthand slash webkit": { 35 | "params": [ "-webkit-border-radius:5px 4px 3px/10px;" ], 36 | "expect": "-webkit-border-radius:5px 4px 3px/10px;" 37 | }, 38 | "shorthand slash regular final": { 39 | "params": [ "-webkit-border-radius:10px/10px;" ], 40 | "expect": "-webkit-border-radius:10px/10px;" 41 | }, 42 | "simple multiple": { 43 | "params": [ 44 | "border-radius:4px;", 45 | "-webkit-border-radius:4px;", 46 | "-moz-border-radius:4px;" 47 | ], 48 | "paramjoin": "", 49 | "expect": [ 50 | "border-radius:4px;", 51 | "-webkit-border-radius:4px;", 52 | "-moz-border-radius:4px;" 53 | ] 54 | }, 55 | "complex multiple": { 56 | "params": [ 57 | "border-radius:5px 4px 5px 4px/5px 5px;", 58 | "-webkit-border-radius:5px 4px 5px 4px/5px 5px;", 59 | "-moz-border-radius:5px 4px 5px 4px/5px 5px;" 60 | ], 61 | "paramjoin": "", 62 | "expect": [ 63 | "border-radius:5px 4px/5px;", 64 | "-webkit-border-radius:5px 4px/5px;", 65 | "-moz-border-radius:5px 4px/5px;" 66 | ] 67 | }, 68 | "full regular": { 69 | "params": [ 70 | "border-top-left-radius:10px;", 71 | "border-top-right-radius:10px;", 72 | "border-bottom-right-radius:10px;", 73 | "border-bottom-left-radius:10px" 74 | ], 75 | "paramjoin": "", 76 | "expect": "border-radius:10px;" 77 | }, 78 | "full slash moz": { 79 | "params": [ 80 | "-moz-border-radius-topleft:10px 5px;", 81 | "-moz-border-radius-topright:9px 4px;", 82 | "-moz-border-radius-bottomright:10px 3px;", 83 | "-moz-border-radius-bottomleft:9px 4px" 84 | ], 85 | "paramjoin": "", 86 | "expect": "-moz-border-radius:10px 9px/5px 4px 3px;" 87 | }, 88 | "full slash webkit": { 89 | "params": [ 90 | "-webkit-border-top-left-radius:10px 5px;", 91 | "-webkit-border-top-right-radius:9px 5px;", 92 | "-webkit-border-bottom-right-radius:8px 5px;", 93 | "-webkit-border-bottom-left-radius:7px 5px" 94 | ], 95 | "paramjoin": "", 96 | "expect": "-webkit-border-radius:10px 9px 8px 7px/5px;" 97 | }, 98 | "overwrite regular": { 99 | "params": [ "border-radius:10px;border-top-left-radius:11px;" ], 100 | "expect": "border-radius:11px 10px 10px;" 101 | }, 102 | "overwrite slash moz": { 103 | "params": [ "-moz-border-radius:10px;-moz-border-radius-topleft:11px 12px;-moz-border-radius-bottomright:11px 12px;" ], 104 | "expect": "-moz-border-radius:11px 10px/12px 0;" 105 | }, 106 | "overwrite slash webkit": { 107 | "params": [ "-webkit-border-radius:10px;-webkit-border-top-left-radius:11px;" ], 108 | "expect": "-webkit-border-radius:11px 10px 10px;" 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /unit/sandbox/Combine.Combine.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Combine.Combine 7 | */ 8 | { 9 | "checkUncombinables": { 10 | "important alone": { 11 | "params": [ "!important" ], 12 | "expect": true 13 | }, 14 | "ie alone": { 15 | "params": [ "!ie" ], 16 | "expect": true 17 | }, 18 | "space alone": { 19 | "params": [ " " ], 20 | "expect": true 21 | }, 22 | "inherit alone": { 23 | "params": [ "inherit" ], 24 | "expect": true 25 | }, 26 | "important color": { 27 | "params": [ "red!important;" ], 28 | "expect": true 29 | }, 30 | "important fail": { 31 | "params": [ "important" ], 32 | "expect": false 33 | }, 34 | "ie fail": { 35 | "params": [ "ie" ], 36 | "expect": false 37 | }, 38 | "clean alone": { 39 | "params": [ "red" ], 40 | "expect": false 41 | }, 42 | "ie color": { 43 | "params": [ "red!ie;" ], 44 | "expect": true 45 | }, 46 | "inherit color space": { 47 | "params": [ "red inherit;" ], 48 | "expect": true 49 | }, 50 | "escaped space": { 51 | "params": [ "red;\\ " ], 52 | "expect": false 53 | }, 54 | "array important": { 55 | "params": [ [ "red", "!important" ] ], 56 | "expect": true 57 | }, 58 | "array ie": { 59 | "params": [ [ "red", "!ie" ] ], 60 | "expect": true 61 | }, 62 | "array inherit": { 63 | "params": [ [ "red", "inherit" ] ], 64 | "expect": true 65 | }, 66 | "array escaped space": { 67 | "params": [ [ "red", "\\ " ] ], 68 | "expect": false 69 | }, 70 | "array important fail": { 71 | "params": [ [ "red", "important" ] ], 72 | "expect": false 73 | }, 74 | "array ie fail": { 75 | "params": [ [ "red", "ie" ] ], 76 | "expect": false 77 | }, 78 | "array clean": { 79 | "params": [ [ "10px", "9px", "8px", "4px" ] ], 80 | "expect": false 81 | } 82 | }, 83 | 84 | "combine": { 85 | "_special": "details", 86 | "params": [ 87 | "font-size:12pt;list-style-type:none;font-family:arial;list-style-position:inline;", 88 | "background-color:green;background-image:url(images/img.gif);", 89 | "margin-top:10px;margin-left:10px;margin-right:10px;margin-bottom:10px;", 90 | "margin-top:10px;color:white;margin-right:10px;color:red;" 91 | ], 92 | "expect": [ 93 | "font:12pt arial;list-style:none inline;", 94 | "background:green url(images/img.gif);", 95 | "margin:10px;", 96 | "margin-top:10px;color:white;margin-right:10px;color:red;" 97 | ] 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /unit/sandbox/Combine.Font.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Combine.Font 7 | */ 8 | { 9 | "storage": { 10 | "_special": "storage", 11 | "1": { 12 | "params": [ "font-style:italic;font-variant:normal;font-weight:bold;font-size:12pt;line-height:20px;font-family:arial" ], 13 | "expect": { 14 | "font-style": "italic", 15 | "font-variant": "normal", 16 | "font-weight": "bold", 17 | "font-family": "arial", 18 | "size/height": "12pt/20px" 19 | } 20 | }, 21 | "2": { 22 | "params": [ "font-style:italic;font-variant:normal;font-weight:bold;font-size:12pt;font-family:arial;" ], 23 | "expect": { 24 | "font-style": "italic", 25 | "font-variant": "normal", 26 | "font-weight": "bold", 27 | "font-size": "12pt", 28 | "font-family": "arial" 29 | } 30 | }, 31 | "3": { 32 | "params": [ "font-style:italic;font-variant:normal;font-size:12pt;line-height:20px;font-family:arial" ], 33 | "expect": { 34 | "font-style":"italic", 35 | "font-variant": "normal", 36 | "font-family": "arial", 37 | "size/height": "12pt/20px" 38 | } 39 | }, 40 | "injection": { 41 | "params": [ "font-variant:normal;font-size:12pt;font-family:arial;color:red;" ], 42 | "expect": { 43 | "font-variant":"normal", 44 | "font-size": "12pt", 45 | "font-family": "arial" 46 | } 47 | }, 48 | "nothing": { 49 | "params": [ "color:red;background:blue;" ], 50 | "expect": {} 51 | } 52 | }, 53 | 54 | "combine": { 55 | "1": { 56 | "params": [ "font-style:italic;font-variant:normal;font-weight:bold;font-size:12pt;line-height:20px;font-family:arial;" ], 57 | "expect": "font:italic normal bold 12pt/20px arial;" 58 | }, 59 | "2": { 60 | "params": [ "font-style:italic;font-variant:normal;font-weight:bold;font-size:12pt;font-family:arial;" ], 61 | "expect": "font:italic normal bold 12pt arial;" 62 | }, 63 | "3": { 64 | "params": [ "font-style:italic;font-variant:normal;font-size:12pt;line-height:20px;font-family:arial" ], 65 | "expect": "font:italic normal 12pt/20px arial;" 66 | }, 67 | "4": { 68 | "params": [ "font-style:italic;font-variant:normal;font-size:12pt;font-family:arial;" ], 69 | "expect": "font:italic normal 12pt arial;" 70 | }, 71 | "5": { 72 | "params": [ "font-style:italic;font-weight:bold;font-size:12pt;line-height:20px;font-family:arial;" ], 73 | "expect": "font:italic bold 12pt/20px arial;" 74 | }, 75 | "6": { 76 | "params": [ "font-style:italic;color:red;font-weight:bold;font-size:12pt;font-family:arial;" ], 77 | "expect": "font:italic bold 12pt arial;color:red;" 78 | }, 79 | "7": { 80 | "params": [ "font-variant:normal;font-weight:bold;font-size:12pt;line-height:20px;font-family:arial;" ], 81 | "expect": "font:normal bold 12pt/20px arial;" 82 | }, 83 | "8": { 84 | "params": [ "font-variant:normal;font-weight:bold;font-size:12pt;font-family:arial;" ], 85 | "expect": "font:normal bold 12pt arial;" 86 | }, 87 | "9": { 88 | "params": [ "color:red;font-weight:bold;font-size:12pt;line-height:20px;font-family:arial;" ], 89 | "expect": "color:red;font:bold 12pt/20px arial;" 90 | }, 91 | "10": { 92 | "params": [ "font-weight:bold;font-size:12pt;font-family:arial;" ], 93 | "expect": "font:bold 12pt arial;" 94 | }, 95 | "11": { 96 | "params": [ "font-variant:normal;font-size:12pt;line-height:20px;font-family:arial" ], 97 | "expect": "font:normal 12pt/20px arial;" 98 | }, 99 | "12": { 100 | "params": [ "font-variant:normal;font-size:12pt;font-family:arial;color:red;" ], 101 | "expect": "font:normal 12pt arial;color:red;" 102 | }, 103 | "13": { 104 | "params": [ "font-style:italic;font-size:12pt;line-height:20px;font-family:arial;" ], 105 | "expect": "font:italic 12pt/20px arial;" 106 | }, 107 | "14": { 108 | "params": [ "font-style:italic;font-size:12pt;font-family:arial;" ], 109 | "expect": "font:italic 12pt arial;" 110 | }, 111 | "15": { 112 | "params": [ "font-size:12pt;color:black;line-height:20px;font-family:arial" ], 113 | "expect": "font:12pt/20px arial;color:black;" 114 | }, 115 | "16": { 116 | "params": [ "color:white;font-size:12pt;font-family:arial;" ], 117 | "expect": "color:white;font:12pt arial;" 118 | }, 119 | "no change": { 120 | "params": [ "font-style:italic;font-size:12pt;" ], 121 | "expect": "font-style:italic;font-size:12pt;" 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /unit/sandbox/Combine.List.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Combine.List 7 | */ 8 | { 9 | "replace": { 10 | "1": { 11 | "params": [ "list-style-type:none;list-style-position:inline;list-style-image:url(images/img.gif)" ], 12 | "expect": "list-style:none inline url(images/img.gif);" 13 | }, 14 | "2": { 15 | "params": [ "list-style-type:none;color:white;list-style-position:inline;" ], 16 | "expect": "list-style:none inline;" 17 | }, 18 | "3": { 19 | "params": [ "color:red;list-style-type:none;list-style-image:url(images/img.gif);" ], 20 | "expect": "list-style:none url(images/img.gif);" 21 | }, 22 | "4": { 23 | "params": [ "list-style-position:inline;list-style-image:url(images/img.gif)" ], 24 | "expect": "list-style:inline url(images/img.gif);" 25 | }, 26 | "5": { 27 | "params": [ "list-style-type:none;color:black;" ], 28 | "expect": "list-style:none;" 29 | }, 30 | "6": { 31 | "params": [ "list-style-position:inline;" ], 32 | "expect": "list-style:inline;" 33 | }, 34 | "7": { 35 | "params": [ "list-style-image:url(images/img.gif);" ], 36 | "expect": "list-style:url(images/img.gif);" 37 | } 38 | }, 39 | 40 | "combine": { 41 | "1": { 42 | "params": [ "list-style-type:none;list-style-position:inline;list-style-image:url(images/img.gif);" ], 43 | "expect": "list-style:none inline url(images/img.gif);" 44 | }, 45 | "2": { 46 | "params": [ "list-style-type:none;color:white;list-style-position:inline;" ], 47 | "expect": "list-style:none inline;color:white;" 48 | }, 49 | "3": { 50 | "params": [ "color:red;list-style-type:none;list-style-image:url(images/img.gif);" ], 51 | "expect": "color:red;list-style:none url(images/img.gif);" 52 | }, 53 | "4": { 54 | "params": [ "list-style-position:inline;list-style-image:url(images/img.gif);" ], 55 | "expect": "list-style:inline url(images/img.gif);" 56 | }, 57 | "5": { 58 | "params": [ "list-style-type:none;color:black;" ], 59 | "expect": "list-style:none;color:black;" 60 | }, 61 | "6": { 62 | "params": [ "list-style-position:inline;" ], 63 | "expect": "list-style:inline;" 64 | }, 65 | "7": { 66 | "params": [ "list-style-image:url(images/img.gif);" ], 67 | "expect": "list-style:url(images/img.gif);" 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /unit/sandbox/Combine.MarginPadding.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Combine.MarginPadding 7 | */ 8 | { 9 | "storage": { 10 | "_special": "storage", 11 | "4-way": { 12 | "params": [ "margin-top:10px;margin-right:10px;margin-bottom:10px;margin-left:10px;" ], 13 | "expect": { 14 | "margin": "margin:10px;" 15 | } 16 | }, 17 | "2-way": { 18 | "params": [ "color:red;padding-top:0;padding-right:10px;padding-bottom:0;padding-left:10px;" ], 19 | "expect": { 20 | "padding": "padding:0 10px;" 21 | } 22 | }, 23 | "3-way": { 24 | "params": [ "margin-top:0;margin-right:10px;margin-bottom:2px;margin-left:10px;color:white;" ], 25 | "expect": { 26 | "margin": "margin:0 10px 2px;" 27 | } 28 | }, 29 | "just combine": { 30 | "params": [ "color:red;padding-top:0;padding-right:5px;padding-bottom:10px;padding-left:2px;color:white;" ], 31 | "expect": { 32 | "padding": "padding:0 5px 10px 2px;" 33 | } 34 | }, 35 | "multiple": { 36 | "paramjoin": ";", 37 | "params": [ 38 | "margin-top:2px", 39 | "margin-right:3px", 40 | "margin-bottom:4px", 41 | "margin-left:3px", 42 | "padding-top:5px", 43 | "padding-right:5px", 44 | "padding-bottom:5px", 45 | "padding-left:5px" 46 | ], 47 | "expect": { 48 | "margin": "margin:2px 3px 4px;", 49 | "padding": "padding:5px;" 50 | } 51 | }, 52 | "do nothing": { 53 | "params": [ "color:red;margin-top:20px;margin-left:10px;color:white;" ], 54 | "expect": {} 55 | } 56 | }, 57 | 58 | "expand": { 59 | "expand 1": { 60 | "params": [ "margin:10px" ], 61 | "expect": "margin-top:10px;margin-right:10px;margin-bottom:10px;margin-left:10px;" 62 | }, 63 | "expand 2": { 64 | "params": [ "color:red;padding:0 10px" ], 65 | "expect": "color:red;padding-top:0;padding-right:10px;padding-bottom:0;padding-left:10px;" 66 | }, 67 | "expand 3": { 68 | "params": [ "margin:0 10px 2px;color:white;" ], 69 | "expect": "margin-top:0;margin-right:10px;margin-bottom:2px;margin-left:10px;color:white;" 70 | }, 71 | "expand 4": { 72 | "params": [ "color:red;padding:0 5px 10px 2px;color:white;" ], 73 | "expect": "color:red;padding-top:0;padding-right:5px;padding-bottom:10px;padding-left:2px;color:white;" 74 | }, 75 | "future hack?": { 76 | "params": [ "some-margin:10px;" ], 77 | "expect": "some-margin:10px;" 78 | }, 79 | "no expand": { 80 | "params": [ "color:red;margin-top:20px;margin-left:10px;color:white;" ], 81 | "expect": "color:red;margin-top:20px;margin-left:10px;color:white;" 82 | } 83 | }, 84 | 85 | // Margin/Padding combinations 86 | "combine": { 87 | "top-left": { 88 | "params": [ "margin-top:10px;margin-left:10px;" ], 89 | "expect": "margin-top:10px;margin-left:10px;" 90 | }, 91 | "top-bottom": { 92 | "params": [ "margin-top:10px;margin-bottom:10px;" ], 93 | "expect": "margin-top:10px;margin-bottom:10px;" 94 | }, 95 | "4 to 1": { 96 | "params": [ "margin-top:10px;margin-left:10px;margin-right:10px;margin-bottom:10px;" ], 97 | "expect": "margin:10px;" 98 | }, 99 | "4 to 2": { 100 | "params": [ "padding-top:12px;padding-left:10px;padding-right:10px;padding-bottom:12px;" ], 101 | "expect": "padding:12px 10px;" 102 | }, 103 | "overwrite": { 104 | "params": [ "margin:0;margin-left:10px;margin-right:10px;" ], 105 | "expect": "margin:0 10px;" 106 | }, 107 | "remain the same": { 108 | "params": [ "margin:0;color:blue;" ], 109 | "expect": "margin:0;color:blue;" 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /unit/sandbox/Numeric.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Numeric 7 | */ 8 | { 9 | // Decimal removal 10 | "decimal": { 11 | "remove": { 12 | "params": [ "1.0em" ], 13 | "expect": "1em" 14 | }, 15 | "negative remove": { 16 | "params": [ "-1.0em" ], 17 | "expect": "-1em" 18 | }, 19 | "positive remove": { 20 | "params": [ "+1.0em" ], 21 | "expect": "1em" 22 | }, 23 | "long decimal int": { 24 | "params": [ "1.00000em" ], 25 | "expect": "1em" 26 | }, 27 | "negative long decimal int": { 28 | "params": [ "-1.00000em" ], 29 | "expect": "-1em" 30 | }, 31 | "positive long decimal int": { 32 | "params": [ "+1.00000em" ], 33 | "expect": "1em" 34 | }, 35 | "long decimal": { 36 | "params": [ "1.10000em" ], 37 | "expect": "1.1em" 38 | }, 39 | "negative long decimal": { 40 | "params": [ "-1.10000em" ], 41 | "expect": "-1.1em" 42 | }, 43 | "keep": { 44 | "params": [ "1.059em" ], 45 | "expect": "1.059em" 46 | }, 47 | "negative keep": { 48 | "params": [ "-1.059em" ], 49 | "expect": "-1.059em" 50 | } 51 | }, 52 | 53 | // Unit removal 54 | "units": { 55 | "remove": { 56 | "params": [ "0px" ], 57 | "expect": "0" 58 | }, 59 | "percentage": { 60 | "params": [ "0%" ], 61 | "expect": "0" 62 | }, 63 | "non-zero": { 64 | "params": [ "50px" ], 65 | "expect": "50px" 66 | }, 67 | "non-zero decimal": { 68 | "params": [ "50.0px" ], 69 | "expect": "50.0px" 70 | }, 71 | "keep": { 72 | "params": [ "1pt" ], 73 | "expect": "1pt" 74 | } 75 | }, 76 | 77 | // Zero Removal 78 | "zeroes": { 79 | "0.8px": { 80 | "params": [ "0.8px" ], 81 | "expect": ".8px" 82 | }, 83 | "-0.5px": { 84 | "params": [ "-0.5px" ], 85 | "expect": "-.5px" 86 | }, 87 | "+0.5px": { 88 | "params": [ "+0.5px" ], 89 | "expect": ".5px" 90 | }, 91 | "0.2983%": { 92 | "params": [ "0.2983%" ], 93 | "expect": ".2983%" 94 | }, 95 | "-10.5px": { 96 | "params": [ "-10.5px" ], 97 | "expect": "-10.5px" 98 | }, 99 | "10.2983%": { 100 | "params": [ "10.2983%" ], 101 | "expect": "10.2983%" 102 | } 103 | }, 104 | 105 | // Main numeric handler, just checking that it handles 106 | // all of the above scenarios 107 | "numeric": { 108 | "0.8px": { 109 | "params": [ "0.8px" ], 110 | "expect": ".8px" 111 | }, 112 | "0 pixel": { 113 | "params": [ "0px" ], 114 | "expect": "0" 115 | }, 116 | "decimal removal": { 117 | "params": [ "1.0em" ], 118 | "expect": "1em" 119 | }, 120 | "Nothing": { 121 | "params": [ "1pt" ], 122 | "expect": "1pt" 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /unit/sandbox/Organize.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Organize 7 | */ 8 | { 9 | // Selector based combination 10 | "reduceSelectors": { 11 | "_special": "both", 12 | "selectors": { 13 | "params": [ 14 | "#id div.class", 15 | "#secondary .oops", 16 | "#today p.boss", 17 | "#id div.class", 18 | "#today p.boss", 19 | "#id div.class", 20 | "#id div.class", 21 | "#secondary .oops" 22 | ], 23 | "expect": [ 24 | "#id div.class", 25 | "#secondary .oops", 26 | "#today p.boss" 27 | ] 28 | }, 29 | "details": { 30 | "params": [ 31 | "test1;", 32 | "test2;", 33 | "test3;", 34 | "test4;", 35 | "test5;", 36 | "test6;", 37 | "test7;", 38 | "test8;" 39 | ], 40 | "expect": [ 41 | "test1;test4;test6;test7;", 42 | "test2;test8;", 43 | "test3;test5;" 44 | ] 45 | } 46 | }, 47 | 48 | // Detail based combination 49 | "reduceDetails": { 50 | "_special": "both", 51 | "selectors": { 52 | "params": [ 53 | "#id div.class", 54 | "#secondary .oops", 55 | "#today p.boss", 56 | "#id div.class", 57 | "#today p.boss", 58 | "#id div.class", 59 | "#id div.class", 60 | "#secondary .oops" 61 | ], 62 | "expect": [ 63 | "#id div.class,#today p.boss,#id div.class", 64 | "#secondary .oops,#id div.class", 65 | "#id div.class", 66 | "#today p.boss,#secondary .oops" 67 | ] 68 | }, 69 | "details": { 70 | "params": [ 71 | "color:red;font-size:12pt;font-weight:bold;", 72 | "margin-left:10px;margin-top:20px;", 73 | "font-size:12pt;font-weight:bold;color:red;", 74 | "background:white;", 75 | "border:1px solid black;border-radius:20px;", 76 | "margin-top:20px;margin-left:10px;", 77 | "font-weight:bold;color:red;font-size:12pt;", 78 | "border-radius:20px;border:1px solid black;" 79 | ], 80 | "expect": [ 81 | "color:red;font-size:12pt;font-weight:bold;", 82 | "margin-left:10px;margin-top:20px;", 83 | "background:white;", 84 | "border:1px solid black;border-radius:20px;" 85 | ] 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /unit/sandbox/Setup.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Setup 7 | */ 8 | { 9 | // Convert urls into strings in single line at rules 10 | "liner": { 11 | "simple": { 12 | "params": [ "@import url(styles.css)" ], 13 | "expect": "@import 'styles.css'" 14 | }, 15 | "escaped quote": { 16 | "params": [ "@import url(styles.css?quote=\\'yes\\')" ], 17 | "expect": "@import \"styles.css?quote=\\'yes\\'\"" 18 | }, 19 | "full url": { 20 | "params": [ "@import url(http://www.example.com/styles.css?semi=yes;"e=\\'yes\\'&email=corey\\@codenothing.com)" ], 21 | "expect": "@import \"http://www.example.com/styles.css?semi=yes;"e=\\'yes\\'&email=corey\\@codenothing.com\"" 22 | }, 23 | "do nothing": { 24 | "params": [ "@import 'donothing.css'" ], 25 | "expect": "@import 'donothing.css'" 26 | } 27 | }, 28 | 29 | // Run rule sets through individual compressions 30 | "details": { 31 | "simple": { 32 | "params": [ "color:#FF0000;font-size:12.0px;" ], 33 | "expect": "color:red;font-size:12px;" 34 | }, 35 | "semicolon": { 36 | "params": [ "color:#FF0000;background:url(myimage.png?semi=yes\\;);font-size:12.0px;" ], 37 | "expect": "color:red;background:url(myimage.png?semi=yes\\;);font-size:12px;" 38 | }, 39 | "empty": { 40 | "params": [ "" ], 41 | "expect": "" 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /unit/sandbox/Trim.json: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS Compressor [VERSION] 3 | * [DATE] 4 | * Corey Hart @ http://www.codenothing.com 5 | * 6 | * @class Trim 7 | */ 8 | { 9 | // Stripping comments out from stylesheet 10 | "comments": { 11 | "basic": { 12 | "params": [ 13 | "te/*abc*/st" 14 | ], 15 | "expect": "test" 16 | }, 17 | "escaped": { 18 | "params": [ 19 | "te/*abc*\\/def*/st" 20 | ], 21 | "expect": "test" 22 | }, 23 | "in a string": { 24 | "params": [ 25 | "t\"/*e\"/*ab\"c*\\/def*/st" 26 | ], 27 | "expect": "t\"/*e\"st" 28 | }, 29 | "ignore": { 30 | "params": [ "#red { content: blue; }" ], 31 | "expect": "#red { content: blue; }" 32 | } 33 | }, 34 | 35 | // Trimming down the stylesheet, removing all whitespace possible 36 | "strip": { 37 | "simple": { 38 | "paramjoin": "\n\t", 39 | "params": [ 40 | "\n\n\n\n\t\t\n", 41 | "\n\t\t\t\t\t#red > div.today + b.old, body.broken, #wtf {\n\n", 42 | "\t\n\tbackground: URL(\"someimg.jpg\");;;;\n\n\n", 43 | "\t\n\tbackground: url('someimg.jpg');;;;\n\n\n", 44 | "\t\n\tbackground: URL(someimg.jpg);;;;\n\n\n", 45 | "\t\tborder: 1px solid red;;;;;\n\t\n\t", 46 | "\tcolor: white !important;;;;;\n\t\n", 47 | "}\n\n\n" 48 | ], 49 | "expect": [ 50 | "#red>div.today+b.old,body.broken,#wtf{", 51 | "background: url(someimg.jpg);", 52 | "background: url(someimg.jpg);", 53 | "background: url(someimg.jpg);", 54 | "border: 1px solid red;", 55 | "color: white!important;", 56 | "}" 57 | ] 58 | } 59 | }, 60 | 61 | // Escaping special characters 62 | "escape": { 63 | // Single property with URL 64 | "single": { 65 | "params": [ "#one{background:url(http://www.example1.com?a=semi;);}" ], 66 | "expect": "#one{background:url(http\\:\\/\\/www\\.example1\\.com?a\\=semi\\;);}" 67 | }, 68 | 69 | // Many properties with URL 70 | "many": { 71 | "paramjoin": "", 72 | "params": [ 73 | "#one{background:url(http://www.example1.com?a=semi;);}", 74 | "#two{background:url(http://www.example2.com?a=semi;);}", 75 | "#three{background:url(http://www.example3.com?a=semi;);}", 76 | "#four{background:url(http://www.example4.com?a=semi;);}" 77 | ], 78 | "expect": [ 79 | "#one{background:url(http\\:\\/\\/www\\.example1\\.com?a\\=semi\\;);}", 80 | "#two{background:url(http\\:\\/\\/www\\.example2\\.com?a\\=semi\\;);}", 81 | "#three{background:url(http\\:\\/\\/www\\.example3\\.com?a\\=semi\\;);}", 82 | "#four{background:url(http\\:\\/\\/www\\.example4\\.com?a\\=semi\\;);}" 83 | ] 84 | } 85 | }, 86 | 87 | // Combines all of the above methods 88 | "trim": { 89 | "combined": { 90 | "paramjoin": "\n\t", 91 | "params": [ 92 | "\n\n\n\n\t\t\n", 93 | "\n\t\t\t\t\t#red > div.today + b.old, body.broken, #wtf {\n\n", 94 | "\t\n\tbackground: url(\"http://www.example1.com?a=semi;\");;;;\n\n\n", 95 | "\t\tborder: 1px solid red;;;;;\n\t\n\t", 96 | "\tcolor: white !important;;;;;\n\t\n", 97 | "\n\t}\n\n\n", 98 | "#next \t\t {\n", 99 | "\t\n\tbackground: url(\"http://www.example2.com?a=semi;\");;;;\n\n\n", 100 | "\n}\n\n" 101 | ], 102 | "expect": [ 103 | "#red>div.today+b.old,body.broken,#wtf{", 104 | "background: url(http\\:\\/\\/www\\.example1\\.com?a\\=semi\\;);", 105 | "border: 1px solid red;", 106 | "color: white!important;", 107 | "}", 108 | "#next{", 109 | "background: url(http\\:\\/\\/www\\.example2\\.com?a\\=semi\\;);", 110 | "}" 111 | ] 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /unit/sheets/README.md: -------------------------------------------------------------------------------- 1 | These sheets were initially provided by [yui](http://github.com/yui/yuicompressor/tree/master/tests/) test suit. 2 | They have since been modified, and added to, to fit CSS Compressor. 3 | -------------------------------------------------------------------------------- /unit/sheets/expected/border-none.css: -------------------------------------------------------------------------------- 1 | a{border:0}b{background:0}s{border-top:0} -------------------------------------------------------------------------------- /unit/sheets/expected/border-radius.css: -------------------------------------------------------------------------------- 1 | #simple { 2 | border-radius: 4px; 3 | -webkit-border-radius: 4px; 4 | -moz-border-radius: 4px 5 | } 6 | 7 | #a1 { 8 | border-radius: 5px 9 | } 10 | 11 | #a2 { 12 | -moz-border-radius: -.5px -25px 13 | } 14 | 15 | #a3 { 16 | -webkit-border-radius: 10px 5px 8px 17 | } 18 | 19 | #a4 { 20 | border-radius: 5px 6px 7px 8px 21 | } 22 | 23 | #b1 { 24 | border-radius: 10px 25 | } 26 | 27 | #b2 { 28 | -moz-border-radius: 5px 10px/6px 29 | } 30 | 31 | #b2 { 32 | -webkit-border-radius: 5px 10px 8px/6px 8px 33 | } 34 | 35 | #b4 { 36 | border-radius: 7px 5px 5px 37 | } 38 | 39 | #b5 { 40 | border-radius: 5px 6px 7px 8px 41 | } 42 | -------------------------------------------------------------------------------- /unit/sheets/expected/box-model.css: -------------------------------------------------------------------------------- 1 | #elem{width:100px;voice-family:"\"}\"";voice-family:inherit;width:200px}html>body #elem{width:200px} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/charset-media.css: -------------------------------------------------------------------------------- 1 | @charset 'utf-8';@media all{body{background:gold}} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/class.css: -------------------------------------------------------------------------------- 1 | div.testing.classnames p{color:red}div[class=dont.change] p.one.two.three a{color:red} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/color.css: -------------------------------------------------------------------------------- 1 | .color{me:#7b7b7b;impressed:#fed;background:none repeat scroll 0 0 red;alpha:rgba(1,2,3,4)} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/comment-ie5-mac.css: -------------------------------------------------------------------------------- 1 | body{font-size:5pt} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/concat-charset.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8";@charset "another one";#foo{border-width:1px}#bar{border-width:10px} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/decimals.css: -------------------------------------------------------------------------------- 1 | ::selection{margin:.6px .333pt 1.2em 8.8cm} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/empty-selector.css: -------------------------------------------------------------------------------- 1 | a[href$='/test/'] span:first-child{b:1} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/escapables.css: -------------------------------------------------------------------------------- 1 | #one{background:transparent url(http://www.example.com/someimage1.png?add=semi;) no-repeat top center}#two{background:transparent url(http://www.example.com/someimage2.png?add=semi;) no-repeat top center}#three{background:transparent url(http://www.example.com/someimage3.png?add=semi;) no-repeat top center} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/font-face.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:'gzipper';src:url(yanone.eot);src:local('gzipper'),url(yanone.ttf) format('truetype')}@font-face{font-family:'Graublau Web';src:url(GraublauWeb.eot);src:local('☺'),url(GraublauWeb.otf) format('opentype')} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/id.css: -------------------------------------------------------------------------------- 1 | div#testing p{color:red}div[id='no combine'] p{color:red} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/intros.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | @import "stuff.css"; 3 | @import 'crazyurl.css?semi=yes;&email=corey@codenothing.com'; 4 | @import 'stuff.css'; 5 | @import 'stuff.css' print,handheld; 6 | @import 'stuff.css' screen and (color); 7 | @import "stuff.css" screen and (color),projection and (min-color: 256); 8 | @namespace svg "http://www.w3.org/2000/svg"; 9 | @namespace svg 'http://www.w3.org/2000/svg'; 10 | @namespace "http://example.org"; 11 | @namespace empty ""; 12 | @namespace ""; 13 | @somefuturehack "testing.spec"; 14 | @keyframes 'diagonal-slide' { 15 | from { 16 | left: 0; 17 | top: 0 18 | } 19 | 20 | to { 21 | left: 100px; 22 | top: 100px 23 | } 24 | } 25 | 26 | @-webkit-keyframes pulse { 27 | 0% { 28 | background: red; 29 | opacity: 1.0; 30 | -webkit-transform: scale(1.0) rotate(0deg) 31 | } 32 | 33 | 33% { 34 | background: blue; 35 | opacity: .75; 36 | -webkit-transform: scale(1.1) rotate(-5deg) 37 | } 38 | 39 | 67% { 40 | background: green; 41 | opacity: .5; 42 | -webkit-transform: scale(1.1) rotate(5deg) 43 | } 44 | 45 | 100% { 46 | background: red; 47 | opacity: 1.0; 48 | -webkit-transform: scale(1.0) rotate(0deg) 49 | } 50 | } 51 | 52 | @media screen { 53 | margin: 20px 54 | } 55 | 56 | @media print and (color),projection and (device-aspect-ratio: 16/9) { 57 | @page :left { 58 | @bottom-left-corner { 59 | margin: 2cm 60 | } 61 | } 62 | } 63 | 64 | @media only screen and (max-device-width: 480px) { 65 | #bigbanner { 66 | display: none 67 | } 68 | } 69 | 70 | #mydiv { 71 | color: red 72 | } 73 | 74 | @media print { 75 | margin: 1cm; 76 | @page mine :left { 77 | @bottom-left-corner { 78 | margin: 2cm 79 | } 80 | } 81 | } 82 | 83 | @page { 84 | size: A4 landscape 85 | } 86 | -------------------------------------------------------------------------------- /unit/sheets/expected/media-empty-class.css: -------------------------------------------------------------------------------- 1 | @import "another.css";@media print{.noprint{display:none}}@media screen{.printonly{display:none}} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/media-multi.css: -------------------------------------------------------------------------------- 1 | @media only all and (max-width:50em),only all and (max-device-width:800px),only all and (max-width:780px){body{some-css:here}} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/media-test.css: -------------------------------------------------------------------------------- 1 | @media screen and (-webkit-min-device-pixel-ratio:0){body{some-css:here}} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/opacity-filter.css: -------------------------------------------------------------------------------- 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)} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/pit.css: -------------------------------------------------------------------------------- 1 | @charset 'utf-8'; 2 | @import 'import4.css' tv,print; 3 | @import 'yesterday.css'; 4 | @import 'today.css'; 5 | @media all { 6 | * html div { 7 | color: #000; 8 | font-size: 12pt 9 | } 10 | 11 | div > p.example { 12 | font-size: 15px!important 13 | } 14 | 15 | h1, h2, h3 > a { 16 | font-size: 25.3pt 17 | } 18 | } 19 | 20 | body > div[title='spacing test\'s'] + a[href$='nospace'] :first-child { 21 | color: #000; 22 | background: #fff url(http://www.example.com/body-bg.png?a=semi;); 23 | margin: 0 auto; 24 | padding: 10px .001px 25 | } 26 | 27 | p, a:hover, p:hover { 28 | font: small-caps 700 12px/-1pt gerogia,serif; 29 | text-align: justify; 30 | color: red; 31 | background: #ac54bd 32 | } 33 | 34 | pre, code, div.code { 35 | color: red 36 | } 37 | 38 | div.same { 39 | color: red!important; 40 | font-size: 15.2%; 41 | margin: 20px; 42 | background: red; 43 | content: 0!important 44 | } 45 | -------------------------------------------------------------------------------- /unit/sheets/expected/preserve-newline.css: -------------------------------------------------------------------------------- 1 | #sel-o{content:"on\"ce upon \ 2 | a time";content:'once upon \ 3 | a ti\'me'} 4 | -------------------------------------------------------------------------------- /unit/sheets/expected/preserve-strings.css: -------------------------------------------------------------------------------- 1 | .sele{content:"\"keep \" me";something:'\\\' . . ';else:'empty{}';content:"/* test */"} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/pseudo-first.css: -------------------------------------------------------------------------------- 1 | p:first-letter {buh:hum}p:first-line {baa:1}p:first-line ,a,p:first-letter ,b{color:red} -------------------------------------------------------------------------------- /unit/sheets/expected/pseudo.css: -------------------------------------------------------------------------------- 1 | p :first-line {ba:zinga;foo:bar} 2 | -------------------------------------------------------------------------------- /unit/sheets/expected/star-underscore-hacks.css: -------------------------------------------------------------------------------- 1 | #elementarr{width:1px;*width:3pt;_width:2em} -------------------------------------------------------------------------------- /unit/sheets/expected/webkit-transform.css: -------------------------------------------------------------------------------- 1 | c{-webkit-transform-origin:0 0}d{-moz-transform-origin:0 0} -------------------------------------------------------------------------------- /unit/sheets/expected/zeros.css: -------------------------------------------------------------------------------- 1 | a{margin:0;_padding-top:0;background-position:0 0;padding:0} -------------------------------------------------------------------------------- /unit/sheets/original/border-none.css: -------------------------------------------------------------------------------- 1 | a { 2 | border: none; 3 | } 4 | b {BACKGROUND:none} 5 | s {border-top: none;} -------------------------------------------------------------------------------- /unit/sheets/original/border-radius.css: -------------------------------------------------------------------------------- 1 | /* Multiple Defn's */ 2 | #simple { 3 | border-radius: 4px; 4 | -webkit-border-radius: 4px; 5 | -moz-border-radius: 4px; 6 | } 7 | 8 | /* Numeric Testing and Individual Combinations */ 9 | #a1 { 10 | border-radius: 5px 5.0px 5px 5.00px; 11 | } 12 | 13 | #a2 { 14 | -moz-border-radius: -0.5px -25px -.5px -25.00px; 15 | } 16 | 17 | #a3 { 18 | -webkit-border-radius: 10px 5px 8px 5px; 19 | } 20 | 21 | #a4 { 22 | border-radius: 5px 6px 7px 8px; 23 | } 24 | 25 | /* Combinations */ 26 | #b1 { 27 | border-top-left-radius: 10px; 28 | border-top-right-radius: 10px; 29 | border-bottom-right-radius: 10px; 30 | border-bottom-left-radius: 10px; 31 | } 32 | 33 | #b2 { 34 | -moz-border-radius-topleft: 5px 6px; 35 | -moz-border-radius-topright: 10px 6px; 36 | -moz-border-radius-bottomright: 5px 6px; 37 | -moz-border-radius-bottomleft: 10px 6px; 38 | } 39 | 40 | #b2 { 41 | -webkit-border-top-left-radius: 5px 6px; 42 | -webkit-border-top-right-radius: 10px 8px; 43 | -webkit-border-bottom-right-radius: 8px 6px; 44 | -webkit-border-bottom-left-radius: 10px 8px; 45 | } 46 | 47 | #b4 { 48 | border-radius: 5px; 49 | border-top-left-radius: 7px; 50 | } 51 | 52 | #b5 { 53 | border-top-left-radius: 5px; 54 | border-top-right-radius: 6px; 55 | border-bottom-right-radius: 7px; 56 | border-bottom-left-radius: 8px; 57 | } 58 | -------------------------------------------------------------------------------- /unit/sheets/original/box-model.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Thanks to yuicompressor for this test case: http://developer.yahoo.com/yui/compressor/css.html 4 | 5 | */ 6 | #elem { 7 | width: 100px; /* IE */ 8 | voice-family: "\"}\""; 9 | voice-family:inherit; 10 | width: 200px; /* others */ 11 | } 12 | 13 | html > body #elem { 14 | width: 200px; /* others */ 15 | } 16 | -------------------------------------------------------------------------------- /unit/sheets/original/charset-media.css: -------------------------------------------------------------------------------- 1 | /* re: 2495387 */ 2 | @charset 'utf-8'; 3 | @media all { 4 | body { 5 | } 6 | body { 7 | background-color: gold; 8 | } 9 | } -------------------------------------------------------------------------------- /unit/sheets/original/class.css: -------------------------------------------------------------------------------- 1 | div[class="testing classnames"] p { 2 | color: red; 3 | } 4 | 5 | div[class="dont.change"] p[class='one two three'] a { 6 | color: red; 7 | } 8 | -------------------------------------------------------------------------------- /unit/sheets/original/color.css: -------------------------------------------------------------------------------- 1 | .color { 2 | me: rgb(123, 123, 123); 3 | impressed: #ffeedd; 4 | background: none repeat scroll 0 0 rgb(255, 0,0); 5 | alpha: rgba(1, 2, 3, 4); 6 | } 7 | -------------------------------------------------------------------------------- /unit/sheets/original/comment-ie5-mac.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: 12pt; 3 | /* ie5 mac comment hack \*/ 4 | font-size: 5pt; 5 | } 6 | -------------------------------------------------------------------------------- /unit/sheets/original/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 | } -------------------------------------------------------------------------------- /unit/sheets/original/decimals.css: -------------------------------------------------------------------------------- 1 | ::selection { 2 | margin: 0.6px 0.333pt 1.2em 8.8cm; 3 | } 4 | -------------------------------------------------------------------------------- /unit/sheets/original/empty-selector.css: -------------------------------------------------------------------------------- 1 | a[href$="/test/"] span:first-child { b:1; } 2 | a[href$="/test/"] span:first-child { } 3 | -------------------------------------------------------------------------------- /unit/sheets/original/escapables.css: -------------------------------------------------------------------------------- 1 | #one { 2 | background: transparent url(http://www.example.com/someimage1.png?add=semi;) no-repeat top center; 3 | } 4 | #two { 5 | background: transparent url(http://www.example.com/someimage2.png?add=semi;) no-repeat top center; 6 | } 7 | #three { 8 | background: transparent url(http://www.example.com/someimage3.png?add=semi;) no-repeat top center; 9 | } 10 | -------------------------------------------------------------------------------- /unit/sheets/original/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 | 8 | /* Thank you Paul Irish - http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/ */ 9 | @font-face { 10 | font-family: 'Graublau Web'; 11 | src: url('GraublauWeb.eot'); 12 | src: local('☺'), 13 | url('GraublauWeb.otf') format('opentype'); 14 | } 15 | -------------------------------------------------------------------------------- /unit/sheets/original/id.css: -------------------------------------------------------------------------------- 1 | div[id=testing] p { color:red; } 2 | div[id="no combine"] p { color:red; } 3 | -------------------------------------------------------------------------------- /unit/sheets/original/intros.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | A good portion of this test file was takin directly from http://www.phpied.com/css-railroad-diagrams/, 4 | and keyframe chunk from http://webkit.org/blog/324/css-animation-2/ 5 | 6 | */ 7 | @charset "UTF-8"; 8 | 9 | @import "stuff.css"; 10 | @import url("crazyurl.css?semi=yes;&email=corey@codenothing.com"); 11 | @import url(stuff.css); 12 | @import url(stuff.css) print, handheld; 13 | @import url(stuff.css) screen and (color); 14 | @import "stuff.css" screen and (color), projection and (min-color: 256); 15 | 16 | @namespace svg "http://www.w3.org/2000/svg"; 17 | @namespace svg url(http://www.w3.org/2000/svg); 18 | @namespace "http://example.org"; 19 | @namespace empty ""; 20 | @namespace ""; 21 | 22 | @somefuturehack "testing.spec"; 23 | 24 | @keyframes 'diagonal-slide' { 25 | from { 26 | left: 0; 27 | top: 0; 28 | } 29 | to { 30 | left: 100px; 31 | top: 100px; 32 | } 33 | } 34 | 35 | @-webkit-keyframes pulse { 36 | 0% { 37 | background-color: red; 38 | opacity: 1.0; 39 | -webkit-transform: scale(1.0) rotate(0deg); 40 | } 41 | 33% { 42 | background-color: blue; 43 | opacity: 0.75; 44 | -webkit-transform: scale(1.1) rotate(-5deg); 45 | } 46 | 67% { 47 | background-color: green; 48 | opacity: 0.5; 49 | -webkit-transform: scale(1.1) rotate(5deg); 50 | } 51 | 100% { 52 | background-color: red; 53 | opacity: 1.0; 54 | -webkit-transform: scale(1.0) rotate(0deg); 55 | } 56 | } 57 | 58 | @media screen { 59 | margin: 20px; 60 | } 61 | 62 | @media print and (color), projection and (device-aspect-ratio: 16/9) { 63 | @page :left { 64 | @bottom-left-corner { 65 | margin: 2cm; 66 | } 67 | } 68 | } 69 | 70 | @media only screen and (max-device-width: 480px) { 71 | #bigbanner { 72 | display: none; 73 | } 74 | } 75 | 76 | #mydiv { 77 | color: red; 78 | } 79 | 80 | @media print { 81 | @page mine :left { 82 | margin: 1cm; 83 | @bottom-left-corner { 84 | margin: 2cm; 85 | } 86 | } 87 | } 88 | 89 | @page { 90 | size: A4 landscape; 91 | } 92 | -------------------------------------------------------------------------------- /unit/sheets/original/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 | } -------------------------------------------------------------------------------- /unit/sheets/original/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 | body { 3 | some-css : here 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /unit/sheets/original/media-test.css: -------------------------------------------------------------------------------- 1 | @media screen and (-webkit-min-device-pixel-ratio:0) { 2 | body { 3 | some-css : here 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /unit/sheets/original/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 | } -------------------------------------------------------------------------------- /unit/sheets/original/pit.css: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | This is just a cluster of various templates that can be compressed 4 | 5 | **/ 6 | 7 | /* Some imports and charset */ 8 | @charset 'utf-8'; 9 | @import url("import4.css") tv, print; 10 | @import url("yesterday.css"); 11 | @import url("today.css"); 12 | 13 | /* Get some media action in there */ 14 | @media all { 15 | * html div { 16 | color: black; 17 | font-size: 12pt; 18 | } 19 | 20 | div > p.example { 21 | font-size: 15.0px !important; 22 | } 23 | 24 | h1, h2, h3 > a { 25 | font-size: 25.3pt; 26 | } 27 | } 28 | 29 | /* basic elements */ 30 | body > div[title='spacing test\'s'] + a[href$='nospace'] :first-child { 31 | color: black; 32 | background-color: white; 33 | background-image: url(http://www.example.com/body-bg.png?a=semi;); 34 | margin-top: 0px; 35 | margin-bottom: 0px; 36 | margin-left: auto; 37 | margin-right: auto; 38 | padding: 10.0px 0.001px 010.0px 0.001px; 39 | } 40 | 41 | p, a:hover, p:hover { 42 | font-family: gerogia, serif; 43 | font-size: 12.0px; 44 | line-height: -1pt; 45 | font-weight: bold; 46 | font-variant: small-caps; 47 | text-align: justify; 48 | color: #FF0000; 49 | background: #AC54BD; 50 | } 51 | 52 | pre { 53 | color: red; 54 | } 55 | 56 | code { 57 | color: red; 58 | } 59 | 60 | div.code { 61 | color: red; 62 | } 63 | 64 | div.same { 65 | color: #FF0000 !important; 66 | font-size: 15.2%; 67 | } 68 | 69 | div.same { 70 | margin: 20.0px 20px; 71 | background: red; 72 | content: 0px !important; 73 | } 74 | -------------------------------------------------------------------------------- /unit/sheets/original/preserve-newline.css: -------------------------------------------------------------------------------- 1 | #sel-o { 2 | content: "on\"ce upon \ 3 | a time"; 4 | content: 'once upon \ 5 | a ti\'me'; 6 | } 7 | -------------------------------------------------------------------------------- /unit/sheets/original/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 | } 8 | -------------------------------------------------------------------------------- /unit/sheets/original/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 | } -------------------------------------------------------------------------------- /unit/sheets/original/pseudo.css: -------------------------------------------------------------------------------- 1 | p :first-line { 2 | ba:zinga;;; 3 | foo: bar;;; 4 | } 5 | -------------------------------------------------------------------------------- /unit/sheets/original/star-underscore-hacks.css: -------------------------------------------------------------------------------- 1 | #elementarr { 2 | width: 1px; 3 | *width: 3pt; 4 | _width: 2em; 5 | } -------------------------------------------------------------------------------- /unit/sheets/original/webkit-transform.css: -------------------------------------------------------------------------------- 1 | c {-webkit-transform-origin: 0 0;} 2 | d {-MOZ-TRANSFORM-ORIGIN: 0 0 } -------------------------------------------------------------------------------- /unit/sheets/original/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 | } 7 | -------------------------------------------------------------------------------- /unit/src/Color.php: -------------------------------------------------------------------------------- 1 | 31, 18 | 'green' => 32, 19 | 'yellow' => 33, 20 | 'blue' => 34, 21 | 'gray' => 37, 22 | ); 23 | 24 | // Main wrapping function 25 | public static function wrap( $color = 'red', $bold = false, $msg = 'Invalid Message' ) { 26 | return "\x1B[" . ( $bold ? '1' : '0' ) . ";" . self::$colors[ $color ] . "m" . $msg . "\x1B[0m"; 27 | } 28 | 29 | // Main utility functions ( red, gree, yellow, blue, gray ) 30 | public static function red( $msg ) { 31 | return self::wrap( 'red', false, $msg ); 32 | } 33 | 34 | public static function green( $msg ) { 35 | return self::wrap( 'green', false, $msg ); 36 | } 37 | 38 | public static function yellow( $msg ) { 39 | return self::wrap( 'yellow', false, $msg ); 40 | } 41 | 42 | public static function blue( $msg ) { 43 | return self::wrap( 'blue', false, $msg ); 44 | } 45 | 46 | public static function gray( $msg ) { 47 | return self::wrap( 'gray', false, $msg ); 48 | } 49 | 50 | 51 | // Bold versions of utitlity functions minus gray 52 | public static function boldred( $msg ) { 53 | return self::wrap( 'red', true, $msg ); 54 | } 55 | 56 | public static function boldgreen( $msg ) { 57 | return self::wrap( 'green', true, $msg ); 58 | } 59 | 60 | public static function boldyellow( $msg ) { 61 | return self::wrap( 'yellow', true, $msg ); 62 | } 63 | 64 | public static function boldblue( $msg ) { 65 | return self::wrap( 'blue', true, $msg ); 66 | } 67 | }; 68 | 69 | ?> 70 | -------------------------------------------------------------------------------- /unit/src/Core.php: -------------------------------------------------------------------------------- 1 | block = $block; 42 | $this->specials = $specials; 43 | 44 | // Common compression instance 45 | $this->compressor = new CSSCompression(); 46 | 47 | // Root unit directory 48 | $this->root = realpath( dirname( __FILE__ ) . '/../' ) . '/' ; 49 | 50 | // Clean out any lingering errors 51 | $this->clean( $this->root . 'errors/' ); 52 | 53 | // Construct up the tree 54 | parent::__construct(); 55 | 56 | // Run focused tests first, then sheet tests 57 | $this->reset(); 58 | $this->sandbox(); 59 | $this->sheets(); 60 | } 61 | 62 | /** 63 | * Removes all files in a directory (NOT RECURSIVE) 64 | * 65 | * @param (string) dir: Full directory path 66 | */ 67 | private function clean( $dir ) { 68 | if ( ! is_dir( $dir ) ) { 69 | return mkdir( $dir ); 70 | } 71 | 72 | $handle = opendir( $dir ); 73 | while ( ( $file = readdir( $handle ) ) !== false ) { 74 | if ( $file != '.' && $file != '..' && is_file( $dir . $file ) && strpos( $file, 'README' ) === false ) { 75 | unlink( $dir . $file ); 76 | } 77 | } 78 | } 79 | 80 | /** 81 | * Turns all options to true 82 | * 83 | * @params none 84 | */ 85 | protected function reset(){ 86 | $options = $this->compressor->option(); 87 | foreach ( $options as $key => $value ) { 88 | $this->compressor->option( $key, true ); 89 | } 90 | $this->compressor->option( 'readability', CSSCompression::READ_NONE ); 91 | } 92 | 93 | /** 94 | * Outputs result onto table 95 | * 96 | * @param (string) method: CSSC Method 97 | * @param (string) entry: Entry of test array 98 | * @param (boolean) result: Result of test matching 99 | */ 100 | protected function mark( $method, $entry, $result ) { 101 | if ( $result ) { 102 | $this->passes++; 103 | echo Color::green( "Passed: ${method}[$entry]" ) . "\r\n"; 104 | } 105 | else{ 106 | $this->errors++; 107 | $this->errorstack .= Color::red( "Failed: ${method}[$entry]" ) . "\r\n"; 108 | echo Color::red( "Failed: ${method}[$entry]" ) . "\r\n"; 109 | } 110 | } 111 | 112 | /** 113 | * Destructor - Displays final errors 114 | * 115 | * @params none 116 | */ 117 | public function __destruct(){ 118 | // Add warnings before the last report 119 | if ( count( $this->block ) ) { 120 | echo "\r\n\r\n"; 121 | foreach ( $this->block as $file ) { 122 | echo Color::yellow( "Warning: $file is NOT being tested." ) . "\r\n"; 123 | } 124 | } 125 | 126 | // Final count 127 | if ( $this->errors > 0 ) { 128 | $final = Color::boldred( "Test Failed: " . $this->errors . " total errors. -- " ) . "\r\n" . $this->errorstack; 129 | $exit = 1; 130 | } 131 | else { 132 | $final = Color::boldgreen( "All " . $this->passes . " Tests Passed" ); 133 | $exit = 0; 134 | } 135 | 136 | // Output final and exit accordingly 137 | echo "\r\n\r\n$final\r\n\r\n"; 138 | exit( $exit ); 139 | } 140 | }; 141 | 142 | ?> 143 | -------------------------------------------------------------------------------- /unit/src/File.php: -------------------------------------------------------------------------------- 1 | arguments( $args ); 45 | $this->setup(); 46 | $this->clean( $this->root . 'errors/' ); 47 | $this->run(); 48 | $this->output(); 49 | } 50 | 51 | /** 52 | * Marges arguments into this instance 53 | * 54 | * @param (array) args: Array of arguments passed into the constructor 55 | */ 56 | private function arguments( $args = array() ) { 57 | $this->file = isset( $args['file'] ) ? $args['file'] : ''; 58 | $this->mode = isset( $args['mode'] ) ? $args['mode'] : ''; 59 | $this->options = isset( $args['options'] ) ? $args['options'] : ''; 60 | } 61 | 62 | /** 63 | * Initializes the compression instance and sets modes/options 64 | * 65 | * @params none 66 | */ 67 | private function setup(){ 68 | $this->instance = new CSSCompression(); 69 | $this->root = realpath( dirname( __FILE__ ) . '/../' ) . '/'; 70 | $this->original = $this->root . 'sheets/original/' . $this->file; 71 | $this->expected = $this->root . 'sheets/expected/' . $this->file; 72 | $this->result = $this->root . 'errors/' . $this->file; 73 | 74 | // Set mode if availiable 75 | if ( $this->mode ) { 76 | $this->instance->mode( $this->mode ); 77 | } 78 | 79 | // Set custom options if needed 80 | if ( $this->options ) { 81 | $this->instance->option( $this->options ); 82 | } 83 | } 84 | 85 | /** 86 | * Removes all files in a directory (NOT RECURSIVE) 87 | * 88 | * @param (string) dir: Full directory path 89 | */ 90 | private function clean( $dir ) { 91 | if ( ! is_dir( $dir ) ) { 92 | return mkdir( $dir ); 93 | } 94 | 95 | $handle = opendir( $dir ); 96 | while ( ( $file = readdir( $handle ) ) !== false ) { 97 | if ( $file != '.' && $file != '..' && strpos( $file, 'README' ) === false ) { 98 | unlink( $dir . $file ); 99 | } 100 | } 101 | } 102 | 103 | /** 104 | * Gets the contents of the test file (original & expected), and stores the compression result 105 | * 106 | * @params none 107 | */ 108 | private function run(){ 109 | $original = trim( file_get_contents( $this->original ) ); 110 | $expected = trim( file_get_contents( $this->expected ) ); 111 | $result = $this->instance->compress( $original ); 112 | $this->passed = ( $expected === $result ); 113 | 114 | // Store compression data 115 | file_put_contents( $this->result, $result ); 116 | } 117 | 118 | /** 119 | * Prints out meta data about the test, and the final result 120 | * 121 | * @params none 122 | */ 123 | private function output(){ 124 | // Print out meta data 125 | echo Color::blue( 'File: ' ) . $this->file . "\n"; 126 | echo Color::blue( 'Mode: ' ) . $this->mode . "\n"; 127 | echo Color::blue( 'Options: ' ) . print_r( $this->options, true ) . "\n"; 128 | echo Color::gray( '---------------------------------------' ) . "\n"; 129 | echo Color::blue( 'Original to Expected diff: ' ) . "\ndiff " . $this->original . ' ' . $this->expected . "\n"; 130 | echo Color::gray( '---------------------------------------' ) . "\n"; 131 | echo Color::blue( 'Expected to Actual diff: ' ) . "\ndiff " . $this->expected . ' ' . $this->result . "\n"; 132 | echo "\n\n"; 133 | 134 | if ( $this->passed ) { 135 | echo Color::boldgreen( "File Test Passed" ) . "\n\n"; 136 | exit( 0 ); 137 | } 138 | else { 139 | echo Color::boldred( "File Test Failed" ) . "\n\n"; 140 | exit( 1 ); 141 | } 142 | } 143 | }; 144 | 145 | ?> 146 | -------------------------------------------------------------------------------- /unit/src/Focus.php: -------------------------------------------------------------------------------- 1 | arguments( $args ); 42 | $this->setup(); 43 | $this->result = $this->instance->access( $this->class, $this->method, $this->params ); 44 | $this->output(); 45 | } 46 | 47 | /** 48 | * Marges arguments into this instance 49 | * 50 | * @param (array) args: Array of arguments passed into the constructor 51 | */ 52 | private function arguments( $args = array() ) { 53 | $this->class = isset( $args['class'] ) ? $args['class'] : ''; 54 | $this->method = isset( $args['method'] ) ? $args['method'] : ''; 55 | $this->mode = isset( $args['mode'] ) ? $args['mode'] : ''; 56 | $this->options = isset( $args['options'] ) ? $args['options'] : array(); 57 | $this->params = isset( $args['params'] ) ? $args['params'] : array(); 58 | $this->expect = isset( $args['expect'] ) ? $args['expect'] : ''; 59 | } 60 | 61 | /** 62 | * Initializes the compression instance and sets modes/options 63 | * 64 | * @params none 65 | */ 66 | private function setup(){ 67 | $this->instance = new CSSCompression(); 68 | 69 | // Set mode if availiable 70 | if ( $this->mode ) { 71 | $this->instance->mode( $this->mode ); 72 | } 73 | 74 | // Set custom options if needed 75 | if ( $this->options ) { 76 | $this->instance->option( $this->options ); 77 | } 78 | } 79 | 80 | /** 81 | * Prints out meta data about the test, and the final result 82 | * 83 | * @params none 84 | */ 85 | private function output(){ 86 | // Printable copies of expected and actual results 87 | $expect = is_array( $this->expect ) ? print_r( $this->expect, true ) : $this->expect; 88 | $result = is_array( $this->result ) ? print_r( $this->result, true ) : $this->result; 89 | 90 | // Print out meta data 91 | echo Color::blue( 'Subclass: ' ) . $this->class . "\n"; 92 | echo Color::blue( 'Method: ' ) . $this->method . "\n"; 93 | echo Color::blue( 'Mode: ' ) . $this->mode . "\n"; 94 | echo Color::blue( 'Options: ' ) . print_r( $this->options, true ) . "\n"; 95 | echo Color::gray( '---------------------------------------' ) . "\n"; 96 | echo Color::blue( 'Parameters Sent: ' ) . "\n" . print_r( $this->params, true ) . "\n"; 97 | echo Color::gray( '---------------------------------------' ) . "\n"; 98 | echo Color::blue( 'Expected Result: ' ) . "\n$expect\n"; 99 | echo Color::gray( '---------------------------------------' ) . "\n"; 100 | echo Color::blue( 'Actual Result: ' ) . "\n$result\n"; 101 | echo "\n\n"; 102 | 103 | if ( $this->result === $this->expect ) { 104 | echo Color::boldgreen( "Focused Test Passed" ) . "\n\n"; 105 | exit( 0 ); 106 | } 107 | else { 108 | echo Color::boldred( "Focused Test Failed" ) . "\n\n"; 109 | exit( 1 ); 110 | } 111 | } 112 | }; 113 | 114 | ?> 115 | -------------------------------------------------------------------------------- /unit/start.php: -------------------------------------------------------------------------------- 1 | array( 32 | 'files' => array( 33 | 'pit.css', 34 | 'intros.css', 35 | ), 36 | 'mode' => NULL, 37 | 'options' => array( 38 | 'readability' => CSSCompression::READ_MAX, 39 | ), 40 | ), 41 | 'maxsane' => array( 42 | 'files' => array( 43 | 'border-radius.css', 44 | ), 45 | 'mode' => 'sane', 46 | 'options' => array( 47 | 'readability' => CSSCompression::READ_MAX, 48 | ), 49 | ), 50 | 'sane' => array( 51 | 'files' => array( 52 | 'id.css', 53 | 'class.css', 54 | ), 55 | 'mode' => 'sane', 56 | 'options' => array(), 57 | ), 58 | 'safe' => array( 59 | 'files' => array( 60 | 'box-model.css', 61 | 'preserve-strings.css', 62 | 'preserve-newline.css', 63 | 'font-face.css', 64 | ), 65 | 'mode' => 'safe', 66 | 'options' => array(), 67 | ), 68 | ); 69 | 70 | /** 71 | * Start the unit tests along with the blockers and specials 72 | * 73 | * @param (array) block: Files that are only temporarily blocked until fix is found 74 | * @param (array) specials: Special handling for certain sheets 75 | */ 76 | new CSScompression_Unit_Core( $block, $specials ); 77 | 78 | ?> 79 | --------------------------------------------------------------------------------