MDL-55381 php-css-parser: Patch for Sabberworm/PHP-CSS-Parser#115
REMOVE ME ONCE Sabberworm/PHP-CSS-Parser#115 is merged Part of MDL-55071
This commit is contained in:
committed by
Dan Poltawski
parent
66bb9eadfe
commit
515ceadddd
@@ -35,6 +35,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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an item from the CSS list.
|
||||
* @param RuleSet|Import|Charset|CSSList $oItemToRemove May be a RuleSet (most likely a DeclarationBlock), a Import, a Charset or another CSSList (most likely a MediaQuery)
|
||||
|
||||
Reference in New Issue
Block a user