Skip to content

Commit 7aa7f93

Browse files
authored
Merge pull request #54 from The-Nutty/devel
Update ComputeDeclarations and ComputeCascadedStyle to take IEnumerable<ICssStyleRule>
2 parents af910d9 + a880eee commit 7aa7f93

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 0.14.1
2+
3+
Released on Monday, May 4 2020.
4+
5+
- Changed StyleCollectionExtensions.ComputeDeclarations and StyleCollectionExtensions.ComputeCascadedStyle to take IEnumerable<ICssStyleRule> (#53)
6+
17
# 0.14.0
28

39
Released on Tuesday, April 7 2020.

src/AngleSharp.Css/Extensions/StyleCollectionExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static IStyleCollection GetStyleCollection(this IWindow window)
4040
/// <param name="element">The element that is questioned.</param>
4141
/// <param name="pseudoSelector">The optional pseudo selector to use.</param>
4242
/// <returns>The style declaration containing all the declarations.</returns>
43-
public static ICssStyleDeclaration ComputeDeclarations(this IStyleCollection rules, IElement element, String pseudoSelector = null)
43+
public static ICssStyleDeclaration ComputeDeclarations(this IEnumerable<ICssStyleRule> rules, IElement element, String pseudoSelector = null)
4444
{
4545
var computedStyle = new CssStyleDeclaration(element.Owner?.Context);
4646
var nodes = element.GetAncestors().OfType<IElement>();
@@ -74,7 +74,7 @@ public static ICssStyleDeclaration ComputeDeclarations(this IStyleCollection rul
7474
/// <param name="element">The element to compute the cascade for.</param>
7575
/// <param name="parent">The potential parent for the cascade.</param>
7676
/// <returns>Returns the cascaded read-only style declaration.</returns>
77-
public static ICssStyleDeclaration ComputeCascadedStyle(this IStyleCollection styleCollection, IElement element, ICssStyleDeclaration parent = null)
77+
public static ICssStyleDeclaration ComputeCascadedStyle(this IEnumerable<ICssStyleRule> styleCollection, IElement element, ICssStyleDeclaration parent = null)
7878
{
7979
var computedStyle = new CssStyleDeclaration(element.Owner?.Context);
8080
var rules = styleCollection.SortBySpecificity(element);

src/Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<PropertyGroup>
33
<Description>Extends the CSSOM from the core AngleSharp library.</Description>
44
<Product>AngleSharp.Css</Product>
5-
<Version>0.14.0</Version>
5+
<Version>0.14.1</Version>
66
</PropertyGroup>
77
</Project>

0 commit comments

Comments
 (0)