@@ -64,7 +64,13 @@ internal static ICssProperty CreateShorthand(this IBrowsingContext context, Stri
64
64
var factory = context . GetFactory < IDeclarationFactory > ( ) ;
65
65
var info = factory . Create ( name ) ;
66
66
var value = info . Combine ( factory , longhands ) ;
67
- return new CssProperty ( name , info . Converter , info . Flags , value , important ) ;
67
+
68
+ if ( context . AllowsDeclaration ( info ) )
69
+ {
70
+ return new CssProperty ( name , info . Converter , info . Flags , value , important ) ;
71
+ }
72
+
73
+ return null ;
68
74
}
69
75
70
76
internal static ICssProperty [ ] CreateLonghands ( this IBrowsingContext context , ICssProperty shorthand )
@@ -78,16 +84,18 @@ internal static ICssProperty[] CreateLonghands(this IBrowsingContext context, IC
78
84
internal static CssProperty CreateProperty ( this IBrowsingContext context , String propertyName )
79
85
{
80
86
var info = context . GetDeclarationInfo ( propertyName ) ;
81
- var provider = context . GetProvider < CssParser > ( ) ;
82
87
83
- if ( info . Flags != PropertyFlags . Unknown || context . IsAllowingUnknownDeclarations ( ) )
88
+ if ( context . AllowsDeclaration ( info ) )
84
89
{
85
90
return new CssProperty ( propertyName , info . Converter , info . Flags ) ;
86
91
}
87
92
88
93
return null ;
89
94
}
90
95
96
+ private static Boolean AllowsDeclaration ( this IBrowsingContext context , DeclarationInfo info ) =>
97
+ info . Flags != PropertyFlags . Unknown || context . IsAllowingUnknownDeclarations ( ) ;
98
+
91
99
private static Boolean IsAllowingUnknownDeclarations ( this IBrowsingContext context )
92
100
{
93
101
var parser = context . GetProvider < CssParser > ( ) ;
0 commit comments