Skip to content
Snippets Groups Projects
Commit 5646f690 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

a small CSS hack to make the buttons work in IE5.2 Mac

darcs-hash:20051103114701-6e07b-cb87eca037066a21f59da7f14e65986873607e29.gz
parent 0dc92c6f
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,14 @@ class css_css_compress_test extends UnitTestCase {
$this->assertEqual(css_compress($text), '#comment/* */{color:lime;}');
}
function test_hack(){
$text = '/* Mac IE will not see this and continue with inline-block */
/* \\*/
display: inline;
/* */';
$this->assertEqual(css_compress($text), '/* \\*/display:inline;/* */');
}
function test_nl1(){
$text = "a{left:20px;\ntop:20px}";
$this->assertEqual(css_compress($text), 'a{left:20px;top:20px}');
......
......@@ -9,9 +9,9 @@ define('TEST_CASES',realpath(dirname(__FILE__).'/../cases'));
// try to load runkit extension
if (!extension_loaded('runkit')) {
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
dl('php_runkit.dll');
@dl('php_runkit.dll');
} else {
dl('runkit.so');
@dl('runkit.so');
}
}
......
......@@ -206,11 +206,11 @@ function css_pluginstyles($mode='screen'){
function css_compress($css){
// strip whitespaces
$css = preg_replace('![\r\n\t ]+!',' ',$css);
$css = preg_replace('/ ?([:;,{}]) ?/','\\1',$css);
$css = preg_replace('/ ?([:;,{}\/]) ?/','\\1',$css);
// strip comments (ungreedy)
// We keep very small comments to maintain typical browser hacks
$css = preg_replace('!(/\*)(.{4,})(\*/)!U','',$css);
$css = preg_replace('#(/\*)((?!\*/).){4,}(\*/)#Us','',$css);
// shorten colors
$css = preg_replace("/#([0-9a-fA-F]{1})\\1([0-9a-fA-F]{1})\\2([0-9a-fA-F]{1})\\3/", "#\\1\\2\\3",$css);
......
......@@ -129,7 +129,12 @@ input.button, button.button{
max-height: 22px !important;
min-height: 22px !important;
margin: 1px;
display: inline-block;
/* Mac IE will not see this and continue with inline-block */
/* \*/
display: inline;
/* */
}
div.secedit input.button {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment