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: 172 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Document:: (11 methods):
  __construct()
  parse()
  getAllDeclarationBlocks()
  getAllSelectors()
  getAllRuleSets()
  getAllValues()
  getSelectorsBySpecificity()
  expandShorthands()
  createShorthands()
  render()
  isRootList()


Class: Document  - X-Ref

The root `CSSList` of a parsed file. Contains all top-level CSS contents, mostly declaration blocks,
but also any at-rules encountered.

__construct($iLineNo = 0)   X-Ref

param: int $iLineNo

parse(ParserState $oParserState)   X-Ref

return: Document

getAllDeclarationBlocks()   X-Ref
Gets all `DeclarationBlock` objects recursively.

return: array<int, DeclarationBlock>

getAllSelectors()   X-Ref
Gets all `DeclarationBlock` objects recursively.

return: array<int, DeclarationBlock>

getAllRuleSets()   X-Ref
Returns all `RuleSet` objects found recursively in the tree.

return: array<int, RuleSet>

getAllValues($mElement = null, $bSearchInFunctionArguments = false)   X-Ref
Returns all `Value` objects found recursively in the tree.

param: CSSList|RuleSet|string $mElement
param: bool $bSearchInFunctionArguments whether to also return Value objects used as Function arguments.
return: array<int, Value>

getSelectorsBySpecificity($sSpecificitySearch = null)   X-Ref
Returns all `Selector` objects found recursively in the tree.

Note that this does not yield the full `DeclarationBlock` that the selector belongs to
(and, currently, there is no way to get to that).

param: string|null $sSpecificitySearch
return: array<int, Selector>

expandShorthands()   X-Ref
Expands all shorthand properties to their long value.

return: void

createShorthands()   X-Ref
Create shorthands properties whenever possible.

return: void

render(OutputFormat $oOutputFormat = null)   X-Ref
Overrides `render()` to make format argument optional.

param: OutputFormat|null $oOutputFormat
return: string

isRootList()   X-Ref

return: bool