Merge pull request #54 from denys-volodarskyi/update_and_fix_compilation

Update and fix compilation
This commit is contained in:
Max Katz 2024-09-17 16:56:27 -07:00 коммит произвёл GitHub
Родитель 9225416841 4287b95ba8
Коммит 9aff368a19
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
10 изменённых файлов: 39 добавлений и 25 удалений

Просмотреть файл

@ -1,12 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<NoWarn>CS0436</NoWarn>
<LangVersion>Latest</LangVersion>
</PropertyGroup>
<PropertyGroup>
<Version>11.0.0</Version>
<Authors>Avalonia Team</Authors>
<Copyright>Copyright 2013-$([System.DateTime]::Now.ToString(`yyyy`)) &#169; The AvaloniaUI Project</Copyright>
<Copyright>Copyright 2013-$([System.DateTime]::Now.ToString(`yyyy`)) © The AvaloniaUI Project</Copyright>
<PackageProjectUrl>https://avaloniaui.net</PackageProjectUrl>
<RepositoryUrl>https://github.com/AvaloniaUI/Avalonia.HtmlRenderer/</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@ -29,7 +30,7 @@
<Compile Include="../HtmlRenderer/Adapters/**/*.cs" Link="External/Adapters/%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Avalonia" Version="11.0.11" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0-android</TargetFramework>
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ApplicationId>com.CompanyName.HtmlRenderer.Demo.Avalonia</ApplicationId>
@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Android" Version="11.0.0" />
<PackageReference Include="Avalonia.Android" Version="11.0.11" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<WasmMainJSPath>AppBundle\main.js</WasmMainJSPath>
<OutputType>Exe</OutputType>
@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Browser" Version="11.0.0" />
<PackageReference Include="Avalonia.Browser" Version="11.0.11" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
</PropertyGroup>
@ -11,9 +11,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.0.0" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.11" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.11" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0-ios</TargetFramework>
<TargetFramework>net8.0-ios</TargetFramework>
<SupportedOSPlatformVersion>10.0</SupportedOSPlatformVersion>
<ProvisioningType>manual</ProvisioningType>
<Nullable>enable</Nullable>
@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia.iOS" Version="11.0.0" />
<PackageReference Include="Avalonia.iOS" Version="11.0.11" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Avalonia.HtmlRenderer\Avalonia.HtmlRenderer.csproj" />
@ -10,7 +10,7 @@
<AvaloniaResource Include="fonts\CustomFont.ttf" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.0" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.0.0" />
<PackageReference Include="Avalonia" Version="11.0.11" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.0.11" />
</ItemGroup>
</Project>

Просмотреть файл

@ -130,7 +130,7 @@
<EmbeddedResource Include="TestSamples\35.Breaking pages 2 - Tables.htm" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="System.Resources.Extensions" Version="8.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.7" />
</ItemGroup>
</Project>

Просмотреть файл

@ -10,7 +10,12 @@
// - Sun Tsu,
// "The Art of War"
using System.Collections.Generic;
using System.Linq;
using TheArtOfDev.HtmlRenderer.Core.Entities;
using TheArtOfDev.HtmlRenderer.Core.Parse;
using TheArtOfDev.HtmlRenderer.Core.Utils;
namespace TheArtOfDev.HtmlRenderer.Core.Dom
{

Просмотреть файл

@ -13,6 +13,8 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using TheArtOfDev.HtmlRenderer.Adapters;
using TheArtOfDev.HtmlRenderer.Adapters.Entities;
using TheArtOfDev.HtmlRenderer.Core.Dom;

Просмотреть файл

@ -11,6 +11,7 @@
// "The Art of War"
using System;
using System.Collections.Generic;
using System.Globalization;
using TheArtOfDev.HtmlRenderer.Adapters.Entities;
using TheArtOfDev.HtmlRenderer.Core.Dom;
@ -332,14 +333,9 @@ namespace TheArtOfDev.HtmlRenderer.Core.Parse
return true;
}
/// <summary>
/// Assigns the given css style block properties to the given css box.
/// </summary>
/// <param name="box">the css box to assign css to</param>
/// <param name="block">the css block to assign</param>
private static void AssignCssBlock(CssBox box, CssBlock block)
internal static void AssignCssProps(CssBox box, IDictionary<string, string> properties)
{
foreach (var prop in block.Properties)
foreach (var prop in properties)
{
var value = prop.Value;
if (prop.Value == CssConstants.Inherit && box.ParentBox != null)
@ -353,6 +349,16 @@ namespace TheArtOfDev.HtmlRenderer.Core.Parse
}
}
/// <summary>
/// Assigns the given css style block properties to the given css box.
/// </summary>
/// <param name="box">the css box to assign css to</param>
/// <param name="block">the css block to assign</param>
private static void AssignCssBlock(CssBox box, CssBlock block)
{
AssignCssProps(box, block.Properties);
}
/// <summary>
/// Check if the given style is allowed to be set on the given css box.<br/>
/// Used to prevent invalid CssBoxes creation like table with inline display style.