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 310 and 311] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

(no description)

File Size: 110 lines (3 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 @-rules encountered.

__construct($iLineNo = 0)   X-Ref
Document constructor.

param: int $iLineNo

parse(ParserState $oParserState)   X-Ref
No description

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


getAllSelectors()   X-Ref


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


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

param: (object|string) $mElement the CSSList or RuleSet to start the search from (defaults to the whole document). If a string is given, it is used as rule name filter (@see{RuleSet->getRules()}).
param: (bool) $bSearchInFunctionArguments whether to also return Value objects used as Function arguments.

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: $sSpecificitySearch An optional filter by specificity. May contain a comparison operator and a number or just a number (defaults to "==").

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


createShorthands()   X-Ref
Create shorthands properties whenever possible


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

isRootList()   X-Ref
No description