Skip to content

Commit

Permalink
Only use 'all and...' in conjunction with 'not'
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Jun 2, 2020
1 parent 17ed19b commit 917a01d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/optimizer/src/Transformer/ServerSideRendering.php
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,9 @@ private function extractMediaAttributeCss(Document $document, DOMElement $elemen
$attributeValue = preg_replace('/^not\s+/i', '', $attributeValue, 1, $notFound);
$not = $notFound ? '' : 'not ';

if ($attributeValue[0] === '(') {
if ($attributeValue[0] === '(' && ! $notFound) {
// 'not' can only be used with a media type, so we use 'all' as media type if it is missing.
// See quirksmode.org/blog/archives/2012/11/what_the_hells.html#c15586
$attributeValue = 'all and ' . $attributeValue;
}

Expand Down

0 comments on commit 917a01d

Please # to comment.