mirror of
https://github.com/mrclay/minify.git
synced 2025-09-08 05:00:46 +02:00
Compare commits
66 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
07e032a3f0 | ||
|
3a1f9f55cf | ||
|
59a466d6a6 | ||
|
6f5721d2db | ||
|
d67feea182 | ||
|
c95d6bac4e | ||
|
faec60fff6 | ||
|
35cddbf5eb | ||
|
416296ad6f | ||
|
2089caaf66 | ||
|
e228891304 | ||
|
3f0485e54f | ||
|
c1c375cb0e | ||
|
7a268d99df | ||
|
cb75a4fd30 | ||
|
db65f55738 | ||
|
04f5873e28 | ||
|
7ffdeef7ef | ||
|
f6d078785f | ||
|
8c54519b32 | ||
|
37ff25ef06 | ||
|
73ae2b74e2 | ||
|
04adfef406 | ||
|
2975b0f581 | ||
|
1daa72f57c | ||
|
437d3dcc15 | ||
|
1662208a10 | ||
|
828a3bd4f5 | ||
|
f9c0319049 | ||
|
a49a6a2f01 | ||
|
32abbfa328 | ||
|
f680ac83e7 | ||
|
a82d70b0ba | ||
|
7e08cff1f0 | ||
|
85a75541a3 | ||
|
3b2fd8dfd6 | ||
|
0d5e3295a3 | ||
|
248aff9b72 | ||
|
884977fde2 | ||
|
335800947b | ||
|
c196dd39df | ||
|
db00fa6eb0 | ||
|
41cb743d6c | ||
|
666cd6d89a | ||
|
8fdf3db564 | ||
|
91af676645 | ||
|
a2b6036430 | ||
|
dfdcdf874a | ||
|
d6621ec185 | ||
|
c51ca8ddca | ||
|
73dd77569e | ||
|
ff45c76484 | ||
|
a2bed51e2b | ||
|
9ccc1e98a7 | ||
|
9fa1463ab7 | ||
|
6eefd7a7ed | ||
|
9dba65a0e9 | ||
|
a703d325d5 | ||
|
b5807b8ad2 | ||
|
c3485ac5a5 | ||
|
45bea314d6 | ||
|
98f372d7da | ||
|
f40f4e4f56 | ||
|
2275d21146 | ||
|
acbcd84c14 | ||
|
5f2c5a4f2d |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -2,4 +2,6 @@
|
||||
# /
|
||||
/test
|
||||
/docs
|
||||
.idea/
|
||||
.idea/
|
||||
.DS_Store
|
||||
vendor
|
||||
|
12
HISTORY.txt
12
HISTORY.txt
@@ -1,5 +1,17 @@
|
||||
Minify Release History
|
||||
|
||||
Version 2.1.6
|
||||
* JSMin fixes
|
||||
* Prevents some Closure Compiler API failures
|
||||
* Uses autoloading for all class loading
|
||||
* Multiple group support in HTML Helper
|
||||
* Cache adaptor for XCache
|
||||
* Allow setting stack-size in YUI Compressor wrapper
|
||||
* Adds jsCleanComments option to HTML minifier
|
||||
* Upgrades CSSmin
|
||||
* CLI script more portable
|
||||
* Adds composer.json
|
||||
|
||||
Version 2.1.5
|
||||
* Removed XSS vulnerability
|
||||
* Disabled builder bby default
|
||||
|
16
README.txt
16
README.txt
@@ -21,19 +21,23 @@ INSTALLATION
|
||||
Place the /min/ directory as a child of your DOCUMENT_ROOT
|
||||
directory: i.e. you will have: /home/example/www/min
|
||||
|
||||
You can see verify that it is working by visiting these two URLs:
|
||||
http://example.org/min/?f=min/quick-test.js
|
||||
http://example.org/min/?f=min/quick-test.css
|
||||
|
||||
If your server supports mod_rewrite, this URL should also work:
|
||||
http://example.org/min/f=min/quick-test.js
|
||||
|
||||
CONFIGURATION & USAGE
|
||||
|
||||
See the MIN.txt file and http://code.google.com/p/minify/wiki/UserGuide
|
||||
|
||||
Minify also comes with a URI Builder application that can help you write URLs
|
||||
for use with Minify or configure groups of files.
|
||||
|
||||
To enable this, edit min/config.php, set $min_enableBuilder = true; and visit
|
||||
http://example.org/min/builder/
|
||||
|
||||
When you're finished with this, please set $min_enableBuilder = false;
|
||||
for use with Minify or configure groups of files. See here for details:
|
||||
http://code.google.com/p/minify/wiki/BuilderApp
|
||||
|
||||
The cookbook also provides some more advanced options for minification:
|
||||
http://code.google.com/p/minify/wiki/CookBook
|
||||
|
||||
UPGRADING
|
||||
|
||||
|
21
composer.json
Normal file
21
composer.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "mrclay/minify",
|
||||
"type": "library",
|
||||
"description": "Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers",
|
||||
"homepage": "http://code.google.com/p/minify/",
|
||||
"license": "BSD-3-Clause",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Stephen Clay",
|
||||
"email": "steve@mrclay.org",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.2.1",
|
||||
"ext-pcre": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": ["min/lib/"]
|
||||
}
|
||||
}
|
4
min/builder/.htaccess
Normal file
4
min/builder/.htaccess
Normal file
@@ -0,0 +1,4 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
|
||||
</IfModule>
|
@@ -71,7 +71,7 @@ var MUB = {
|
||||
return;
|
||||
var li = this;
|
||||
$('span', this).html('');
|
||||
var url = 'http://' + location.host + '/' +
|
||||
var url = location.protocol + '//' + location.host + '/' +
|
||||
$('input', this)[0].value.replace(/^\//, '');
|
||||
$.ajax({
|
||||
url : url,
|
||||
@@ -257,4 +257,4 @@ var MUB = {
|
||||
MUB.checkRewrite();
|
||||
}
|
||||
};
|
||||
$(MUB.init);
|
||||
$(MUB.init);
|
||||
|
@@ -24,26 +24,19 @@ if (0 === strpos($_SERVER["SERVER_SOFTWARE"], 'Apache/')
|
||||
|
||||
require dirname(__FILE__) . '/../config.php';
|
||||
|
||||
require "$min_libPath/Minify/Loader.php";
|
||||
Minify_Loader::register();
|
||||
|
||||
if (! $min_enableBuilder) {
|
||||
header('Location: /');
|
||||
exit();
|
||||
header('Content-Type: text/plain');
|
||||
die('This application is not enabled. See http://code.google.com/p/minify/wiki/BuilderApp');
|
||||
}
|
||||
|
||||
$setIncludeSuccess = set_include_path(dirname(__FILE__) . '/../lib' . PATH_SEPARATOR . get_include_path());
|
||||
// we do it this way because we want the builder to work after the user corrects
|
||||
// include_path. (set_include_path returning FALSE is OK).
|
||||
try {
|
||||
require_once 'Minify/Cache/File.php';
|
||||
} catch (Exception $e) {
|
||||
if (! $setIncludeSuccess) {
|
||||
echo "Minify: set_include_path() failed. You may need to set your include_path "
|
||||
."outside of PHP code, e.g., in php.ini.";
|
||||
} else {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
exit();
|
||||
if (isset($min_builderPassword)
|
||||
&& is_string($min_builderPassword)
|
||||
&& $min_builderPassword !== '') {
|
||||
DooDigestAuth::http_auth('Minify Builder', array('admin' => $min_builderPassword));
|
||||
}
|
||||
require 'Minify.php';
|
||||
|
||||
$cachePathCode = '';
|
||||
if (! isset($min_cachePath) && ! function_exists('sys_get_temp_dir')) {
|
||||
|
10
min/config-test.php
Normal file
10
min/config-test.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Additional configuration applied when the variable "test" is added to the querystring.
|
||||
*
|
||||
* To test config options, place them in this file and add "&test" to your Minify URL.
|
||||
* Note that if this is on a public server, anyone can execute your test.
|
||||
*
|
||||
* @package Minify
|
||||
*/
|
||||
|
@@ -9,8 +9,14 @@
|
||||
|
||||
/**
|
||||
* Allow use of the Minify URI Builder app. Only set this to true while you need it.
|
||||
**/
|
||||
$min_enableBuilder = true;
|
||||
*/
|
||||
$min_enableBuilder = false;
|
||||
|
||||
/**
|
||||
* If non-empty, the Builder will be protected with HTTP Digest auth.
|
||||
* The username is "admin".
|
||||
*/
|
||||
$min_builderPassword = 'admin';
|
||||
|
||||
|
||||
/**
|
||||
@@ -100,15 +106,10 @@ $min_serveOptions['maxAge'] = 1800;
|
||||
|
||||
|
||||
/**
|
||||
* To use Google's Closure Compiler API (falling back to JSMin on failure),
|
||||
* uncomment the following lines:
|
||||
* To use Google's Closure Compiler API to minify Javascript (falling back to JSMin
|
||||
* on failure), uncomment the following line:
|
||||
*/
|
||||
/*function closureCompiler($js) {
|
||||
require_once 'Minify/JS/ClosureCompiler.php';
|
||||
return Minify_JS_ClosureCompiler::minify($js);
|
||||
}
|
||||
$min_serveOptions['minifiers']['application/x-javascript'] = 'closureCompiler';
|
||||
//*/
|
||||
//$min_serveOptions['minifiers']['application/x-javascript'] = array('Minify_JS_ClosureCompiler', 'minify');
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -12,10 +12,12 @@ define('MINIFY_MIN_DIR', dirname(__FILE__));
|
||||
// load config
|
||||
require MINIFY_MIN_DIR . '/config.php';
|
||||
|
||||
// setup include path
|
||||
set_include_path($min_libPath . PATH_SEPARATOR . get_include_path());
|
||||
if (isset($_GET['test'])) {
|
||||
include MINIFY_MIN_DIR . '/config-test.php';
|
||||
}
|
||||
|
||||
require 'Minify.php';
|
||||
require "$min_libPath/Minify/Loader.php";
|
||||
Minify_Loader::register();
|
||||
|
||||
Minify::$uploaderHoursBehind = $min_uploaderHoursBehind;
|
||||
Minify::setCache(
|
||||
@@ -35,14 +37,11 @@ foreach ($min_symlinks as $uri => $target) {
|
||||
}
|
||||
|
||||
if ($min_allowDebugFlag) {
|
||||
require_once 'Minify/DebugDetector.php';
|
||||
$min_serveOptions['debug'] = Minify_DebugDetector::shouldDebugRequest($_COOKIE, $_GET, $_SERVER['REQUEST_URI']);
|
||||
}
|
||||
|
||||
if ($min_errorLogger) {
|
||||
require_once 'Minify/Logger.php';
|
||||
if (true === $min_errorLogger) {
|
||||
require_once 'FirePHP.php';
|
||||
$min_errorLogger = FirePHP::getInstance(true);
|
||||
}
|
||||
Minify_Logger::setLogger($min_errorLogger);
|
||||
@@ -60,7 +59,6 @@ if (isset($_GET['f']) || isset($_GET['g'])) {
|
||||
// serve!
|
||||
|
||||
if (! isset($min_serveController)) {
|
||||
require 'Minify/Controller/MinApp.php';
|
||||
$min_serveController = new Minify_Controller_MinApp();
|
||||
}
|
||||
Minify::serve($min_serveController, $min_serveOptions);
|
||||
|
758
min/lib/CSSmin.php
Normal file
758
min/lib/CSSmin.php
Normal file
@@ -0,0 +1,758 @@
|
||||
<?php
|
||||
|
||||
/*!
|
||||
* cssmin.php rev ebaf67b 12/06/2013
|
||||
* Author: Tubal Martin - http://tubalmartin.me/
|
||||
* Repo: https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port
|
||||
*
|
||||
* This is a PHP port of the CSS minification tool distributed with YUICompressor,
|
||||
* itself a port of the cssmin utility by Isaac Schlueter - http://foohack.com/
|
||||
* Permission is hereby granted to use the PHP version under the same
|
||||
* conditions as the YUICompressor.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* YUI Compressor
|
||||
* http://developer.yahoo.com/yui/compressor/
|
||||
* Author: Julien Lecomte - http://www.julienlecomte.net/
|
||||
* Copyright (c) 2013 Yahoo! Inc. All rights reserved.
|
||||
* The copyrights embodied in the content of this file are licensed
|
||||
* by Yahoo! Inc. under the BSD (revised) open source license.
|
||||
*/
|
||||
|
||||
class CSSmin
|
||||
{
|
||||
const NL = '___YUICSSMIN_PRESERVED_NL___';
|
||||
const TOKEN = '___YUICSSMIN_PRESERVED_TOKEN_';
|
||||
const COMMENT = '___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_';
|
||||
const CLASSCOLON = '___YUICSSMIN_PSEUDOCLASSCOLON___';
|
||||
const QUERY_FRACTION = '___YUICSSMIN_QUERY_FRACTION___';
|
||||
|
||||
private $comments;
|
||||
private $preserved_tokens;
|
||||
private $memory_limit;
|
||||
private $max_execution_time;
|
||||
private $pcre_backtrack_limit;
|
||||
private $pcre_recursion_limit;
|
||||
private $raise_php_limits;
|
||||
|
||||
/**
|
||||
* @param bool|int $raise_php_limits
|
||||
* If true, PHP settings will be raised if needed
|
||||
*/
|
||||
public function __construct($raise_php_limits = TRUE)
|
||||
{
|
||||
// Set suggested PHP limits
|
||||
$this->memory_limit = 128 * 1048576; // 128MB in bytes
|
||||
$this->max_execution_time = 60; // 1 min
|
||||
$this->pcre_backtrack_limit = 1000 * 1000;
|
||||
$this->pcre_recursion_limit = 500 * 1000;
|
||||
|
||||
$this->raise_php_limits = (bool) $raise_php_limits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minify a string of CSS
|
||||
* @param string $css
|
||||
* @param int|bool $linebreak_pos
|
||||
* @return string
|
||||
*/
|
||||
public function run($css = '', $linebreak_pos = FALSE)
|
||||
{
|
||||
if (empty($css)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($this->raise_php_limits) {
|
||||
$this->do_raise_php_limits();
|
||||
}
|
||||
|
||||
$this->comments = array();
|
||||
$this->preserved_tokens = array();
|
||||
|
||||
$start_index = 0;
|
||||
$length = strlen($css);
|
||||
|
||||
$css = $this->extract_data_urls($css);
|
||||
|
||||
// collect all comment blocks...
|
||||
while (($start_index = $this->index_of($css, '/*', $start_index)) >= 0) {
|
||||
$end_index = $this->index_of($css, '*/', $start_index + 2);
|
||||
if ($end_index < 0) {
|
||||
$end_index = $length;
|
||||
}
|
||||
$comment_found = $this->str_slice($css, $start_index + 2, $end_index);
|
||||
$this->comments[] = $comment_found;
|
||||
$comment_preserve_string = self::COMMENT . (count($this->comments) - 1) . '___';
|
||||
$css = $this->str_slice($css, 0, $start_index + 2) . $comment_preserve_string . $this->str_slice($css, $end_index);
|
||||
// Set correct start_index: Fixes issue #2528130
|
||||
$start_index = $end_index + 2 + strlen($comment_preserve_string) - strlen($comment_found);
|
||||
}
|
||||
|
||||
// preserve strings so their content doesn't get accidentally minified
|
||||
$css = preg_replace_callback('/(?:"(?:[^\\\\"]|\\\\.|\\\\)*")|'."(?:'(?:[^\\\\']|\\\\.|\\\\)*')/S", array($this, 'replace_string'), $css);
|
||||
|
||||
// Let's divide css code in chunks of 25.000 chars aprox.
|
||||
// Reason: PHP's PCRE functions like preg_replace have a "backtrack limit"
|
||||
// of 100.000 chars by default (php < 5.3.7) so if we're dealing with really
|
||||
// long strings and a (sub)pattern matches a number of chars greater than
|
||||
// the backtrack limit number (i.e. /(.*)/s) PCRE functions may fail silently
|
||||
// returning NULL and $css would be empty.
|
||||
$charset = '';
|
||||
$charset_regexp = '/(@charset)( [^;]+;)/i';
|
||||
$css_chunks = array();
|
||||
$css_chunk_length = 25000; // aprox size, not exact
|
||||
$start_index = 0;
|
||||
$i = $css_chunk_length; // save initial iterations
|
||||
$l = strlen($css);
|
||||
|
||||
|
||||
// if the number of characters is 25000 or less, do not chunk
|
||||
if ($l <= $css_chunk_length) {
|
||||
$css_chunks[] = $css;
|
||||
} else {
|
||||
// chunk css code securely
|
||||
while ($i < $l) {
|
||||
$i += 50; // save iterations. 500 checks for a closing curly brace }
|
||||
if ($l - $start_index <= $css_chunk_length || $i >= $l) {
|
||||
$css_chunks[] = $this->str_slice($css, $start_index);
|
||||
break;
|
||||
}
|
||||
if ($css[$i - 1] === '}' && $i - $start_index > $css_chunk_length) {
|
||||
// If there are two ending curly braces }} separated or not by spaces,
|
||||
// join them in the same chunk (i.e. @media blocks)
|
||||
$next_chunk = substr($css, $i);
|
||||
if (preg_match('/^\s*\}/', $next_chunk)) {
|
||||
$i = $i + $this->index_of($next_chunk, '}') + 1;
|
||||
}
|
||||
|
||||
$css_chunks[] = $this->str_slice($css, $start_index, $i);
|
||||
$start_index = $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Minify each chunk
|
||||
for ($i = 0, $n = count($css_chunks); $i < $n; $i++) {
|
||||
$css_chunks[$i] = $this->minify($css_chunks[$i], $linebreak_pos);
|
||||
// Keep the first @charset at-rule found
|
||||
if (empty($charset) && preg_match($charset_regexp, $css_chunks[$i], $matches)) {
|
||||
$charset = strtolower($matches[1]) . $matches[2];
|
||||
}
|
||||
// Delete all @charset at-rules
|
||||
$css_chunks[$i] = preg_replace($charset_regexp, '', $css_chunks[$i]);
|
||||
}
|
||||
|
||||
// Update the first chunk and push the charset to the top of the file.
|
||||
$css_chunks[0] = $charset . $css_chunks[0];
|
||||
|
||||
return implode('', $css_chunks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the memory limit for this script
|
||||
* @param int|string $limit
|
||||
*/
|
||||
public function set_memory_limit($limit)
|
||||
{
|
||||
$this->memory_limit = $this->normalize_int($limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum execution time for this script
|
||||
* @param int|string $seconds
|
||||
*/
|
||||
public function set_max_execution_time($seconds)
|
||||
{
|
||||
$this->max_execution_time = (int) $seconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the PCRE backtrack limit for this script
|
||||
* @param int $limit
|
||||
*/
|
||||
public function set_pcre_backtrack_limit($limit)
|
||||
{
|
||||
$this->pcre_backtrack_limit = (int) $limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the PCRE recursion limit for this script
|
||||
* @param int $limit
|
||||
*/
|
||||
public function set_pcre_recursion_limit($limit)
|
||||
{
|
||||
$this->pcre_recursion_limit = (int) $limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to configure PHP to use at least the suggested minimum settings
|
||||
*/
|
||||
private function do_raise_php_limits()
|
||||
{
|
||||
$php_limits = array(
|
||||
'memory_limit' => $this->memory_limit,
|
||||
'max_execution_time' => $this->max_execution_time,
|
||||
'pcre.backtrack_limit' => $this->pcre_backtrack_limit,
|
||||
'pcre.recursion_limit' => $this->pcre_recursion_limit
|
||||
);
|
||||
|
||||
// If current settings are higher respect them.
|
||||
foreach ($php_limits as $name => $suggested) {
|
||||
$current = $this->normalize_int(ini_get($name));
|
||||
// memory_limit exception: allow -1 for "no memory limit".
|
||||
if ($current > -1 && ($suggested == -1 || $current < $suggested)) {
|
||||
ini_set($name, $suggested);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Does bulk of the minification
|
||||
* @param string $css
|
||||
* @param int|bool $linebreak_pos
|
||||
* @return string
|
||||
*/
|
||||
private function minify($css, $linebreak_pos)
|
||||
{
|
||||
// strings are safe, now wrestle the comments
|
||||
for ($i = 0, $max = count($this->comments); $i < $max; $i++) {
|
||||
|
||||
$token = $this->comments[$i];
|
||||
$placeholder = '/' . self::COMMENT . $i . '___/';
|
||||
|
||||
// ! in the first position of the comment means preserve
|
||||
// so push to the preserved tokens keeping the !
|
||||
if (substr($token, 0, 1) === '!') {
|
||||
$this->preserved_tokens[] = $token;
|
||||
$token_tring = self::TOKEN . (count($this->preserved_tokens) - 1) . '___';
|
||||
$css = preg_replace($placeholder, $token_tring, $css, 1);
|
||||
// Preserve new lines for /*! important comments
|
||||
$css = preg_replace('/\s*[\n\r\f]+\s*(\/\*'. $token_tring .')/S', self::NL.'$1', $css);
|
||||
$css = preg_replace('/('. $token_tring .'\*\/)\s*[\n\r\f]+\s*/', '$1'.self::NL, $css);
|
||||
continue;
|
||||
}
|
||||
|
||||
// \ in the last position looks like hack for Mac/IE5
|
||||
// shorten that to /*\*/ and the next one to /**/
|
||||
if (substr($token, (strlen($token) - 1), 1) === '\\') {
|
||||
$this->preserved_tokens[] = '\\';
|
||||
$css = preg_replace($placeholder, self::TOKEN . (count($this->preserved_tokens) - 1) . '___', $css, 1);
|
||||
$i = $i + 1; // attn: advancing the loop
|
||||
$this->preserved_tokens[] = '';
|
||||
$css = preg_replace('/' . self::COMMENT . $i . '___/', self::TOKEN . (count($this->preserved_tokens) - 1) . '___', $css, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
// keep empty comments after child selectors (IE7 hack)
|
||||
// e.g. html >/**/ body
|
||||
if (strlen($token) === 0) {
|
||||
$start_index = $this->index_of($css, $this->str_slice($placeholder, 1, -1));
|
||||
if ($start_index > 2) {
|
||||
if (substr($css, $start_index - 3, 1) === '>') {
|
||||
$this->preserved_tokens[] = '';
|
||||
$css = preg_replace($placeholder, self::TOKEN . (count($this->preserved_tokens) - 1) . '___', $css, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// in all other cases kill the comment
|
||||
$css = preg_replace('/\/\*' . $this->str_slice($placeholder, 1, -1) . '\*\//', '', $css, 1);
|
||||
}
|
||||
|
||||
|
||||
// Normalize all whitespace strings to single spaces. Easier to work with that way.
|
||||
$css = preg_replace('/\s+/', ' ', $css);
|
||||
|
||||
// Shorten & preserve calculations calc(...) since spaces are important
|
||||
$css = preg_replace_callback('/calc(\(((?:[^\(\)]+|(?1))*)\))/i', array($this, 'replace_calc'), $css);
|
||||
|
||||
// Replace positive sign from numbers preceded by : or a white-space before the leading space is removed
|
||||
// +1.2em to 1.2em, +.8px to .8px, +2% to 2%
|
||||
$css = preg_replace('/((?<!\\\\)\:|\s)\+(\.?\d+)/S', '$1$2', $css);
|
||||
|
||||
// Remove leading zeros from integer and float numbers preceded by : or a white-space
|
||||
// 000.6 to .6, -0.8 to -.8, 0050 to 50, -01.05 to -1.05
|
||||
$css = preg_replace('/((?<!\\\\)\:|\s)(\-?)0+(\.?\d+)/S', '$1$2$3', $css);
|
||||
|
||||
// Remove trailing zeros from float numbers preceded by : or a white-space
|
||||
// -6.0100em to -6.01em, .0100 to .01, 1.200px to 1.2px
|
||||
$css = preg_replace('/((?<!\\\\)\:|\s)(\-?)(\d?\.\d+?)0+([^\d])/S', '$1$2$3$4', $css);
|
||||
|
||||
// Remove trailing .0 -> -9.0 to -9
|
||||
$css = preg_replace('/((?<!\\\\)\:|\s)(\-?\d+)\.0([^\d])/S', '$1$2$3', $css);
|
||||
|
||||
// Replace 0 length numbers with 0
|
||||
$css = preg_replace('/((?<!\\\\)\:|\s)\-?\.?0+([^\d])/S', '${1}0$2', $css);
|
||||
|
||||
// Remove the spaces before the things that should not have spaces before them.
|
||||
// But, be careful not to turn "p :link {...}" into "p:link{...}"
|
||||
// Swap out any pseudo-class colons with the token, and then swap back.
|
||||
$css = preg_replace_callback('/(?:^|\})(?:(?:[^\{\:])+\:)+(?:[^\{]*\{)/', array($this, 'replace_colon'), $css);
|
||||
|
||||
// Remove spaces before the things that should not have spaces before them.
|
||||
$css = preg_replace('/\s+([\!\{\}\;\:\>\+\(\)\]\~\=,])/', '$1', $css);
|
||||
|
||||
// Restore spaces for !important
|
||||
$css = preg_replace('/\!important/i', ' !important', $css);
|
||||
|
||||
// bring back the colon
|
||||
$css = preg_replace('/' . self::CLASSCOLON . '/', ':', $css);
|
||||
|
||||
// retain space for special IE6 cases
|
||||
$css = preg_replace_callback('/\:first\-(line|letter)(\{|,)/i', array($this, 'lowercase_pseudo_first'), $css);
|
||||
|
||||
// no space after the end of a preserved comment
|
||||
$css = preg_replace('/\*\/ /', '*/', $css);
|
||||
|
||||
// lowercase some popular @directives
|
||||
$css = preg_replace_callback('/@(font-face|import|(?:-(?:atsc|khtml|moz|ms|o|wap|webkit)-)?keyframe|media|page|namespace)/i', array($this, 'lowercase_directives'), $css);
|
||||
|
||||
// lowercase some more common pseudo-elements
|
||||
$css = preg_replace_callback('/:(active|after|before|checked|disabled|empty|enabled|first-(?:child|of-type)|focus|hover|last-(?:child|of-type)|link|only-(?:child|of-type)|root|:selection|target|visited)/i', array($this, 'lowercase_pseudo_elements'), $css);
|
||||
|
||||
// lowercase some more common functions
|
||||
$css = preg_replace_callback('/:(lang|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|(?:-(?:moz|webkit)-)?any)\(/i', array($this, 'lowercase_common_functions'), $css);
|
||||
|
||||
// lower case some common function that can be values
|
||||
// NOTE: rgb() isn't useful as we replace with #hex later, as well as and() is already done for us
|
||||
$css = preg_replace_callback('/([:,\( ]\s*)(attr|color-stop|from|rgba|to|url|(?:-(?:atsc|khtml|moz|ms|o|wap|webkit)-)?(?:calc|max|min|(?:repeating-)?(?:linear|radial)-gradient)|-webkit-gradient)/iS', array($this, 'lowercase_common_functions_values'), $css);
|
||||
|
||||
// Put the space back in some cases, to support stuff like
|
||||
// @media screen and (-webkit-min-device-pixel-ratio:0){
|
||||
$css = preg_replace('/\band\(/i', 'and (', $css);
|
||||
|
||||
// Remove the spaces after the things that should not have spaces after them.
|
||||
$css = preg_replace('/([\!\{\}\:;\>\+\(\[\~\=,])\s+/S', '$1', $css);
|
||||
|
||||
// remove unnecessary semicolons
|
||||
$css = preg_replace('/;+\}/', '}', $css);
|
||||
|
||||
// Fix for issue: #2528146
|
||||
// Restore semicolon if the last property is prefixed with a `*` (lte IE7 hack)
|
||||
// to avoid issues on Symbian S60 3.x browsers.
|
||||
$css = preg_replace('/(\*[a-z0-9\-]+\s*\:[^;\}]+)(\})/', '$1;$2', $css);
|
||||
|
||||
// Replace 0 length units 0(px,em,%) with 0.
|
||||
$css = preg_replace('/(^|[^0-9])(?:0?\.)?0(?:em|ex|ch|rem|vw|vh|vm|vmin|cm|mm|in|px|pt|pc|%|deg|g?rad|m?s|k?hz)/iS', '${1}0', $css);
|
||||
|
||||
// Replace 0 0; or 0 0 0; or 0 0 0 0; with 0.
|
||||
$css = preg_replace('/\:0(?: 0){1,3}(;|\}| \!)/', ':0$1', $css);
|
||||
|
||||
// Fix for issue: #2528142
|
||||
// Replace text-shadow:0; with text-shadow:0 0 0;
|
||||
$css = preg_replace('/(text-shadow\:0)(;|\}| \!)/i', '$1 0 0$2', $css);
|
||||
|
||||
// Replace background-position:0; with background-position:0 0;
|
||||
// same for transform-origin
|
||||
// Changing -webkit-mask-position: 0 0 to just a single 0 will result in the second parameter defaulting to 50% (center)
|
||||
$css = preg_replace('/(background\-position|webkit-mask-position|(?:webkit|moz|o|ms|)\-?transform\-origin)\:0(;|\}| \!)/iS', '$1:0 0$2', $css);
|
||||
|
||||
// Shorten colors from rgb(51,102,153) to #336699, rgb(100%,0%,0%) to #ff0000 (sRGB color space)
|
||||
// Shorten colors from hsl(0, 100%, 50%) to #ff0000 (sRGB color space)
|
||||
// This makes it more likely that it'll get further compressed in the next step.
|
||||
$css = preg_replace_callback('/rgb\s*\(\s*([0-9,\s\-\.\%]+)\s*\)(.{1})/i', array($this, 'rgb_to_hex'), $css);
|
||||
$css = preg_replace_callback('/hsl\s*\(\s*([0-9,\s\-\.\%]+)\s*\)(.{1})/i', array($this, 'hsl_to_hex'), $css);
|
||||
|
||||
// Shorten colors from #AABBCC to #ABC or short color name.
|
||||
$css = $this->compress_hex_colors($css);
|
||||
|
||||
// border: none to border:0, outline: none to outline:0
|
||||
$css = preg_replace('/(border\-?(?:top|right|bottom|left|)|outline)\:none(;|\}| \!)/iS', '$1:0$2', $css);
|
||||
|
||||
// shorter opacity IE filter
|
||||
$css = preg_replace('/progid\:DXImageTransform\.Microsoft\.Alpha\(Opacity\=/i', 'alpha(opacity=', $css);
|
||||
|
||||
// Find a fraction that is used for Opera's -o-device-pixel-ratio query
|
||||
// Add token to add the "\" back in later
|
||||
$css = preg_replace('/\(([a-z\-]+):([0-9]+)\/([0-9]+)\)/i', '($1:$2'. self::QUERY_FRACTION .'$3)', $css);
|
||||
|
||||
// Remove empty rules.
|
||||
$css = preg_replace('/[^\};\{\/]+\{\}/S', '', $css);
|
||||
|
||||
// Add "/" back to fix Opera -o-device-pixel-ratio query
|
||||
$css = preg_replace('/'. self::QUERY_FRACTION .'/', '/', $css);
|
||||
|
||||
// Some source control tools don't like it when files containing lines longer
|
||||
// than, say 8000 characters, are checked in. The linebreak option is used in
|
||||
// that case to split long lines after a specific column.
|
||||
if ($linebreak_pos !== FALSE && (int) $linebreak_pos >= 0) {
|
||||
$linebreak_pos = (int) $linebreak_pos;
|
||||
$start_index = $i = 0;
|
||||
while ($i < strlen($css)) {
|
||||
$i++;
|
||||
if ($css[$i - 1] === '}' && $i - $start_index > $linebreak_pos) {
|
||||
$css = $this->str_slice($css, 0, $i) . "\n" . $this->str_slice($css, $i);
|
||||
$start_index = $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Replace multiple semi-colons in a row by a single one
|
||||
// See SF bug #1980989
|
||||
$css = preg_replace('/;;+/', ';', $css);
|
||||
|
||||
// Restore new lines for /*! important comments
|
||||
$css = preg_replace('/'. self::NL .'/', "\n", $css);
|
||||
|
||||
// Lowercase all uppercase properties
|
||||
$css = preg_replace_callback('/(\{|\;)([A-Z\-]+)(\:)/', array($this, 'lowercase_properties'), $css);
|
||||
|
||||
// restore preserved comments and strings
|
||||
for ($i = 0, $max = count($this->preserved_tokens); $i < $max; $i++) {
|
||||
$css = preg_replace('/' . self::TOKEN . $i . '___/', $this->preserved_tokens[$i], $css, 1);
|
||||
}
|
||||
|
||||
// Trim the final string (for any leading or trailing white spaces)
|
||||
return trim($css);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to replace all data urls with tokens before we start
|
||||
* compressing, to avoid performance issues running some of the subsequent
|
||||
* regexes against large strings chunks.
|
||||
*
|
||||
* @param string $css
|
||||
* @return string
|
||||
*/
|
||||
private function extract_data_urls($css)
|
||||
{
|
||||
// Leave data urls alone to increase parse performance.
|
||||
$max_index = strlen($css) - 1;
|
||||
$append_index = $index = $last_index = $offset = 0;
|
||||
$sb = array();
|
||||
$pattern = '/url\(\s*(["\']?)data\:/i';
|
||||
|
||||
// Since we need to account for non-base64 data urls, we need to handle
|
||||
// ' and ) being part of the data string. Hence switching to indexOf,
|
||||
// to determine whether or not we have matching string terminators and
|
||||
// handling sb appends directly, instead of using matcher.append* methods.
|
||||
|
||||
while (preg_match($pattern, $css, $m, 0, $offset)) {
|
||||
$index = $this->index_of($css, $m[0], $offset);
|
||||
$last_index = $index + strlen($m[0]);
|
||||
$start_index = $index + 4; // "url(".length()
|
||||
$end_index = $last_index - 1;
|
||||
$terminator = $m[1]; // ', " or empty (not quoted)
|
||||
$found_terminator = FALSE;
|
||||
|
||||
if (strlen($terminator) === 0) {
|
||||
$terminator = ')';
|
||||
}
|
||||
|
||||
while ($found_terminator === FALSE && $end_index+1 <= $max_index) {
|
||||
$end_index = $this->index_of($css, $terminator, $end_index + 1);
|
||||
|
||||
// endIndex == 0 doesn't really apply here
|
||||
if ($end_index > 0 && substr($css, $end_index - 1, 1) !== '\\') {
|
||||
$found_terminator = TRUE;
|
||||
if (')' != $terminator) {
|
||||
$end_index = $this->index_of($css, ')', $end_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Enough searching, start moving stuff over to the buffer
|
||||
$sb[] = $this->str_slice($css, $append_index, $index);
|
||||
|
||||
if ($found_terminator) {
|
||||
$token = $this->str_slice($css, $start_index, $end_index);
|
||||
$token = preg_replace('/\s+/', '', $token);
|
||||
$this->preserved_tokens[] = $token;
|
||||
|
||||
$preserver = 'url(' . self::TOKEN . (count($this->preserved_tokens) - 1) . '___)';
|
||||
$sb[] = $preserver;
|
||||
|
||||
$append_index = $end_index + 1;
|
||||
} else {
|
||||
// No end terminator found, re-add the whole match. Should we throw/warn here?
|
||||
$sb[] = $this->str_slice($css, $index, $last_index);
|
||||
$append_index = $last_index;
|
||||
}
|
||||
|
||||
$offset = $last_index;
|
||||
}
|
||||
|
||||
$sb[] = $this->str_slice($css, $append_index);
|
||||
|
||||
return implode('', $sb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to compress hex color values of the form #AABBCC to #ABC or short color name.
|
||||
*
|
||||
* DOES NOT compress CSS ID selectors which match the above pattern (which would break things).
|
||||
* e.g. #AddressForm { ... }
|
||||
*
|
||||
* DOES NOT compress IE filters, which have hex color values (which would break things).
|
||||
* e.g. filter: chroma(color="#FFFFFF");
|
||||
*
|
||||
* DOES NOT compress invalid hex values.
|
||||
* e.g. background-color: #aabbccdd
|
||||
*
|
||||
* @param string $css
|
||||
* @return string
|
||||
*/
|
||||
private function compress_hex_colors($css)
|
||||
{
|
||||
// Look for hex colors inside { ... } (to avoid IDs) and which don't have a =, or a " in front of them (to avoid filters)
|
||||
$pattern = '/(\=\s*?["\']?)?#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])(\}|[^0-9a-f{][^{]*?\})/iS';
|
||||
$_index = $index = $last_index = $offset = 0;
|
||||
$sb = array();
|
||||
// See: http://ajaxmin.codeplex.com/wikipage?title=CSS%20Colors
|
||||
$short_safe = array(
|
||||
'#808080' => 'gray',
|
||||
'#008000' => 'green',
|
||||
'#800000' => 'maroon',
|
||||
'#000080' => 'navy',
|
||||
'#808000' => 'olive',
|
||||
'#ffa500' => 'orange',
|
||||
'#800080' => 'purple',
|
||||
'#c0c0c0' => 'silver',
|
||||
'#008080' => 'teal',
|
||||
'#f00' => 'red'
|
||||
);
|
||||
|
||||
while (preg_match($pattern, $css, $m, 0, $offset)) {
|
||||
$index = $this->index_of($css, $m[0], $offset);
|
||||
$last_index = $index + strlen($m[0]);
|
||||
$is_filter = $m[1] !== null && $m[1] !== '';
|
||||
|
||||
$sb[] = $this->str_slice($css, $_index, $index);
|
||||
|
||||
if ($is_filter) {
|
||||
// Restore, maintain case, otherwise filter will break
|
||||
$sb[] = $m[1] . '#' . $m[2] . $m[3] . $m[4] . $m[5] . $m[6] . $m[7];
|
||||
} else {
|
||||
if (strtolower($m[2]) == strtolower($m[3]) &&
|
||||
strtolower($m[4]) == strtolower($m[5]) &&
|
||||
strtolower($m[6]) == strtolower($m[7])) {
|
||||
// Compress.
|
||||
$hex = '#' . strtolower($m[3] . $m[5] . $m[7]);
|
||||
} else {
|
||||
// Non compressible color, restore but lower case.
|
||||
$hex = '#' . strtolower($m[2] . $m[3] . $m[4] . $m[5] . $m[6] . $m[7]);
|
||||
}
|
||||
// replace Hex colors to short safe color names
|
||||
$sb[] = array_key_exists($hex, $short_safe) ? $short_safe[$hex] : $hex;
|
||||
}
|
||||
|
||||
$_index = $offset = $last_index - strlen($m[8]);
|
||||
}
|
||||
|
||||
$sb[] = $this->str_slice($css, $_index);
|
||||
|
||||
return implode('', $sb);
|
||||
}
|
||||
|
||||
/* CALLBACKS
|
||||
* ---------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private function replace_string($matches)
|
||||
{
|
||||
$match = $matches[0];
|
||||
$quote = substr($match, 0, 1);
|
||||
// Must use addcslashes in PHP to avoid parsing of backslashes
|
||||
$match = addcslashes($this->str_slice($match, 1, -1), '\\');
|
||||
|
||||
// maybe the string contains a comment-like substring?
|
||||
// one, maybe more? put'em back then
|
||||
if (($pos = $this->index_of($match, self::COMMENT)) >= 0) {
|
||||
for ($i = 0, $max = count($this->comments); $i < $max; $i++) {
|
||||
$match = preg_replace('/' . self::COMMENT . $i . '___/', $this->comments[$i], $match, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// minify alpha opacity in filter strings
|
||||
$match = preg_replace('/progid\:DXImageTransform\.Microsoft\.Alpha\(Opacity\=/i', 'alpha(opacity=', $match);
|
||||
|
||||
$this->preserved_tokens[] = $match;
|
||||
return $quote . self::TOKEN . (count($this->preserved_tokens) - 1) . '___' . $quote;
|
||||
}
|
||||
|
||||
private function replace_colon($matches)
|
||||
{
|
||||
return preg_replace('/\:/', self::CLASSCOLON, $matches[0]);
|
||||
}
|
||||
|
||||
private function replace_calc($matches)
|
||||
{
|
||||
$this->preserved_tokens[] = trim(preg_replace('/\s*([\*\/\(\),])\s*/', '$1', $matches[2]));
|
||||
return 'calc('. self::TOKEN . (count($this->preserved_tokens) - 1) . '___' . ')';
|
||||
}
|
||||
|
||||
private function rgb_to_hex($matches)
|
||||
{
|
||||
// Support for percentage values rgb(100%, 0%, 45%);
|
||||
if ($this->index_of($matches[1], '%') >= 0){
|
||||
$rgbcolors = explode(',', str_replace('%', '', $matches[1]));
|
||||
for ($i = 0; $i < count($rgbcolors); $i++) {
|
||||
$rgbcolors[$i] = $this->round_number(floatval($rgbcolors[$i]) * 2.55);
|
||||
}
|
||||
} else {
|
||||
$rgbcolors = explode(',', $matches[1]);
|
||||
}
|
||||
|
||||
// Values outside the sRGB color space should be clipped (0-255)
|
||||
for ($i = 0; $i < count($rgbcolors); $i++) {
|
||||
$rgbcolors[$i] = $this->clamp_number(intval($rgbcolors[$i], 10), 0, 255);
|
||||
$rgbcolors[$i] = sprintf("%02x", $rgbcolors[$i]);
|
||||
}
|
||||
|
||||
// Fix for issue #2528093
|
||||
if (!preg_match('/[\s\,\);\}]/', $matches[2])){
|
||||
$matches[2] = ' ' . $matches[2];
|
||||
}
|
||||
|
||||
return '#' . implode('', $rgbcolors) . $matches[2];
|
||||
}
|
||||
|
||||
private function hsl_to_hex($matches)
|
||||
{
|
||||
$values = explode(',', str_replace('%', '', $matches[1]));
|
||||
$h = floatval($values[0]);
|
||||
$s = floatval($values[1]);
|
||||
$l = floatval($values[2]);
|
||||
|
||||
// Wrap and clamp, then fraction!
|
||||
$h = ((($h % 360) + 360) % 360) / 360;
|
||||
$s = $this->clamp_number($s, 0, 100) / 100;
|
||||
$l = $this->clamp_number($l, 0, 100) / 100;
|
||||
|
||||
if ($s == 0) {
|
||||
$r = $g = $b = $this->round_number(255 * $l);
|
||||
} else {
|
||||
$v2 = $l < 0.5 ? $l * (1 + $s) : ($l + $s) - ($s * $l);
|
||||
$v1 = (2 * $l) - $v2;
|
||||
$r = $this->round_number(255 * $this->hue_to_rgb($v1, $v2, $h + (1/3)));
|
||||
$g = $this->round_number(255 * $this->hue_to_rgb($v1, $v2, $h));
|
||||
$b = $this->round_number(255 * $this->hue_to_rgb($v1, $v2, $h - (1/3)));
|
||||
}
|
||||
|
||||
return $this->rgb_to_hex(array('', $r.','.$g.','.$b, $matches[2]));
|
||||
}
|
||||
|
||||
private function lowercase_pseudo_first($matches)
|
||||
{
|
||||
return ':first-'. strtolower($matches[1]) .' '. $matches[2];
|
||||
}
|
||||
|
||||
private function lowercase_directives($matches)
|
||||
{
|
||||
return '@'. strtolower($matches[1]);
|
||||
}
|
||||
|
||||
private function lowercase_pseudo_elements($matches)
|
||||
{
|
||||
return ':'. strtolower($matches[1]);
|
||||
}
|
||||
|
||||
private function lowercase_common_functions($matches)
|
||||
{
|
||||
return ':'. strtolower($matches[1]) .'(';
|
||||
}
|
||||
|
||||
private function lowercase_common_functions_values($matches)
|
||||
{
|
||||
return $matches[1] . strtolower($matches[2]);
|
||||
}
|
||||
|
||||
private function lowercase_properties($matches)
|
||||
{
|
||||
return $matches[1].strtolower($matches[2]).$matches[3];
|
||||
}
|
||||
|
||||
/* HELPERS
|
||||
* ---------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private function hue_to_rgb($v1, $v2, $vh)
|
||||
{
|
||||
$vh = $vh < 0 ? $vh + 1 : ($vh > 1 ? $vh - 1 : $vh);
|
||||
if ($vh * 6 < 1) return $v1 + ($v2 - $v1) * 6 * $vh;
|
||||
if ($vh * 2 < 1) return $v2;
|
||||
if ($vh * 3 < 2) return $v1 + ($v2 - $v1) * ((2/3) - $vh) * 6;
|
||||
return $v1;
|
||||
}
|
||||
|
||||
private function round_number($n)
|
||||
{
|
||||
return intval(floor(floatval($n) + 0.5), 10);
|
||||
}
|
||||
|
||||
private function clamp_number($n, $min, $max)
|
||||
{
|
||||
return min(max($n, $min), $max);
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP port of Javascript's "indexOf" function for strings only
|
||||
* Author: Tubal Martin http://blog.margenn.com
|
||||
*
|
||||
* @param string $haystack
|
||||
* @param string $needle
|
||||
* @param int $offset index (optional)
|
||||
* @return int
|
||||
*/
|
||||
private function index_of($haystack, $needle, $offset = 0)
|
||||
{
|
||||
$index = strpos($haystack, $needle, $offset);
|
||||
|
||||
return ($index !== FALSE) ? $index : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP port of Javascript's "slice" function for strings only
|
||||
* Author: Tubal Martin http://blog.margenn.com
|
||||
* Tests: http://margenn.com/tubal/str_slice/
|
||||
*
|
||||
* @param string $str
|
||||
* @param int $start index
|
||||
* @param int|bool $end index (optional)
|
||||
* @return string
|
||||
*/
|
||||
private function str_slice($str, $start = 0, $end = FALSE)
|
||||
{
|
||||
if ($end !== FALSE && ($start < 0 || $end <= 0)) {
|
||||
$max = strlen($str);
|
||||
|
||||
if ($start < 0) {
|
||||
if (($start = $max + $start) < 0) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($end < 0) {
|
||||
if (($end = $max + $end) < 0) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($end <= $start) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$slice = ($end === FALSE) ? substr($str, $start) : substr($str, $start, $end - $start);
|
||||
return ($slice === FALSE) ? '' : $slice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert strings like "64M" or "30" to int values
|
||||
* @param mixed $size
|
||||
* @return int
|
||||
*/
|
||||
private function normalize_int($size)
|
||||
{
|
||||
if (is_string($size)) {
|
||||
switch (substr($size, -1)) {
|
||||
case 'M': case 'm': return $size * 1048576;
|
||||
case 'K': case 'k': return $size * 1024;
|
||||
case 'G': case 'g': return $size * 1073741824;
|
||||
}
|
||||
}
|
||||
|
||||
return (int) $size;
|
||||
}
|
||||
}
|
121
min/lib/DooDigestAuth.php
Normal file
121
min/lib/DooDigestAuth.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* DooDigestAuth class file.
|
||||
*
|
||||
* @author Leng Sheng Hong <darkredz@gmail.com>
|
||||
* @link http://www.doophp.com/
|
||||
* @copyright Copyright © 2009 Leng Sheng Hong
|
||||
* @license http://www.doophp.com/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* Handles HTTP digest authentication
|
||||
*
|
||||
* <p>HTTP digest authentication can be used with the URI router.
|
||||
* HTTP digest is much more recommended over the use of HTTP Basic auth which doesn't provide any encryption.
|
||||
* If you are running PHP on Apache in CGI/FastCGI mode, you would need to
|
||||
* add the following line to your .htaccess for digest auth to work correctly.</p>
|
||||
* <code>RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]</code>
|
||||
*
|
||||
* <p>This class is tested under Apache 2.2 and Cherokee web server. It should work in both mod_php and cgi mode.</p>
|
||||
*
|
||||
* @author Leng Sheng Hong <darkredz@gmail.com>
|
||||
* @version $Id: DooDigestAuth.php 1000 2009-07-7 18:27:22
|
||||
* @package doo.auth
|
||||
* @since 1.0
|
||||
*/
|
||||
class DooDigestAuth{
|
||||
|
||||
/**
|
||||
* Authenticate against a list of username and passwords.
|
||||
*
|
||||
* <p>HTTP Digest Authentication doesn't work with PHP in CGI mode,
|
||||
* you have to add this into your .htaccess <code>RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]</code></p>
|
||||
*
|
||||
* @param string $realm Name of the authentication session
|
||||
* @param array $users An assoc array of username and password: array('uname1'=>'pwd1', 'uname2'=>'pwd2')
|
||||
* @param string $fail_msg Message to be displayed if the User cancel the login
|
||||
* @param string $fail_url URL to be redirect if the User cancel the login
|
||||
* @return string The username if login success.
|
||||
*/
|
||||
public static function http_auth($realm, $users, $fail_msg=NULL, $fail_url=NULL){
|
||||
$realm = "Restricted area - $realm";
|
||||
|
||||
//user => password
|
||||
//$users = array('admin' => '1234', 'guest' => 'guest');
|
||||
if(!empty($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && strpos($_SERVER['REDIRECT_HTTP_AUTHORIZATION'], 'Digest')===0){
|
||||
$_SERVER['PHP_AUTH_DIGEST'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
|
||||
}
|
||||
|
||||
if (empty($_SERVER['PHP_AUTH_DIGEST'])) {
|
||||
header('WWW-Authenticate: Digest realm="'.$realm.
|
||||
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
if($fail_msg!=NULL)
|
||||
die($fail_msg);
|
||||
if($fail_url!=NULL)
|
||||
die("<script>window.location.href = '$fail_url'</script>");
|
||||
exit;
|
||||
}
|
||||
|
||||
// analyze the PHP_AUTH_DIGEST variable
|
||||
if (!($data = self::http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) || !isset($users[$data['username']])){
|
||||
header('WWW-Authenticate: Digest realm="'.$realm.
|
||||
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
if($fail_msg!=NULL)
|
||||
die($fail_msg);
|
||||
if($fail_url!=NULL)
|
||||
die("<script>window.location.href = '$fail_url'</script>");
|
||||
exit;
|
||||
}
|
||||
|
||||
// generate the valid response
|
||||
$A1 = md5($data['username'] . ':' . $realm . ':' . $users[$data['username']]);
|
||||
$A2 = md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
|
||||
$valid_response = md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);
|
||||
|
||||
if ($data['response'] != $valid_response){
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
header('WWW-Authenticate: Digest realm="'.$realm.
|
||||
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
|
||||
if($fail_msg!=NULL)
|
||||
die($fail_msg);
|
||||
if($fail_url!=NULL)
|
||||
die("<script>window.location.href = '$fail_url'</script>");
|
||||
exit;
|
||||
}
|
||||
|
||||
// ok, valid username & password
|
||||
return $data['username'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to parse the http auth header, works with IE.
|
||||
*
|
||||
* Internet Explorer returns a qop="xxxxxxxxxxx" in the header instead of qop=xxxxxxxxxxx as most browsers do.
|
||||
*
|
||||
* @param string $txt header string to parse
|
||||
* @return array An assoc array of the digest auth session
|
||||
*/
|
||||
private static function http_digest_parse($txt)
|
||||
{
|
||||
$res = preg_match("/username=\"([^\"]+)\"/i", $txt, $match);
|
||||
$data['username'] = (isset($match[1]))?$match[1]:null;
|
||||
$res = preg_match('/nonce=\"([^\"]+)\"/i', $txt, $match);
|
||||
$data['nonce'] = $match[1];
|
||||
$res = preg_match('/nc=([0-9]+)/i', $txt, $match);
|
||||
$data['nc'] = $match[1];
|
||||
$res = preg_match('/cnonce=\"([^\"]+)\"/i', $txt, $match);
|
||||
$data['cnonce'] = $match[1];
|
||||
$res = preg_match('/qop=([^,]+)/i', $txt, $match);
|
||||
$data['qop'] = str_replace('"','',$match[1]);
|
||||
$res = preg_match('/uri=\"([^\"]+)\"/i', $txt, $match);
|
||||
$data['uri'] = $match[1];
|
||||
$res = preg_match('/response=\"([^\"]+)\"/i', $txt, $match);
|
||||
$data['response'] = $match[1];
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -7,14 +7,14 @@
|
||||
* </code>
|
||||
*
|
||||
* This is a modified port of jsmin.c. Improvements:
|
||||
*
|
||||
*
|
||||
* Does not choke on some regexp literals containing quote characters. E.g. /'/
|
||||
*
|
||||
* Spaces are preserved after some add/sub operators, so they are not mistakenly
|
||||
*
|
||||
* Spaces are preserved after some add/sub operators, so they are not mistakenly
|
||||
* converted to post-inc/dec. E.g. a + ++b -> a+ ++b
|
||||
*
|
||||
* Preserves multi-line comments that begin with /*!
|
||||
*
|
||||
*
|
||||
* PHP 5 or higher is required.
|
||||
*
|
||||
* Permission is hereby granted to use this version of the library under the
|
||||
@@ -69,6 +69,7 @@ class JSMin {
|
||||
protected $lookAhead = null;
|
||||
protected $output = '';
|
||||
protected $lastByteOut = '';
|
||||
protected $keptComment = '';
|
||||
|
||||
/**
|
||||
* Minify Javascript.
|
||||
@@ -116,8 +117,8 @@ class JSMin {
|
||||
// determine next command
|
||||
$command = self::ACTION_KEEP_A; // default
|
||||
if ($this->a === ' ') {
|
||||
if (($this->lastByteOut === '+' || $this->lastByteOut === '-')
|
||||
&& ($this->b === $this->lastByteOut)) {
|
||||
if (($this->lastByteOut === '+' || $this->lastByteOut === '-')
|
||||
&& ($this->b === $this->lastByteOut)) {
|
||||
// Don't delete this space. If we do, the addition/subtraction
|
||||
// could be parsed as a post-increment
|
||||
} elseif (! $this->isAlphaNum($this->b)) {
|
||||
@@ -126,16 +127,17 @@ class JSMin {
|
||||
} elseif ($this->a === "\n") {
|
||||
if ($this->b === ' ') {
|
||||
$command = self::ACTION_DELETE_A_B;
|
||||
// in case of mbstring.func_overload & 2, must check for null b,
|
||||
// otherwise mb_strpos will give WARNING
|
||||
|
||||
// in case of mbstring.func_overload & 2, must check for null b,
|
||||
// otherwise mb_strpos will give WARNING
|
||||
} elseif ($this->b === null
|
||||
|| (false === strpos('{[(+-', $this->b)
|
||||
|| (false === strpos('{[(+-!~', $this->b)
|
||||
&& ! $this->isAlphaNum($this->b))) {
|
||||
$command = self::ACTION_DELETE_A;
|
||||
}
|
||||
} elseif (! $this->isAlphaNum($this->a)) {
|
||||
if ($this->b === ' '
|
||||
|| ($this->b === "\n"
|
||||
|| ($this->b === "\n"
|
||||
&& (false === strpos('}])+-"\'', $this->a)))) {
|
||||
$command = self::ACTION_DELETE_A_B;
|
||||
}
|
||||
@@ -160,7 +162,8 @@ class JSMin {
|
||||
*/
|
||||
protected function action($command)
|
||||
{
|
||||
if ($command === self::ACTION_DELETE_A_B
|
||||
// make sure we don't compress "a + ++b" to "a+++b", etc.
|
||||
if ($command === self::ACTION_DELETE_A_B
|
||||
&& $this->b === ' '
|
||||
&& ($this->a === '+' || $this->a === '-')) {
|
||||
// Note: we're at an addition/substraction operator; the inputIndex
|
||||
@@ -170,58 +173,86 @@ class JSMin {
|
||||
$command = self::ACTION_KEEP_A;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($command) {
|
||||
case self::ACTION_KEEP_A:
|
||||
case self::ACTION_KEEP_A: // 1
|
||||
$this->output .= $this->a;
|
||||
|
||||
if ($this->keptComment) {
|
||||
$this->output = rtrim($this->output, "\n");
|
||||
$this->output .= $this->keptComment;
|
||||
$this->keptComment = '';
|
||||
}
|
||||
|
||||
$this->lastByteOut = $this->a;
|
||||
|
||||
// fallthrough
|
||||
case self::ACTION_DELETE_A:
|
||||
|
||||
// fallthrough intentional
|
||||
case self::ACTION_DELETE_A: // 2
|
||||
$this->a = $this->b;
|
||||
if ($this->a === "'" || $this->a === '"') { // string literal
|
||||
$str = $this->a; // in case needed for exception
|
||||
while (true) {
|
||||
for(;;) {
|
||||
$this->output .= $this->a;
|
||||
$this->lastByteOut = $this->a;
|
||||
|
||||
$this->a = $this->get();
|
||||
|
||||
$this->a = $this->get();
|
||||
if ($this->a === $this->b) { // end quote
|
||||
break;
|
||||
}
|
||||
if (ord($this->a) <= self::ORD_LF) {
|
||||
if ($this->isEOF($this->a)) {
|
||||
throw new JSMin_UnterminatedStringException(
|
||||
"JSMin: Unterminated String at byte "
|
||||
. $this->inputIndex . ": {$str}");
|
||||
"JSMin: Unterminated String at byte {$this->inputIndex}: {$str}");
|
||||
}
|
||||
$str .= $this->a;
|
||||
if ($this->a === '\\') {
|
||||
$this->output .= $this->a;
|
||||
$this->lastByteOut = $this->a;
|
||||
|
||||
|
||||
$this->a = $this->get();
|
||||
$str .= $this->a;
|
||||
}
|
||||
}
|
||||
}
|
||||
// fallthrough
|
||||
case self::ACTION_DELETE_A_B:
|
||||
|
||||
// fallthrough intentional
|
||||
case self::ACTION_DELETE_A_B: // 3
|
||||
$this->b = $this->next();
|
||||
if ($this->b === '/' && $this->isRegexpLiteral()) { // RegExp literal
|
||||
if ($this->b === '/' && $this->isRegexpLiteral()) {
|
||||
$this->output .= $this->a . $this->b;
|
||||
$pattern = '/'; // in case needed for exception
|
||||
while (true) {
|
||||
$pattern = '/'; // keep entire pattern in case we need to report it in the exception
|
||||
for(;;) {
|
||||
$this->a = $this->get();
|
||||
$pattern .= $this->a;
|
||||
if ($this->a === '[') {
|
||||
for(;;) {
|
||||
$this->output .= $this->a;
|
||||
$this->a = $this->get();
|
||||
$pattern .= $this->a;
|
||||
if ($this->a === ']') {
|
||||
break;
|
||||
}
|
||||
if ($this->a === '\\') {
|
||||
$this->output .= $this->a;
|
||||
$this->a = $this->get();
|
||||
$pattern .= $this->a;
|
||||
}
|
||||
if ($this->isEOF($this->a)) {
|
||||
throw new JSMin_UnterminatedRegExpException(
|
||||
"JSMin: Unterminated set in RegExp at byte "
|
||||
. $this->inputIndex .": {$pattern}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->a === '/') { // end pattern
|
||||
break; // while (true)
|
||||
} elseif ($this->a === '\\') {
|
||||
$this->output .= $this->a;
|
||||
$this->a = $this->get();
|
||||
$pattern .= $this->a;
|
||||
} elseif (ord($this->a) <= self::ORD_LF) {
|
||||
$this->a = $this->get();
|
||||
$pattern .= $this->a;
|
||||
} elseif ($this->isEOF($this->a)) {
|
||||
throw new JSMin_UnterminatedRegExpException(
|
||||
"JSMin: Unterminated RegExp at byte "
|
||||
. $this->inputIndex .": {$pattern}");
|
||||
"JSMin: Unterminated RegExp at byte {$this->inputIndex}: {$pattern}");
|
||||
}
|
||||
$this->output .= $this->a;
|
||||
$this->lastByteOut = $this->a;
|
||||
@@ -237,10 +268,11 @@ class JSMin {
|
||||
*/
|
||||
protected function isRegexpLiteral()
|
||||
{
|
||||
if (false !== strpos("\n{;(,=:[!&|?", $this->a)) { // we aren't dividing
|
||||
if (false !== strpos("(,=:[!&|?+-~*{;", $this->a)) {
|
||||
// we obviously aren't dividing
|
||||
return true;
|
||||
}
|
||||
if (' ' === $this->a) {
|
||||
if ($this->a === ' ' || $this->a === "\n") {
|
||||
$length = strlen($this->output);
|
||||
if ($length < 2) { // weird edge case
|
||||
return true;
|
||||
@@ -261,7 +293,8 @@ class JSMin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get next char. Convert ctrl char to space.
|
||||
* Return the next character from stdin. Watch out for lookahead. If the character is a control character,
|
||||
* translate it to a space or linefeed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -270,24 +303,36 @@ class JSMin {
|
||||
$c = $this->lookAhead;
|
||||
$this->lookAhead = null;
|
||||
if ($c === null) {
|
||||
// getc(stdin)
|
||||
if ($this->inputIndex < $this->inputLength) {
|
||||
$c = $this->input[$this->inputIndex];
|
||||
$this->inputIndex += 1;
|
||||
} else {
|
||||
return null;
|
||||
$c = null;
|
||||
}
|
||||
}
|
||||
if ($c === "\r" || $c === "\n") {
|
||||
if (ord($c) >= self::ORD_SPACE || $c === "\n" || $c === null) {
|
||||
return $c;
|
||||
}
|
||||
if ($c === "\r") {
|
||||
return "\n";
|
||||
}
|
||||
if (ord($c) < self::ORD_SPACE) { // control char
|
||||
return ' ';
|
||||
}
|
||||
return $c;
|
||||
return ' ';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get next char. If is ctrl character, translate to a space or newline.
|
||||
* Does $a indicate end of input?
|
||||
*
|
||||
* @param string $a
|
||||
* @return bool
|
||||
*/
|
||||
protected function isEOF($a)
|
||||
{
|
||||
return ord($a) <= self::ORD_LF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get next char (without getting it). If is ctrl character, translate to a space or newline.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -298,7 +343,7 @@ class JSMin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is $c a letter, digit, underscore, dollar sign, escape, or non-ASCII?
|
||||
* Return true if the character is a letter, digit, underscore, dollar sign, or non-ASCII character.
|
||||
*
|
||||
* @param string $c
|
||||
*
|
||||
@@ -306,77 +351,84 @@ class JSMin {
|
||||
*/
|
||||
protected function isAlphaNum($c)
|
||||
{
|
||||
return (preg_match('/^[0-9a-zA-Z_\\$\\\\]$/', $c) || ord($c) > 126);
|
||||
return (preg_match('/^[a-z0-9A-Z_\\$\\\\]$/', $c) || ord($c) > 126);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* Consume a single line comment from input (possibly retaining it)
|
||||
*/
|
||||
protected function singleLineComment()
|
||||
protected function consumeSingleLineComment()
|
||||
{
|
||||
$comment = '';
|
||||
while (true) {
|
||||
$get = $this->get();
|
||||
$comment .= $get;
|
||||
if (ord($get) <= self::ORD_LF) { // EOL reached
|
||||
if (ord($get) <= self::ORD_LF) { // end of line reached
|
||||
// if IE conditional comment
|
||||
if (preg_match('/^\\/@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
|
||||
return "/{$comment}";
|
||||
$this->keptComment .= "/{$comment}";
|
||||
}
|
||||
return $get;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* Consume a multiple line comment from input (possibly retaining it)
|
||||
*
|
||||
* @throws JSMin_UnterminatedCommentException
|
||||
*/
|
||||
protected function multipleLineComment()
|
||||
protected function consumeMultipleLineComment()
|
||||
{
|
||||
$this->get();
|
||||
$comment = '';
|
||||
while (true) {
|
||||
for(;;) {
|
||||
$get = $this->get();
|
||||
if ($get === '*') {
|
||||
if ($this->peek() === '/') { // end of comment reached
|
||||
$this->get();
|
||||
// if comment preserved by YUI Compressor
|
||||
if (0 === strpos($comment, '!')) {
|
||||
return "\n/*!" . substr($comment, 1) . "*/\n";
|
||||
// preserved by YUI Compressor
|
||||
if (!$this->keptComment) {
|
||||
// don't prepend a newline if two comments right after one another
|
||||
$this->keptComment = "\n";
|
||||
}
|
||||
$this->keptComment .= "/*!" . substr($comment, 1) . "*/\n";
|
||||
} else if (preg_match('/^@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
|
||||
// IE conditional
|
||||
$this->keptComment .= "/*{$comment}*/";
|
||||
}
|
||||
// if IE conditional comment
|
||||
if (preg_match('/^@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
|
||||
return "/*{$comment}*/";
|
||||
}
|
||||
return ' ';
|
||||
return;
|
||||
}
|
||||
} elseif ($get === null) {
|
||||
throw new JSMin_UnterminatedCommentException(
|
||||
"JSMin: Unterminated comment at byte "
|
||||
. $this->inputIndex . ": /*{$comment}");
|
||||
"JSMin: Unterminated comment at byte {$this->inputIndex}: /*{$comment}");
|
||||
}
|
||||
$comment .= $get;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next character, skipping over comments.
|
||||
* Some comments may be preserved.
|
||||
* Get the next character, skipping over comments. Some comments may be preserved.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function next()
|
||||
{
|
||||
$get = $this->get();
|
||||
if ($get !== '/') {
|
||||
return $get;
|
||||
}
|
||||
switch ($this->peek()) {
|
||||
case '/': return $this->singleLineComment();
|
||||
case '*': return $this->multipleLineComment();
|
||||
default: return $get;
|
||||
if ($get === '/') {
|
||||
switch ($this->peek()) {
|
||||
case '/':
|
||||
$this->consumeSingleLineComment();
|
||||
$get = "\n";
|
||||
break;
|
||||
case '*':
|
||||
$this->consumeMultipleLineComment();
|
||||
$get = ' ';
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $get;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,11 +3,6 @@
|
||||
* Class Minify
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
/**
|
||||
* Minify_Source
|
||||
*/
|
||||
require_once 'Minify/Source.php';
|
||||
|
||||
/**
|
||||
* Minify - Combines, minifies, and caches JavaScript and CSS files on demand.
|
||||
@@ -29,7 +24,7 @@ require_once 'Minify/Source.php';
|
||||
*/
|
||||
class Minify {
|
||||
|
||||
const VERSION = '2.1.5';
|
||||
const VERSION = '2.1.6';
|
||||
const TYPE_CSS = 'text/css';
|
||||
const TYPE_HTML = 'text/html';
|
||||
// there is some debate over the ideal JS Content-Type, but this is the
|
||||
@@ -85,7 +80,6 @@ class Minify {
|
||||
public static function setCache($cache = '', $fileLocking = true)
|
||||
{
|
||||
if (is_string($cache)) {
|
||||
require_once 'Minify/Cache/File.php';
|
||||
self::$_cache = new Minify_Cache_File($cache, $fileLocking);
|
||||
} else {
|
||||
self::$_cache = $cache;
|
||||
@@ -161,9 +155,11 @@ class Minify {
|
||||
*
|
||||
* @param array $options controller/serve options
|
||||
*
|
||||
* @return mixed null, or, if the 'quiet' option is set to true, an array
|
||||
* @return null|array if the 'quiet' option is set to true, an array
|
||||
* with keys "success" (bool), "statusCode" (int), "content" (string), and
|
||||
* "headers" (array).
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function serve($controller, $options = array())
|
||||
{
|
||||
@@ -174,10 +170,6 @@ class Minify {
|
||||
if (is_string($controller)) {
|
||||
// make $controller into object
|
||||
$class = 'Minify_Controller_' . $controller;
|
||||
if (! class_exists($class, false)) {
|
||||
require_once "Minify/Controller/"
|
||||
. str_replace('_', '/', $controller) . ".php";
|
||||
}
|
||||
$controller = new $class();
|
||||
/* @var Minify_Controller_Base $controller */
|
||||
}
|
||||
@@ -219,8 +211,7 @@ class Minify {
|
||||
$contentEncoding = self::$_options['encodeMethod'];
|
||||
} else {
|
||||
// sniff request header
|
||||
require_once 'HTTP/Encoder.php';
|
||||
// depending on what the client accepts, $contentEncoding may be
|
||||
// depending on what the client accepts, $contentEncoding may be
|
||||
// 'x-gzip' while our internal encodeMethod is 'gzip'. Calling
|
||||
// getAcceptedEncoding(false, false) leaves out compress and deflate as options.
|
||||
list(self::$_options['encodeMethod'], $contentEncoding) = HTTP_Encoder::getAcceptedEncoding(false, false);
|
||||
@@ -231,7 +222,6 @@ class Minify {
|
||||
}
|
||||
|
||||
// check client cache
|
||||
require_once 'HTTP/ConditionalGet.php';
|
||||
$cgOptions = array(
|
||||
'lastModifiedTime' => self::$_options['lastModifiedTime']
|
||||
,'isPublic' => self::$_options['isPublic']
|
||||
@@ -300,7 +290,7 @@ class Minify {
|
||||
throw $e;
|
||||
}
|
||||
self::$_cache->store($cacheId, $content);
|
||||
if (function_exists('gzencode')) {
|
||||
if (function_exists('gzencode') && self::$_options['encodeMethod']) {
|
||||
self::$_cache->store($cacheId . '.gz', gzencode($content, self::$_options['encodeLevel']));
|
||||
}
|
||||
}
|
||||
@@ -451,7 +441,7 @@ class Minify {
|
||||
/**
|
||||
* Set up sources to use Minify_Lines
|
||||
*
|
||||
* @param array $sources Minify_Source instances
|
||||
* @param Minify_Source[] $sources Minify_Source instances
|
||||
*/
|
||||
protected static function _setupDebug($sources)
|
||||
{
|
||||
@@ -468,6 +458,8 @@ class Minify {
|
||||
* Combines sources and minifies the result.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected static function _combineMinify()
|
||||
{
|
||||
@@ -526,7 +518,6 @@ class Minify {
|
||||
$imploded = implode($implodeSeparator, $groupToProcessTogether);
|
||||
$groupToProcessTogether = array();
|
||||
if ($lastMinifier) {
|
||||
self::$_controller->loadMinifier($lastMinifier);
|
||||
try {
|
||||
$content[] = call_user_func($lastMinifier, $imploded, $lastOptions);
|
||||
} catch (Exception $e) {
|
||||
|
@@ -4,8 +4,6 @@
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
require_once 'Minify/Source.php';
|
||||
|
||||
/**
|
||||
* Maintain a single last modification time for a group of Minify sources to
|
||||
* allow use of far off Expires headers in Minify.
|
||||
|
@@ -56,6 +56,7 @@ class Minify_CSS {
|
||||
public static function minify($css, $options = array())
|
||||
{
|
||||
$options = array_merge(array(
|
||||
'compress' => true,
|
||||
'removeCharsets' => true,
|
||||
'preserveComments' => true,
|
||||
'currentDir' => null,
|
||||
@@ -67,21 +68,20 @@ class Minify_CSS {
|
||||
if ($options['removeCharsets']) {
|
||||
$css = preg_replace('/@charset[^;]+;\\s*/', '', $css);
|
||||
}
|
||||
require_once 'Minify/CSS/Compressor.php';
|
||||
if (! $options['preserveComments']) {
|
||||
$css = Minify_CSS_Compressor::process($css, $options);
|
||||
} else {
|
||||
require_once 'Minify/CommentPreserver.php';
|
||||
$css = Minify_CommentPreserver::process(
|
||||
$css
|
||||
,array('Minify_CSS_Compressor', 'process')
|
||||
,array($options)
|
||||
);
|
||||
if ($options['compress']) {
|
||||
if (! $options['preserveComments']) {
|
||||
$css = Minify_CSS_Compressor::process($css, $options);
|
||||
} else {
|
||||
$css = Minify_CommentPreserver::process(
|
||||
$css
|
||||
,array('Minify_CSS_Compressor', 'process')
|
||||
,array($options)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (! $options['currentDir'] && ! $options['prependRelativePath']) {
|
||||
return $css;
|
||||
}
|
||||
require_once 'Minify/CSS/UriRewriter.php';
|
||||
if ($options['currentDir']) {
|
||||
return Minify_CSS_UriRewriter::rewrite(
|
||||
$css
|
||||
|
@@ -186,7 +186,6 @@ class Minify_Cache_File {
|
||||
*/
|
||||
protected function _log($msg)
|
||||
{
|
||||
require_once 'Minify/Logger.php';
|
||||
Minify_Logger::log($msg);
|
||||
}
|
||||
|
||||
|
126
min/lib/Minify/Cache/XCache.php
Normal file
126
min/lib/Minify/Cache/XCache.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* Class Minify_Cache_XCache
|
||||
*
|
||||
* @link http://xcache.lighttpd.net/
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
/**
|
||||
* XCache-based cache class for Minify
|
||||
* {@see http://xcache.lighttpd.net/wiki/XcacheApi XCache API}
|
||||
*
|
||||
* <code>
|
||||
* Minify::setCache(new Minify_Cache_XCache());
|
||||
* </code>
|
||||
*
|
||||
* @package Minify
|
||||
* @author Elan Ruusamäe <glen@delfi.ee>
|
||||
**/
|
||||
class Minify_Cache_XCache {
|
||||
|
||||
/**
|
||||
* Create a Minify_Cache_XCache object, to be passed to
|
||||
* Minify::setCache().
|
||||
*
|
||||
* @param int $expire seconds until expiration (default = 0
|
||||
* meaning the item will not get an expiration date)
|
||||
*/
|
||||
public function __construct($expire = 0)
|
||||
{
|
||||
$this->_exp = $expire;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write data to cache.
|
||||
*
|
||||
* @param string $id cache id
|
||||
* @param string $data
|
||||
* @return bool success
|
||||
*/
|
||||
public function store($id, $data)
|
||||
{
|
||||
return xcache_set($id, "{$_SERVER['REQUEST_TIME']}|{$data}", $this->_exp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the size of a cache entry
|
||||
*
|
||||
* @param string $id cache id
|
||||
* @return int size in bytes
|
||||
*/
|
||||
public function getSize($id)
|
||||
{
|
||||
if (! $this->_fetch($id)) {
|
||||
return false;
|
||||
}
|
||||
return (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2))
|
||||
? mb_strlen($this->_data, '8bit')
|
||||
: strlen($this->_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does a valid cache entry exist?
|
||||
*
|
||||
* @param string $id cache id
|
||||
* @param int $srcMtime mtime of the original source file(s)
|
||||
* @return bool exists
|
||||
*/
|
||||
public function isValid($id, $srcMtime)
|
||||
{
|
||||
return ($this->_fetch($id) && ($this->_lm >= $srcMtime));
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the cached content to output
|
||||
*
|
||||
* @param string $id cache id
|
||||
*/
|
||||
public function display($id)
|
||||
{
|
||||
echo $this->_fetch($id)
|
||||
? $this->_data
|
||||
: '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the cached content
|
||||
*
|
||||
* @param string $id cache id
|
||||
* @return string
|
||||
*/
|
||||
public function fetch($id)
|
||||
{
|
||||
return $this->_fetch($id)
|
||||
? $this->_data
|
||||
: '';
|
||||
}
|
||||
|
||||
private $_exp = null;
|
||||
|
||||
// cache of most recently fetched id
|
||||
private $_lm = null;
|
||||
private $_data = null;
|
||||
private $_id = null;
|
||||
|
||||
/**
|
||||
* Fetch data and timestamp from xcache, store in instance
|
||||
*
|
||||
* @param string $id
|
||||
* @return bool success
|
||||
*/
|
||||
private function _fetch($id)
|
||||
{
|
||||
if ($this->_id === $id) {
|
||||
return true;
|
||||
}
|
||||
$ret = xcache_get($id);
|
||||
if (false === $ret) {
|
||||
$this->_id = null;
|
||||
return false;
|
||||
}
|
||||
list($this->_lm, $this->_data) = explode('|', $ret, 2);
|
||||
$this->_id = $id;
|
||||
return true;
|
||||
}
|
||||
}
|
123
min/lib/Minify/ClosureCompiler.php
Normal file
123
min/lib/Minify/ClosureCompiler.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/**
|
||||
* Class Minify_ClosureCompiler
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
/**
|
||||
* Compress Javascript using the Closure Compiler
|
||||
*
|
||||
* You must set $jarFile and $tempDir before calling the minify functions.
|
||||
* Also, depending on your shell's environment, you may need to specify
|
||||
* the full path to java in $javaExecutable or use putenv() to setup the
|
||||
* Java environment.
|
||||
*
|
||||
* <code>
|
||||
* Minify_ClosureCompiler::$jarFile = '/path/to/closure-compiler-20120123.jar';
|
||||
* Minify_ClosureCompiler::$tempDir = '/tmp';
|
||||
* $code = Minify_ClosureCompiler::minify(
|
||||
* $code,
|
||||
* array('compilation_level' => 'SIMPLE_OPTIMIZATIONS')
|
||||
* );
|
||||
*
|
||||
* --compilation_level WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS, ADVANCED_OPTIMIZATIONS
|
||||
*
|
||||
* </code>
|
||||
*
|
||||
* @todo unit tests, $options docs
|
||||
* @todo more options support (or should just passthru them all?)
|
||||
*
|
||||
* @package Minify
|
||||
* @author Stephen Clay <steve@mrclay.org>
|
||||
* @author Elan Ruusamäe <glen@delfi.ee>
|
||||
*/
|
||||
class Minify_ClosureCompiler {
|
||||
|
||||
/**
|
||||
* Filepath of the Closure Compiler jar file. This must be set before
|
||||
* calling minifyJs().
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $jarFile = null;
|
||||
|
||||
/**
|
||||
* Writable temp directory. This must be set before calling minifyJs().
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $tempDir = null;
|
||||
|
||||
/**
|
||||
* Filepath of "java" executable (may be needed if not in shell's PATH)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $javaExecutable = 'java';
|
||||
|
||||
/**
|
||||
* Minify a Javascript string
|
||||
*
|
||||
* @param string $js
|
||||
*
|
||||
* @param array $options (verbose is ignored)
|
||||
*
|
||||
* @see https://code.google.com/p/closure-compiler/source/browse/trunk/README
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function minify($js, $options = array())
|
||||
{
|
||||
self::_prepare();
|
||||
if (! ($tmpFile = tempnam(self::$tempDir, 'cc_'))) {
|
||||
throw new Exception('Minify_ClosureCompiler : could not create temp file.');
|
||||
}
|
||||
file_put_contents($tmpFile, $js);
|
||||
exec(self::_getCmd($options, $tmpFile), $output, $result_code);
|
||||
unlink($tmpFile);
|
||||
if ($result_code != 0) {
|
||||
throw new Exception('Minify_ClosureCompiler : Closure Compiler execution failed.');
|
||||
}
|
||||
return implode("\n", $output);
|
||||
}
|
||||
|
||||
private static function _getCmd($userOptions, $tmpFile)
|
||||
{
|
||||
$o = array_merge(
|
||||
array(
|
||||
'charset' => 'utf-8',
|
||||
'compilation_level' => 'SIMPLE_OPTIMIZATIONS',
|
||||
),
|
||||
$userOptions
|
||||
);
|
||||
$cmd = self::$javaExecutable . ' -jar ' . escapeshellarg(self::$jarFile)
|
||||
. (preg_match('/^[\\da-zA-Z0-9\\-]+$/', $o['charset'])
|
||||
? " --charset {$o['charset']}"
|
||||
: '');
|
||||
|
||||
foreach (array('compilation_level') as $opt) {
|
||||
if ($o[$opt]) {
|
||||
$cmd .= " --{$opt} ". escapeshellarg($o[$opt]);
|
||||
}
|
||||
}
|
||||
return $cmd . ' ' . escapeshellarg($tmpFile);
|
||||
}
|
||||
|
||||
private static function _prepare()
|
||||
{
|
||||
if (! is_file(self::$jarFile)) {
|
||||
throw new Exception('Minify_ClosureCompiler : $jarFile('.self::$jarFile.') is not a valid file.');
|
||||
}
|
||||
if (! is_readable(self::$jarFile)) {
|
||||
throw new Exception('Minify_ClosureCompiler : $jarFile('.self::$jarFile.') is not readable.');
|
||||
}
|
||||
if (! is_dir(self::$tempDir)) {
|
||||
throw new Exception('Minify_ClosureCompiler : $tempDir('.self::$tempDir.') is not a valid direcotry.');
|
||||
}
|
||||
if (! is_writable(self::$tempDir)) {
|
||||
throw new Exception('Minify_ClosureCompiler : $tempDir('.self::$tempDir.') is not writable.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* vim:ts=4:sw=4:et */
|
@@ -78,33 +78,6 @@ abstract class Minify_Controller_Base {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load any code necessary to execute the given minifier callback.
|
||||
*
|
||||
* The controller is responsible for loading minification code on demand
|
||||
* via this method. This built-in function will only load classes for
|
||||
* static method callbacks where the class isn't already defined. It uses
|
||||
* the PEAR convention, so, given array('Jimmy_Minifier', 'minCss'), this
|
||||
* function will include 'Jimmy/Minifier.php'.
|
||||
*
|
||||
* If you need code loaded on demand and this doesn't suit you, you'll need
|
||||
* to override this function in your subclass.
|
||||
* @see Minify_Controller_Page::loadMinifier()
|
||||
*
|
||||
* @param callback $minifierCallback callback of minifier function
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public function loadMinifier($minifierCallback)
|
||||
{
|
||||
if (is_array($minifierCallback)
|
||||
&& is_string($minifierCallback[0])
|
||||
&& !class_exists($minifierCallback[0], false)) {
|
||||
|
||||
require str_replace('_', '/', $minifierCallback[0]) . '.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Is a user-given file within an allowable directory, existing,
|
||||
* and having an extension js/css/html/txt ?
|
||||
@@ -244,7 +217,6 @@ abstract class Minify_Controller_Base {
|
||||
* @return null
|
||||
*/
|
||||
public function log($msg) {
|
||||
require_once 'Minify/Logger.php';
|
||||
Minify_Logger::log($msg);
|
||||
}
|
||||
}
|
||||
|
@@ -4,8 +4,6 @@
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
require_once 'Minify/Controller/Base.php';
|
||||
|
||||
/**
|
||||
* Controller class for minifying a set of files
|
||||
*
|
||||
|
@@ -4,8 +4,6 @@
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
require_once 'Minify/Controller/Base.php';
|
||||
|
||||
/**
|
||||
* Controller class for serving predetermined groups of minimized sets, selected
|
||||
* by PATH_INFO
|
||||
|
@@ -4,8 +4,6 @@
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
require_once 'Minify/Controller/Base.php';
|
||||
|
||||
/**
|
||||
* Controller class for requests to /min/index.php
|
||||
*
|
||||
@@ -38,6 +36,10 @@ class Minify_Controller_MinApp extends Minify_Controller_Base {
|
||||
$firstMissingResource = null;
|
||||
|
||||
if (isset($_GET['g'])) {
|
||||
if (! is_string($_GET['g'])) {
|
||||
$this->log("GET param 'g' was invalid");
|
||||
return $options;
|
||||
}
|
||||
// add group(s)
|
||||
$this->selectionId .= 'g=' . $_GET['g'];
|
||||
$keys = explode(',', $_GET['g']);
|
||||
@@ -92,6 +94,10 @@ class Minify_Controller_MinApp extends Minify_Controller_Base {
|
||||
}
|
||||
}
|
||||
if (! $cOptions['groupsOnly'] && isset($_GET['f'])) {
|
||||
if (! is_string($_GET['f'])) {
|
||||
$this->log("GET param 'f' was invalid");
|
||||
return $options;
|
||||
}
|
||||
// try user files
|
||||
// The following restrictions are to limit the URLs that minify will
|
||||
// respond to.
|
||||
@@ -120,7 +126,8 @@ class Minify_Controller_MinApp extends Minify_Controller_Base {
|
||||
}
|
||||
if (isset($_GET['b'])) {
|
||||
// check for validity
|
||||
if (preg_match('@^[^/]+(?:/[^/]+)*$@', $_GET['b'])
|
||||
if (is_string($_GET['b'])
|
||||
&& preg_match('@^[^/]+(?:/[^/]+)*$@', $_GET['b'])
|
||||
&& false === strpos($_GET['b'], '..')
|
||||
&& $_GET['b'] !== '.') {
|
||||
// valid base
|
||||
@@ -195,9 +202,12 @@ class Minify_Controller_MinApp extends Minify_Controller_Base {
|
||||
protected function _getFileSource($file, $cOptions)
|
||||
{
|
||||
$spec['filepath'] = $file;
|
||||
if ($cOptions['noMinPattern']
|
||||
&& preg_match($cOptions['noMinPattern'], basename($file))) {
|
||||
$spec['minifier'] = '';
|
||||
if ($cOptions['noMinPattern'] && preg_match($cOptions['noMinPattern'], basename($file))) {
|
||||
if (preg_match('~\.css$~i', $file)) {
|
||||
$spec['minifyOptions']['compress'] = false;
|
||||
} else {
|
||||
$spec['minifier'] = '';
|
||||
}
|
||||
}
|
||||
return new Minify_Source($spec);
|
||||
}
|
||||
|
@@ -4,8 +4,6 @@
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
require_once 'Minify/Controller/Base.php';
|
||||
|
||||
/**
|
||||
* Controller class for serving a single HTML page
|
||||
*
|
||||
@@ -59,7 +57,6 @@ class Minify_Controller_Page extends Minify_Controller_Base {
|
||||
'cssMinifier' => array('Minify_CSS', 'minify')
|
||||
,'jsMinifier' => array('JSMin', 'minify')
|
||||
);
|
||||
$this->_loadCssJsMinifiers = true;
|
||||
unset($options['minifyAll']);
|
||||
}
|
||||
$this->sources[] = new Minify_Source($sourceSpec);
|
||||
@@ -67,21 +64,5 @@ class Minify_Controller_Page extends Minify_Controller_Base {
|
||||
$options['contentType'] = Minify::TYPE_HTML;
|
||||
return $options;
|
||||
}
|
||||
|
||||
protected $_loadCssJsMinifiers = false;
|
||||
|
||||
/**
|
||||
* @see Minify_Controller_Base::loadMinifier()
|
||||
*/
|
||||
public function loadMinifier($minifierCallback)
|
||||
{
|
||||
if ($this->_loadCssJsMinifiers) {
|
||||
// Minify will not call for these so we must manually load
|
||||
// them when Minify/HTML.php is called for.
|
||||
require_once 'Minify/CSS.php';
|
||||
require_once 'JSMin.php';
|
||||
}
|
||||
parent::loadMinifier($minifierCallback); // load Minify/HTML.php
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4,8 +4,6 @@
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
require_once 'Minify/Controller/Base.php';
|
||||
|
||||
/**
|
||||
* Controller class for emulating version 1 of minify.php (mostly a proof-of-concept)
|
||||
*
|
||||
|
@@ -1,22 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Class Minify_HTML
|
||||
* Class Minify_HTML
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
/**
|
||||
* Compress HTML
|
||||
*
|
||||
* This is a heavy regex-based removal of whitespace, unnecessary comments and
|
||||
* This is a heavy regex-based removal of whitespace, unnecessary comments and
|
||||
* tokens. IE conditional comments are preserved. There are also options to have
|
||||
* STYLE and SCRIPT blocks compressed by callback functions.
|
||||
*
|
||||
* STYLE and SCRIPT blocks compressed by callback functions.
|
||||
*
|
||||
* A test suite is available.
|
||||
*
|
||||
*
|
||||
* @package Minify
|
||||
* @author Stephen Clay <steve@mrclay.org>
|
||||
*/
|
||||
class Minify_HTML {
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_jsCleanComments = true;
|
||||
|
||||
/**
|
||||
* "Minify" an HTML page
|
||||
@@ -27,21 +31,21 @@ class Minify_HTML {
|
||||
*
|
||||
* 'cssMinifier' : (optional) callback function to process content of STYLE
|
||||
* elements.
|
||||
*
|
||||
*
|
||||
* 'jsMinifier' : (optional) callback function to process content of SCRIPT
|
||||
* elements. Note: the type attribute is ignored.
|
||||
*
|
||||
*
|
||||
* 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
|
||||
* unset, minify will sniff for an XHTML doctype.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function minify($html, $options = array()) {
|
||||
$min = new Minify_HTML($html, $options);
|
||||
$min = new self($html, $options);
|
||||
return $min->process();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a minifier object
|
||||
*
|
||||
@@ -51,13 +55,15 @@ class Minify_HTML {
|
||||
*
|
||||
* 'cssMinifier' : (optional) callback function to process content of STYLE
|
||||
* elements.
|
||||
*
|
||||
*
|
||||
* 'jsMinifier' : (optional) callback function to process content of SCRIPT
|
||||
* elements. Note: the type attribute is ignored.
|
||||
*
|
||||
*
|
||||
* 'jsCleanComments' : (optional) whether to remove HTML comments beginning and end of script block
|
||||
*
|
||||
* 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
|
||||
* unset, minify will sniff for an XHTML doctype.
|
||||
*
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public function __construct($html, $options = array())
|
||||
@@ -72,9 +78,12 @@ class Minify_HTML {
|
||||
if (isset($options['jsMinifier'])) {
|
||||
$this->_jsMinifier = $options['jsMinifier'];
|
||||
}
|
||||
if (isset($options['jsCleanComments'])) {
|
||||
$this->_jsCleanComments = (bool)$options['jsCleanComments'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Minify the markeup given in the constructor
|
||||
*
|
||||
@@ -213,17 +222,19 @@ class Minify_HTML {
|
||||
// whitespace surrounding? preserve at least one space
|
||||
$ws1 = ($m[1] === '') ? '' : ' ';
|
||||
$ws2 = ($m[4] === '') ? '' : ' ';
|
||||
|
||||
|
||||
// remove HTML comments (and ending "//" if present)
|
||||
$js = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js);
|
||||
|
||||
if ($this->_jsCleanComments) {
|
||||
$js = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js);
|
||||
}
|
||||
|
||||
// remove CDATA section markers
|
||||
$js = $this->_removeCdata($js);
|
||||
|
||||
// minify
|
||||
$minifier = $this->_jsMinifier
|
||||
? $this->_jsMinifier
|
||||
: 'trim';
|
||||
: 'trim';
|
||||
$js = call_user_func($minifier, $js);
|
||||
|
||||
return $this->_reservePlace($this->_needsCdata($js)
|
||||
|
@@ -15,10 +15,10 @@ class Minify_HTML_Helper {
|
||||
public $minAppUri = '/min';
|
||||
public $groupsConfigFile = '';
|
||||
|
||||
/*
|
||||
/**
|
||||
* Get an HTML-escaped Minify URI for a group or set of files
|
||||
*
|
||||
* @param mixed $keyOrFiles a group key or array of filepaths/URIs
|
||||
* @param string|array $keyOrFiles a group key or array of filepaths/URIs
|
||||
* @param array $opts options:
|
||||
* 'farExpires' : (default true) append a modified timestamp for cache revving
|
||||
* 'debug' : (default false) append debug flag
|
||||
@@ -51,8 +51,12 @@ class Minify_HTML_Helper {
|
||||
return htmlspecialchars($uri, ENT_QUOTES, $opts['charset']);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Get non-HTML-escaped URI to minify the specified files
|
||||
*
|
||||
* @param bool $farExpires
|
||||
* @param bool $debug
|
||||
* @return string
|
||||
*/
|
||||
public function getRawUri($farExpires = true, $debug = false)
|
||||
{
|
||||
@@ -74,6 +78,12 @@ class Minify_HTML_Helper {
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the files that will comprise the URI we're building
|
||||
*
|
||||
* @param array $files
|
||||
* @param bool $checkLastModified
|
||||
*/
|
||||
public function setFiles($files, $checkLastModified = true)
|
||||
{
|
||||
$this->_groupKey = null;
|
||||
@@ -94,6 +104,12 @@ class Minify_HTML_Helper {
|
||||
$this->_filePaths = $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the group of files that will comprise the URI we're building
|
||||
*
|
||||
* @param string $key
|
||||
* @param bool $checkLastModified
|
||||
*/
|
||||
public function setGroup($key, $checkLastModified = true)
|
||||
{
|
||||
$this->_groupKey = $key;
|
||||
@@ -103,13 +119,23 @@ class Minify_HTML_Helper {
|
||||
}
|
||||
if (is_file($this->groupsConfigFile)) {
|
||||
$gc = (require $this->groupsConfigFile);
|
||||
if (isset($gc[$key])) {
|
||||
$this->_lastModified = self::getLastModified($gc[$key]);
|
||||
$keys = explode(',', $key);
|
||||
foreach ($keys as $key) {
|
||||
if (isset($gc[$key])) {
|
||||
$this->_lastModified = self::getLastModified($gc[$key], $this->_lastModified);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the max(lastModified) of all files
|
||||
*
|
||||
* @param array|string $sources
|
||||
* @param int $lastModified
|
||||
* @return int
|
||||
*/
|
||||
public static function getLastModified($sources, $lastModified = 0)
|
||||
{
|
||||
$max = $lastModified;
|
||||
@@ -142,13 +168,19 @@ class Minify_HTML_Helper {
|
||||
* @return mixed a common char or '' if any do not match
|
||||
*/
|
||||
protected static function _getCommonCharAtPos($arr, $pos) {
|
||||
$l = count($arr);
|
||||
if (!isset($arr[0][$pos])) {
|
||||
return '';
|
||||
}
|
||||
$c = $arr[0][$pos];
|
||||
if ($c === '' || $l === 1)
|
||||
$l = count($arr);
|
||||
if ($l === 1) {
|
||||
return $c;
|
||||
for ($i = 1; $i < $l; ++$i)
|
||||
if ($arr[$i][$pos] !== $c)
|
||||
}
|
||||
for ($i = 1; $i < $l; ++$i) {
|
||||
if ($arr[$i][$pos] !== $c) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
|
||||
@@ -157,11 +189,11 @@ class Minify_HTML_Helper {
|
||||
*
|
||||
* @param array $paths root-relative URIs of files
|
||||
* @param string $minRoot root-relative URI of the "min" application
|
||||
* @return string
|
||||
*/
|
||||
protected static function _getShortestUri($paths, $minRoot = '/min/') {
|
||||
$pos = 0;
|
||||
$base = '';
|
||||
$c;
|
||||
while (true) {
|
||||
$c = self::_getCommonCharAtPos($paths, $pos);
|
||||
if ($c === '') {
|
||||
|
@@ -69,7 +69,7 @@ class Minify_JS_ClosureCompiler {
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
protected $_fallbackFunc = null;
|
||||
|
||||
protected function _getResponse($postBody)
|
||||
@@ -79,7 +79,7 @@ class Minify_JS_ClosureCompiler {
|
||||
$contents = file_get_contents(self::URL, false, stream_context_create(array(
|
||||
'http' => array(
|
||||
'method' => 'POST',
|
||||
'header' => 'Content-type: application/x-www-form-urlencoded',
|
||||
'header' => "Content-type: application/x-www-form-urlencoded\r\nConnection: close\r\n",
|
||||
'content' => $postBody,
|
||||
'max_redirects' => 0,
|
||||
'timeout' => 15,
|
||||
@@ -125,7 +125,6 @@ class Minify_JS_ClosureCompiler {
|
||||
*/
|
||||
protected function _fallback($js)
|
||||
{
|
||||
require_once 'JSMin.php';
|
||||
return JSMin::minify($js);
|
||||
}
|
||||
}
|
||||
|
@@ -55,7 +55,11 @@ class Minify_Lines {
|
||||
$newLines = array();
|
||||
while (null !== ($line = array_shift($lines))) {
|
||||
if (('' !== $id) && (0 == $i % 50)) {
|
||||
array_push($newLines, '', "/* {$id} */", '');
|
||||
if ($inComment) {
|
||||
array_push($newLines, '', "/* {$id} *|", '');
|
||||
} else {
|
||||
array_push($newLines, '', "/* {$id} */", '');
|
||||
}
|
||||
}
|
||||
++$i;
|
||||
$newLines[] = self::_addNote($line, $i, $inComment, $padTo);
|
||||
@@ -65,7 +69,6 @@ class Minify_Lines {
|
||||
|
||||
// check for desired URI rewriting
|
||||
if (isset($options['currentDir'])) {
|
||||
require_once 'Minify/CSS/UriRewriter.php';
|
||||
Minify_CSS_UriRewriter::$debugText = '';
|
||||
$content = Minify_CSS_UriRewriter::rewrite(
|
||||
$content
|
||||
@@ -93,6 +96,9 @@ class Minify_Lines {
|
||||
*/
|
||||
private static function _eolInComment($line, $inComment)
|
||||
{
|
||||
// crude way to avoid things like // */
|
||||
$line = preg_replace('~//.*?(\\*/|/\\*).*~', '', $line);
|
||||
|
||||
while (strlen($line)) {
|
||||
$search = $inComment
|
||||
? '*/'
|
||||
|
28
min/lib/Minify/Loader.php
Normal file
28
min/lib/Minify/Loader.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Class Minify_Loader
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class autoloader
|
||||
*
|
||||
* @package Minify
|
||||
* @author Stephen Clay <steve@mrclay.org>
|
||||
*/
|
||||
class Minify_Loader {
|
||||
public function loadClass($class)
|
||||
{
|
||||
$file = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR;
|
||||
$file .= strtr($class, "\\_", DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR) . '.php';
|
||||
if (is_readable($file)) {
|
||||
require $file;
|
||||
}
|
||||
}
|
||||
|
||||
static public function register()
|
||||
{
|
||||
$inst = new self();
|
||||
spl_autoload_register(array($inst, 'loadClass'));
|
||||
}
|
||||
}
|
@@ -13,14 +13,17 @@
|
||||
* Java environment.
|
||||
*
|
||||
* <code>
|
||||
* Minify_YUICompressor::$jarFile = '/path/to/yuicompressor-2.3.5.jar';
|
||||
* Minify_YUICompressor::$jarFile = '/path/to/yuicompressor-2.4.6.jar';
|
||||
* Minify_YUICompressor::$tempDir = '/tmp';
|
||||
* $code = Minify_YUICompressor::minifyJs(
|
||||
* $code
|
||||
* ,array('nomunge' => true, 'line-break' => 1000)
|
||||
* );
|
||||
* </code>
|
||||
*
|
||||
*
|
||||
* Note: In case you run out stack (default is 512k), you may increase stack size in $options:
|
||||
* array('stack-size' => '2048k')
|
||||
*
|
||||
* @todo unit tests, $options docs
|
||||
*
|
||||
* @package Minify
|
||||
@@ -108,10 +111,15 @@ class Minify_YUICompressor {
|
||||
,'nomunge' => false
|
||||
,'preserve-semi' => false
|
||||
,'disable-optimizations' => false
|
||||
,'stack-size' => ''
|
||||
)
|
||||
,$userOptions
|
||||
);
|
||||
$cmd = self::$javaExecutable . ' -jar ' . escapeshellarg(self::$jarFile)
|
||||
$cmd = self::$javaExecutable
|
||||
. (!empty($o['stack-size'])
|
||||
? ' -Xss' . $o['stack-size']
|
||||
: '')
|
||||
. ' -jar ' . escapeshellarg(self::$jarFile)
|
||||
. " --type {$type}"
|
||||
. (preg_match('/^[\\da-zA-Z0-9\\-]+$/', $o['charset'])
|
||||
? " --charset {$o['charset']}"
|
||||
@@ -134,8 +142,8 @@ class Minify_YUICompressor {
|
||||
if (! is_file(self::$jarFile)) {
|
||||
throw new Exception('Minify_YUICompressor : $jarFile('.self::$jarFile.') is not a valid file.');
|
||||
}
|
||||
if (! is_executable(self::$jarFile)) {
|
||||
throw new Exception('Minify_YUICompressor : $jarFile('.self::$jarFile.') is not executable.');
|
||||
if (! is_readable(self::$jarFile)) {
|
||||
throw new Exception('Minify_YUICompressor : $jarFile('.self::$jarFile.') is not readable.');
|
||||
}
|
||||
if (! is_dir(self::$tempDir)) {
|
||||
throw new Exception('Minify_YUICompressor : $tempDir('.self::$tempDir.') is not a valid direcotry.');
|
||||
|
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace MrClay;
|
||||
|
||||
use MrClay\Cli\Arg;
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Forms a front controller for a console app, handling and validating arguments (options)
|
||||
*
|
||||
@@ -51,7 +54,7 @@ class Cli {
|
||||
public $isHelpRequest = false;
|
||||
|
||||
/**
|
||||
* @var array of Cli\Arg
|
||||
* @var Arg[]
|
||||
*/
|
||||
protected $_args = array();
|
||||
|
||||
@@ -80,8 +83,8 @@ class Cli {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Cli\Arg|string $letter
|
||||
* @return Cli\Arg
|
||||
* @param Arg|string $letter
|
||||
* @return Arg
|
||||
*/
|
||||
public function addOptionalArg($letter)
|
||||
{
|
||||
@@ -89,8 +92,8 @@ class Cli {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Cli\Arg|string $letter
|
||||
* @return Cli\Arg
|
||||
* @param Arg|string $letter
|
||||
* @return Arg
|
||||
*/
|
||||
public function addRequiredArg($letter)
|
||||
{
|
||||
@@ -100,17 +103,17 @@ class Cli {
|
||||
/**
|
||||
* @param string $letter
|
||||
* @param bool $required
|
||||
* @param Cli\Arg|null $arg
|
||||
* @return Cli\Arg
|
||||
* @throws \InvalidArgumentException
|
||||
* @param Arg|null $arg
|
||||
* @return Arg
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function addArgument($letter, $required, Cli\Arg $arg = null)
|
||||
public function addArgument($letter, $required, Arg $arg = null)
|
||||
{
|
||||
if (! preg_match('/^[a-zA-Z]$/', $letter)) {
|
||||
throw new \InvalidArgumentException('$letter must be in [a-zA-z]');
|
||||
throw new InvalidArgumentException('$letter must be in [a-zA-Z]');
|
||||
}
|
||||
if (! $arg) {
|
||||
$arg = new Cli\Arg($required);
|
||||
$arg = new Arg($required);
|
||||
}
|
||||
$this->_args[$letter] = $arg;
|
||||
return $arg;
|
||||
@@ -118,7 +121,7 @@ class Cli {
|
||||
|
||||
/**
|
||||
* @param string $letter
|
||||
* @return Cli\Arg|null
|
||||
* @return Arg|null
|
||||
*/
|
||||
public function getArgument($letter)
|
||||
{
|
||||
@@ -143,7 +146,7 @@ class Cli {
|
||||
|
||||
$lettersUsed = '';
|
||||
foreach ($this->_args as $letter => $arg) {
|
||||
/* @var Cli\Arg $arg */
|
||||
/* @var Arg $arg */
|
||||
$options .= $letter;
|
||||
$lettersUsed .= $letter;
|
||||
|
||||
@@ -159,7 +162,7 @@ class Cli {
|
||||
$this->debug['getopt_return'] = $o;
|
||||
|
||||
foreach ($this->_args as $letter => $arg) {
|
||||
/* @var Cli\Arg $arg */
|
||||
/* @var Arg $arg */
|
||||
$this->values[$letter] = false;
|
||||
if (isset($o[$letter])) {
|
||||
if (is_bool($o[$letter])) {
|
||||
@@ -295,7 +298,7 @@ class Cli {
|
||||
{
|
||||
$r = "\n";
|
||||
foreach ($this->_args as $letter => $arg) {
|
||||
/* @var Cli\Arg $arg */
|
||||
/* @var Arg $arg */
|
||||
$desc = $arg->getDescription();
|
||||
$flag = " -$letter ";
|
||||
if ($arg->mayHaveValue) {
|
||||
|
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace MrClay\Cli;
|
||||
|
||||
use BadMethodCallException;
|
||||
|
||||
/**
|
||||
* An argument for a CLI app. This specifies the argument, what values it expects and
|
||||
* how it's treated during validation.
|
||||
@@ -150,7 +152,7 @@ class Arg {
|
||||
* @param string $name
|
||||
* @param array $args
|
||||
* @return Arg
|
||||
* @throws \BadMethodCallException
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function __call($name, array $args = array())
|
||||
{
|
||||
@@ -160,7 +162,7 @@ class Arg {
|
||||
$this->spec['mustHaveValue'] = true;
|
||||
}
|
||||
} else {
|
||||
throw new \BadMethodCallException('Method does not exist');
|
||||
throw new BadMethodCallException('Method does not exist');
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
30
min/quick-test.css
Normal file
30
min/quick-test.css
Normal file
@@ -0,0 +1,30 @@
|
||||
/*! This file exists only for testing a Minify installation. It's content is not used.
|
||||
*
|
||||
* http://example.org/min/f=min/quick-test.css
|
||||
*/
|
||||
|
||||
@import url( /more.css );
|
||||
|
||||
body, td, th {
|
||||
font-family: Verdana , "Bitstream Vera Sans" , Arial Narrow, sans-serif ;
|
||||
|
||||
font-size : 12px;
|
||||
}
|
||||
|
||||
.nav {
|
||||
margin-left: 20%;
|
||||
}
|
||||
#main-nav {
|
||||
background-color: red;
|
||||
border: 1px solid #00ff77;
|
||||
}
|
||||
|
||||
div#content
|
||||
h1 + p {
|
||||
padding-top: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
@media all and (min-width: 640px) {
|
||||
#media-queries-1 { background-color: #0f0; }
|
||||
}
|
74
min/quick-test.js
Normal file
74
min/quick-test.js
Normal file
@@ -0,0 +1,74 @@
|
||||
/*! This file exists only for testing a Minify installation. It's content is not used.
|
||||
*
|
||||
* http://example.org/min/f=min/quick-test.js
|
||||
*/
|
||||
|
||||
/* Finds the lowest common multiple of two numbers */
|
||||
function LCMCalculator(x, y) { // constructor function
|
||||
var checkInt = function (x) { // inner function
|
||||
if (x % 1 !== 0) {
|
||||
throw new TypeError(x + " is not an integer"); // throw an exception
|
||||
}
|
||||
return x;
|
||||
};
|
||||
this.a = checkInt(x);
|
||||
// ^ semicolons are optional
|
||||
this.b = checkInt(y);
|
||||
}
|
||||
// The prototype of object instances created by a constructor is
|
||||
// that constructor's "prototype" property.
|
||||
LCMCalculator.prototype = { // object literal
|
||||
constructor: LCMCalculator, // when reassigning a prototype, set the constructor property appropriately
|
||||
gcd: function () { // method that calculates the greatest common divisor
|
||||
// Euclidean algorithm:
|
||||
var a = Math.abs(this.a), b = Math.abs(this.b), t;
|
||||
if (a < b) {
|
||||
// swap variables
|
||||
t = b;
|
||||
b = a;
|
||||
a = t;
|
||||
}
|
||||
while (b !== 0) {
|
||||
t = b;
|
||||
b = a % b;
|
||||
a = t;
|
||||
}
|
||||
// Only need to calculate GCD once, so "redefine" this method.
|
||||
// (Actually not redefinition - it's defined on the instance itself,
|
||||
// so that this.gcd refers to this "redefinition" instead of LCMCalculator.prototype.gcd.)
|
||||
// Also, 'gcd' === "gcd", this['gcd'] === this.gcd
|
||||
this['gcd'] = function () {
|
||||
return a;
|
||||
};
|
||||
return a;
|
||||
},
|
||||
// Object property names can be specified by strings delimited by double (") or single (') quotes.
|
||||
"lcm" : function () {
|
||||
// Variable names don't collide with object properties, e.g. |lcm| is not |this.lcm|.
|
||||
// not using |this.a * this.b| to avoid FP precision issues
|
||||
var lcm = this.a / this.gcd() * this.b;
|
||||
// Only need to calculate lcm once, so "redefine" this method.
|
||||
this.lcm = function () {
|
||||
return lcm;
|
||||
};
|
||||
return lcm;
|
||||
},
|
||||
toString: function () {
|
||||
return "LCMCalculator: a = " + this.a + ", b = " + this.b;
|
||||
}
|
||||
};
|
||||
|
||||
//define generic output function; this implementation only works for web browsers
|
||||
function output(x) {
|
||||
document.write(x + "<br>");
|
||||
}
|
||||
|
||||
// Note: Array's map() and forEach() are defined in JavaScript 1.6.
|
||||
// They are used here to demonstrate JavaScript's inherent functional nature.
|
||||
[[25, 55], [21, 56], [22, 58], [28, 56]].map(function (pair) { // array literal + mapping function
|
||||
return new LCMCalculator(pair[0], pair[1]);
|
||||
}).sort(function (a, b) { // sort with this comparative function
|
||||
return a.lcm() - b.lcm();
|
||||
}).forEach(function (obj) {
|
||||
output(obj + ", gcd = " + obj.gcd() + ", lcm = " + obj.lcm());
|
||||
});
|
@@ -2,11 +2,18 @@
|
||||
/**
|
||||
* Utility functions for generating URIs in HTML files
|
||||
*
|
||||
* @warning These functions execute min/groupsConfig.php, sometimes multiple times.
|
||||
* You must make sure that functions are not redefined, and if your use custom sources,
|
||||
* you must require_once dirname(__FILE__) . '/lib/Minify/Source.php' so that
|
||||
* class is available.
|
||||
*
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/lib/Minify/HTML/Helper.php';
|
||||
|
||||
if (! class_exists('Minify_Loader', false)) {
|
||||
require dirname(__FILE__) . '/lib/Minify/Loader.php';
|
||||
Minify_Loader::register();
|
||||
}
|
||||
|
||||
/*
|
||||
* Get an HTML-escaped Minify URI for a group or set of files. By default, URIs
|
||||
|
@@ -1,16 +1,10 @@
|
||||
#!/usr/bin/php
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
$pathToLib = dirname(dirname(__DIR__)) . '/min/lib';
|
||||
|
||||
// needed because of dumb require statements in class files :(
|
||||
set_include_path($pathToLib . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
// barebones autoloader
|
||||
spl_autoload_register(function ($class) use ($pathToLib) {
|
||||
$file = $pathToLib . '/' . str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $class) . '.php';
|
||||
return is_file($file) ? ((require $file) || true) : false;
|
||||
});
|
||||
require "$pathToLib/Minify/Loader.php";
|
||||
Minify_Loader::register();
|
||||
|
||||
$cli = new MrClay\Cli;
|
||||
|
||||
|
@@ -3,14 +3,8 @@
|
||||
|
||||
$pathToLib = dirname(dirname(__DIR__)) . '/min/lib';
|
||||
|
||||
// needed because of dumb require statements in class files :(
|
||||
set_include_path($pathToLib . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
// barebones autoloader
|
||||
spl_autoload_register(function ($class) use ($pathToLib) {
|
||||
$file = $pathToLib . '/' . str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $class) . '.php';
|
||||
return is_file($file) ? ((require $file) || true) : false;
|
||||
});
|
||||
require "$min_libPath/Minify/Loader.php";
|
||||
Minify_Loader::register();
|
||||
|
||||
$cli = new MrClay\Cli;
|
||||
|
||||
|
@@ -4,13 +4,9 @@
|
||||
|
||||
require dirname(__FILE__) . '/../min/config.php';
|
||||
|
||||
set_include_path($min_libPath . PATH_SEPARATOR . get_include_path());
|
||||
require "$min_libPath/Minify/Loader.php";
|
||||
Minify_Loader::register();
|
||||
|
||||
$minifyCachePath = isset($min_cachePath)
|
||||
? $min_cachePath
|
||||
: '';
|
||||
|
||||
function min_autoload($name) {
|
||||
require str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $name) . '.php';
|
||||
}
|
||||
spl_autoload_register('min_autoload');
|
||||
|
@@ -17,7 +17,7 @@ if (isset($_POST['method']) && $_POST['method'] === 'Minify and serve') {
|
||||
if ($base) {
|
||||
$textIn = preg_replace(
|
||||
'@(<head\\b[^>]*>)@i'
|
||||
,'$1<base href="' . htmlentities($base) . '" />'
|
||||
,'$1<base href="' . htmlspecialchars($base, ENT_QUOTES, 'UTF-8') . '" />'
|
||||
,$textIn
|
||||
);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ if (isset($_POST['method']) && $_POST['method'] === 'Minify and serve') {
|
||||
,'contentType' => Minify::TYPE_HTML
|
||||
));
|
||||
} catch (Exception $e) {
|
||||
echo htmlspecialchars($e->getMessage());
|
||||
echo htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
exit();
|
||||
}
|
||||
@@ -56,12 +56,14 @@ if (isset($_POST['method']) && in_array($_POST['method'], $classes)) {
|
||||
}
|
||||
$func = array($_POST['method'], 'minify');
|
||||
$inOutBytes[0] = strlen($textIn);
|
||||
$startTime = microtime(true);
|
||||
try {
|
||||
$textOut = call_user_func_array($func, $args);
|
||||
} catch (Exception $e) {
|
||||
echo htmlspecialchars($e->getMessage());
|
||||
echo htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8');
|
||||
exit;
|
||||
}
|
||||
$elapsedTime = microtime(true) - $startTime;
|
||||
$inOutBytes[1] = strlen($textOut);
|
||||
}
|
||||
|
||||
@@ -74,6 +76,7 @@ if (isset($inOutBytes)) {
|
||||
<table>
|
||||
<tr><th>Bytes in</th><td>{$inOutBytes[0]} (after line endings normalized to <code>\\n</code>)</td></tr>
|
||||
<tr><th>Bytes out</th><td>{$inOutBytes[1]} (reduced " . round(100 - (100 * $inOutBytes[1] / $inOutBytes[0])) . "%)</td></tr>
|
||||
<tr><th>Time (s)</th><td>" . round($elapsedTime, 5) . "</td></tr>
|
||||
</table>
|
||||
";
|
||||
}
|
||||
@@ -81,7 +84,7 @@ if (isset($inOutBytes)) {
|
||||
<form action="?2" method="post">
|
||||
<p><label>Content<br><textarea name="textIn" cols="80" rows="35" style="width:99%"><?php
|
||||
if (isset($textOut)) {
|
||||
echo htmlspecialchars($textOut);
|
||||
echo htmlspecialchars($textOut, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
?></textarea></label></p>
|
||||
<p>Minify with:
|
||||
|
@@ -84,7 +84,7 @@ if (isset($_POST['url'])) {
|
||||
&& ! preg_match('@<base\\b@i', $content)) {
|
||||
$content = preg_replace(
|
||||
'@(<head\\b[^>]*>)@i'
|
||||
,'$1<base href="' . htmlentities($url) . '" />'
|
||||
,'$1<base href="' . htmlspecialchars($url, ENT_QUOTES, 'UTF-8') . '" />'
|
||||
,$content
|
||||
);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ if (isset($_POST['url'])) {
|
||||
));
|
||||
} catch (Exception $e) {
|
||||
header('Content-Type: text/html;charset=utf-8');
|
||||
echo htmlspecialchars($e->getMessage());
|
||||
echo htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
exit();
|
||||
}
|
||||
@@ -156,7 +156,7 @@ The fetched resource Content-Type will determine the minifier used.</p>
|
||||
|
||||
<fieldset><legend>Retreival options</legend>
|
||||
<ul>
|
||||
<li><label>User-Agent: <input type="text" name="ua" size="60" value="<?php echo htmlspecialchars($ua); ?>"></label>
|
||||
<li><label>User-Agent: <input type="text" name="ua" size="60" value="<?php echo htmlspecialchars($ua, ENT_QUOTES, 'UTF-8'); ?>"></label>
|
||||
<li><label>Cookie: <input type="text" name="cook" size="60"></label>
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
@@ -2,7 +2,8 @@
|
||||
|
||||
require dirname(__FILE__) . '/../min/config.php';
|
||||
|
||||
set_include_path($min_libPath . PATH_SEPARATOR . get_include_path());
|
||||
require "$min_libPath/Minify/Loader.php";
|
||||
Minify_Loader::register();
|
||||
|
||||
// set cache path and doc root if configured
|
||||
$minifyCachePath = isset($min_cachePath)
|
||||
@@ -13,11 +14,9 @@ if ($min_documentRoot) {
|
||||
}
|
||||
|
||||
// default log to FirePHP
|
||||
require_once 'Minify/Logger.php';
|
||||
if ($min_errorLogger && true !== $min_errorLogger) { // custom logger
|
||||
Minify_Logger::setLogger($min_errorLogger);
|
||||
} else {
|
||||
require_once 'FirePHP.php';
|
||||
Minify_Logger::setLogger(FirePHP::getInstance(true));
|
||||
}
|
||||
|
||||
|
@@ -55,3 +55,12 @@ if ((is.ie && is.win) == recognizesCondComm)
|
||||
document.write("PASS: IE/win honored single-line conditional comment.<br>");
|
||||
else
|
||||
document.write("FAIL: Non-IE/win browser did not ignore single-line conditional comment.<br>");
|
||||
|
||||
// hello
|
||||
//@cc_on/*
|
||||
// world
|
||||
//@cc_on*/
|
||||
//@cc_on/*
|
||||
'hello';
|
||||
/*!* preserved */
|
||||
/*!* preserved */
|
7
min_unit_tests/_test_files/js/before.min.js
vendored
7
min_unit_tests/_test_files/js/before.min.js
vendored
@@ -19,4 +19,9 @@ document.write("PASS: Non-IE/win browser ignores multi-line conditional comment.
|
||||
recognizesCondComm=false;//@cc_on*/
|
||||
if((is.ie&&is.win)==recognizesCondComm)
|
||||
document.write("PASS: IE/win honored single-line conditional comment.<br>");else
|
||||
document.write("FAIL: Non-IE/win browser did not ignore single-line conditional comment.<br>");
|
||||
document.write("FAIL: Non-IE/win browser did not ignore single-line conditional comment.<br>");//@cc_on/*
|
||||
//@cc_on*/
|
||||
//@cc_on/*
|
||||
'hello';
|
||||
/*!* preserved */
|
||||
/*!* preserved */
|
3
min_unit_tests/_test_files/js/issue256.js
Normal file
3
min_unit_tests/_test_files/js/issue256.js
Normal file
@@ -0,0 +1,3 @@
|
||||
!function(){}(window)
|
||||
|
||||
!function(){}(window)
|
2
min_unit_tests/_test_files/js/issue256.min.js
vendored
Normal file
2
min_unit_tests/_test_files/js/issue256.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
!function(){}(window)
|
||||
!function(){}(window)
|
@@ -1,4 +0,0 @@
|
||||
|
||||
function testIssue74() {
|
||||
return /'/;
|
||||
}
|
1
min_unit_tests/_test_files/js/issue74.min.js
vendored
1
min_unit_tests/_test_files/js/issue74.min.js
vendored
@@ -1 +0,0 @@
|
||||
function testIssue74(){return /'/;}
|
@@ -1 +0,0 @@
|
||||
function testIssue74(){return /'/}
|
20
min_unit_tests/_test_files/js/regexes.js
Normal file
20
min_unit_tests/_test_files/js/regexes.js
Normal file
@@ -0,0 +1,20 @@
|
||||
function testIssue74() {
|
||||
return /'/;
|
||||
}
|
||||
|
||||
!function(s) {
|
||||
return /^[£$€?.]/.test(s);
|
||||
}();
|
||||
|
||||
typeof
|
||||
/ ' /;
|
||||
|
||||
x = / [/] /;
|
||||
|
||||
1
|
||||
|
||||
/ foo;
|
||||
|
||||
(2)
|
||||
|
||||
/ foo;
|
3
min_unit_tests/_test_files/js/regexes.min.js
vendored
Normal file
3
min_unit_tests/_test_files/js/regexes.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
function testIssue74(){return /'/;}
|
||||
!function(s){return /^[£$€?.]/.test(s);}();typeof
|
||||
/ ' /;x=/ [/] /;1/foo;(2)/foo;
|
@@ -1,227 +1,4 @@
|
||||
|
||||
/* email.js */
|
||||
|
||||
/* 1 */ // http://mrclay.org/
|
||||
/* 2 */ (function(){
|
||||
/* 3 */ var
|
||||
/* 4 */ reMailto = /^mailto:my_name_is_(\S+)_and_the_domain_is_(\S+)$/,
|
||||
/* 5 */ reRemoveTitleIf = /^my name is/,
|
||||
/* 6 */ oo = window.onload,
|
||||
/* 7 */ fixHrefs = function() {
|
||||
/* 8 */ var i = 0, l, m;
|
||||
/* 9 */ while (l = document.links[i++]) {
|
||||
/* 10 */ // require phrase in href property
|
||||
/* 11 */ if (m = l.href.match(reMailto)) {
|
||||
/* 12 */ l.href = 'mailto:' + m[1] + '@' + m[2];
|
||||
/* 13 */ if (reRemoveTitleIf.test(l.title)) {
|
||||
/* 14 */ l.title = '';
|
||||
/* 15 */ }
|
||||
/* 16 */ }
|
||||
/* 17 */ }
|
||||
/* 18 */ };
|
||||
/* 19 */ // end var
|
||||
/* 20 */ window.onload = function() {
|
||||
/* 21 */ oo && oo();
|
||||
/* 22 */ fixHrefs();
|
||||
/* 23 */ };
|
||||
/* 24 */ })();
|
||||
|
||||
;
|
||||
/* lines_bugs.js */
|
||||
|
||||
/* 1 */ // sections from Prototype 1.6.1
|
||||
/* 2 */ var xpath = ".//"+"*[local-name()='ul' or local-name()='UL']" +
|
||||
/* 3 */ "//"+"*[local-name()='li' or local-name()='LI']";
|
||||
/* 4 */ this.matcher = ['.//'+'*'];
|
||||
/* 5 */ xpath = {
|
||||
/* 6 */ descendant: "//"+"*",
|
||||
/* 7 */ child: "/"+"*",
|
||||
/* 8 */ f: 0
|
||||
/* 9 */ };
|
||||
/* 10 */ document._getElementsByXPath('.//'+'*' + cond, element);
|
||||
|
||||
;
|
||||
/* QueryString.js */
|
||||
|
||||
/* 1 */ var MrClay = window.MrClay || {};
|
||||
/* 2 */
|
||||
/* 3 */ /**
|
||||
/* 4 *| * Simplified access to/manipulation of the query string
|
||||
/* 5 *| *
|
||||
/* 6 *| * Based on: http://adamv.com/dev/javascript/files/querystring.js
|
||||
/* 7 *| * Design pattern: http://www.litotes.demon.co.uk/js_info/private_static.html#wConst
|
||||
/* 8 *| */
|
||||
/* 9 */ MrClay.QueryString = function(){
|
||||
/* 10 */ /**
|
||||
/* 11 *| * @static
|
||||
/* 12 *| * @private
|
||||
/* 13 *| */
|
||||
/* 14 */ var parse = function(str) {
|
||||
/* 15 */ var assignments = str.split('&')
|
||||
/* 16 */ ,obj = {}
|
||||
/* 17 */ ,propValue;
|
||||
/* 18 */ for (var i = 0, l = assignments.length; i < l; ++i) {
|
||||
/* 19 */ propValue = assignments[i].split('=');
|
||||
/* 20 */ if (propValue.length > 2
|
||||
/* 21 */ || -1 != propValue[0].indexOf('+')
|
||||
/* 22 */ || propValue[0] == ''
|
||||
/* 23 */ ) {
|
||||
/* 24 */ continue;
|
||||
/* 25 */ }
|
||||
/* 26 */ if (propValue.length == 1) {
|
||||
/* 27 */ propValue[1] = propValue[0];
|
||||
/* 28 */ }
|
||||
/* 29 */ obj[unescape(propValue[0])] = unescape(propValue[1].replace(/\+/g, ' '));
|
||||
/* 30 */ }
|
||||
/* 31 */ return obj;
|
||||
/* 32 */ };
|
||||
/* 33 */
|
||||
/* 34 */ /**
|
||||
/* 35 *| * Constructor (MrClay.QueryString becomes this)
|
||||
/* 36 *| *
|
||||
/* 37 *| * @param mixed A window object, a query string, or empty (default current window)
|
||||
/* 38 *| */
|
||||
/* 39 */ function construct_(spec) {
|
||||
/* 40 */ spec = spec || window;
|
||||
/* 41 */ if (typeof spec == 'object') {
|
||||
/* 42 */ // get querystring from window
|
||||
/* 43 */ this.window = spec;
|
||||
/* 44 */ spec = spec.location.search.substr(1);
|
||||
/* 45 */ } else {
|
||||
/* 46 */ this.window = window;
|
||||
/* 47 */ }
|
||||
/* 48 */ this.vars = parse(spec);
|
||||
/* 49 */ }
|
||||
/* 50 */
|
||||
|
||||
/* QueryString.js */
|
||||
|
||||
/* 51 */ /**
|
||||
/* 52 *| * Reload the window
|
||||
/* 53 *| *
|
||||
/* 54 *| * @static
|
||||
/* 55 *| * @public
|
||||
/* 56 *| * @param object vars Specify querystring vars only if you wish to replace them
|
||||
/* 57 *| * @param object window_ window to be reloaded (current window by default)
|
||||
/* 58 *| */
|
||||
/* 59 */ construct_.reload = function(vars, window_) {
|
||||
/* 60 */ window_ = window_ || window;
|
||||
/* 61 */ vars = vars || (new MrClay.QueryString(window_)).vars;
|
||||
/* 62 */ var l = window_.location
|
||||
/* 63 */ ,currUrl = l.href
|
||||
/* 64 */ ,s = MrClay.QueryString.toString(vars)
|
||||
/* 65 */ ,newUrl = l.protocol + '//' + l.hostname + l.pathname
|
||||
/* 66 */ + (s ? '?' + s : '') + l.hash;
|
||||
/* 67 */ if (currUrl == newUrl) {
|
||||
/* 68 */ l.reload();
|
||||
/* 69 */ } else {
|
||||
/* 70 */ l.assign(newUrl);
|
||||
/* 71 */ }
|
||||
/* 72 */ };
|
||||
/* 73 */
|
||||
/* 74 */ /**
|
||||
/* 75 *| * Get the value of a querystring var
|
||||
/* 76 *| *
|
||||
/* 77 *| * @static
|
||||
/* 78 *| * @public
|
||||
/* 79 *| * @param string key
|
||||
/* 80 *| * @param mixed default_ value to return if key not found
|
||||
/* 81 *| * @param object window_ window to check (current window by default)
|
||||
/* 82 *| * @return mixed
|
||||
/* 83 *| */
|
||||
/* 84 */ construct_.get = function(key, default_, window_) {
|
||||
/* 85 */ window_ = window_ || window;
|
||||
/* 86 */ return (new MrClay.QueryString(window_)).get(key, default_);
|
||||
/* 87 */ };
|
||||
/* 88 */
|
||||
/* 89 */ /**
|
||||
/* 90 *| * Reload the page setting one or multiple querystring vars
|
||||
/* 91 *| *
|
||||
/* 92 *| * @static
|
||||
/* 93 *| * @public
|
||||
/* 94 *| * @param mixed key object of query vars/values, or a string key for a single
|
||||
/* 95 *| * assignment
|
||||
/* 96 *| * @param mixed null for multiple settings, the value to assign for single
|
||||
/* 97 *| * @param object window_ window to reload (current window by default)
|
||||
/* 98 *| */
|
||||
/* 99 */ construct_.set = function(key, value, window_) {
|
||||
/* 100 */ window_ = window_ || window;
|
||||
|
||||
/* QueryString.js */
|
||||
|
||||
/* 101 */ (new MrClay.QueryString(window_)).set(key, value).reload();
|
||||
/* 102 */ };
|
||||
/* 103 */
|
||||
/* 104 */ /**
|
||||
/* 105 *| * Convert an object of query vars/values to a querystring
|
||||
/* 106 *| *
|
||||
/* 107 *| * @static
|
||||
/* 108 *| * @public
|
||||
/* 109 *| * @param object query vars/values
|
||||
/* 110 *| * @return string
|
||||
/* 111 *| */
|
||||
/* 112 */ construct_.toString = function(vars) {
|
||||
/* 113 */ var pieces = [];
|
||||
/* 114 */ for (var prop in vars) {
|
||||
/* 115 */ pieces.push(escape(prop) + '=' + escape(vars[prop]));
|
||||
/* 116 */ }
|
||||
/* 117 */ return pieces.join('&');
|
||||
/* 118 */ };
|
||||
/* 119 */
|
||||
/* 120 */ /**
|
||||
/* 121 *| * @public
|
||||
/* 122 *| */
|
||||
/* 123 */ construct_.prototype.reload = function() {
|
||||
/* 124 */ MrClay.QueryString.reload(this.vars, this.window);
|
||||
/* 125 */ return this;
|
||||
/* 126 */ };
|
||||
/* 127 */
|
||||
/* 128 */ /**
|
||||
/* 129 *| * @public
|
||||
/* 130 *| */
|
||||
/* 131 */ construct_.prototype.get = function(key, default_) {
|
||||
/* 132 */ if (typeof default_ == 'undefined') {
|
||||
/* 133 */ default_ = null;
|
||||
/* 134 */ }
|
||||
/* 135 */ return (this.vars[key] == null)
|
||||
/* 136 */ ? default_
|
||||
/* 137 */ : this.vars[key];
|
||||
/* 138 */ };
|
||||
/* 139 */
|
||||
/* 140 */ /**
|
||||
/* 141 *| * @public
|
||||
/* 142 *| */
|
||||
/* 143 */ construct_.prototype.set = function(key, value) {
|
||||
/* 144 */ var obj = {};
|
||||
/* 145 */ if (typeof key == 'string') {
|
||||
/* 146 */ obj[key] = value;
|
||||
/* 147 */ } else {
|
||||
/* 148 */ obj = key;
|
||||
/* 149 */ }
|
||||
/* 150 */ for (var prop in obj) {
|
||||
|
||||
/* QueryString.js */
|
||||
|
||||
/* 151 */ if (obj[prop] == null) {
|
||||
/* 152 */ delete this.vars[prop];
|
||||
/* 153 */ } else {
|
||||
/* 154 */ this.vars[prop] = obj[prop];
|
||||
/* 155 */ }
|
||||
/* 156 */ }
|
||||
/* 157 */ return this;
|
||||
/* 158 */ };
|
||||
/* 159 */
|
||||
/* 160 */ /**
|
||||
/* 161 *| * @public
|
||||
/* 162 *| */
|
||||
/* 163 */ construct_.prototype.toString = function() {
|
||||
/* 164 */ return QueryString.toString(this.vars);
|
||||
/* 165 */ };
|
||||
/* 166 */
|
||||
/* 167 */ return construct_;
|
||||
/* 168 */ }(); // define and execute
|
||||
|
||||
;
|
||||
/* before.js */
|
||||
|
||||
/* 1 */ /*! is.js
|
||||
@@ -277,11 +54,19 @@
|
||||
|
||||
/* before.js */
|
||||
|
||||
/* 51 *| recognizesCondComm = false;
|
||||
/* 52 *| //@cc_on*/
|
||||
/* 51 */ recognizesCondComm = false;
|
||||
/* 52 */ //@cc_on*/
|
||||
/* 53 */
|
||||
/* 54 */ if ((is.ie && is.win) == recognizesCondComm)
|
||||
/* 55 */ document.write("PASS: IE/win honored single-line conditional comment.<br>");
|
||||
/* 56 */ else
|
||||
/* 57 */ document.write("FAIL: Non-IE/win browser did not ignore single-line conditional comment.<br>");
|
||||
/* 58 */
|
||||
/* 59 */ // hello
|
||||
/* 60 */ //@cc_on/*
|
||||
/* 61 */ // world
|
||||
/* 62 */ //@cc_on*/
|
||||
/* 63 */ //@cc_on/*
|
||||
/* 64 */ 'hello';
|
||||
/* 65 */ /*!* preserved */
|
||||
/* 66 */ /*!* preserved */
|
||||
|
@@ -1,6 +0,0 @@
|
||||
To add a test:
|
||||
|
||||
1. Create a "blah.css" or "blah.js" file.
|
||||
2. Create a "blah.css.min" or "blah.js.min" file, containing the expected minified output.
|
||||
|
||||
That's all!
|
0
min_unit_tests/_test_files/yuic/background-position.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/background-position.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/background-position.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/background-position.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/border-none.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/border-none.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/border-none.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/border-none.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/box-model-hack.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/box-model-hack.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/box-model-hack.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/box-model-hack.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527974.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527974.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527974.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527974.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527991.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527991.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527991.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527991.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527998.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527998.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527998.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2527998.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2528034.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2528034.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2528034.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/bug2528034.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/charset-media.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/charset-media.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/charset-media.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/charset-media.css.min
Normal file → Executable file
8
min_unit_tests/_test_files/yuic/color-simple.css
Executable file
8
min_unit_tests/_test_files/yuic/color-simple.css
Executable file
@@ -0,0 +1,8 @@
|
||||
.foo, #AABBCC {
|
||||
background-color:#aabbcc;
|
||||
border-color:#Ee66aA #ABCDEF #FeAb2C;
|
||||
filter:chroma(color = #FFFFFF );
|
||||
filter:chroma(color="#AABBCC");
|
||||
filter:chroma(color='#BBDDEE');
|
||||
color:#112233
|
||||
}
|
1
min_unit_tests/_test_files/yuic/color-simple.css.min
Executable file
1
min_unit_tests/_test_files/yuic/color-simple.css.min
Executable file
@@ -0,0 +1 @@
|
||||
.foo,#AABBCC{background-color:#abc;border-color:#e6a #abcdef #feab2c;filter:chroma(color = #FFFFFF);filter:chroma(color="#AABBCC");filter:chroma(color='#BBDDEE');color:#123}
|
43
min_unit_tests/_test_files/yuic/color.css
Normal file → Executable file
43
min_unit_tests/_test_files/yuic/color.css
Normal file → Executable file
@@ -1,7 +1,46 @@
|
||||
.color {
|
||||
me: rgb(123, 123, 123);
|
||||
impressed: #ffeedd;
|
||||
impressed: #FfEedD;
|
||||
again: #ABCDEF;
|
||||
andagain:#aa66cc;
|
||||
background-color:#aa66ccc;
|
||||
filter: chroma(color="#FFFFFF");
|
||||
background: none repeat scroll 0 0 rgb(255, 0,0);
|
||||
alpha: rgba(1, 2, 3, 4);
|
||||
}
|
||||
color:#1122aa
|
||||
}
|
||||
|
||||
#AABBCC {
|
||||
background-color:#ffee11;
|
||||
filter: chroma(color = #FFFFFF );
|
||||
color:#441122;
|
||||
foo:#00fF11 #ABC #AABbCc #123344;
|
||||
border-color:#aa66ccC
|
||||
}
|
||||
|
||||
.foo #AABBCC {
|
||||
background-color:#fFEe11;
|
||||
color:#441122;
|
||||
border-color:#AbC;
|
||||
filter: chroma(color= #FFFFFF)
|
||||
}
|
||||
|
||||
.bar, #AABBCC {
|
||||
background-color:#FFee11;
|
||||
border-color:#00fF11 #ABCDEF;
|
||||
filter: chroma(color=#11FFFFFF);
|
||||
color:#441122;
|
||||
}
|
||||
|
||||
.foo, #AABBCC.foobar {
|
||||
background-color:#ffee11;
|
||||
border-color:#00fF11 #ABCDEF #AABbCc;
|
||||
color:#441122;
|
||||
}
|
||||
|
||||
@media screen {
|
||||
.bar, #AABBCC {
|
||||
background-color:#ffEE11;
|
||||
color:#441122
|
||||
}
|
||||
}
|
||||
|
2
min_unit_tests/_test_files/yuic/color.css.min
Normal file → Executable file
2
min_unit_tests/_test_files/yuic/color.css.min
Normal file → Executable file
@@ -1 +1 @@
|
||||
.color{me:#7b7b7b;impressed:#fed;filter:chroma(color="#FFFFFF");background:none repeat scroll 0 0 #f00;alpha:rgba(1,2,3,4)}
|
||||
.color{me:#7b7b7b;impressed:#fed;again:#abcdef;andagain:#a6c;background-color:#aa66ccc;filter:chroma(color="#FFFFFF");background:none repeat scroll 0 0 #f00;alpha:rgba(1,2,3,4);color:#12a}#AABBCC{background-color:#fe1;filter:chroma(color = #FFFFFF);color:#412;foo:#0f1 #ABC #abc #123344;border-color:#aa66ccC}.foo #AABBCC{background-color:#fe1;color:#412;border-color:#AbC;filter:chroma(color= #FFFFFF)}.bar,#AABBCC{background-color:#fe1;border-color:#0f1 #abcdef;filter:chroma(color=#11FFFFFF);color:#412}.foo,#AABBCC.foobar{background-color:#fe1;border-color:#0f1 #abcdef #abc;color:#412}@media screen{.bar,#AABBCC{background-color:#fe1;color:#412}}
|
||||
|
0
min_unit_tests/_test_files/yuic/comment.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/comment.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/comment.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/comment.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/concat-charset.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/concat-charset.css
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/concat-charset.css.min
Normal file → Executable file
0
min_unit_tests/_test_files/yuic/concat-charset.css.min
Normal file → Executable file
23
min_unit_tests/_test_files/yuic/dataurl-base64-doublequotes.css
Executable file
23
min_unit_tests/_test_files/yuic/dataurl-base64-doublequotes.css
Executable file
File diff suppressed because one or more lines are too long
1
min_unit_tests/_test_files/yuic/dataurl-base64-doublequotes.css.min
Executable file
1
min_unit_tests/_test_files/yuic/dataurl-base64-doublequotes.css.min
Executable file
File diff suppressed because one or more lines are too long
10
min_unit_tests/_test_files/yuic/dataurl-base64-eof.css
Executable file
10
min_unit_tests/_test_files/yuic/dataurl-base64-eof.css
Executable file
@@ -0,0 +1,10 @@
|
||||
div.base64-singlequotes {
|
||||
width:100px;
|
||||
height:100px;
|
||||
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t%2FAAAACXBIWXMAAA3WAAAN1gGQb3mcAAAFrUlEQVRYw%2B2Xz28kRxXHP%2B9Vdc8vj2fG9uIkm2yUeFGEhNCKQwBpj1yRUBAnpJU4ceZP4MxfkBxy2GO45bQXuEGQohUKigQ%2BsBBE1sbYXv8Yz%2FRMd9fjUN09PV5nFZA4kZZa79W3quu9er%2FqNfy%2FPwJgZty%2Ffz%2FZ29vrpmmqhlWTgmFg1UpbfWhYhG6Yq2cFi%2FNrj9nJyWnx%2BPHjeafbMTEzPvjVB9%2B6d%2B%2FezweDwV1BfHubivkC3lZya%2F4m7Np8UZYXhweHH7733rvvC0Kyv7%2F%2F7p07d34qIjyvr63RNb4l4CbsRUrNrq6OfvfRRz%2FxDx486A%2F6g7vXhX9ZIf%2Bp4JomaToZj8d7Pk1SFRFXb1aWodq09l%2F9YZu%2FCWMVL9e%2FaVFVQVUREEG8r3VUEZ4cX%2FHL30%2B5shRtAhFq4wggNb6GrXgVa2K2jYtACIHv7Sz54TfHjWWagBOBy0Xgt%2BcjLtwQxVCpNwURQat1DdYaT7pwdwKDFA6ncHgFizJmSb3WLPDa7PMIVlb2daqZxdONUnAetEojEdBGiXXhTmAjhZ0%2B3N6AlzeEROH1TXiWGf%2BcwmkWZYnAfAkdx1pq%2BhUbT9z3IElUJlVhI4WsgCLUyggi4MQYd4VXNmCYRqXOspV7UoHbQ3hpEMeLAk5mkFYRYlWI%2BHZ6CTDwkKSQqrA7gFeHMF3C6VyYLmFZGiKCE6GrMFsaWb7yuVOh66N1FkUUpBJ3TyvFovToBl9XMbNY2bZ70BsKfW94hbyErosmXpQwy4VgkCjMizjvRRik0EtiLNwagBf465lwOqtkETEn60XT1%2BlTazrpKlR%2BKkooy3Xfb3Wj3wGWJRQhnni7B53q5FqZ4%2FUR7PYhGMxyuMwgWVqTxrYWAwZYQX78J5i8ie9txSAkoOqqQAqk3pBgKLDhlY5XVKPCi3w97YRoKSFaceCgF2hqSXRBPQAIOcXRH8hP%2F0y6%2BRpWLrEyg3SbS9tmzggzJQSLQZo4xoOE8UbCsJfQ7zi6iaIizZ5OBVfXDKPireWC%2BvAYWOBqeszl9Jg03afbH6OqGH%2FBSUrqbrFIXiHoiEDC%2FPySi2d9nnZHJE7opY7dcY%2FdcZej84zpPGfY9Uw2ErYGCf2O4mUVEzELWtqUxZKjf3zK2cURzicMRy%2BzvbuH8ylFPqXIPqNczClKY1mUZFcnSDKkv%2FUNuptbWG%2BLw%2FMh%2FzrYpKBHKV3ONOXzYxeV20z49qhs7gaMWIjqQQiBxVXB4irg05yz4u%2FMpieoJuTLjDJfUJYBzBAFUUHkhMvLvzFPuvQ2JvQ3duh0R%2FjuiDQdIn6MJdvkxTafZUPuaN6UaOo6UNtgNl9weboguwqoA5fCjEusNCzE8LJQFRuNrzpQD%2BrmZNM55%2F4A5z1J2iHtDEg6fZK0j0uHlDrh2N4i3Ptuc%2BH5tjp5HliWQmmOUAhlYe0rqUqWSEOhcZ05AvE1UdColSQJaHWlSUYgJy%2FO2fFfo%2F34piphFOZ4OrvNdL5EJZbcmE8OQzFxIJEGEgIeE1%2FhrjJLxZcOrIVpVC7TW00WmLWyAMDEs%2Bi9wVJDtG17Y21vVmNxLKqIOkQqqoq2qHORmgj9UQcza7mgFm4GmiDjO5C72DSoQ6uPVTW%2BzuFUcQ2teKd4pzhd8b6Nu6jg7vZsrb1rClEIxhu7Q37x47fIy3j%2Fi8iqqlUuEWTFN%2FOrMU3fEEuhUM8FIPDqZgcRIVhsAXxtjGDGS5M%2BP%2Fv%2Bm7yopVrRVsPabsW%2BYG1T%2Fy3KahqSg6cHRb5cTmt5ZXhxQ7nS6yZsVWOajDFbw2JSCSGEIsuyC%2F%2Fo0aPp%2Fv7%2Br9NO5%2F5gMOhJLNn%2FpQLrLfw6tkKKorCDg4NPP%2Fnkjx%2FLOz96h2enzyZvf%2BftH9za2fm6qLrnO9tGk2vY86f%2FMliWZRdPnjz5zcOHDz%2B%2B%2Fifimorzv31C9X718G%2FYrCYSNJa5LgAAACJ6VFh0U29mdHdhcmUAAHjaKy8v18vMyy5OTixI1csvSgcANtgGWBBTylwAAAAASUVORK5CYII%3D');
|
||||
background-position:center center;
|
||||
border:1px solid #00aa00;
|
||||
}
|
||||
div.otherdataurl {
|
||||
background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwqwjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWiiBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOMhWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtTvICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYmyeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDiQonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BWrozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OBGjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2FupH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC");
|
||||
}
|
1
min_unit_tests/_test_files/yuic/dataurl-base64-eof.css.min
Executable file
1
min_unit_tests/_test_files/yuic/dataurl-base64-eof.css.min
Executable file
@@ -0,0 +1 @@
|
||||
div.base64-singlequotes{width:100px;height:100px;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t%2FAAAACXBIWXMAAA3WAAAN1gGQb3mcAAAFrUlEQVRYw%2B2Xz28kRxXHP%2B9Vdc8vj2fG9uIkm2yUeFGEhNCKQwBpj1yRUBAnpJU4ceZP4MxfkBxy2GO45bQXuEGQohUKigQ%2BsBBE1sbYXv8Yz%2FRMd9fjUN09PV5nFZA4kZZa79W3quu9er%2FqNfy%2FPwJgZty%2Ffz%2FZ29vrpmmqhlWTgmFg1UpbfWhYhG6Yq2cFi%2FNrj9nJyWnx%2BPHjeafbMTEzPvjVB9%2B6d%2B%2FezweDwV1BfHubivkC3lZya%2F4m7Np8UZYXhweHH7733rvvC0Kyv7%2F%2F7p07d34qIjyvr63RNb4l4CbsRUrNrq6OfvfRRz%2FxDx486A%2F6g7vXhX9ZIf%2Bp4JomaToZj8d7Pk1SFRFXb1aWodq09l%2F9YZu%2FCWMVL9e%2FaVFVQVUREEG8r3VUEZ4cX%2FHL30%2B5shRtAhFq4wggNb6GrXgVa2K2jYtACIHv7Sz54TfHjWWagBOBy0Xgt%2BcjLtwQxVCpNwURQat1DdYaT7pwdwKDFA6ncHgFizJmSb3WLPDa7PMIVlb2daqZxdONUnAetEojEdBGiXXhTmAjhZ0%2B3N6AlzeEROH1TXiWGf%2BcwmkWZYnAfAkdx1pq%2BhUbT9z3IElUJlVhI4WsgCLUyggi4MQYd4VXNmCYRqXOspV7UoHbQ3hpEMeLAk5mkFYRYlWI%2BHZ6CTDwkKSQqrA7gFeHMF3C6VyYLmFZGiKCE6GrMFsaWb7yuVOh66N1FkUUpBJ3TyvFovToBl9XMbNY2bZ70BsKfW94hbyErosmXpQwy4VgkCjMizjvRRik0EtiLNwagBf465lwOqtkETEn60XT1%2BlTazrpKlR%2BKkooy3Xfb3Wj3wGWJRQhnni7B53q5FqZ4%2FUR7PYhGMxyuMwgWVqTxrYWAwZYQX78J5i8ie9txSAkoOqqQAqk3pBgKLDhlY5XVKPCi3w97YRoKSFaceCgF2hqSXRBPQAIOcXRH8hP%2F0y6%2BRpWLrEyg3SbS9tmzggzJQSLQZo4xoOE8UbCsJfQ7zi6iaIizZ5OBVfXDKPireWC%2BvAYWOBqeszl9Jg03afbH6OqGH%2FBSUrqbrFIXiHoiEDC%2FPySi2d9nnZHJE7opY7dcY%2FdcZej84zpPGfY9Uw2ErYGCf2O4mUVEzELWtqUxZKjf3zK2cURzicMRy%2BzvbuH8ylFPqXIPqNczClKY1mUZFcnSDKkv%2FUNuptbWG%2BLw%2FMh%2FzrYpKBHKV3ONOXzYxeV20z49qhs7gaMWIjqQQiBxVXB4irg05yz4u%2FMpieoJuTLjDJfUJYBzBAFUUHkhMvLvzFPuvQ2JvQ3duh0R%2FjuiDQdIn6MJdvkxTafZUPuaN6UaOo6UNtgNl9weboguwqoA5fCjEusNCzE8LJQFRuNrzpQD%2BrmZNM55%2F4A5z1J2iHtDEg6fZK0j0uHlDrh2N4i3Ptuc%2BH5tjp5HliWQmmOUAhlYe0rqUqWSEOhcZ05AvE1UdColSQJaHWlSUYgJy%2FO2fFfo%2F34piphFOZ4OrvNdL5EJZbcmE8OQzFxIJEGEgIeE1%2FhrjJLxZcOrIVpVC7TW00WmLWyAMDEs%2Bi9wVJDtG17Y21vVmNxLKqIOkQqqoq2qHORmgj9UQcza7mgFm4GmiDjO5C72DSoQ6uPVTW%2BzuFUcQ2teKd4pzhd8b6Nu6jg7vZsrb1rClEIxhu7Q37x47fIy3j%2Fi8iqqlUuEWTFN%2FOrMU3fEEuhUM8FIPDqZgcRIVhsAXxtjGDGS5M%2BP%2Fv%2Bm7yopVrRVsPabsW%2BYG1T%2Fy3KahqSg6cHRb5cTmt5ZXhxQ7nS6yZsVWOajDFbw2JSCSGEIsuyC%2F%2Fo0aPp%2Fv7%2Br9NO5%2F5gMOhJLNn%2FpQLrLfw6tkKKorCDg4NPP%2Fnkjx%2FLOz96h2enzyZvf%2BftH9za2fm6qLrnO9tGk2vY86f%2FMliWZRdPnjz5zcOHDz%2B%2B%2Fifimorzv31C9X718G%2FYrCYSNJa5LgAAACJ6VFh0U29mdHdhcmUAAHjaKy8v18vMyy5OTixI1csvSgcANtgGWBBTylwAAAAASUVORK5CYII%3D');background-position:center center;border:1px solid #0a0}div.otherdataurl{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwqwjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWiiBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOMhWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtTvICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYmyeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDiQonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BWrozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OBGjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2FupH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC")}
|
34
min_unit_tests/_test_files/yuic/dataurl-base64-linebreakindata.css
Executable file
34
min_unit_tests/_test_files/yuic/dataurl-base64-linebreakindata.css
Executable file
@@ -0,0 +1,34 @@
|
||||
.yui3-skin-night .yui3-dial-ring-vml,
|
||||
.yui3-skin-night .yui3-dial-center-button-vml,
|
||||
.yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min,
|
||||
.yui3-skin-night v\:oval.yui3-dial-marker-max-min,
|
||||
.yui3-skin-night .yui3-dial-marker-vml,
|
||||
.yui3-skin-night .yui3-dial-handle-vml {
|
||||
background: none;
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
div.base64-doublequotes {
|
||||
width:100px;
|
||||
height:100px;
|
||||
background-image:url( "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwq
|
||||
wjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWi
|
||||
iBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv
|
||||
1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOM
|
||||
hWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtT
|
||||
vICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYm
|
||||
yeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDi
|
||||
QonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BW
|
||||
rozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OB
|
||||
GjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2Fu
|
||||
pH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6
|
||||
EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC" );
|
||||
background-position:center center;
|
||||
border:1px solid #00aa00;
|
||||
}
|
||||
|
||||
.yui-skin-sam .yui-h-slider {
|
||||
background: url(bg-h.gif) no-repeat 5px 0;
|
||||
height: 28px;
|
||||
width: 228px;
|
||||
}
|
1
min_unit_tests/_test_files/yuic/dataurl-base64-linebreakindata.css.min
Executable file
1
min_unit_tests/_test_files/yuic/dataurl-base64-linebreakindata.css.min
Executable file
@@ -0,0 +1 @@
|
||||
.yui3-skin-night .yui3-dial-ring-vml,.yui3-skin-night .yui3-dial-center-button-vml,.yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min,.yui3-skin-night v\:oval.yui3-dial-marker-max-min,.yui3-skin-night .yui3-dial-marker-vml,.yui3-skin-night .yui3-dial-handle-vml{background:0;opacity:1}div.base64-doublequotes{width:100px;height:100px;background-image:url("data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwqwjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWiiBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOMhWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtTvICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYmyeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDiQonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BWrozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OBGjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2FupH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC");background-position:center center;border:1px solid #0a0}.yui-skin-sam .yui-h-slider{background:url(bg-h.gif) no-repeat 5px 0;height:28px;width:228px}
|
26
min_unit_tests/_test_files/yuic/dataurl-base64-noquotes.css
Executable file
26
min_unit_tests/_test_files/yuic/dataurl-base64-noquotes.css
Executable file
File diff suppressed because one or more lines are too long
1
min_unit_tests/_test_files/yuic/dataurl-base64-noquotes.css.min
Executable file
1
min_unit_tests/_test_files/yuic/dataurl-base64-noquotes.css.min
Executable file
File diff suppressed because one or more lines are too long
23
min_unit_tests/_test_files/yuic/dataurl-base64-singlequotes.css
Executable file
23
min_unit_tests/_test_files/yuic/dataurl-base64-singlequotes.css
Executable file
File diff suppressed because one or more lines are too long
1
min_unit_tests/_test_files/yuic/dataurl-base64-singlequotes.css.min
Executable file
1
min_unit_tests/_test_files/yuic/dataurl-base64-singlequotes.css.min
Executable file
File diff suppressed because one or more lines are too long
27
min_unit_tests/_test_files/yuic/dataurl-base64-twourls.css
Executable file
27
min_unit_tests/_test_files/yuic/dataurl-base64-twourls.css
Executable file
@@ -0,0 +1,27 @@
|
||||
.yui3-skin-night .yui3-dial-ring-vml,
|
||||
.yui3-skin-night .yui3-dial-center-button-vml,
|
||||
.yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min,
|
||||
.yui3-skin-night v\:oval.yui3-dial-marker-max-min,
|
||||
.yui3-skin-night .yui3-dial-marker-vml,
|
||||
.yui3-skin-night .yui3-dial-handle-vml {
|
||||
background: none;
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
div.base64-singlequotes {
|
||||
width:100px;
|
||||
height:100px;
|
||||
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t%2FAAAACXBIWXMAAA3WAAAN1gGQb3mcAAAFrUlEQVRYw%2B2Xz28kRxXHP%2B9Vdc8vj2fG9uIkm2yUeFGEhNCKQwBpj1yRUBAnpJU4ceZP4MxfkBxy2GO45bQXuEGQohUKigQ%2BsBBE1sbYXv8Yz%2FRMd9fjUN09PV5nFZA4kZZa79W3quu9er%2FqNfy%2FPwJgZty%2Ffz%2FZ29vrpmmqhlWTgmFg1UpbfWhYhG6Yq2cFi%2FNrj9nJyWnx%2BPHjeafbMTEzPvjVB9%2B6d%2B%2FezweDwV1BfHubivkC3lZya%2F4m7Np8UZYXhweHH7733rvvC0Kyv7%2F%2F7p07d34qIjyvr63RNb4l4CbsRUrNrq6OfvfRRz%2FxDx486A%2F6g7vXhX9ZIf%2Bp4JomaToZj8d7Pk1SFRFXb1aWodq09l%2F9YZu%2FCWMVL9e%2FaVFVQVUREEG8r3VUEZ4cX%2FHL30%2B5shRtAhFq4wggNb6GrXgVa2K2jYtACIHv7Sz54TfHjWWagBOBy0Xgt%2BcjLtwQxVCpNwURQat1DdYaT7pwdwKDFA6ncHgFizJmSb3WLPDa7PMIVlb2daqZxdONUnAetEojEdBGiXXhTmAjhZ0%2B3N6AlzeEROH1TXiWGf%2BcwmkWZYnAfAkdx1pq%2BhUbT9z3IElUJlVhI4WsgCLUyggi4MQYd4VXNmCYRqXOspV7UoHbQ3hpEMeLAk5mkFYRYlWI%2BHZ6CTDwkKSQqrA7gFeHMF3C6VyYLmFZGiKCE6GrMFsaWb7yuVOh66N1FkUUpBJ3TyvFovToBl9XMbNY2bZ70BsKfW94hbyErosmXpQwy4VgkCjMizjvRRik0EtiLNwagBf465lwOqtkETEn60XT1%2BlTazrpKlR%2BKkooy3Xfb3Wj3wGWJRQhnni7B53q5FqZ4%2FUR7PYhGMxyuMwgWVqTxrYWAwZYQX78J5i8ie9txSAkoOqqQAqk3pBgKLDhlY5XVKPCi3w97YRoKSFaceCgF2hqSXRBPQAIOcXRH8hP%2F0y6%2BRpWLrEyg3SbS9tmzggzJQSLQZo4xoOE8UbCsJfQ7zi6iaIizZ5OBVfXDKPireWC%2BvAYWOBqeszl9Jg03afbH6OqGH%2FBSUrqbrFIXiHoiEDC%2FPySi2d9nnZHJE7opY7dcY%2FdcZej84zpPGfY9Uw2ErYGCf2O4mUVEzELWtqUxZKjf3zK2cURzicMRy%2BzvbuH8ylFPqXIPqNczClKY1mUZFcnSDKkv%2FUNuptbWG%2BLw%2FMh%2FzrYpKBHKV3ONOXzYxeV20z49qhs7gaMWIjqQQiBxVXB4irg05yz4u%2FMpieoJuTLjDJfUJYBzBAFUUHkhMvLvzFPuvQ2JvQ3duh0R%2FjuiDQdIn6MJdvkxTafZUPuaN6UaOo6UNtgNl9weboguwqoA5fCjEusNCzE8LJQFRuNrzpQD%2BrmZNM55%2F4A5z1J2iHtDEg6fZK0j0uHlDrh2N4i3Ptuc%2BH5tjp5HliWQmmOUAhlYe0rqUqWSEOhcZ05AvE1UdColSQJaHWlSUYgJy%2FO2fFfo%2F34piphFOZ4OrvNdL5EJZbcmE8OQzFxIJEGEgIeE1%2FhrjJLxZcOrIVpVC7TW00WmLWyAMDEs%2Bi9wVJDtG17Y21vVmNxLKqIOkQqqoq2qHORmgj9UQcza7mgFm4GmiDjO5C72DSoQ6uPVTW%2BzuFUcQ2teKd4pzhd8b6Nu6jg7vZsrb1rClEIxhu7Q37x47fIy3j%2Fi8iqqlUuEWTFN%2FOrMU3fEEuhUM8FIPDqZgcRIVhsAXxtjGDGS5M%2BP%2Fv%2Bm7yopVrRVsPabsW%2BYG1T%2Fy3KahqSg6cHRb5cTmt5ZXhxQ7nS6yZsVWOajDFbw2JSCSGEIsuyC%2F%2Fo0aPp%2Fv7%2Br9NO5%2F5gMOhJLNn%2FpQLrLfw6tkKKorCDg4NPP%2Fnkjx%2FLOz96h2enzyZvf%2BftH9za2fm6qLrnO9tGk2vY86f%2FMliWZRdPnjz5zcOHDz%2B%2B%2Fifimorzv31C9X718G%2FYrCYSNJa5LgAAACJ6VFh0U29mdHdhcmUAAHjaKy8v18vMyy5OTixI1csvSgcANtgGWBBTylwAAAAASUVORK5CYII%3D');
|
||||
background-position:center center;
|
||||
border:1px solid #00aa00;
|
||||
}
|
||||
|
||||
div.otherdataurl {
|
||||
background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwqwjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWiiBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOMhWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtTvICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYmyeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDiQonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BWrozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OBGjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2FupH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC");
|
||||
}
|
||||
|
||||
.yui-skin-sam .yui-h-slider {
|
||||
background: url(bg-h.gif) no-repeat 5px 0;
|
||||
height: 28px;
|
||||
width: 228px;
|
||||
}
|
1
min_unit_tests/_test_files/yuic/dataurl-base64-twourls.css.min
Executable file
1
min_unit_tests/_test_files/yuic/dataurl-base64-twourls.css.min
Executable file
@@ -0,0 +1 @@
|
||||
.yui3-skin-night .yui3-dial-ring-vml,.yui3-skin-night .yui3-dial-center-button-vml,.yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min,.yui3-skin-night v\:oval.yui3-dial-marker-max-min,.yui3-skin-night .yui3-dial-marker-vml,.yui3-skin-night .yui3-dial-handle-vml{background:0;opacity:1}div.base64-singlequotes{width:100px;height:100px;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QAAAAAAAD5Q7t%2FAAAACXBIWXMAAA3WAAAN1gGQb3mcAAAFrUlEQVRYw%2B2Xz28kRxXHP%2B9Vdc8vj2fG9uIkm2yUeFGEhNCKQwBpj1yRUBAnpJU4ceZP4MxfkBxy2GO45bQXuEGQohUKigQ%2BsBBE1sbYXv8Yz%2FRMd9fjUN09PV5nFZA4kZZa79W3quu9er%2FqNfy%2FPwJgZty%2Ffz%2FZ29vrpmmqhlWTgmFg1UpbfWhYhG6Yq2cFi%2FNrj9nJyWnx%2BPHjeafbMTEzPvjVB9%2B6d%2B%2FezweDwV1BfHubivkC3lZya%2F4m7Np8UZYXhweHH7733rvvC0Kyv7%2F%2F7p07d34qIjyvr63RNb4l4CbsRUrNrq6OfvfRRz%2FxDx486A%2F6g7vXhX9ZIf%2Bp4JomaToZj8d7Pk1SFRFXb1aWodq09l%2F9YZu%2FCWMVL9e%2FaVFVQVUREEG8r3VUEZ4cX%2FHL30%2B5shRtAhFq4wggNb6GrXgVa2K2jYtACIHv7Sz54TfHjWWagBOBy0Xgt%2BcjLtwQxVCpNwURQat1DdYaT7pwdwKDFA6ncHgFizJmSb3WLPDa7PMIVlb2daqZxdONUnAetEojEdBGiXXhTmAjhZ0%2B3N6AlzeEROH1TXiWGf%2BcwmkWZYnAfAkdx1pq%2BhUbT9z3IElUJlVhI4WsgCLUyggi4MQYd4VXNmCYRqXOspV7UoHbQ3hpEMeLAk5mkFYRYlWI%2BHZ6CTDwkKSQqrA7gFeHMF3C6VyYLmFZGiKCE6GrMFsaWb7yuVOh66N1FkUUpBJ3TyvFovToBl9XMbNY2bZ70BsKfW94hbyErosmXpQwy4VgkCjMizjvRRik0EtiLNwagBf465lwOqtkETEn60XT1%2BlTazrpKlR%2BKkooy3Xfb3Wj3wGWJRQhnni7B53q5FqZ4%2FUR7PYhGMxyuMwgWVqTxrYWAwZYQX78J5i8ie9txSAkoOqqQAqk3pBgKLDhlY5XVKPCi3w97YRoKSFaceCgF2hqSXRBPQAIOcXRH8hP%2F0y6%2BRpWLrEyg3SbS9tmzggzJQSLQZo4xoOE8UbCsJfQ7zi6iaIizZ5OBVfXDKPireWC%2BvAYWOBqeszl9Jg03afbH6OqGH%2FBSUrqbrFIXiHoiEDC%2FPySi2d9nnZHJE7opY7dcY%2FdcZej84zpPGfY9Uw2ErYGCf2O4mUVEzELWtqUxZKjf3zK2cURzicMRy%2BzvbuH8ylFPqXIPqNczClKY1mUZFcnSDKkv%2FUNuptbWG%2BLw%2FMh%2FzrYpKBHKV3ONOXzYxeV20z49qhs7gaMWIjqQQiBxVXB4irg05yz4u%2FMpieoJuTLjDJfUJYBzBAFUUHkhMvLvzFPuvQ2JvQ3duh0R%2FjuiDQdIn6MJdvkxTafZUPuaN6UaOo6UNtgNl9weboguwqoA5fCjEusNCzE8LJQFRuNrzpQD%2BrmZNM55%2F4A5z1J2iHtDEg6fZK0j0uHlDrh2N4i3Ptuc%2BH5tjp5HliWQmmOUAhlYe0rqUqWSEOhcZ05AvE1UdColSQJaHWlSUYgJy%2FO2fFfo%2F34piphFOZ4OrvNdL5EJZbcmE8OQzFxIJEGEgIeE1%2FhrjJLxZcOrIVpVC7TW00WmLWyAMDEs%2Bi9wVJDtG17Y21vVmNxLKqIOkQqqoq2qHORmgj9UQcza7mgFm4GmiDjO5C72DSoQ6uPVTW%2BzuFUcQ2teKd4pzhd8b6Nu6jg7vZsrb1rClEIxhu7Q37x47fIy3j%2Fi8iqqlUuEWTFN%2FOrMU3fEEuhUM8FIPDqZgcRIVhsAXxtjGDGS5M%2BP%2Fv%2Bm7yopVrRVsPabsW%2BYG1T%2Fy3KahqSg6cHRb5cTmt5ZXhxQ7nS6yZsVWOajDFbw2JSCSGEIsuyC%2F%2Fo0aPp%2Fv7%2Br9NO5%2F5gMOhJLNn%2FpQLrLfw6tkKKorCDg4NPP%2Fnkjx%2FLOz96h2enzyZvf%2BftH9za2fm6qLrnO9tGk2vY86f%2FMliWZRdPnjz5zcOHDz%2B%2B%2Fifimorzv31C9X718G%2FYrCYSNJa5LgAAACJ6VFh0U29mdHdhcmUAAHjaKy8v18vMyy5OTixI1csvSgcANtgGWBBTylwAAAAASUVORK5CYII%3D');background-position:center center;border:1px solid #0a0}div.otherdataurl{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFBQ0WDWwqwjwAAANMSURBVEjHrdZbaFxVFAbgb2aSTG6GTi6mVIwxNxF9qFI0RQnFUqiYamutVutLa2t9EY0oPggFoYgPRR%2FaghYviA%2BiIAYvmBJKoYWiiBCigVTT1FisbUhrEtNkJpc5PuQkjGEmJqkLFmdz2Hv%2Fa%2F3rX3tvlm95oS%2FLokuZtIpbdvAs7KFtL22wjb3V1C41upy2ke1DXC2k%2FBjv1HHXDrbkEamg7lX2P8QTldQ2UtfOB8uiJsHNiB%2Fik0GmO%2BgZIxgnGA59nGCMoJPeQaYP047iBDXZEohkAYof4%2FNyKlZRdR%2F1ASZCnoOMhWkUheMz9F1laJSRZ3gEqVw1ipZQjcoBRrbT3Ez9OJLhZkHG5CD8l8Q47qXhMZp%2FYxhVFaxBLBtQejdtA%2FTtZPMIJnOknI2WSYzicTYN8OtTvICZbECxdr5Pkm6iPL0C3c%2BgkfIJgi%2F4LnP%2FudRKD3K4jf1VJGLEAiuz6VnA4AGam1h7gpNIzSFe66D3NurLKVhJNkHo07N9V9BE3XHOYmyeuirqG1l9mdHgOkDSGd8%2FGWtg9Roa56lrYdchDtRQPLlCkEywKVRScDfrurnwC2diiPTRe47iVtbnLZDxckGCkKYpPM%2FRr3kbyRhsYOtRDiQonFoBSHrBOI18rOeOPvr76YrCeUbf5fTvjOddJ0gQ1uMPku9z6hwjiEZhgOMn%2BaaUeHQJIOkMD7KMA5QQP01HP18hPbfvDTvZPETqb2YiS1BWrozM6jk9SPJJHkZZ5qFagtoaNnbyZg1FE4sUPRdlAQpwkdSjvDZAJ%2FoxNt%2Bw6NlGbQVFl5iKLKKsXCAwyFQZ8S3ciu65ho1lBJ5%2FkZk3OBGjpJWGmVCmsjTkQvA8JHCUU7s5eImevzg%2Fd7BGFhzCARIf8uVN3J5Heh1VM%2BHlko2y%2FHBxF0NJolfo38eDuJJxbf0ro%2FnMurh8hM%2FupH4tdT8zciOFsTC8SAgQoJfRxKzCuvfw0k%2F8MDx7xqUyez%2BS48ESIN7Ky6OUpfAtrxzhx03UR4m0c%2FZF7tnKW2mma4l9yuthTSIZIvxPi6EcpZW0PM0xtOzjo%2Bf4GPfv4r1qNqAUFYs9diJLBC1CIa7FZx8fUlwI22LuNv%2FfLbKMAOftH9TwRXg6%2FiCDAAAAAElFTkSuQmCC")}.yui-skin-sam .yui-h-slider{background:url(bg-h.gif) no-repeat 5px 0;height:28px;width:228px}
|
30
min_unit_tests/_test_files/yuic/dataurl-dbquote-font.css
Executable file
30
min_unit_tests/_test_files/yuic/dataurl-dbquote-font.css
Executable file
@@ -0,0 +1,30 @@
|
||||
/*csslint fontfamily: true*/
|
||||
|
||||
/**
|
||||
* Foo
|
||||
*/
|
||||
|
||||
.y-ff-1 {
|
||||
font-family:"Foo Bar",Helvetica,Arial;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
||||
.ua-op .y-ff-1 {
|
||||
/* Some Comment */
|
||||
font-family:Helvetica,Arial;
|
||||
}
|
||||
|
||||
/*
|
||||
Foo
|
||||
|
||||
Bar
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
font-family: "Foo Bar";
|
||||
src: url("data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA") format("truetype"),
|
||||
url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
5
min_unit_tests/_test_files/yuic/dataurl-dbquote-font.css.min
Executable file
5
min_unit_tests/_test_files/yuic/dataurl-dbquote-font.css.min
Executable file
@@ -0,0 +1,5 @@
|
||||
.y-ff-1{font-family:"Foo Bar",Helvetica,Arial;text-rendering:optimizeLegibility}.ua-op .y-ff-1{font-family:Helvetica,Arial}@font-face{font-family:"Foo Bar";src:url("data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA") format("truetype"),url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg");font-weight:normal;font-style:normal}
|
||||
|
||||
|
||||
|
||||
|
13
min_unit_tests/_test_files/yuic/dataurl-nonbase64-doublequotes.css
Executable file
13
min_unit_tests/_test_files/yuic/dataurl-nonbase64-doublequotes.css
Executable file
@@ -0,0 +1,13 @@
|
||||
div.nonbase64-doublequotes {
|
||||
width:100px;
|
||||
height:100px;
|
||||
background-image:url(
|
||||
"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0'''%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh)))%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3(((%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82"
|
||||
);
|
||||
border:1px solid #00aa00;
|
||||
}
|
||||
|
||||
span.othercss {
|
||||
font-family:"Times New Roman";
|
||||
font-weight:inherit;
|
||||
}
|
1
min_unit_tests/_test_files/yuic/dataurl-nonbase64-doublequotes.css.min
Executable file
1
min_unit_tests/_test_files/yuic/dataurl-nonbase64-doublequotes.css.min
Executable file
@@ -0,0 +1 @@
|
||||
div.nonbase64-doublequotes{width:100px;height:100px;background-image:url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0'''%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh)))%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3(((%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82");border:1px solid #0a0}span.othercss{font-family:"Times New Roman";font-weight:inherit}
|
11
min_unit_tests/_test_files/yuic/dataurl-nonbase64-noquotes.css
Executable file
11
min_unit_tests/_test_files/yuic/dataurl-nonbase64-noquotes.css
Executable file
@@ -0,0 +1,11 @@
|
||||
div.nonbase64-noquotes {
|
||||
width:100px;
|
||||
height:100px;
|
||||
background-image:url( data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0\'\'\'%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh\)\)\)%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3\(\(\(%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82 );
|
||||
border:1px solid red;
|
||||
}
|
||||
|
||||
span.othercss {
|
||||
font-family:"Times New Roman";
|
||||
font-weight:inherit;
|
||||
}
|
1
min_unit_tests/_test_files/yuic/dataurl-nonbase64-noquotes.css.min
Executable file
1
min_unit_tests/_test_files/yuic/dataurl-nonbase64-noquotes.css.min
Executable file
@@ -0,0 +1 @@
|
||||
div.nonbase64-noquotes{width:100px;height:100px;background-image:url(data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0\'\'\'%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh\)\)\)%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3\(\(\(%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82);border:1px solid red}span.othercss{font-family:"Times New Roman";font-weight:inherit}
|
15
min_unit_tests/_test_files/yuic/dataurl-nonbase64-singlequotes.css
Executable file
15
min_unit_tests/_test_files/yuic/dataurl-nonbase64-singlequotes.css
Executable file
@@ -0,0 +1,15 @@
|
||||
/* Some Comment */
|
||||
|
||||
div.nonbase64-singlequotes {
|
||||
width:100px;
|
||||
height:100px;
|
||||
background-image:url('data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0\'\'\'%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh)))%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3(((%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82');
|
||||
border:1px solid #0000aa;
|
||||
}
|
||||
|
||||
/* Some Other Comment */
|
||||
|
||||
span.othercss {
|
||||
font-family:"Times New Roman";
|
||||
font-weight:inherit;
|
||||
}
|
2
min_unit_tests/_test_files/yuic/dataurl-nonbase64-singlequotes.css.min
Executable file
2
min_unit_tests/_test_files/yuic/dataurl-nonbase64-singlequotes.css.min
Executable file
@@ -0,0 +1,2 @@
|
||||
div.nonbase64-singlequotes{width:100px;height:100px;background-image:url('data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0E%08%03%00%00%00%2Cc%0D%DE%00%00%00%A2PLTEQQQ%FA%FA%FA%FC%FC%FC%EE%EE%EE%A9%A9%A9%E9%E9%E9%0A%0A%0A%0D%0D%0D444PPP%CD%CD%CD%CC%CC%CC%F5%F5%F5UUU%D0%D0%D0\'\'\'%F9%F9%F9%A6%A6%A6%40%40%40FFF%A0%A0%A0%89%89%89%8D%8D%8D%20%20%20%14%14%14%DA%DA%DA%B6%B6%B6%02%02%02%87%87%87%81%81%81%AC%AC%AC%0E%0E%0E111%7D%7D%7D%92%92%92333%B9%B9%B9%BC%BC%BChhh)))%E1%E1%E1%03%03%03%CB%CB%CB%EB%EB%EB%FD%FD%FD%A3%A3%A3(((%04%04%04%CA%CA%CAttt%2C%2C%2C%F4%F4%F4%00%00%00%FF%FF%FF%D6%DE%02%C3%00%00%006tRNS%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%00%A1%8FN1%00%00%00iIDAT%08%D7E%C7E%16%02Q%10%C5%D0j%C3%DD%BDqw%5E%F6%BF5%06%D4%3Fd%94kx%BDf%DE6%FFIA%AB%C8qYj%1F%E3Xk%93%E0%C8JZ%10%90%9E%3A1%60%BBY%85%A8%AE%14%C0%5E%1A6%8E%C5w%02%60%99%C9%FA%9A%03%60%8C%EFz%8C%CE%0EnSu%3F%01%AD%B2%06%04%F0%3CT%FF%B8nk%3F%7C%01%C5z%1B%F9%26%2F%3Az%00%00%00%00IEND%AEB%60%82');border:1px solid #00a}span.othercss{font-family:"Times New Roman";font-weight:inherit}
|
||||
|
31
min_unit_tests/_test_files/yuic/dataurl-noquote-multiline-font.css
Executable file
31
min_unit_tests/_test_files/yuic/dataurl-noquote-multiline-font.css
Executable file
@@ -0,0 +1,31 @@
|
||||
/*csslint fontfamily: true*/
|
||||
|
||||
/**
|
||||
* Foo
|
||||
*/
|
||||
|
||||
.y-ff-1 {
|
||||
font-family:"Foo Bar",Helvetica,Arial;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
||||
.ua-op .y-ff-1 {
|
||||
/* Some Comment */
|
||||
font-family:Helvetica,Arial;
|
||||
}
|
||||
|
||||
/*
|
||||
Foo
|
||||
|
||||
Bar
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
font-family: "Foo Bar";
|
||||
src: url(
|
||||
data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA) format("truetype"),
|
||||
url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
3
min_unit_tests/_test_files/yuic/dataurl-noquote-multiline-font.css.min
Executable file
3
min_unit_tests/_test_files/yuic/dataurl-noquote-multiline-font.css.min
Executable file
@@ -0,0 +1,3 @@
|
||||
.y-ff-1{font-family:"Foo Bar",Helvetica,Arial;text-rendering:optimizeLegibility}.ua-op .y-ff-1{font-family:Helvetica,Arial}@font-face{font-family:"Foo Bar";src:url(data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA) format("truetype"),url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg");font-weight:normal;font-style:normal}
|
||||
|
||||
|
90
min_unit_tests/_test_files/yuic/dataurl-realdata-doublequotes.css
Executable file
90
min_unit_tests/_test_files/yuic/dataurl-realdata-doublequotes.css
Executable file
@@ -0,0 +1,90 @@
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar {
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
-moz-transform: translate(0, 0);
|
||||
}
|
||||
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle,
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last {
|
||||
border-radius:3px;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==");
|
||||
}
|
||||
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last {
|
||||
border-bottom-right-radius:0;
|
||||
border-bottom-left-radius:0;
|
||||
|
||||
-webkit-border-bottom-right-radius:0;
|
||||
-webkit-border-bottom-left-radius:0;
|
||||
|
||||
-moz-border-radius-bottomright:0;
|
||||
-moz-border-radius-bottomleft:0;
|
||||
}
|
||||
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last {
|
||||
border-radius:0;
|
||||
border-bottom-right-radius:3px;
|
||||
border-bottom-left-radius:3px;
|
||||
|
||||
-webkit-border-radius:0;
|
||||
-webkit-border-bottom-right-radius:3px;
|
||||
-webkit-border-bottom-left-radius:3px;
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
|
||||
-moz-border-radius:0;
|
||||
-moz-border-radius-bottomright:3px;
|
||||
-moz-border-radius-bottomleft:3px;
|
||||
-moz-transform: translate(0, 0);
|
||||
}
|
||||
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle {
|
||||
border-radius:0;
|
||||
-webkit-border-radius: 0;
|
||||
-moz-border-radius: 0;
|
||||
|
||||
-webkit-transform: translate3d(0,0,0) scaleY(1);
|
||||
-webkit-transform-origin-y: 0;
|
||||
|
||||
-moz-transform: translate(0,0) scaleY(1);
|
||||
-moz-transform-origin: 0 0;
|
||||
}
|
||||
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 3px;
|
||||
|
||||
-webkit-border-top-right-radius: 0;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
|
||||
-moz-border-radius-topright: 0;
|
||||
-moz-border-radius-bottomleft: 3px;
|
||||
}
|
||||
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last {
|
||||
border-bottom-left-radius: 0;
|
||||
border-top-right-radius: 3px;
|
||||
|
||||
-webkit-border-bottom-left-radius: 0;
|
||||
-webkit-border-top-right-radius: 3px;
|
||||
|
||||
-moz-border-radius-bottomleft: 0;
|
||||
-moz-border-radius-topright: 3px;
|
||||
}
|
||||
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle {
|
||||
-webkit-transform: translate3d(0,0,0) scaleX(1);
|
||||
-webkit-transform-origin: 0 0;
|
||||
|
||||
-moz-transform: translate(0,0) scaleX(1);
|
||||
-moz-transform-origin: 0 0;
|
||||
}
|
||||
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child,
|
||||
.yui3-skin-sam .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child {
|
||||
background-color: #aaa;
|
||||
background-image: none;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user