Skip to content

Commit 130015f

Browse files
committed
[TASK] Drop special support for vendor prefixes
In the past, vendor prefixes like `-moz-` or `-webkit-` were used for experimental CSS features in browsers. Nowadays, the browsers use features for this instead. Hence, special support for vendor prefixes is no longer needed. https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix
1 parent 13a118a commit 130015f

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Please also have a look at our
4343

4444
### Removed
4545

46+
- Drop special support for vendor prefixes (#1083)
4647
- Remove the IE hack in `Rule` (#995)
4748
- Drop `getLineNo()` from the `Renderable` interface (#1038)
4849
- Remove `OutputFormat::level()` (#874)

src/Value/CalcFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static function parse(ParserState $parserState, bool $ignoreCase = false)
3333
if ($parserState->peek() != '(') {
3434
// Found ; or end of line before an opening bracket
3535
throw new UnexpectedTokenException('(', $parserState->peek(), 'literal', $parserState->currentLine());
36-
} elseif (!\in_array($function, ['calc', '-moz-calc', '-webkit-calc'], true)) {
36+
} elseif ($function !== 'calc') {
3737
// Found invalid calc definition. Example calc (...
3838
throw new UnexpectedTokenException('calc', $function, 'literal', $parserState->currentLine());
3939
}

src/Value/Value.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,7 @@ public static function parseIdentifierOrFunction(ParserState $parserState, $igno
127127
$anchor->backtrack();
128128
if ($parserState->streql('url', $result)) {
129129
$result = URL::parse($parserState);
130-
} elseif (
131-
$parserState->streql('calc', $result)
132-
|| $parserState->streql('-webkit-calc', $result)
133-
|| $parserState->streql('-moz-calc', $result)
134-
) {
130+
} elseif ($parserState->streql('calc', $result)) {
135131
$result = CalcFunction::parse($parserState);
136132
} else {
137133
$result = CSSFunction::parse($parserState, $ignoreCase);

tests/ParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ public function calcInFile(): void
618618
$document = self::parsedStructureForFile('calc', Settings::create()->withMultibyteSupport(true));
619619
$expected = 'div {width: calc(100% / 4);}
620620
div {margin-top: calc(-120% - 4px);}
621-
div {height: -webkit-calc(9 / 16 * 100%) !important;width: -moz-calc(( 50px - 50% ) * 2);}
621+
div {height: calc(9 / 16 * 100%) !important;width: calc(( 50px - 50% ) * 2);}
622622
div {width: calc(50% - ( ( 4% ) * .5 ));}';
623623
self::assertSame($expected, $document->render());
624624
}

tests/fixtures/calc.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
div { width: calc(100% / 4); }
22
div { margin-top: calc(-120% - 4px); }
33
div {
4-
height: -webkit-calc(9/16 * 100%)!important;
5-
width: -moz-calc((50px - 50%)*2);
4+
height: calc(9/16 * 100%)!important;
5+
width: calc((50px - 50%)*2);
66
}
77
div { width: calc(50% - ( ( 4% ) * 0.5 ) ); }

0 commit comments

Comments
 (0)