File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/AngleSharp.Css/Extensions Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ namespace AngleSharp.Css.Dom
2
2
{
3
3
using AngleSharp . Css . Parser ;
4
4
using AngleSharp . Css . Values ;
5
+ using AngleSharp . Dom ;
5
6
using AngleSharp . Text ;
6
7
using System ;
7
8
using System . Linq ;
@@ -11,6 +12,18 @@ namespace AngleSharp.Css.Dom
11
12
/// </summary>
12
13
public static class CssOmExtensions
13
14
{
15
+ /// <summary>
16
+ /// Gets the computed style of the element.
17
+ /// </summary>
18
+ /// <param name="element">The element to compute the style for.</param>
19
+ /// <param name="pseudo">The optional pseudo selector to use.</param>
20
+ /// <returns>The computed style of the element.</returns>
21
+ public static ICssStyleDeclaration ComputeStyle ( this IElement element , String pseudo = null )
22
+ {
23
+ var window = element ? . Owner ? . DefaultView ;
24
+ return window ? . GetComputedStyle ( element , pseudo ) ;
25
+ }
26
+
14
27
/// <summary>
15
28
/// Gets the style rule with the provided selector text.
16
29
/// </summary>
You can’t perform that action at this time.
0 commit comments