mirror of
https://github.com/moodle/moodle.git
synced 2025-07-09 16:36:28 +02:00
MDL-75475 lib: Applied PHP CSS Parser patches
This commit is contained in:
@ -89,7 +89,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());
|
||||
@ -283,6 +282,20 @@ abstract class CSSList implements Renderable, Commentable
|
||||
$this->aContents[] = $oItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert an item before its sibling.
|
||||
*
|
||||
* @param mixed $oItem The item.
|
||||
* @param mixed $oSibling The sibling.
|
||||
*/
|
||||
public function insert($oItem, $oSibling) {
|
||||
$iIndex = array_search($oSibling, $this->aContents);
|
||||
if ($iIndex === false) {
|
||||
return $this->append($oItem);
|
||||
}
|
||||
array_splice($this->aContents, $iIndex, 0, array($oItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* Splices the list of contents.
|
||||
*
|
||||
|
Reference in New Issue
Block a user