mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
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:
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)
|
||||
|
@ -9,3 +9,5 @@ Downloaded from: https://github.com/sabberworm/PHP-CSS-Parser
|
||||
Import procedure:
|
||||
|
||||
- Copy all the files from the folder 'lib/Sabberworm/CSS/' in this directory.
|
||||
|
||||
- Apply the patch in Sabberworm/PHP-CSS-Parser#115
|
||||
|
Loading…
x
Reference in New Issue
Block a user