Sanitizes a CSS style rule.
More...
|
| doSanitize (CSSObject $object) |
| @inheritDoc
|
|
| 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.
|
|
| 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.
|
|
|
| $selectorMatcher |
|
| $prependSelectors |
|
| $hoistableMatcher |
|
| $propertySanitizer |
|
| $sanitizationErrors = [] |
|
◆ __construct()
Wikimedia\CSS\Sanitizer\StyleRuleSanitizer::__construct |
( |
Matcher | $selectorMatcher, |
|
|
PropertySanitizer | $propertySanitizer, |
|
|
array | $options = [] ) |
- Parameters
-
Matcher | $selectorMatcher | Matcher for valid selectors. Probably from MatcherFactory::cssSelectorList(). |
PropertySanitizer | $propertySanitizer | Sanitizer to test property declarations. Probably an instance of StylePropertySanitizer. |
array | $options | Additional options
- prependSelectors: (ComponentValue[]) Prepend this (and a whitespace) to all selectors. Note: $selectorMatcher must capture each selector with the name 'selector'.
- hoistableComponentMatcher: (Matcher) Component groups (simple selector sequences, in CSS3 Selectors terminology) matched by this will be hoisted before the prepended selector sequence. (To be more precise: the hoisted part is the longest prefix of the selector that only contains matching simple selector sequences and descendant combinators, and is not followed by a non-descendant combinator.) This can be used to allow filtering by top-level conditional classes/IDs emitted by some framework (e.g. html.no-js) while still jailing selectors into some subsection of the content. For example, if prependSelectors is equivalent to '#content' and hoistableComponentMatcher to [html|body]<simple selector>* will turn 'html.no-js body.ltr div.list' into 'html.no-js body.ltr #content div.list'. Note: $selectorMatcher must capture each simple selector group with the name 'simple' and the combinators with 'combinator'.
|
◆ doSanitize()
Wikimedia\CSS\Sanitizer\StyleRuleSanitizer::doSanitize |
( |
CSSObject | $object | ) |
|
|
protected |
◆ handlesRule()
Wikimedia\CSS\Sanitizer\StyleRuleSanitizer::handlesRule |
( |
Rule | $rule | ) |
|
The documentation for this class was generated from the following file: