Permalink
Browse files

Allow space as function argument delimiter

Closes #36 as fixed
  • Loading branch information...
1 parent b05360e commit e40af6185dd7401f8debaffc72749546f76816e2 @sabberworm committed May 4, 2012
Showing with 8 additions and 1 deletion.
  1. +1 −1 CSSParser.php
  2. +6 −0 tests/CSSParserTests.php
  3. +1 −0 tests/files/webkit.css
View
@@ -109,7 +109,7 @@ private function parseIdentifier($bAllowFunctions = true) {
}
if($bAllowFunctions && $this->comes('(')) {
$this->consume('(');
- $sResult = new CSSFunction($sResult, $this->parseValue(array('=', ',')));
+ $sResult = new CSSFunction($sResult, $this->parseValue(array('=', ',', ' ')));
$this->consume(')');
}
return $sResult;
@@ -239,6 +239,12 @@ function testCreateShorthands() {
$sExpected = 'body {background: rgb(255,255,255) url("foobar.png") repeat-y;margin: 2px 5px 4px 3px;border: 2px dotted rgb(153,153,153);font: bold 2em Helvetica,Arial,sans-serif;}'."\n";
$this->assertSame($sExpected, $oDoc->__toString());
}
+
+ function testPrefixedGradient() {
+ $oDoc = $this->parsedStructureForFile('webkit');
+ $sExpected = '.test {background: -webkit-linear-gradient(top right,white,black);}'."\n";
+ $this->assertSame($sExpected, $oDoc->__toString());
+ }
function testListValueRemoval() {
$oDoc = $this->parsedStructureForFile('atrules');
@@ -0,0 +1 @@
+.test { background:-webkit-linear-gradient(top right, white, black)}

0 comments on commit e40af61

Please sign in to comment.