Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402]

(no description)

File Size: 492 lines (16 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()
  insert()
  splice()
  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 at-rules.
__construct($iLineNo = 0)   X-Ref

param: int $iLineNo

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

return: void

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

return: AtRuleBlockList|KeyFrame|Charset|CSSNamespace|Import|AtRuleSet|DeclarationBlock|null|false

parseAtRule(ParserState $oParserState)   X-Ref

param: ParserState $oParserState
return: AtRuleBlockList|KeyFrame|Charset|CSSNamespace|Import|AtRuleSet|null

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.

param: string $sIdentifier
param: string $sMatch
return: bool

getLineNo()   X-Ref

return: int

prepend($oItem)   X-Ref
Prepends an item to the list of contents.

param: RuleSet|CSSList|Import|Charset $oItem
return: void

append($oItem)   X-Ref
Appends an item to tje list of contents.

param: RuleSet|CSSList|Import|Charset $oItem
return: void

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

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

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

param: int $iOffset
param: int $iLength
param: array<int, RuleSet|CSSList|Import|Charset> $mReplacement
return: void

remove($oItemToRemove)   X-Ref
Removes an item from the CSS list.

param: RuleSet|Import|Charset|CSSList $oItemToRemove
return: bool whether the item was removed

replace($oOldItem, $mNewItem)   X-Ref
Replaces an item from the CSS list.

param: RuleSet|Import|Charset|CSSList $oOldItem
return: bool

setContents(array $aContents)   X-Ref

param: array<int, RuleSet|Import|Charset|CSSList> $aContents

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

param: DeclarationBlock|array<array-key, Selector>|string $mSelector the selectors to match
param: bool $bRemoveAll whether to stop at the first declaration block found or remove all blocks
return: void

__toString()   X-Ref

return: string

render(OutputFormat $oOutputFormat)   X-Ref

return: string

getContents()   X-Ref

return: array<int, RuleSet|Import|Charset|CSSList>

addComments(array $aComments)   X-Ref

param: array<array-key, Comment> $aComments
return: void

getComments()   X-Ref

return: array<array-key, Comment>

setComments(array $aComments)   X-Ref

param: array<array-key, Comment> $aComments
return: void