Skip to content
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

fix(Selector): support Selector selection token #385

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/NUglify.Benchmarks/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
</configuration>
3 changes: 2 additions & 1 deletion src/NUglify.Benchmarks/NUglify.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NUglify.Benchmarks</RootNamespace>
<AssemblyName>NUglify.Benchmarks</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down
4 changes: 2 additions & 2 deletions src/NUglify.Benchmarks/packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.9.6" targetFramework="net45" />
<package id="BenchmarkDotNet" version="0.9.6" targetFramework="net45" />
<package id="BenchmarkDotNet" version="0.9.6" targetFramework="net45" requireReinstallation="true" />
<package id="BenchmarkDotNet.Diagnostics.Windows" version="0.9.6" targetFramework="net45" />
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net45" />
<package id="Microsoft.Diagnostics.Tracing.TraceEvent" version="1.0.41" targetFramework="net45" />
<package id="WebMarkupMin.Core" version="2.0.0-rc7" targetFramework="net45" />
<package id="WebMarkupMin.Core" version="2.0.0-rc7" targetFramework="net45" requireReinstallation="true" />
<package id="ZetaProducerHtmlCompressor" version="1.0.2.0" targetFramework="net45" />
</packages>
4 changes: 2 additions & 2 deletions src/NUglify.Tasks/ManifestStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/NUglify.Tasks/NUglify.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NUglify</RootNamespace>
<AssemblyName>NUglify.Tasks</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -25,6 +25,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -36,6 +37,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Build.Framework" />
Expand Down
2 changes: 1 addition & 1 deletion src/NUglify.Tasks/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/NUglify.Tests/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
34 changes: 24 additions & 10 deletions src/NUglify.Tests/Css/Bugs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public void Bug74()
[Test]
public void Bug181()
{
var uglifyResult = Uglify.Css("p { color: red; }", new CssSettings { Indent = " ", OutputMode = OutputMode.MultipleLines });
Assert.AreEqual("p\n{\n color: #f00\n}", uglifyResult.Code);
var uglifyResult = Uglify.Css("p { color: red; }", new CssSettings { Indent = " ", OutputMode = OutputMode.MultipleLines });
Assert.AreEqual("p\n{\n color: #f00\n}", uglifyResult.Code);
}

[Test]
Expand All @@ -60,7 +60,7 @@ public void Bug250()
[Test]
public void Bug270()
{
TestHelper.Instance.RunTest();
TestHelper.Instance.RunTest();
}

[Test]
Expand Down Expand Up @@ -112,7 +112,7 @@ public void Bug280()
[Test]
public void Bug302()
{
Assert.AreEqual("p{background-color:var(--_flumo-grid-secondary-border-color)!important}", Uglify.Css(@"
Assert.AreEqual("p{background-color:var(--_flumo-grid-secondary-border-color)!important}", Uglify.Css(@"
p {
background-color: var(--_flumo-grid-secondary-border-color) !important;
}").Code);
Expand All @@ -121,7 +121,7 @@ public void Bug302()
[Test]
public void Bug309()
{
Assert.AreEqual("body{border-top-width:.5vmax;--custom-property:0px}", Uglify.Css(@"
Assert.AreEqual("body{border-top-width:.5vmax;--custom-property:0px}", Uglify.Css(@"
body
{
border-top-width: 0.5vmax;
Expand All @@ -132,14 +132,14 @@ public void Bug309()

[Test]
public void Bug331()
{
TestHelper.Instance.RunTest();
{
TestHelper.Instance.RunTest();
}

[Test]
public void Bug317()
{
Assert.AreEqual("body{border:0;border-top:0;border-right:0;border-bottom:0;border-left:0;outline:0}", Uglify.Css(@"
{
Assert.AreEqual("body{border:0;border-top:0;border-right:0;border-bottom:0;border-left:0;outline:0}", Uglify.Css(@"
body
{
border: none;
Expand All @@ -166,11 +166,25 @@ public void Bug343()
[Test]
public void Bug379()
{
Assert.AreEqual(".\\!inline-flex{display:inline-flex!important}", Uglify.Css(@"
Assert.AreEqual(".\\!inline-flex{display:inline-flex!important}", Uglify.Css(@"
.\!inline-flex {
display: inline-flex!important
}
").Code);
}

[Test]
public void Bug383()
{
var result = Uglify.Css("""
@supports not selector(::-webkit-scrollbar) {
.scroll {
scrollbar-color: rgba(0,0,0,0.3) rgba(0,0,0,0);
scrollbar-width: thin;
}
}
""");
Assert.False(result.HasErrors);
}
}
}
8 changes: 1 addition & 7 deletions src/NUglify.Tests/NUglify.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NUglify.Tests</RootNamespace>
<AssemblyName>NUglify.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<CopyNuGetImplementations>true</CopyNuGetImplementations>
Expand Down Expand Up @@ -4199,12 +4199,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NUglifyApp\NUglifyApp.csproj">
<Project>{6ed835a6-8a8a-44ec-8679-7ebbe2a0dbe4}</Project>
<Name>NUglifyApp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
Expand Down
12 changes: 5 additions & 7 deletions src/NUglify.Tests/NUglify.Tests.nuget.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.lock.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Andrew Bullock\.nuget\packages\</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Argo\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">ProjectJson</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.11.1</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.10.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Andrew Bullock\.nuget\packages\" />
<SourceRoot Include="C:\Users\Argo\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgNUnit3TestAdapter Condition=" '$(PkgNUnit3TestAdapter)' == '' ">C:\Users\Andrew Bullock\.nuget\packages\nunit3testadapter\3.5.0</PkgNUnit3TestAdapter>
<PkgNUnit3TestAdapter Condition=" '$(PkgNUnit3TestAdapter)' == '' ">C:\Users\Argo\.nuget\packages\nunit3testadapter\3.5.0</PkgNUnit3TestAdapter>
</PropertyGroup>
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 2 additions & 38 deletions src/NUglify.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30128.74
# Visual Studio Version 17
VisualStudioVersion = 17.10.35027.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUglify", "NUglify\NUglify.csproj", "{CA85C41A-928F-4626-9025-0FE5991C7BE8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUglify.Tests", "NUglify.Tests\NUglify.Tests.csproj", "{5F19295A-C991-4A72-A943-846384F90EAB}"
ProjectSection(ProjectDependencies) = postProject
{CA85C41A-928F-4626-9025-0FE5991C7BE8} = {CA85C41A-928F-4626-9025-0FE5991C7BE8}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{061866E2-005C-4D13-A338-EA464BBEC60F}"
ProjectSection(SolutionItems) = preProject
..\appveyor.yml = ..\appveyor.yml
Expand All @@ -23,21 +18,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\readme.md = ..\readme.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUglifyApp", "NUglifyApp\NUglifyApp.csproj", "{6ED835A6-8A8A-44EC-8679-7EBBE2A0DBE4}"
ProjectSection(ProjectDependencies) = postProject
{CA85C41A-928F-4626-9025-0FE5991C7BE8} = {CA85C41A-928F-4626-9025-0FE5991C7BE8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUglify.Tasks", "NUglify.Tasks\NUglify.Tasks.csproj", "{0C7BC471-4112-43CA-89AA-B7EBDB5689C1}"
ProjectSection(ProjectDependencies) = postProject
{CA85C41A-928F-4626-9025-0FE5991C7BE8} = {CA85C41A-928F-4626-9025-0FE5991C7BE8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUglify.Benchmarks", "NUglify.Benchmarks\NUglify.Benchmarks.csproj", "{B78A6BC2-3FC9-4AFA-A314-2B5C62BCD94D}"
ProjectSection(ProjectDependencies) = postProject
{CA85C41A-928F-4626-9025-0FE5991C7BE8} = {CA85C41A-928F-4626-9025-0FE5991C7BE8}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -48,22 +28,6 @@ Global
{CA85C41A-928F-4626-9025-0FE5991C7BE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA85C41A-928F-4626-9025-0FE5991C7BE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA85C41A-928F-4626-9025-0FE5991C7BE8}.Release|Any CPU.Build.0 = Release|Any CPU
{5F19295A-C991-4A72-A943-846384F90EAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F19295A-C991-4A72-A943-846384F90EAB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F19295A-C991-4A72-A943-846384F90EAB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F19295A-C991-4A72-A943-846384F90EAB}.Release|Any CPU.Build.0 = Release|Any CPU
{6ED835A6-8A8A-44EC-8679-7EBBE2A0DBE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6ED835A6-8A8A-44EC-8679-7EBBE2A0DBE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6ED835A6-8A8A-44EC-8679-7EBBE2A0DBE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6ED835A6-8A8A-44EC-8679-7EBBE2A0DBE4}.Release|Any CPU.Build.0 = Release|Any CPU
{0C7BC471-4112-43CA-89AA-B7EBDB5689C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C7BC471-4112-43CA-89AA-B7EBDB5689C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C7BC471-4112-43CA-89AA-B7EBDB5689C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C7BC471-4112-43CA-89AA-B7EBDB5689C1}.Release|Any CPU.Build.0 = Release|Any CPU
{B78A6BC2-3FC9-4AFA-A314-2B5C62BCD94D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B78A6BC2-3FC9-4AFA-A314-2B5C62BCD94D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B78A6BC2-3FC9-4AFA-A314-2B5C62BCD94D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B78A6BC2-3FC9-4AFA-A314-2B5C62BCD94D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading