forked from AngleSharp/AngleSharp.Css
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fe8a86
commit 50d8e9d
Showing
4 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
namespace AngleSharp.Css.Tests.Library | ||
{ | ||
using AngleSharp.Dom; | ||
using AngleSharp.Html.Dom; | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
|
||
[TestFixture] | ||
public class ComputedStyleTests | ||
{ | ||
[Test] | ||
[Ignore("Not implemented yet")] | ||
public async Task TransformEmToPx_Issue136() | ||
{ | ||
// .With<IRenderDevice>() | ||
var config = Configuration.Default.WithCss(); | ||
var context = BrowsingContext.New(config); | ||
var source = "<p>This is <span>only</span> a test.</p>"; | ||
var cssSheet = "p { font-size: 1.5em }"; | ||
var document = await context.OpenAsync(req => req.Content(source)); | ||
var style = document.CreateElement<IHtmlStyleElement>(); | ||
style.TextContent = cssSheet; | ||
document.Head.AppendChild(style); | ||
var span = document.QuerySelector("span"); | ||
var fontSize = span.ComputeCurrentStyle().GetProperty("font-size"); | ||
|
||
Assert.AreEqual("24px", fontSize.Value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters