Skip to content

Commit

Permalink
Merge pull request #54 from The-Nutty/devel
Browse files Browse the repository at this point in the history
Update ComputeDeclarations and ComputeCascadedStyle to take IEnumerable<ICssStyleRule>
  • Loading branch information
FlorianRappl authored May 4, 2020
2 parents af910d9 + a880eee commit 7aa7f93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.14.1

Released on Monday, May 4 2020.

- Changed StyleCollectionExtensions.ComputeDeclarations and StyleCollectionExtensions.ComputeCascadedStyle to take IEnumerable<ICssStyleRule> (#53)

# 0.14.0

Released on Tuesday, April 7 2020.
Expand Down
4 changes: 2 additions & 2 deletions src/AngleSharp.Css/Extensions/StyleCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static IStyleCollection GetStyleCollection(this IWindow window)
/// <param name="element">The element that is questioned.</param>
/// <param name="pseudoSelector">The optional pseudo selector to use.</param>
/// <returns>The style declaration containing all the declarations.</returns>
public static ICssStyleDeclaration ComputeDeclarations(this IStyleCollection rules, IElement element, String pseudoSelector = null)
public static ICssStyleDeclaration ComputeDeclarations(this IEnumerable<ICssStyleRule> rules, IElement element, String pseudoSelector = null)
{
var computedStyle = new CssStyleDeclaration(element.Owner?.Context);
var nodes = element.GetAncestors().OfType<IElement>();
Expand Down Expand Up @@ -74,7 +74,7 @@ public static ICssStyleDeclaration ComputeDeclarations(this IStyleCollection rul
/// <param name="element">The element to compute the cascade for.</param>
/// <param name="parent">The potential parent for the cascade.</param>
/// <returns>Returns the cascaded read-only style declaration.</returns>
public static ICssStyleDeclaration ComputeCascadedStyle(this IStyleCollection styleCollection, IElement element, ICssStyleDeclaration parent = null)
public static ICssStyleDeclaration ComputeCascadedStyle(this IEnumerable<ICssStyleRule> styleCollection, IElement element, ICssStyleDeclaration parent = null)
{
var computedStyle = new CssStyleDeclaration(element.Owner?.Context);
var rules = styleCollection.SortBySpecificity(element);
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<PropertyGroup>
<Description>Extends the CSSOM from the core AngleSharp library.</Description>
<Product>AngleSharp.Css</Product>
<Version>0.14.0</Version>
<Version>0.14.1</Version>
</PropertyGroup>
</Project>

0 comments on commit 7aa7f93

Please sign in to comment.