Closed atlastodor closed 5 years ago
Thanks for the report. I'll look into it.
PS: When you are changing CSS properties behavior, could you please override the ToString() method to return the CssText. This will make working in the debugger much easier.
Unfortunately, this was one of the original designs and it has many pitfalls. What I can recommend is either working with some auto variables or something like OzCode.
Just for debugging reasons ToString
should not be overridden. Instead, DebuggerDisplayAttribute
could be used in such cases (which was already used in AngleSharp in earlier versions; but as explained we discarded that). One of the reasons not to use it in AngleSharp (and AngleSharp.Css) is that this output (W3C serialization) may be confusing at times and does not tell the whole story (e.g., two classes may be have the same serialization).
Landed in devel
.
Just for debugging reasons ToString should not be overridden. Instead, DebuggerDisplayAttribute could be used in such cases (which was already used in AngleSharp in earlier versions; but as explained we discarded that). One of the reasons not to use it in AngleSharp (and AngleSharp.Css) is that this output (W3C serialization) may be confusing at times and does not tell the whole story (e.g., two classes may be have the same serialization).
OK. I understand. Normally when I need such a thing, my method will return something like:
ToString() => this.GetType().Name + ": " + this.MyName;
… so that the object can easily be debugged, but users won't confuse ToString with something returning useful information.
This sounds like a great strategy @atlastodor. I guess we could do something like this!
Bug Report
Prerequisites
AngleSharp
directly)For more information, see the
CONTRIBUTING
guide.Description
CSS shorthand property text-decoration is not properly expanded.
Steps to Reproduce
var styleDeclaration = document.Body.ComputeCurrentStyle();
Expected behavior: As per CSS text-decoration
Actual behavior:
Environment details: Windows 10, .Net 4.7
Possible Solution
Swap so text-decoration-style is expanded into text-decoration-line and vice-versa.
PS: When you are changing CSS properties behavior, could you please override the ToString() method to return the CssText. This will make working in the debugger much easier.