Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

(no description)

File Size: 361 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

CSSList:: (20 methods):
  __construct()
  parseList()
  parseListItem()
  parseAtRule()
  identifierIs()
  getLineNo()
  prepend()
  append()
  splice()
  insert()
  remove()
  replace()
  setContents()
  removeDeclarationBlockBySelector()
  __toString()
  render()
  getContents()
  addComments()
  getComments()
  setComments()


Class: CSSList  - X-Ref

A CSSList is the most generic container available. Its contents include RuleSet as well as other CSSList objects.
Also, it may contain Import and Charset objects stemming from @-rules.

__construct($iLineNo = 0)   X-Ref
No description

parseList(ParserState $oParserState, CSSList $oList)   X-Ref
No description

parseListItem(ParserState $oParserState, CSSList $oList)   X-Ref
No description

parseAtRule(ParserState $oParserState)   X-Ref
No description

identifierIs($sIdentifier, $sMatch)   X-Ref
Tests an identifier for a given value. Since identifiers are all keywords, they can be vendor-prefixed. We need to check for these versions too.


getLineNo()   X-Ref

return: int

prepend($oItem)   X-Ref
Prepend item to list of contents.

param: object $oItem Item.

append($oItem)   X-Ref
Append item to list of contents.

param: object $oItem Item.

splice($iOffset, $iLength = null, $mReplacement = null)   X-Ref
Splice the list of contents.

param: int       $iOffset      Offset.
param: int       $iLength      Length. Optional.
param: RuleSet[] $mReplacement Replacement. Optional.

insert($oItem, $oSibling)   X-Ref
Insert an item before its sibling.

param: mixed $oItem The item.
param: mixed $oSibling The sibling.

remove($oItemToRemove)   X-Ref
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)
return: bool Whether the item was removed.

replace($oOldItem, $oNewItem)   X-Ref
Replaces 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)

setContents(array $aContents)   X-Ref
Set the contents.

param: array $aContents Objects to set as content.

removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false)   X-Ref
Removes a declaration block from the CSS list if it matches all given selectors.

param: array|string $mSelector The selectors to match.
param: boolean $bRemoveAll Whether to stop at the first declaration block found or remove all blocks

__toString()   X-Ref
No description

render(\Sabberworm\CSS\OutputFormat $oOutputFormat)   X-Ref
No description

getContents()   X-Ref
Return true if the list can not be further outdented. Only important when rendering.


addComments(array $aComments)   X-Ref

param: array $aComments Array of comments.

getComments()   X-Ref

return: array

setComments(array $aComments)   X-Ref

param: array $aComments Array containing Comment objects.