MDL-67097 libraries: fix comment parsing in php-css-parser library

This fixes a bug when parsing the following rule-level and list-level
comments.

div {/*rtl:ignore*/left:10px;/*rtl:ignore*/ display:inline;}
/*rtl:ignore*/div {left:10px;} /*rtl:ignore*/ a {left:10px}

The latter rtl directive was being swallowed by the parser in these
cases and was not being properly allocated as a property of the rule
or csslist.

This restores the correct behaviour of the rtlcss library, which depends
on php-css-parser.
This commit is contained in:
Jake Dallimore
2019-11-01 13:21:17 +08:00
parent 5aa7d19615
commit 88267b1c68
2 changed files with 0 additions and 2 deletions

View File

@@ -61,7 +61,6 @@ abstract class CSSList implements Renderable, Commentable {
$oListItem->setComments($comments);
$oList->append($oListItem);
}
$oParserState->consumeWhiteSpace();
}
if(!$bIsRoot && !$bLenientParsing) {
throw new SourceException("Unexpected end of document", $oParserState->currentLine());

View File

@@ -56,7 +56,6 @@ class Rule implements Renderable, Commentable {
while ($oParserState->comes(';')) {
$oParserState->consume(';');
}
$oParserState->consumeWhiteSpace();
return $oRule;
}