Bug Report
Prerequisites
Description
var config = Configuration.Default
.WithRenderDevice(
new DefaultRenderDevice {
DeviceWidth = 1920,
DeviceHeight = 1080
})
.WithDefaultLoader(
new LoaderOptions() {
IsNavigationDisabled = true,
IsResourceLoadingEnabled = true
})
.WithCss();
var context = BrowsingContext.New(config);
var doc = await context.OpenAsync(req => req.Content(@"""
<html>
<head><link href=""https://some/tested/url.css"" rel=""stylesheet""></head>
<body><label>HI</label></body>
</html>
"""));
/*var style = doc.CreateElement<IHtmlStyleElement>();
style.TextContent = File.ReadAllText("some/actual/file.css");
doc.Head?.AppendElement(style);*/
var window = doc.DefaultView;
var tree = window.Render();
var label = tree.Find(doc.QuerySelector("label"));
await label.DownloadResources();
Console.WriteLine($"min-width: {window.GetComputedStyle(label.Ref as HtmlElement).GetMinWidth()}");
The css file has:
label, .test {
min-width: 50px;
border: 1px solid green;
}
If you uncomment the adding IHtmlStyleElement, it will work (injecting style directly), but when using the <link> it won't get processed.
Steps to Reproduce
Use code above.
Expected behavior: GetMinWidth() should return "50px" like it does when I add an IHtmlStyleElement directly.
Actual behavior: GetMinWidth() returns ""
Environment details: Windows 11, .NET 7
Bug Report
Prerequisites
AngleSharp.Cssfor CSS support)Description
The css file has:
If you uncomment the adding IHtmlStyleElement, it will work (injecting style directly), but when using the
<link>it won't get processed.Steps to Reproduce
Use code above.
Expected behavior: GetMinWidth() should return "50px" like it does when I add an IHtmlStyleElement directly.
Actual behavior: GetMinWidth() returns ""
Environment details: Windows 11, .NET 7