Skip to content

Commit 4a0a464

Browse files
committed
Streamline parseCalcValue()
1 parent b27717d commit 4a0a464

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/Sabberworm/CSS/Parser.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,13 +525,9 @@ private function parseURLValue() {
525525
}
526526

527527
private function parseCalcValue() {
528-
$func = $this->comes('calc', true) ? 'calc' : '-webkit-calc';
529-
$this->consume($func);
530-
$this->consumeWhiteSpace();
531-
$this->consume('(');
528+
$func = trim($this->consumeUntil('(', false, true));
532529
$aArguments = $this->parseValue(array('+', '-', '*', '/', ' '), '\Sabberworm\CSS\Value\CalcRuleValueList');
533-
$this->consumeWhiteSpace();
534-
$this->consume(')');
530+
$this->consumeUntil(')', false, true);
535531
return new CalcFunction($func, $aArguments, ',', $this->iLineNo);
536532
}
537533

0 commit comments

Comments
 (0)