matcher = new Juxtaposition( [ new Alternative( [ $matcherFactory->url( 'css' ), $matcherFactory->urlstring( 'css' ), ] ), $matcherFactory->cssMediaQueryList(), ] ); } public function getIndex() { return -1000; } public function handlesRule( Rule $rule ) { return $rule instanceof AtRule && !strcasecmp( $rule->getName(), 'import' ); } protected function doSanitize( CSSObject $object ) { if ( !$object instanceof Rule || !$this->handlesRule( $object ) ) { $this->sanitizationError( 'expected-at-rule', $object, [ 'import' ] ); return null; } if ( $object->getBlock() !== null ) { $this->sanitizationError( 'at-rule-block-not-allowed', $object->getBlock(), [ 'import' ] ); return null; } if ( !$this->matcher->match( $object->getPrelude(), [ 'mark-significance' => true ] ) ) { $cv = Util::findFirstNonWhitespace( $object->getPrelude() ); if ( $cv ) { $this->sanitizationError( 'invalid-import-value', $cv ); } else { $this->sanitizationError( 'missing-import-source', $object ); } return null; } $object = $this->fixPreludeWhitespace( $object, true ); return $object; } }