@@ -36,14 +36,14 @@ public static IStyleCollection GetStyleCollection(this IWindow window)
36
36
/// Computes the declarations for the given element in the context of
37
37
/// the specified styling rules.
38
38
/// </summary>
39
- /// <param name="rules ">The styles to use.</param>
39
+ /// <param name="styles ">The styles to use.</param>
40
40
/// <param name="element">The element that is questioned.</param>
41
41
/// <param name="pseudoSelector">The optional pseudo selector to use.</param>
42
42
/// <returns>The style declaration containing all the declarations.</returns>
43
- public static ICssStyleDeclaration ComputeDeclarations ( this IEnumerable < ICssStyleRule > rules , IElement element , String pseudoSelector = null )
43
+ public static ICssStyleDeclaration ComputeDeclarations ( this IStyleCollection styles , IElement element , String pseudoSelector = null )
44
44
{
45
45
var ctx = element . Owner ? . Context ;
46
- var device = ctx ? . GetService < IRenderDevice > ( ) ;
46
+ var device = styles . Device ;
47
47
var computedStyle = new CssStyleDeclaration ( ctx ) ;
48
48
var nodes = element . GetAncestors ( ) . OfType < IElement > ( ) ;
49
49
@@ -57,11 +57,11 @@ public static ICssStyleDeclaration ComputeDeclarations(this IEnumerable<ICssStyl
57
57
}
58
58
}
59
59
60
- computedStyle . SetDeclarations ( rules . ComputeCascadedStyle ( element ) ) ;
60
+ computedStyle . SetDeclarations ( styles . ComputeCascadedStyle ( element ) ) ;
61
61
62
62
foreach ( var node in nodes )
63
63
{
64
- computedStyle . UpdateDeclarations ( rules . ComputeCascadedStyle ( node ) ) ;
64
+ computedStyle . UpdateDeclarations ( styles . ComputeCascadedStyle ( node ) ) ;
65
65
}
66
66
67
67
if ( device is not null )
@@ -77,14 +77,14 @@ public static ICssStyleDeclaration ComputeDeclarations(this IEnumerable<ICssStyl
77
77
/// Two rules with the same specificity are ordered according to their appearance. The more
78
78
/// recent declaration wins. Inheritance is not taken into account.
79
79
/// </summary>
80
- /// <param name="styleCollection ">The style rules to apply.</param>
80
+ /// <param name="rules ">The style rules to apply.</param>
81
81
/// <param name="element">The element to compute the cascade for.</param>
82
82
/// <param name="parent">The potential parent for the cascade.</param>
83
83
/// <returns>Returns the cascaded read-only style declaration.</returns>
84
- public static ICssStyleDeclaration ComputeCascadedStyle ( this IEnumerable < ICssStyleRule > styleCollection , IElement element , ICssStyleDeclaration parent = null )
84
+ public static ICssStyleDeclaration ComputeCascadedStyle ( this IStyleCollection styles , IElement element , ICssStyleDeclaration parent = null )
85
85
{
86
86
var computedStyle = new CssStyleDeclaration ( element . Owner ? . Context ) ;
87
- var rules = styleCollection . SortBySpecificity ( element ) ;
87
+ var rules = styles . SortBySpecificity ( element ) ;
88
88
89
89
foreach ( var rule in rules )
90
90
{
0 commit comments