diff --git a/includes/Hooks/StylesheetSanitizerHook.php b/includes/Hooks/StylesheetSanitizerHook.php index ed2a473..69e346a 100644 --- a/includes/Hooks/StylesheetSanitizerHook.php +++ b/includes/Hooks/StylesheetSanitizerHook.php @@ -69,6 +69,7 @@ class StylesheetSanitizerHook { $extended->addAspectRatio( $extender, $matcherFactory ); $extended->addInlineBlockMarginPaddingProperties( $extender, $matcherFactory ); $extended->addInsetProperties( $extender, $matcherFactory ); + $extended->addBackdropFilter( $extender ); $propertySanitizer->setKnownProperties( $extender->getKnownProperties() ); } diff --git a/includes/TemplateStylesExtender.php b/includes/TemplateStylesExtender.php index 62c65c7..812bece 100644 --- a/includes/TemplateStylesExtender.php +++ b/includes/TemplateStylesExtender.php @@ -330,6 +330,23 @@ class TemplateStylesExtender { } } + /** + * Adds the backdrop-filter matcher + * + * @param StylePropertySanitizer $propertySanitizer + */ + public function addBackdropFilter( StylePropertySanitizer $propertySanitizer ): void { + try { + $filter = $propertySanitizer->getKnownProperties()['filter']; + + $propertySanitizer->addKnownProperties( [ + 'backdrop-filter' => Quantifier::plus( $filter ), + ] ); + } catch ( InvalidArgumentException $e ) { + // Fail silently + } + } + /** * Loads a config value for a given key from the main config * Returns null on if an ConfigException was thrown