-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Fizzler V3 #1092
Remove Fizzler V3 #1092
Conversation
I have enough Implemented for AngleSharp to run the Benchmark. here are the numbers (Maybe I need some more optimization)
There is certainly room for improvements in the AngleSharp Implementation. But I don't know if I can find there Factor 50. |
nth-child(2) does not work yet need to make step and offset visible
Implmented N th Child and N th Last Child with reflection, if the Properties become public in excss than this refelction Code can be changed to Field, Property Access. All Css Features that Fizzler supported are now supported. By the Excss Evalutor.
|
Source/Css/ExCssQuery.cs
Outdated
TypeSelector typeSelector => ops.Type(typeSelector.Name), | ||
UnknownSelector unknownSelector => throw new NotImplementedException(), // TODO:, | ||
IdSelector idSelector => ops.Id(idSelector.Id), | ||
_ => throw new NotImplementedException(), // TODO:, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the todos and add one more case that is not implemented. For the not typed selectors I have to look into excss what kind of selectors this is.
Source/SvgDocument.cs
Outdated
@@ -421,6 +462,7 @@ private static T Create<T>(XmlReader reader) where T : SvgDocument, new() | |||
{ | |||
styles.Add(unknown); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Source/Css/ExCssQuery.cs
Outdated
AttrHyphenSelector attrHyphenSelector => ops.AttributeDashMatch(attrHyphenSelector.Attribute, attrHyphenSelector.Value), | ||
AttrListSelector attrListSelector => ops.AttributeIncludes(attrListSelector.Attribute, attrListSelector.Value), | ||
AttrMatchSelector attrMatchSelector => ops.AttributeExact(attrMatchSelector.Attribute, attrMatchSelector.Value), | ||
AttrNotMatchSelector attrNotMatchSelector => ops.AttributeNotMatch(attrNotMatchSelector.Attribute, attrNotMatchSelector.Value), // TODO:, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed because it is now implemented
From my perspective this looks quite good, but I'm not really qualified to review this. @wieslawsoltes and @H1Gdev - please check if this can be merged. |
@inforithmics |
Currently nothing, I used it for the Benchmarks. But when I saw that it was not very Performant I didn't continue investigating it. So I remove the AngleSharp Code from this pull request. |
So I reduced the changes and removed AngleSharp Code |
I Implemented the :not Css Selector because in newest Fizzler 1.3.0 this was implemented (To keep feature parity). |
@@ -36,11 +36,12 @@ | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> | |||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
16.8.3 has a security vulnerability so I upgraded to 16.11.0 to silence the warning.
<PackageReference Include="NUnit" Version="3.13.0" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" /> | ||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" /> | ||
<PackageReference Include="Moq" Version="4.16.1" /> | ||
<PackageReference Include="Fizzler" Version="1.3.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgraded to newest fizzler (for regression tests)
@@ -177,7 +177,7 @@ private IEnumerable<SvgElement> ElementsAfterSelf(SvgElement self) | |||
|
|||
public Selector<SvgElement> NthLastChild(int a, int b) | |||
{ | |||
throw new NotImplementedException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nlast child was not implemented previously is now implemented.
{ | ||
var sel = selector.Class.Substring(PseudoClassNames.Not.Length + 1, selector.Class.Length - 2 - PseudoClassNames.Not.Length); | ||
var parser = new StylesheetParser(true, true, tolerateInvalidValues: true); | ||
var styleSheet = parser.Parse(sel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excss does not fully parse the not pseudofunc so I have to parse it myself here.
@@ -27,5 +27,4 @@ This project has dependencies on other open-source projects. These projects are | |||
|
|||
|Project|Author|Sources|License| | |||
|--------|-----|---|---------| | |||
|Fizzler|Atif Aziz (@atifaziz)|[GitHub](https://github.com/atifaziz/Fizzler)|[LGPL](https://github.com/atifaziz/Fizzler/blob/master/COPYING.txt)| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is now removed from the nuget package as dependency is now only used as unit test dependency.
…tion was wrong for nth-child and nth-lastchild
…ators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt initial ExCss Implementation ported from RemoveFizzlerV2 Branch BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt remove Fizzler from Readme BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt updated Fizzler for regression tests to 1.3.0 and implemented :not Pseudofunction BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt implemented nth type and nth-last-type BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt Implement :root
…d Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt initial ExCss Implementation ported from RemoveFizzlerV2 Branch BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt remove Fizzler from Readme BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt updated Fizzler for regression tests to 1.3.0 and implemented :not Pseudofunction BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt implemented nth type and nth-last-type BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt Implement :root
…d Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt initial ExCss Implementation ported from RemoveFizzlerV2 Branch BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt remove Fizzler from Readme BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt updated Fizzler for regression tests to 1.3.0 and implemented :not Pseudofunction BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt implemented nth type and nth-last-type BuildProcessTemplates CONTRIBUTING.md Generators Nuget README.md Samples Source Svg.Custom Tests doc docfx.json index.md license.txt Implement :root
Reference Issue
#1073
What does this implement/fix? Explain your changes.
remove Fizzler implements a QuerySelectAll that uses the ExCSS Selector Dom
Any other comments?
This pull request is based on this pull request
#1083
TODO:
A new Pull Request based on this.
#1086
Main Idea:
The idea is to Implement an IExCssSelectorOps Interface similar interface to IElementOps so that I can regression test to Fizzler Implementation. The ExCss Query tries to map the Selectors to the IExCssSelectorOps Interface, Because Fizzler has not implemented all Css Selectors certain Selectors are not implemented.
List of css selectors which should be supported.
https://stackoverflow.com/questions/42230563/what-is-the-compatibility-of-css3-pseudoclasses-with-svg-renderable-elements
All are handled (:target and :root in need to investigate)