css-sanitizer
Classes to parse and sanitize CSS
|
Base class for CSS rule sanitizers. More...
Public Member Functions | |
getIndex () | |
Return an integer indicating ordering constraints. | |
handlesRule (Rule $rule) | |
Indicate whether this rule is handled by this sanitizer. | |
Public Member Functions inherited from Wikimedia\CSS\Sanitizer\Sanitizer | |
getSanitizationErrors () | |
Return all sanitization errors seen so far. | |
stashSanitizationErrors () | |
Temporarily clear sanitization errors. | |
clearSanitizationErrors () | |
Clear sanitization errors. | |
sanitize (CSSObject $object) | |
Sanitize a CSS object. | |
Protected Member Functions | |
sanitizeDeclarationBlock (SimpleBlock $block, PropertySanitizer $sanitizer) | |
Sanitize a block's contents as a DeclarationList, in place. | |
sanitizeRuleBlock (SimpleBlock $block, array $sanitizers) | |
Sanitize a block's contents as a RuleList, in place. | |
fixPreludeWhitespace (AtRule $rule, $cloneIfNecessary) | |
For the whitespace at the start of the prelude. | |
Protected Member Functions inherited from Wikimedia\CSS\Sanitizer\Sanitizer | |
sanitizationError ( $tag, CSSObject $object, array $data=[]) | |
Record a sanitization error. | |
sanitizeObj (Sanitizer $sanitizer, CSSObject $object) | |
Run another sanitizer over a CSSObject. | |
sanitizeList (Sanitizer $sanitizer, CSSObjectList $list) | |
Run a sanitizer over all CSSObjects in a CSSObjectList. | |
sanitizeRules (array $ruleSanitizers, RuleList $list) | |
Run a set of RuleSanitizers over all rules in a RuleList. | |
doSanitize (CSSObject $object) | |
Sanitize a CSS object. | |
Additional Inherited Members | |
Protected Attributes inherited from Wikimedia\CSS\Sanitizer\Sanitizer | |
$sanitizationErrors = [] | |
Base class for CSS rule sanitizers.
|
protected |
For the whitespace at the start of the prelude.
The matcher probably marked it insignificant, but it's actually significant if it's needed to separate the at-keyword and the first thing in the prelude. And if there isn't a whitespace there, add one if it would be significant.
AtRule | $rule | |
bool | $cloneIfNecessary |
Wikimedia\CSS\Sanitizer\RuleSanitizer::getIndex | ( | ) |
Return an integer indicating ordering constraints.
Lower numbers must come earlier in the document.
Reimplemented in Wikimedia\CSS\Sanitizer\ImportAtRuleSanitizer, and Wikimedia\CSS\Sanitizer\NamespaceAtRuleSanitizer.
|
abstract |
Indicate whether this rule is handled by this sanitizer.
Rule | $rule |
Reimplemented in Wikimedia\CSS\Sanitizer\FontFaceAtRuleSanitizer, Wikimedia\CSS\Sanitizer\ImportAtRuleSanitizer, Wikimedia\CSS\Sanitizer\KeyframesAtRuleSanitizer, Wikimedia\CSS\Sanitizer\MarginAtRuleSanitizer, Wikimedia\CSS\Sanitizer\MediaAtRuleSanitizer, Wikimedia\CSS\Sanitizer\NamespaceAtRuleSanitizer, Wikimedia\CSS\Sanitizer\PageAtRuleSanitizer, Wikimedia\CSS\Sanitizer\StyleRuleSanitizer, and Wikimedia\CSS\Sanitizer\SupportsAtRuleSanitizer.
|
protected |
Sanitize a block's contents as a DeclarationList, in place.
SimpleBlock | $block | |
PropertySanitizer | $sanitizer |
|
protected |
Sanitize a block's contents as a RuleList, in place.
SimpleBlock | $block | |
RuleSanitizer[] | $sanitizers |