css-sanitizer
Classes to parse and sanitize CSS
Loading...
Searching...
No Matches
Wikimedia\CSS\Objects\CSSObject Interface Reference

A base interface for "CSS objects". More...

+ Inheritance diagram for Wikimedia\CSS\Objects\CSSObject:

Public Member Functions

 getPosition ()
 Get the position of this object in the input stream.
 
 toTokenArray ()
 Return an array of Tokens that correspond to this object.
 
 toComponentValueArray ()
 Return an array of ComponentValues that correspond to this object.
 

Detailed Description

A base interface for "CSS objects".

Each object has a position and an ability to be turned into a sequence of Tokens.

Member Function Documentation

◆ getPosition()

Wikimedia\CSS\Objects\CSSObject::getPosition ( )

Get the position of this object in the input stream.

Position is reported as one-based line and one-based codepoint within the line. If no position is available, returns -1 for both line and position.

Returns
array [ $line, $pos ]

Implemented in Wikimedia\CSS\Objects\ComponentValue, Wikimedia\CSS\Objects\CSSObjectList, Wikimedia\CSS\Objects\Declaration, Wikimedia\CSS\Objects\Rule, and Wikimedia\CSS\Objects\Stylesheet.

◆ toComponentValueArray()

Wikimedia\CSS\Objects\CSSObject::toComponentValueArray ( )

Return an array of ComponentValues that correspond to this object.

Warning
Do not return any Tokens that aren't valid in a ComponentValueList.
Returns
ComponentValue[]

Implemented in Wikimedia\CSS\Objects\AtRule, Wikimedia\CSS\Objects\ComponentValue, Wikimedia\CSS\Objects\ComponentValueList, Wikimedia\CSS\Objects\CSSObjectList, Wikimedia\CSS\Objects\Declaration, Wikimedia\CSS\Objects\QualifiedRule, Wikimedia\CSS\Objects\Stylesheet, Wikimedia\CSS\Objects\Token, and Wikimedia\CSS\Objects\TokenList.

◆ toTokenArray()


The documentation for this interface was generated from the following file: