File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/AngleSharp.Diffing/Strategies/AttributeStrategies Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ private static CompareResult CompareElementStyle(in AttributeComparison comparis
2929 var ( ctrlElm , testElm ) = comparison . GetAttributeElements ( ) ;
3030 var ctrlStyle = ctrlElm . GetStyle ( ) ;
3131 var testStyle = testElm . GetStyle ( ) ;
32- return ctrlStyle . CssText . Equals ( testStyle . CssText , StringComparison . Ordinal )
32+ return CompareCssStyleDeclarations ( ctrlStyle , testStyle )
3333 ? CompareResult . Same
3434 : CompareResult . Different ;
3535 }
@@ -39,5 +39,13 @@ private static bool IsStyleAttributeComparison(in AttributeComparison comparison
3939 return comparison . Control . Attribute . Name . Equals ( AttributeNames . Style , StringComparison . Ordinal ) &&
4040 comparison . Test . Attribute . Name . Equals ( AttributeNames . Style , StringComparison . Ordinal ) ;
4141 }
42+
43+ private static bool CompareCssStyleDeclarations ( ICssStyleDeclaration control , ICssStyleDeclaration test )
44+ {
45+ if ( control . Length != test . Length )
46+ return false ;
47+
48+ return control . CssText . Equals ( test . CssText , StringComparison . Ordinal ) ;
49+ }
4250 }
4351}
You can’t perform that action at this time.
0 commit comments