KeyFrame
extends CSSList
in package
implements
AtRule
This is the most generic container available. It can contain `DeclarationBlock`s (rule sets with a selector), `RuleSet`s as well as other `CSSList` objects.
It can also contain Import and Charset objects stemming from at-rules.
Interfaces, Classes and Traits
Table of Contents
- $animationName : string|null
- $vendorKeyFrame : string|null
- __construct() : mixed
- __toString() : string
- addComments() : void
- append() : void
- Appends an item to the list of contents.
- atRuleArgs() : string|null
- atRuleName() : string|null
- getAnimationName() : string|null
- getComments() : array<array-key, Comment>
- getContents() : array<int, \Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet\RuleSet|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Import|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Charset|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList\CSSList>
- Returns the stored items.
- getVendorKeyFrame() : string|null
- insertBefore() : mixed
- Inserts an item in the CSS list before its sibling. If the desired sibling cannot be found, the item is appended at the end.
- isRootList() : bool
- Return true if the list can not be further outdented. Only important when rendering.
- prepend() : void
- Prepends an item to the list of contents.
- remove() : bool
- Removes an item from the CSS list.
- removeDeclarationBlockBySelector() : void
- Removes a declaration block from the CSS list if it matches all given selectors.
- render() : string
- replace() : bool
- Replaces an item from the CSS list.
- setAnimationName() : mixed
- setComments() : void
- setContents() : mixed
- setVendorKeyFrame() : mixed
- splice() : void
- Splices the list of contents.
- renderListContents() : string
- identifierIs() : bool
- Tests an identifier for a given value. Since identifiers are all keywords, they can be vendor-prefixed.
- parseAtRule() : AtRuleBlockList|KeyFrame|Charset|CSSNamespace|Import|AtRuleSet|null
- parseListItem() : AtRuleBlockList|KeyFrame|Charset|CSSNamespace|Import|AtRuleSet|DeclarationBlock|null|false
Properties
$animationName
private
string|null
$animationName
$vendorKeyFrame
private
string|null
$vendorKeyFrame
Methods
__construct()
public
__construct(int $iLineNo) : mixed
Parameters
- $iLineNo : int
Return values
mixed —__toString()
public
__toString() : string
Tags
Return values
string —addComments()
public
addComments(array<array-key, Comment> $aComments) : void
Parameters
- $aComments : array<array-key, Comment>
Return values
void —append()
Appends an item to the list of contents.
public
append(RuleSet|CSSList|Import|Charset $oItem) : void
Parameters
Return values
void —atRuleArgs()
public
atRuleArgs() : string|null
Return values
string|null —atRuleName()
public
atRuleName() : string|null
Return values
string|null —getAnimationName()
public
getAnimationName() : string|null
Return values
string|null —getComments()
public
getComments() : array<array-key, Comment>
Return values
array<array-key, Comment> —getContents()
Returns the stored items.
public
getContents() : array<int, \Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet\RuleSet|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Import|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Charset|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList\CSSList>
Return values
array<int, \Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet\RuleSet|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Import|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Charset|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList\CSSList> —getVendorKeyFrame()
public
getVendorKeyFrame() : string|null
Return values
string|null —insertBefore()
Inserts an item in the CSS list before its sibling. If the desired sibling cannot be found, the item is appended at the end.
public
insertBefore(RuleSet|CSSList|Import|Charset $item, RuleSet|CSSList|Import|Charset $sibling) : mixed
Parameters
Return values
mixed —isRootList()
Return true if the list can not be further outdented. Only important when rendering.
public
isRootList() : bool
Return values
bool —prepend()
Prepends an item to the list of contents.
public
prepend(RuleSet|CSSList|Import|Charset $oItem) : void
Parameters
Return values
void —remove()
Removes an item from the CSS list.
public
remove(RuleSet|Import|Charset|CSSList $oItemToRemove) : bool
Parameters
- $oItemToRemove : RuleSet|Import|Charset|CSSList
-
May be a RuleSet (most likely a DeclarationBlock), a Import, a Charset or another CSSList (most likely a MediaQuery)
Return values
bool — whether the item was removedremoveDeclarationBlockBySelector()
Removes a declaration block from the CSS list if it matches all given selectors.
public
removeDeclarationBlockBySelector(DeclarationBlock|array<array-key, Selector>|string $mSelector[, bool $bRemoveAll = false ]) : void
Parameters
- $mSelector : DeclarationBlock|array<array-key, Selector>|string
-
the selectors to match
- $bRemoveAll : bool = false
-
whether to stop at the first declaration block found or remove all blocks
Return values
void —render()
public
render(OutputFormat|null $oOutputFormat) : string
Parameters
- $oOutputFormat : OutputFormat|null
Return values
string —replace()
Replaces an item from the CSS list.
public
replace(RuleSet|Import|Charset|CSSList $oOldItem, mixed $mNewItem) : bool
Parameters
- $oOldItem : RuleSet|Import|Charset|CSSList
-
May be a
RuleSet(most likely aDeclarationBlock), anImport, aCharsetor anotherCSSList(most likely aMediaQuery) - $mNewItem : mixed
Return values
bool —setAnimationName()
public
setAnimationName(string $animationName) : mixed
Parameters
- $animationName : string
Return values
mixed —setComments()
public
setComments(array<array-key, Comment> $aComments) : void
Parameters
- $aComments : array<array-key, Comment>
Return values
void —setContents()
public
setContents(array<int, \Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet\RuleSet|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Import|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Charset|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList\CSSList> $aContents) : mixed
Parameters
- $aContents : array<int, \Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet\RuleSet|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Import|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Charset|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList\CSSList>
Return values
mixed —setVendorKeyFrame()
public
setVendorKeyFrame(string $vendorKeyFrame) : mixed
Parameters
- $vendorKeyFrame : string
Return values
mixed —splice()
Splices the list of contents.
public
splice(int $iOffset[, int $iLength = null ][, array<int, \Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet\RuleSet|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList\CSSList|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Import|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Charset> $mReplacement = null ]) : void
Parameters
- $iOffset : int
- $iLength : int = null
- $mReplacement : array<int, \Automattic\WooCommerce\Vendor\Sabberworm\CSS\RuleSet\RuleSet|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\CSSList\CSSList|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Import|\Automattic\WooCommerce\Vendor\Sabberworm\CSS\Property\Charset> = null
Return values
void —renderListContents()
protected
renderListContents(OutputFormat $oOutputFormat) : string
Parameters
- $oOutputFormat : OutputFormat
Return values
string —identifierIs()
Tests an identifier for a given value. Since identifiers are all keywords, they can be vendor-prefixed.
private
static identifierIs(string $sIdentifier, string $sMatch) : bool
We need to check for these versions too.
Parameters
- $sIdentifier : string
- $sMatch : string
Return values
bool —parseAtRule()
private
static parseAtRule(ParserState $oParserState) : AtRuleBlockList|KeyFrame|Charset|CSSNamespace|Import|AtRuleSet|null
Parameters
- $oParserState : ParserState
Tags
Return values
AtRuleBlockList|KeyFrame|Charset|CSSNamespace|Import|AtRuleSet|null —parseListItem()
private
static parseListItem(ParserState $oParserState, CSSList $oList) : AtRuleBlockList|KeyFrame|Charset|CSSNamespace|Import|AtRuleSet|DeclarationBlock|null|false
Parameters
- $oParserState : ParserState
- $oList : CSSList
