@@ -19,30 +19,7 @@ import {
1919 type Matcher ,
2020 stripComments
2121} from './CSSPropertyParser.js' ;
22- import {
23- AnchorFunctionMatcher ,
24- AngleMatcher ,
25- AutoBaseMatcher ,
26- BezierMatcher ,
27- BinOpMatcher ,
28- ColorMatcher ,
29- ColorMixMatcher ,
30- CSSWideKeywordMatcher ,
31- FlexGridMatcher ,
32- FontMatcher ,
33- GridTemplateMatcher ,
34- LengthMatcher ,
35- LightDarkColorMatcher ,
36- LinearGradientMatcher ,
37- LinkableNameMatcher ,
38- MathFunctionMatcher ,
39- PositionAnchorMatcher ,
40- PositionTryMatcher ,
41- ShadowMatcher ,
42- StringMatcher ,
43- URLMatcher ,
44- VariableMatcher
45- } from './CSSPropertyParserMatchers.js' ;
22+ import { CSSWideKeywordMatcher , FontMatcher } from './CSSPropertyParserMatchers.js' ;
4623import type { CSSStyleDeclaration } from './CSSStyleDeclaration.js' ;
4724
4825export const enum Events {
@@ -120,37 +97,6 @@ export class CSSProperty extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
12097 return result ;
12198 }
12299
123- #matchers( matchedStyles : CSSMatchedStyles , computedStyles : Map < string , string > | null ) : Array < Matcher < Match > > {
124- const matchers = [
125- new VariableMatcher ( matchedStyles , this . ownerStyle ) ,
126- new ColorMatcher ( ( ) => computedStyles ?. get ( 'color' ) ?? null ) ,
127- new ColorMixMatcher ( ) ,
128- new URLMatcher ( ) ,
129- new AngleMatcher ( ) ,
130- new LinkableNameMatcher ( ) ,
131- new BezierMatcher ( ) ,
132- new StringMatcher ( ) ,
133- new ShadowMatcher ( ) ,
134- new CSSWideKeywordMatcher ( this , matchedStyles ) ,
135- new LightDarkColorMatcher ( this ) ,
136- new GridTemplateMatcher ( ) ,
137- new LinearGradientMatcher ( ) ,
138- new AnchorFunctionMatcher ( ) ,
139- new PositionAnchorMatcher ( ) ,
140- new FlexGridMatcher ( ) ,
141- new PositionTryMatcher ( ) ,
142- new LengthMatcher ( ) ,
143- new MathFunctionMatcher ( ) ,
144- new AutoBaseMatcher ( ) ,
145- new BinOpMatcher ( ) ,
146- ] ;
147-
148- if ( Root . Runtime . experiments . isEnabled ( 'font-editor' ) ) {
149- matchers . push ( new FontMatcher ( ) ) ;
150- }
151- return matchers ;
152- }
153-
154100 parseExpression ( expression : string , matchedStyles : CSSMatchedStyles , computedStyles : Map < string , string > | null ) :
155101 BottomUpTreeMatching | null {
156102 if ( ! this . parsedOk ) {
@@ -168,6 +114,16 @@ export class CSSProperty extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
168114 return matchDeclaration ( this . name , this . value , this . #matchers( matchedStyles , computedStyles ) ) ;
169115 }
170116
117+ #matchers( matchedStyles : CSSMatchedStyles , computedStyles : Map < string , string > | null ) : Array < Matcher < Match > > {
118+ const matchers = matchedStyles . propertyMatchers ( this . ownerStyle , computedStyles ) ;
119+
120+ matchers . push ( new CSSWideKeywordMatcher ( this , matchedStyles ) ) ;
121+ if ( Root . Runtime . experiments . isEnabled ( 'font-editor' ) ) {
122+ matchers . push ( new FontMatcher ( ) ) ;
123+ }
124+ return matchers ;
125+ }
126+
171127 private ensureRanges ( ) : void {
172128 if ( this . #nameRangeInternal && this . #valueRangeInternal) {
173129 return ;
0 commit comments