Skip to content

Commit e40af61

Browse files
committed
Allow space as function argument delimiter
Closes MyIntervals#36 as fixed
1 parent b05360e commit e40af61

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CSSParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private function parseIdentifier($bAllowFunctions = true) {
109109
}
110110
if($bAllowFunctions && $this->comes('(')) {
111111
$this->consume('(');
112-
$sResult = new CSSFunction($sResult, $this->parseValue(array('=', ',')));
112+
$sResult = new CSSFunction($sResult, $this->parseValue(array('=', ',', ' ')));
113113
$this->consume(')');
114114
}
115115
return $sResult;

tests/CSSParserTests.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ function testCreateShorthands() {
239239
$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";
240240
$this->assertSame($sExpected, $oDoc->__toString());
241241
}
242+
243+
function testPrefixedGradient() {
244+
$oDoc = $this->parsedStructureForFile('webkit');
245+
$sExpected = '.test {background: -webkit-linear-gradient(top right,white,black);}'."\n";
246+
$this->assertSame($sExpected, $oDoc->__toString());
247+
}
242248

243249
function testListValueRemoval() {
244250
$oDoc = $this->parsedStructureForFile('atrules');

tests/files/webkit.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.test { background:-webkit-linear-gradient(top right, white, black)}

0 commit comments

Comments
 (0)