Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

(no description)

File Size: 113 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