Open GoogleCodeExporter opened 9 years ago
Thanks for reporting this bug
Original comment by joe.scylla
on 28 Mar 2011 at 1:01
version 2.0.2.2
Original comment by joe.scylla
on 28 Mar 2011 at 1:31
This has regressed in 3.0.0. I can replicate the bug with the following rules:
background-position: 0 0;
background-position: 0px 0px;
background-position: 0% 0%;
Original comment by mattcg
on 13 Sep 2011 at 5:29
Thanks for reporting. Reopened and will get fixed in the next release.
Original comment by joe.scylla
on 14 Sep 2011 at 6:53
Maybe it helps you, I fixed it this way:
/**
* Skip these properties processing
* @var array
*/
protected $propertiesToSkip = array
(
'background-position',
'background'
);
/**
* Implements {@link aCssMinifierPlugin::minify()}.
*
* @param aCssToken $token Token to process
* @return boolean Return TRUE to break the processing of this token; FALSE to continue
*/
public function apply(aCssToken &$token)
{
if (in_array($token->Property, $this->propertiesToSkip)) return true;
Original comment by mr.andre...@gmail.com
on 20 Oct 2011 at 1:39
Still there in version 3.0.1.
Original comment by viktorli...@gmail.com
on 24 Apr 2012 at 4:49
yep, still exists in 3.0.1 - my fix was to skip the replace for the third rule,
replacing 0 0 with 0. 0px 0px should still be replaced with 0 0.
if( 'background-position' == $token->Property && '0' === $reReplace ) continue;
This is how it looks for me now:
public function apply(aCssToken &$token)
{
if (preg_match($this->reMatch, $token->Value) )
{
foreach ($this->re as $reMatch => $reReplace)
{
if( 'background-position' == $token->Property && $reReplace === '0' ) continue;
$token->Value = preg_replace($reMatch, $reReplace, $token->Value);
}
}
return false;
}
Hope this gets fixed somehow in 3.0.2
Original comment by cristi.n...@gmail.com
on 1 Jun 2012 at 1:27
Original issue reported on code.google.com by
a...@tailorstore.com
on 22 Mar 2011 at 1:47