css-sanitizer
Classes to parse and sanitize CSS
Loading...
Searching...
No Matches
Wikimedia\CSS\Sanitizer\MarginAtRuleSanitizer Class Reference

Sanitizes the margin at-rules inside a CSS @page rule. More...

+ Inheritance diagram for Wikimedia\CSS\Sanitizer\MarginAtRuleSanitizer:
+ Collaboration diagram for Wikimedia\CSS\Sanitizer\MarginAtRuleSanitizer:

Public Member Functions

 __construct (PropertySanitizer $propertySanitizer)
 
 handlesRule (Rule $rule)
 @inheritDoc
 
- Public Member Functions inherited from Wikimedia\CSS\Sanitizer\RuleSanitizer
 getIndex ()
 Return an integer indicating ordering constraints.
 
- 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

 doSanitize (CSSObject $object)
 @inheritDoc
 
- Protected Member Functions inherited from Wikimedia\CSS\Sanitizer\RuleSanitizer
 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.
 

Protected Attributes

 $propertySanitizer
 
- Protected Attributes inherited from Wikimedia\CSS\Sanitizer\Sanitizer
 $sanitizationErrors = []
 

Static Protected Attributes

static $marginRuleNames
 

Detailed Description

Sanitizes the margin at-rules inside a CSS @page rule.

See also
https://www.w3.org/TR/2018/WD-css-page-3-20181018/

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\CSS\Sanitizer\MarginAtRuleSanitizer::__construct ( PropertySanitizer $propertySanitizer)
Parameters
PropertySanitizer$propertySanitizerSanitizer for declarations

Member Function Documentation

◆ doSanitize()

Wikimedia\CSS\Sanitizer\MarginAtRuleSanitizer::doSanitize ( CSSObject $object)
protected

@inheritDoc

Reimplemented from Wikimedia\CSS\Sanitizer\Sanitizer.

◆ handlesRule()

Wikimedia\CSS\Sanitizer\MarginAtRuleSanitizer::handlesRule ( Rule $rule)

@inheritDoc

Reimplemented from Wikimedia\CSS\Sanitizer\RuleSanitizer.

Member Data Documentation

◆ $marginRuleNames

Wikimedia\CSS\Sanitizer\MarginAtRuleSanitizer::$marginRuleNames
staticprotected
Initial value:
= [
'top-left-corner', 'top-left', 'top-center', 'top-right', 'top-right-corner',
'bottom-left-corner', 'bottom-left', 'bottom-center', 'bottom-right', 'bottom-right-corner',
'left-top', 'left-middle', 'left-bottom', 'right-top', 'right-middle', 'right-bottom',
]

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