Skip to content

Commit 6f64709

Browse files
committed
Add support for -moz-calc
1 parent 4a0a464 commit 6f64709

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/Sabberworm/CSS/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ private function parsePrimitiveValue() {
436436
$oValue = $this->parseColorValue();
437437
} else if ($this->comes('url', true)) {
438438
$oValue = $this->parseURLValue();
439-
} else if ($this->comes('calc', true) || $this->comes('-webkit-calc', true)) {
439+
} else if ($this->comes('calc', true) || $this->comes('-webkit-calc', true) || $this->comes('-moz-calc', true)) {
440440
$oValue = $this->parseCalcValue();
441441
} else if ($this->comes("'") || $this->comes('"')) {
442442
$oValue = $this->parseStringValue();

tests/Sabberworm/CSS/ParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ function testUrlInFile() {
390390
function testCalcInFile() {
391391
$oDoc = $this->parsedStructureForFile('calc', Settings::create()->withMultibyteSupport(true));
392392
$sExpected = 'div {width: calc(100% / 4);}
393-
div {height: -webkit-calc(9 / 16 * 100%) !important;}';
393+
div {height: -webkit-calc(9 / 16 * 100%) !important;width: -moz-calc(50px - 50%);}';
394394
$this->assertSame($sExpected, $oDoc->render());
395395
}
396396

tests/files/calc.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
div { width: calc(100% / 4); }
22
div {
33
height: -webkit-calc(9/16 * 100%)!important;
4+
width: -moz-calc(50px-50%);
45
}

0 commit comments

Comments
 (0)