Changeset 43374 in spip-zone


Ignore:
Timestamp:
Jan 7, 2011, 3:16:21 PM (10 years ago)
Author:
cedric@…
Message:

la suppression des declarations vide n'etait pas assez prudente et entrainant quelques troncature de selecteur mal a propos ! (Nicolas Hoizey)
+ correction du test

Location:
_core_/plugins/compresseur
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • _core_/plugins/compresseur/inc/compresseur_minifier.php

    r43373 r43374  
    8282                $contenu = preg_replace("/0[.]([0-9]+em)/ims",".$1",$contenu);
    8383                // supprimer les declarations vides
    84                 $contenu = preg_replace(",\s([^{}]*){},Ums"," ",$contenu);
     84                $contenu = preg_replace(",(^|})([^{}]*){},Ums","$1",$contenu);
    8585                // zero est zero, quelle que soit l'unite
    8686                $contenu = preg_replace("/([^0-9.]0)(em|px|pt|%)/ms","$1",$contenu);
  • _core_/plugins/compresseur/tests/compacte_css.php

    r42365 r43374  
    11<?php
    22/**
    3  * Test unitaire de compacte_css
    4  * du fichier inc/compresseur
     3 * Test unitaire de minifier_css
     4 * du fichier inc/compresseur_minifier
    55 *
    66 */
    77
    8         $test = 'compacte_css';
     8        $test = 'minifier_css';
    99        $remonte = "../";
    1010        while (!is_dir($remonte."ecrire"))
     
    1313        $ok = true;
    1414
    15         include_spip('inc/compresseur');
     15        include_spip('inc/compresseur_minifier');
    1616
    1717        lire_fichier(dirname(__FILE__)."/css/source.css", $css_code);
     
    2020        lire_fichier(dirname(__FILE__)."/css/expected.css", $expected);
    2121
    22         $compacte = compacte_css($css_code);
     22        $compacte = minifier_css($css_code);
    2323        if (rtrim($compacte)!=rtrim($expected)) {
    24                 erreur("compacte_css()",$compacte,$expected);
     24                erreur("minifier_css()",$compacte,$expected);
    2525                $ok = false;
    2626        }
     
    2828        // le compacteur simple doit donner le meme resultat
    2929        // avec un media all
    30         $compacte = compacte_css($css_code,'all');
     30        $compacte = minifier_css($css_code,'all');
    3131        if (rtrim($compacte)!=rtrim($expected)) {
    32                 erreur("compacte_css('all')",$compacte,$expected);
     32                erreur("minifier_css('all')",$compacte,$expected);
    3333                $ok = false;
    3434        }
    3535
    3636        lire_fichier(dirname(__FILE__)."/css/expected_more.css", $expected);
    37         $compacte = compacte_css($css_code,array());
     37        $compacte = minifier_css($css_code,array());
    3838        if (rtrim($compacte)!=rtrim($expected)) {
    39                 erreur("compacte_css(array())",$compacte,$expected);
     39                erreur("minifier_css(array())",$compacte,$expected);
    4040                $ok = false;
    4141        }
    4242
    4343        lire_fichier(dirname(__FILE__)."/css/expected_more_screen.css", $expected);
    44         $compacte = compacte_css($css_code,'screen');
     44        $compacte = minifier_css($css_code,'screen');
    4545        if (rtrim($compacte)!=rtrim($expected)) {
    46                 erreur("compacte_css('screen')",$compacte,$expected);
     46                erreur("minifier_css('screen')",$compacte,$expected);
    4747                $ok = false;
    4848        }
    4949
    50         $compacte = compacte_css($css_code,array('media'=>'screen'));
     50        $compacte = minifier_css($css_code,array('media'=>'screen'));
    5151        if (rtrim($compacte)!=rtrim($expected)) {
    52                 erreur("compacte_css(array('media'=>'screen'))",$compacte,$expected);
     52                erreur("minifier_css(array('media'=>'screen'))",$compacte,$expected);
    5353                $ok = false;
    5454        }
    5555
    5656        lire_fichier(dirname(__FILE__)."/css/expected_highest_screen.css", $expected);
    57         $compacte = compacte_css($css_code,array('media'=>'screen','template'=>'highest'));
     57        $compacte = minifier_css($css_code,array('media'=>'screen','template'=>'highest'));
    5858        if (rtrim($compacte)!=rtrim($expected)) {
    59                 erreur("compacte_css(array('media'=>'screen','template'=>'highest'))",$compacte,$expected);
     59                erreur("minifier_css(array('media'=>'screen','template'=>'highest'))",$compacte,$expected);
    6060                $ok = false;
    6161        }
     
    6464
    6565        lire_fichier(dirname(__FILE__)."/css/expected_simple.css", $expected);
    66         $compacte = compacte_css($css_code,'screen');
     66        $compacte = minifier_css($css_code,'screen');
    6767        if (rtrim($compacte)!=rtrim($expected)) {
    68                 erreur("compacte_css('screen')",$compacte,$expected);
     68                erreur("minifier_css('screen')",$compacte,$expected);
    6969                $ok = false;
    7070        }
  • _core_/plugins/compresseur/tests/css/expected.css

    r42291 r43374  
     1.markItUpHeader{text-align:left}
    12.float-l{float:left}
    23.form-suggest{height:200px;background:#DEE2D0;vertical-align:top}
  • _core_/plugins/compresseur/tests/css/expected_highest_screen.css

    r42339 r43374  
    1 @media screen{.float-l{float:left}.form-suggest{height:200px;background:#DEE2D0;vertical-align:top}.form-input input{font-size:10px}}@media print{.hide{display:none}}@media screen{.form-input textarea{font-size:11px;width:350px}.form-label{font-size:10px;font-weight:700;line-height:25px;padding-right:10px;text-align:right;width:100px;color:#39738F}.font-9{font-size:9px}.form-topic{font-weight:700}.form-error{color:red}.inline{display:inline}.space-10{clear:both;font-size:10px;height:10px;line-height:10px}.suggest-success{color:green;padding-left:10px;font-size:11px;font-weight:700}.top{vertical-align:top}table td{padding:3px}a:link,a:active,a:visited,a.postlink{color:#069;text-decoration:none}a:hover{color:#DD6900}a.admin:hover,a.mod:hover{color:#DD6900}a.but,a.but:hover,a.but:visited{color:#000;text-decoration:none}a.topictitle:visited{color:#5493B4}a.topictitle:hover{color:#DD6900}body{color:#000;font:11px Verdana,Arial,Helvetica,sans-serif;margin:0 10px 10px;padding:0;overflow:auto}font,th,td,p{font:12px Verdana,Arial,Helvetica,sans-serif}form{display:inline}hr{border:0 solid #FFF;border-top-width:1px;height:0}img{border:0 solid}input{font:11px Verdana,Arial,Helvetica,sans-serif}input.button,input.liteoption,.fakebut{background:#FAFAFA;border:1px solid #000;font-size:11px}input.catbutton{background:#FAFAFA;border:1px solid #000;font-size:10px}input.mainoption{background:#FAFAFA;border:1px solid #000;font-size:11px;font-weight:700}input.post,textarea.post{background:#FFF;border:1px solid #000;font:11px Verdana,Arial,Helvetica,sans-serif;padding-bottom:2px;padding-left:2px}select{background:#FFF;font:11px Verdana,Arial,Helvetica,sans-serif}table{text-align:left}td{vertical-align:middle}td.cat{background-color:#C2C6BA;font-weight:700;height:20px;letter-spacing:1px;text-indent:4px}td.genmed,.genmed{font-size:11px}td.rowpic{background:#C2C6BA}td.spacerow{background:#E5E6E2}th{background-color:#FADD31;/background-image:url(images/cellpic3.gif);background-repeat:repeat-x;color:#68685E;font-size:11px;font-weight:700;line-height:16px;height:16px;padding-left:8px;padding-right:8px;text-align:center;white-space:nowrap}.admin,.mod{font-size:11px;font-weight:700}.admin,a.admin,a.admin:visited{color:#FFA34F}.bodyline{background:#FFF;border:1px solid #98AAB1}.center{text-align:center}.code{background:#FAFAFA;border:1px solid #D1D7DC;color:#060;font:12px Courier,"Courier New",sans-serif;padding:5px}.errorline{background:#E5E6E2;border:1px solid #8F8B8B;color:#D92A2A}.explaintitle{color:#5C81B1;font-size:11px;font-weight:700}.forumline{background:#FFF}.gensmall{font-size:10px}.h1-font{color:#069;display:inline;font:bold 13px Verdana,Arial,Helvetica,sans-serif;margin:.3em;text-decoration:none}.h2-font{display:inline;font:11px Verdana,Arial,Helvetica,sans-serif}.height1{height:1px}.height22{height:22px}.height25{height:25px}.height28{height:28px}.height30{height:30px}.height40{height:40px}.helpline{border:0 solid;font-size:10px}.imgfolder{margin:1px 4px}.imgspace{margin-left:1px;margin-right:2px}.imgtopic,.imgicon{margin-left:3px}.left{text-align:left}.maintitle,h1,h2{color:#5C81B1;font:bold 20px/120% "Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;text-decoration:none}.maxwidth{width:100%}.mod,a.mod,a.mod:visited{color:#060}.name{font-size:11px;font-weight:700}.nav{font-size:11px;font-weight:700}.nowrap{white-space:nowrap}.postbody{font-size:12px;line-height:125%}.postbody a{text-decoration:underline}.postdetails{color:#00396A;font-size:10px}.quote{background:#F3F3EF;border:1px solid #C2C6BA;color:#069;font-size:11px;line-height:125%}.right{text-align:right}.row1{background:#F0F0EB}.row2,.helpline{background:#E5E6E2}.row3{background:#DBDBD4}.subtitle,h2{font:bold 18px/180% "Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;text-decoration:none}.topictitle{color:#000;font-size:11px;font-weight:700}.underline{text-decoration:underline}.top{vertical-align:top}.image-hspace{margin-right:3px}.clear{clear:both}.degrade{background-color:#777;background:-webkit-gradient(linear,left top,left bottom,from(#999999),to(#666666));background-image:-moz-linear-gradient(top,#999999,#666666);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#999999',endColorstr='#666666');filter:progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=146,Strength=5);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#999999',endColorstr='#666666')";filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#ff999999',endColorstr='#ff666666')}}@media print{.degrade{background:none}}
     1@media screen{.markItUpHeader{text-align:left}.float-l{float:left}.form-suggest{height:200px;background:#DEE2D0;vertical-align:top}.form-input input{font-size:10px}}@media print{.hide{display:none}}@media screen{.form-input textarea{font-size:11px;width:350px}.form-label{font-size:10px;font-weight:700;line-height:25px;padding-right:10px;text-align:right;width:100px;color:#39738F}.font-9{font-size:9px}.form-topic{font-weight:700}.form-error{color:red}.inline{display:inline}.space-10{clear:both;font-size:10px;height:10px;line-height:10px}.suggest-success{color:green;padding-left:10px;font-size:11px;font-weight:700}.top{vertical-align:top}table td{padding:3px}a:link,a:active,a:visited,a.postlink{color:#069;text-decoration:none}a:hover{color:#DD6900}a.admin:hover,a.mod:hover{color:#DD6900}a.but,a.but:hover,a.but:visited{color:#000;text-decoration:none}a.topictitle:visited{color:#5493B4}a.topictitle:hover{color:#DD6900}body{color:#000;font:11px Verdana,Arial,Helvetica,sans-serif;margin:0 10px 10px;padding:0;overflow:auto}font,th,td,p{font:12px Verdana,Arial,Helvetica,sans-serif}form{display:inline}hr{border:0 solid #FFF;border-top-width:1px;height:0}img{border:0 solid}input{font:11px Verdana,Arial,Helvetica,sans-serif}input.button,input.liteoption,.fakebut{background:#FAFAFA;border:1px solid #000;font-size:11px}input.catbutton{background:#FAFAFA;border:1px solid #000;font-size:10px}input.mainoption{background:#FAFAFA;border:1px solid #000;font-size:11px;font-weight:700}input.post,textarea.post{background:#FFF;border:1px solid #000;font:11px Verdana,Arial,Helvetica,sans-serif;padding-bottom:2px;padding-left:2px}select{background:#FFF;font:11px Verdana,Arial,Helvetica,sans-serif}table{text-align:left}td{vertical-align:middle}td.cat{background-color:#C2C6BA;font-weight:700;height:20px;letter-spacing:1px;text-indent:4px}td.genmed,.genmed{font-size:11px}td.rowpic{background:#C2C6BA}td.spacerow{background:#E5E6E2}th{background-color:#FADD31;/background-image:url(images/cellpic3.gif);background-repeat:repeat-x;color:#68685E;font-size:11px;font-weight:700;line-height:16px;height:16px;padding-left:8px;padding-right:8px;text-align:center;white-space:nowrap}.admin,.mod{font-size:11px;font-weight:700}.admin,a.admin,a.admin:visited{color:#FFA34F}.bodyline{background:#FFF;border:1px solid #98AAB1}.center{text-align:center}.code{background:#FAFAFA;border:1px solid #D1D7DC;color:#060;font:12px Courier,"Courier New",sans-serif;padding:5px}.errorline{background:#E5E6E2;border:1px solid #8F8B8B;color:#D92A2A}.explaintitle{color:#5C81B1;font-size:11px;font-weight:700}.forumline{background:#FFF}.gensmall{font-size:10px}.h1-font{color:#069;display:inline;font:bold 13px Verdana,Arial,Helvetica,sans-serif;margin:.3em;text-decoration:none}.h2-font{display:inline;font:11px Verdana,Arial,Helvetica,sans-serif}.height1{height:1px}.height22{height:22px}.height25{height:25px}.height28{height:28px}.height30{height:30px}.height40{height:40px}.helpline{border:0 solid;font-size:10px}.imgfolder{margin:1px 4px}.imgspace{margin-left:1px;margin-right:2px}.imgtopic,.imgicon{margin-left:3px}.left{text-align:left}.maintitle,h1,h2{color:#5C81B1;font:bold 20px/120% "Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;text-decoration:none}.maxwidth{width:100%}.mod,a.mod,a.mod:visited{color:#060}.name{font-size:11px;font-weight:700}.nav{font-size:11px;font-weight:700}.nowrap{white-space:nowrap}.postbody{font-size:12px;line-height:125%}.postbody a{text-decoration:underline}.postdetails{color:#00396A;font-size:10px}.quote{background:#F3F3EF;border:1px solid #C2C6BA;color:#069;font-size:11px;line-height:125%}.right{text-align:right}.row1{background:#F0F0EB}.row2,.helpline{background:#E5E6E2}.row3{background:#DBDBD4}.subtitle,h2{font:bold 18px/180% "Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;text-decoration:none}.topictitle{color:#000;font-size:11px;font-weight:700}.underline{text-decoration:underline}.top{vertical-align:top}.image-hspace{margin-right:3px}.clear{clear:both}.degrade{background-color:#777;background:-webkit-gradient(linear,left top,left bottom,from(#999999),to(#666666));background-image:-moz-linear-gradient(top,#999999,#666666);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#999999',endColorstr='#666666');filter:progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=146,Strength=5);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#999999',endColorstr='#666666')";filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#ff999999',endColorstr='#ff666666')}}@media print{.degrade{background:none}}
  • _core_/plugins/compresseur/tests/css/expected_more.css

    r42339 r43374  
     1.markItUpHeader{text-align:left}
    12.float-l{float:left}
    23.form-suggest{height:200px;background:#DEE2D0;vertical-align:top}
  • _core_/plugins/compresseur/tests/css/expected_more_screen.css

    r42339 r43374  
    11@media screen {
     2.markItUpHeader{text-align:left}
    23.float-l{float:left}
    34.form-suggest{height:200px;background:#DEE2D0;vertical-align:top}
  • _core_/plugins/compresseur/tests/css/source.css

    r42291 r43374  
     1.formulaire_spip  textarea.markItUpEditor, .formulaire_spip li.editer_texte textarea {
     2        /*width: 96%;
     3        clear: both;*/
     4}
     5
     6.markItUpHeader { text-align: left; } /* fix dir=ltr */
     7
    18/* Based on the original Style Sheet for the fisubsilver v2 Theme for phpBB version 2+
    29Edited by Daz  - http://www.forumimages.com - last updated 26-06-03 */
Note: See TracChangeset for help on using the changeset viewer.