Skip to content

Reference

phil/css-sanitizer
TypeKindRole
Phil\CssSanitizer\CssSanitizerfinal readonly classStyle sheets and style attributes sanitized under a policy
Phil\CssSanitizer\Policyfinal readonly classWhat a style sheet may hold, its rewriter, scope and limits
Phil\CssSanitizer\AtRuleKindenumThe at-rules a policy may allow: media, supports, page, font-face, import
Phil\CssSanitizer\Sanitizedfinal readonly classWhat was kept, as CSS and as values, and what was removed
Phil\CssSanitizer\Removalfinal readonly classOne removal: its reason, subject and line; Sanitized lists the first MAX_REMOVALS and counts the others
Phil\CssSanitizer\RemovalReasonenumWhy something was removed, and its description
Phil\CssSanitizer\UrlRewriterinterfaceWhat each URL becomes, or null to refuse it
Phil\CssSanitizer\UrlKindenumWhat a URL loads: an image, a font or a style sheet
Phil\CssSanitizer\Url\RefuseUrlsfinal readonly classRefuses every URL
Phil\CssSanitizer\Url\AllowedFilesfinal readonly classMaps names to the public URLs of allowed files
Phil\CssSanitizer\Url\CallbackRewriterfinal readonly classA rewriter written as a closure
Phil\CssSanitizer\Serializerfinal classCSS written back from values, declarations and style sheets
Phil\CssSanitizer\Sheet\StyleSheetfinal readonly classThe kept @import rules and other rules of a style sheet
Phil\CssSanitizer\Sheet\ImportRulefinal readonly classA kept @import: its rewritten URL and its conditions
Phil\CssSanitizer\Sheet\StyleRulefinal readonly classA kept style rule: its selectors, declarations and nested rules
Phil\CssSanitizer\Sheet\GroupRulefinal readonly classA kept at-rule with its prelude, declarations and rules
Phil\CssSanitizer\Syntax\Tokenizerfinal classThe tokenizer of CSS Syntax Level 3
Phil\CssSanitizer\Syntax\Parserfinal readonly classThe parser of CSS Syntax Level 3
Phil\CssSanitizer\Syntax\TokenTypeenumThe kinds of token
Phil\CssSanitizer\Syntax\ComponentValueinterfaceA token, a simple block or a function
Phil\CssSanitizer\Syntax\Tokenfinal readonly classA token with its escapes resolved
Phil\CssSanitizer\Syntax\SimpleBlockfinal readonly classThe values between matching brackets
Phil\CssSanitizer\Syntax\FunctionValuefinal readonly classA function and its arguments
Phil\CssSanitizer\Syntax\Stylesheetfinal readonly classThe rules of a parsed style sheet
Phil\CssSanitizer\Syntax\QualifiedRulefinal readonly classA prelude and a block
Phil\CssSanitizer\Syntax\AtRulefinal readonly classAn at-rule's name, prelude and optional block
Phil\CssSanitizer\Syntax\Declarationfinal readonly classA property, its value and !important
Phil\CssSanitizer\Syntax\Malformedfinal readonly classWhat the parser skipped as a parse error
Phil\CssSanitizer\Check\Sanitizationfinal class, internalOne pass over a parsed source: rules kept, removals recorded
Phil\CssSanitizer\Check\Selectorsfinal readonly class, internalThe selector grammar and the policy's names
Phil\CssSanitizer\Check\Valuesfinal readonly class, internalValues checked, URLs rewritten
Phil\CssSanitizer\Check\Preludesfinal readonly class, internalMedia queries, conditions, page selectors and the conditions of @import
Phil\CssSanitizer\Check\Importsfinal readonly class, internalAn @import rule checked, its URL rewritten
Phil\CssSanitizer\Check\FontSourcesfinal readonly class, internalThe sources of @font-face checked one by one
Phil\CssSanitizer\Validator\SafeCssfinal classThe constraint: CSS kept whole
Phil\CssSanitizer\Validator\SafeCssValidatorfinal classEach removal a violation
Phil\CssSanitizer\Exception\CssSanitizerExceptioninterfaceEvery exception of the library
Phil\CssSanitizer\Exception\InvalidPolicyfinal classA policy asked for what is never allowed, or an impossible limit
Phil\CssSanitizer\Exception\NestingTooDeepfinal classBlocks nested deeper than the parser's limit