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
22{
33 using AngleSharp . Css . Parser ;
44 using AngleSharp . Css . Values ;
5+ using AngleSharp . Dom ;
56 using AngleSharp . Text ;
67 using System ;
78 using System . Linq ;
@@ -11,6 +12,18 @@ namespace AngleSharp.Css.Dom
1112 /// </summary>
1213 public static class CssOmExtensions
1314 {
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+
1427 /// <summary>
1528 /// Gets the style rule with the provided selector text.
1629 /// </summary>
You can’t perform that action at this time.
0 commit comments