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
29
29
var ( ctrlElm , testElm ) = comparison . GetAttributeElements ( ) ;
30
30
var ctrlStyle = ctrlElm . GetStyle ( ) ;
31
31
var testStyle = testElm . GetStyle ( ) ;
32
- return ctrlStyle . CssText . Equals ( testStyle . CssText , StringComparison . Ordinal )
32
+ return CompareCssStyleDeclarations ( ctrlStyle , testStyle )
33
33
? CompareResult . Same
34
34
: CompareResult . Different ;
35
35
}
@@ -39,5 +39,13 @@ private static bool IsStyleAttributeComparison(in AttributeComparison comparison
39
39
return comparison . Control . Attribute . Name . Equals ( AttributeNames . Style , StringComparison . Ordinal ) &&
40
40
comparison . Test . Attribute . Name . Equals ( AttributeNames . Style , StringComparison . Ordinal ) ;
41
41
}
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
+ }
42
50
}
43
51
}
You can’t perform that action at this time.
0 commit comments