cache[__METHOD__] ) ) { return $this->cache[__METHOD__]; } // @codeCoverageIgnoreEnd $props = parent::cssText3( $matcherFactory ); $props['overflow-wrap'] = new Alternative( [ new KeywordMatcher( [ 'normal' ] ), UnorderedGroup::someOf( [ new KeywordMatcher( [ 'break-word' ] ), new KeywordMatcher( [ 'break-spaces' ] ), new KeywordMatcher( [ 'anywhere' ] ), ] ) ] ); $this->cache[__METHOD__] = $props; self::$extendedCssText3 = true; return $props; } /** * @inheritDoc * Allow rgba syntax like #aaaaaaaa * * T265675 */ protected function cssBorderBackground3( MatcherFactory $matcherFactory ) { // @codeCoverageIgnoreStart if ( self::$extendedCssBorderBackground && isset( $this->cache[__METHOD__] ) ) { return $this->cache[__METHOD__]; } // @codeCoverageIgnoreEnd $props = parent::cssBorderBackground3( $matcherFactory ); $props['background-color'] = new Alternative( [ $matcherFactory->color(), new TokenMatcher( Token::T_HASH, function ( Token $t ) { return preg_match( '/^([0-9a-f]{3}|[0-9a-f]{8})$/i', $t->value() ); } ), ] ); $this->cache[__METHOD__] = $props; self::$extendedCssBorderBackground = true; return $props; } /** * @inheritDoc * Allow width: fit-content * * T271958 */ protected function cssSizing3( MatcherFactory $matcherFactory ) { // @codeCoverageIgnoreStart if ( self::$extendedCssSizing3 && isset( $this->cache[__METHOD__] ) ) { return $this->cache[__METHOD__]; } // @codeCoverageIgnoreEnd $props = parent::cssSizing3( $matcherFactory ); $props['width'] = new Alternative( [ $props['width'], new KeywordMatcher( 'fit-content' ) ] ); $this->cache[__METHOD__] = $props; self::$extendedCssSizing3 = true; return $props; } /** * @param CSSObject $object * @return CSSObject|\Wikimedia\CSS\Objects\Declaration|null */ protected function doSanitize( CSSObject $object ) { $parent = parent::doSanitize( $object ); if ( substr( strtolower( $object->getName() ), 0, 2 ) === '--' ) { $this->clearSanitizationErrors(); } return $parent; } }