Prerequisites
Description
In an inline style where a non-important declaration for the same property comes later that an important one, the non-important takes precedence, although the important one should take precedence.
Originally reported as mganss/HtmlSanitizer#587
Possibly related: #184
Steps to Reproduce
const string html = """
<p style="padding: 20px !important; font-size: 20px; padding: 0;">Test</p>
""";
var parser = new HtmlParser(new HtmlParserOptions { IsScripting = true }, BrowsingContext.New(Configuration.Default.WithCss(new CssParserOptions())));
var dom = parser.ParseDocument(html);
var p = dom.QuerySelector("p") as IHtmlParagraphElement;
var style = p.GetStyle().CssText; // -> "padding: 0; font-size: 20px"
Expected Behavior
style is "padding: 20px !important; font-size: 20px"
Actual Behavior
style is "padding: 0; font-size: 20px"
Possible Solution / Known Workarounds
No response
Prerequisites
AngleSharp.Xmlfor Xml support)Description
In an inline style where a non-important declaration for the same property comes later that an important one, the non-important takes precedence, although the important one should take precedence.
Originally reported as mganss/HtmlSanitizer#587
Possibly related: #184
Steps to Reproduce
Expected Behavior
styleis"padding: 20px !important; font-size: 20px"Actual Behavior
styleis"padding: 0; font-size: 20px"Possible Solution / Known Workarounds
No response