diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a76991f76..9335d30d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build +name: Build, Package & Publish on: [push, pull_request, workflow_dispatch] @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: platform: - - { name: Windows x64, os: windows-2025 } + - { name: Windows x64, os: windows-2025-vs2026 } - { name: Ubuntu x64, os: ubuntu-24.04 } - { name: macOS arm64, os: macos-15 } dotnet: @@ -33,11 +33,11 @@ jobs: steps: - name: Checkout HTML Renderer - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Setup .NET ${{ matrix.dotnet.version }} SDK id: setup-dotnet - uses: actions/setup-dotnet@v5 + uses: actions/setup-dotnet@v6 with: dotnet-version: ${{ matrix.dotnet.version }} - name: Enforce SDK Version @@ -45,11 +45,42 @@ jobs: - name: Verify SDK Installation run: dotnet --info + - name: Select build target + id: build-target + run: | + # HtmlRenderer.WinUI/HtmlRenderer.Demo.WinUI (Windows App SDK/Win2D, MSIX PRI generation via + # native makepri.exe/makeappx.exe) can only build on Windows - unlike the WinForms/WPF adapters, + # which cross-compile cleanly everywhere via EnableWindowsTargeting's reference-assembly story, + # there is no non-Windows equivalent for those native tools at all. Non-Windows runners build a + # solution filter excluding just those two projects; everything else still builds and tests + # identically on every OS. + $target = $IsWindows ? "Source/HtmlRenderer.sln" : "Source/HtmlRenderer.CrossPlatform.slnf" + echo "path=$target" >> $env:GITHUB_OUTPUT + - name: Restore Dependencies - run: dotnet restore Source/HtmlRenderer.sln + run: dotnet restore ${{ steps.build-target.outputs.path }} - name: Build - run: dotnet build Source/HtmlRenderer.sln --configuration Release --no-restore + run: dotnet build ${{ steps.build-target.outputs.path }} --configuration Release --no-restore + + - name: Run Tests + if: runner.os == 'Windows' + run: dotnet test Source/HtmlRenderer.sln --configuration Release --no-build --logger trx --results-directory ${{ github.workspace }}/TestResults + env: + PDF_OUTPUT_DIRECTORY: ${{ github.workspace }}/pdf-artifacts/${{ matrix.platform.name }}-${{ matrix.dotnet.name }} + HTML_RENDERER_REGRESSION_OUTPUT_DIRECTORY: ${{ github.workspace }}/image-regression/${{ matrix.platform.name }}-${{ matrix.dotnet.name }} + + - name: Run Tests + if: runner.os != 'Windows' + run: | + $failed = $false + Get-ChildItem -Path Source/Test -Recurse -Filter *.Test.csproj | ForEach-Object { + dotnet test $_.FullName --configuration Release --no-build --logger trx --results-directory ${{ github.workspace }}/TestResults + if ($LASTEXITCODE -ne 0) { $failed = $true } + } + if ($failed) { exit 1 } + env: + PDF_OUTPUT_DIRECTORY: ${{ github.workspace }}/pdf-artifacts/${{ matrix.platform.name }}-${{ matrix.dotnet.name }} - name: Create HtmlRenderer.Core NuGet package run: dotnet pack Source/HtmlRenderer/HtmlRenderer.csproj --configuration Release --include-symbols -p:SymbolPackageFormat=snupkg --no-build --verbosity normal --output ${{ env.NuGetDirectory }} @@ -64,11 +95,27 @@ jobs: run: dotnet pack Source/HtmlRenderer.WPF/HtmlRenderer.WPF.csproj --configuration Release --include-symbols -p:SymbolPackageFormat=snupkg --no-build --verbosity normal --output ${{ env.NuGetDirectory }} - name: Upload NuGet package artifacts - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v7 with: name: "HTML Renderer (${{ matrix.platform.name }} ${{ matrix.dotnet.name }})" path: ${{ env.NuGetDirectory }}/*.*nupkg + - name: Upload PDF artifacts + if: always() + uses: actions/upload-artifact@v7 + with: + name: "PDF artifacts (${{ matrix.platform.name }} ${{ matrix.dotnet.name }})" + path: ${{ github.workspace }}/pdf-artifacts/**/*.pdf + if-no-files-found: ignore + + - name: Upload image regression artifacts + if: always() + uses: actions/upload-artifact@v7 + with: + name: "Image regression artifacts (${{ matrix.platform.name }} ${{ matrix.dotnet.name }})" + path: ${{ github.workspace }}/image-regression/**/*.png + if-no-files-found: ignore + - name: NuGet Login if: startsWith(github.ref, 'refs/tags/') && matrix.dotnet.name == '.NET 8' && runner.os == 'Windows' uses: NuGet/login@v1 diff --git a/.gitignore b/.gitignore index ec0fb2754..aa314ccc9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ # mstest test results TestResults +# Rider +.idea/ + ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. diff --git a/LICENSE b/LICENSE index 0041d48b4..6b90a0b8d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ Copyright (c) 2009, José Manuel Menéndez Poo -Copyright (c) 2013-2025, Arthur Teplitzki +Copyright (c) 2013-2026, Arthur Teplitzki All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.md b/README.md index f689bdfac..0a8553037 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ For documentation, check out the project on the [CodePlex Archive](https://codep ## Download -The release packages on [GitHub](https://github.com/ArthurHub/HTML-Renderer/releases) or the [CodePlex Archive](https://codeplexarchive.org/project/HtmlRenderer) also contains a Demo application to explore HML Renderer's capabilities. +The release packages on [GitHub](https://github.com/ArthurHub/HTML-Renderer/releases) also contain a Demo application to explore HML Renderer's capabilities. The latest NuGet packages can be found on NuGet.org: diff --git a/Source/Demo/Common/DemoUtils.cs b/Source/Demo/Common/DemoUtils.cs index 682f325f5..a14b33b3f 100644 --- a/Source/Demo/Common/DemoUtils.cs +++ b/Source/Demo/Common/DemoUtils.cs @@ -74,8 +74,8 @@ public static string GetStylesheet(string src) a:link { text-decoration: none; } a:hover { text-decoration: underline; } .gray { color:gray; } - .example { background-color:#efefef; corner-radius:5px; padding:0.5em; } - .whitehole { background-color:white; corner-radius:10px; padding:15px; } + .example { background-color:#efefef; border-radius:5px; padding:0.5em; } + .whitehole { background-color:white; border-radius:10px; padding:15px; } .caption { font-size: 1.1em } .comment { color: green; margin-bottom: 5px; margin-left: 3px; } .comment2 { color: green; }"; diff --git a/Source/Demo/Common/HtmlPrettyPrinter.cs b/Source/Demo/Common/HtmlPrettyPrinter.cs new file mode 100644 index 000000000..09d0e207d --- /dev/null +++ b/Source/Demo/Common/HtmlPrettyPrinter.cs @@ -0,0 +1,145 @@ +// "Therefore those skilled at the unorthodox +// are infinite as heaven and earth, +// inexhaustible as the great rivers. +// When they come to an end, +// they begin again, +// like the days and months; +// they die and are reborn, +// like the four seasons." +// +// - Sun Tsu, +// "The Art of War" + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using HtmlKit; + +namespace TheArtOfDev.HtmlRenderer.Demo.Common +{ + /// + /// Utility to format HTML into a readable representation while preserving semantic structure. + /// + public static class HtmlPrettyPrinter + { + /// + /// html tags that should be written with indentation on separate lines + /// + private static readonly HashSet _blockTags = new HashSet(StringComparer.OrdinalIgnoreCase) + { + "article", "aside", "blockquote", "body", "caption", "colgroup", "dd", "div", "dl", "dt", "fieldset", "figcaption", + "figure", "footer", "form", "head", "header", "html", "li", "main", "nav", "ol", "p", "section", "table", "tbody", + "td", "tfoot", "th", "thead", "tr", "ul", "title" + }; + + /// + /// html tags that don't have a closing tag and should not change indentation depth + /// + private static readonly HashSet _voidTags = new HashSet(StringComparer.OrdinalIgnoreCase) + { + "area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr" + }; + + /// + /// Format the given html into a readable left-to-right comparable layout. + /// + public static string Format(string html) + { + if (string.IsNullOrWhiteSpace(html)) + return string.Empty; + + var builder = new StringBuilder(html.Length * 2); + using (var reader = new StringReader(html)) + using (var writer = new StringWriter(builder)) + { + var tokenizer = new HtmlTokenizer(reader); + HtmlToken token; + int indent = 0; + + while (tokenizer.ReadNextToken(out token)) + { + switch (token.Kind) + { + case HtmlTokenKind.DocType: + case HtmlTokenKind.Comment: + AppendTokenLine(builder, writer, token, indent); + break; + + case HtmlTokenKind.Tag: + var tag = (HtmlTagToken)token; + var isBlockTag = _blockTags.Contains(tag.Name); + var isVoidTag = tag.IsEmptyElement || _voidTags.Contains(tag.Name); + + if (tag.IsEndTag) + { + if (isBlockTag) + { + indent = Math.Max(0, indent - 1); + AppendTokenLine(builder, writer, token, indent); + } + else + { + token.WriteTo(writer); + } + } + else if (isBlockTag) + { + AppendTokenLine(builder, writer, token, indent); + if (!isVoidTag) + indent++; + } + else + { + token.WriteTo(writer); + } + break; + + case HtmlTokenKind.CData: + case HtmlTokenKind.Data: + case HtmlTokenKind.ScriptData: + var data = ((HtmlDataToken)token).Data; + if (!string.IsNullOrWhiteSpace(data)) + { + if (IsAtLineStart(builder)) + AppendIndent(builder, indent); + builder.Append(data); + } + break; + } + } + } + + return builder.ToString().Trim(); + } + + /// + /// Append the given html token on its own line using the given indentation level. + /// + private static void AppendTokenLine(StringBuilder builder, StringWriter writer, HtmlToken token, int indent) + { + if (!IsAtLineStart(builder)) + builder.AppendLine(); + + AppendIndent(builder, indent); + token.WriteTo(writer); + builder.AppendLine(); + } + + /// + /// Append indentation spaces to the string builder. + /// + private static void AppendIndent(StringBuilder builder, int indent) + { + builder.Append(' ', indent * 2); + } + + /// + /// Return if the builder currently points at the start of a new line. + /// + private static bool IsAtLineStart(StringBuilder builder) + { + return builder.Length == 0 || builder[builder.Length - 1] == '\n'; + } + } +} diff --git a/Source/Demo/Common/HtmlRenderer.Demo.Common.csproj b/Source/Demo/Common/HtmlRenderer.Demo.Common.csproj index b2b829640..7128e4a70 100644 --- a/Source/Demo/Common/HtmlRenderer.Demo.Common.csproj +++ b/Source/Demo/Common/HtmlRenderer.Demo.Common.csproj @@ -5,7 +5,6 @@ TheArtOfDev.HtmlRenderer.Demo.Common HtmlRendererDemoCommon true - true @@ -43,6 +42,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -67,12 +94,14 @@ + + @@ -87,12 +116,13 @@ + - + diff --git a/Source/Demo/Common/PerfSamples/1.Big table.htm b/Source/Demo/Common/PerfSamples/1.Big table.htm index cb4cb2ef0..d61e7155c 100644 --- a/Source/Demo/Common/PerfSamples/1.Big table.htm +++ b/Source/Demo/Common/PerfSamples/1.Big table.htm @@ -1,7 +1,7 @@ - + - + Big table @@ -20,10 +21,8 @@

Case 1


Text align justify with background colors

-

- Lorem ipsum dolor sit amet, consectetur adipisicing - elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua tempor incididunt ut labore et dolore magna aliqua incididunt ut labore et dolore magna aliqua. -
+ Lorem ipsum dolor sit amet, consectetur adipisicing + elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua tempor incididunt ut labore et dolore magna aliqua incididunt ut labore et dolore magna aliqua.


Right align adjusts

@@ -38,45 +37,43 @@

Right align adjusts


Transparent text

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ornare mollis elit. Integer sagittis. Fusce elementum commodo felis. Vivamus lacinia eleifend libero. Donec - lacus. Nam sit amet urna. Nullam nulla. Donec accumsan porta magna. Mauris a dolor eu elit rutrum commodo. Nam iaculis turpis non augue. Nullam lobortis egestas risus. Nulla + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ornare mollis elit. Integer sagittis. Fusce elementum commodo felis. Vivamus lacinia eleifend libero. Donec + lacus. Nam sit amet urna. Nullam nulla. Donec accumsan porta magna. Mauris a dolor eu elit rutrum commodo. Nam iaculis turpis non augue. Nullam lobortis egestas risus. Nulla elementum dolor ac mauris. Ut tristique. In varius volutpat metus. Integer leo dolor, tristique a, dignissim ac, iaculis eget, elit. Donec arcu.

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ornare mollis elit. Integer sagittis. Fusce elementum commodo felis. Vivamus lacinia eleifend libero. Donec + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ornare mollis elit. Integer sagittis. Fusce elementum commodo felis. Vivamus lacinia eleifend libero. Donec lacus. -
- -
- Nam sit amet urna. Nullam nulla. Donec accumsan porta magna. Mauris a dolor eu elit rutrum commodo. Nam iaculis turpis non augue. Nullam lobortis egestas risus. Nulla + +
+ + Nam sit amet urna. Nullam nulla. Donec accumsan porta magna. Mauris a dolor eu elit rutrum commodo. Nam iaculis turpis non augue. Nullam lobortis egestas risus. Nulla elementum dolor ac mauris. Ut tristique. In varius volutpat metus. Integer leo dolor, tristique a, dignissim ac, iaculis eget, elit. Donec arcu. -
+

-

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ornare mollis elit. Integer_sagittis_Fusce_elementum_commodo_felis_Vivamus_lacinia_eleifend_libero_Donec +

+ + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ornare mollis elit. Integer_sagittis_Fusce_elementum_commodo_felis_Vivamus_lacinia_eleifend_libero_Donec lacus. -

- -
- Nam sit amet urna. Nullam nulla. Donec accumsan porta magna. Mauris a dolor eu elit rutrum commodo. Nam iaculis turpis non augue. Nullam lobortis egestas risus. Nulla + +
+ + Nam sit amet urna. Nullam nulla. Donec accumsan porta magna. Mauris a dolor eu elit rutrum commodo. Nam iaculis turpis non augue. Nullam lobortis egestas risus. Nulla elementum dolor ac mauris. Ut tristique. In varius volutpat metus. Integer leo dolor, tristique a, dignissim ac, iaculis eget, elit. Donec arcu. -
+


RTL text

+

+ בדיקה של טקסט ימין לשמאל +

+

+ בדיקה של טקסט ימין לשמאל normal text +

-

- בדיקה של טקסט ימין לשמאל -

-

- בדיקה של טקסט ימין לשמאל normal text -

-

- בדיקה של טקסט ימין לשמאל normal text -

+ בדיקה של טקסט ימין לשמאל normal text

- \ No newline at end of file + diff --git a/Source/Demo/Common/TestSamples/13.Tables.htm b/Source/Demo/Common/TestSamples/13.Tables.htm index 70d454067..a58ac927c 100644 --- a/Source/Demo/Common/TestSamples/13.Tables.htm +++ b/Source/Demo/Common/TestSamples/13.Tables.htm @@ -1,7 +1,9 @@ + + Tables + -

All fonts with different decorations

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

-

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

- - +

@font-face fonts with different decorations

+

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

+

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

+

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

+

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

+

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

+

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

+

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

+

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

+

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

+

Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230 | Text, ABCgjwzqh. 1230

+

@font-face weight and style matching (proves nearest-face selection, not just decoration)

+

Regular | Bold | Italic | Bold Italic

+

Regular | Bold | Italic | Bold Italic

+

Regular | Bold | Italic | Bold Italic

+

Regular | Bold | Italic | Bold Italic

+

Regular | Bold | Italic | Bold Italic

+

Regular | Bold | Italic | Bold Italic

- \ No newline at end of file + diff --git a/Source/Demo/Common/TestSamples/21.Bullets.htm b/Source/Demo/Common/TestSamples/21.Bullets.htm index a677321b1..b6a06bfc3 100644 --- a/Source/Demo/Common/TestSamples/21.Bullets.htm +++ b/Source/Demo/Common/TestSamples/21.Bullets.htm @@ -1,4 +1,8 @@ - + + + + Bullets +

Unordered list

@@ -8,10 +12,12 @@

Unordered list
  • Sub item one
  • Sub item two
  • -
      -
    • Sub-sub item two
    • -
    • Sub-sub item two
    • -
    +
  • +
      +
    • Sub-sub item two
    • +
    • Sub-sub item two
    • +
    +
  • Item three
  • @@ -58,7 +64,7 @@

    List type: hebrew

    Ordered list reversed

    -
      +
      1. Item one
      2. Item two
      3. Item three
      4. diff --git a/Source/Demo/Common/TestSamples/22.RTL.htm b/Source/Demo/Common/TestSamples/22.RTL.htm index 35bf9bf6c..eec24ac70 100644 --- a/Source/Demo/Common/TestSamples/22.RTL.htm +++ b/Source/Demo/Common/TestSamples/22.RTL.htm @@ -1,4 +1,8 @@ - + + + + RTL +
        שלום עולם, יש ברבורים בעגם הזה
        diff --git a/Source/Demo/Common/TestSamples/23.Media queries and color scheme.htm b/Source/Demo/Common/TestSamples/23.Media queries and color scheme.htm new file mode 100644 index 000000000..501f1c3d2 --- /dev/null +++ b/Source/Demo/Common/TestSamples/23.Media queries and color scheme.htm @@ -0,0 +1,99 @@ + + + + + + +
        +

        prefers-color-scheme

        + This card follows the platform colour scheme. Reported scheme: . +
        GDI+ and WPF read the Windows app theme; PdfSharp always reports light.
        +
        + +
        +

        @media screen

        + Visible because the adapter's media type is screen. +
        + + + +
        +

        Unsupported media feature

        + This card stays neutral. A media feature the matcher cannot evaluate drops its whole block + rather than applying the rules inside it, so the red styling in + @media all and (scan: interlace) must not win. +
        + +
        +

        Viewport width

        + +
        + + + diff --git a/Source/Demo/Common/TestSamples/30.Misc.htm b/Source/Demo/Common/TestSamples/30.Misc.htm index f3cd2a5e5..544ada699 100644 --- a/Source/Demo/Common/TestSamples/30.Misc.htm +++ b/Source/Demo/Common/TestSamples/30.Misc.htm @@ -1,46 +1,47 @@ - + - - - -
        - Single whitespace in seperate element -
        -
        - Multiple whitespaces in seperate        element - using   -
        -
        - TOP -
        -
        - there are margin with percentage -
        -
        - BOTTOM -
        + + Miscellaneous + + + +
        + Single whitespace in seperate element +
        +
        + Multiple whitespaces in seperate        element + using   +
        +
        + TOP +
        +
        + there are margin with percentage +
        +
        + BOTTOM +
        Line through : Text Text Text Text
        +
        +
        + Text END +
        +
        +
        + text 1, text 2, text 3 +
        +
        + +
        +
        + R1H2O +
        -
        -
        - Text END -
        -
        -
        - text 1, text 2, text 3 -
        -
        - -
        -
        - R1H2O -
        - \ No newline at end of file diff --git a/Source/Demo/Common/TestSamples/31.ACID 1.htm b/Source/Demo/Common/TestSamples/31.ACID 1.htm index 3545bf464..e5b2eef95 100644 --- a/Source/Demo/Common/TestSamples/31.ACID 1.htm +++ b/Source/Demo/Common/TestSamples/31.ACID 1.htm @@ -1,3 +1,4 @@ + display/box/float/clear test diff --git a/Source/Demo/Common/TestSamples/32.Image in css content.htm b/Source/Demo/Common/TestSamples/32.Image in css content.htm index c3b7a86ec..f61d6d038 100644 --- a/Source/Demo/Common/TestSamples/32.Image in css content.htm +++ b/Source/Demo/Common/TestSamples/32.Image in css content.htm @@ -1,5 +1,7 @@ - + + + Image in CSS Content ", endIdx, StringComparison.OrdinalIgnoreCase); - if (endIdx > -1) - AddTextBox(source, endIdxS, endIdx, ref curBox); - } + case HtmlTokenKind.Tag: + { + var tag = (HtmlTagToken)token; + ParseHtmlTag(tag, ref curBox); + break; + } + case HtmlTokenKind.Data: + { + var text = (HtmlDataToken)token; + + if (curBox.HtmlTag != null && curBox.HtmlTag.Name.Equals(HtmlConstants.NoScript, StringComparison.OrdinalIgnoreCase)) + { + curBox = ParseDocument(text.Data, curBox); + } + else + { + AddTextBox(text, ref curBox); + } + + break; + } + case HtmlTokenKind.CData: + case HtmlTokenKind.Comment: + case HtmlTokenKind.DocType: + case HtmlTokenKind.ScriptData: + break; + default: + throw new ArgumentOutOfRangeException(); } } - startIdx = tagIdx > -1 && endIdx > 0 ? endIdx : -1; - } - - // handle pieces of html without proper structure - if (endIdx > -1 && endIdx < source.Length) - { - // there is text after the end of last element - var endText = new SubString(source, endIdx, source.Length - endIdx); - if (!endText.IsEmptyOrWhitespace()) - { - var abox = CssBox.CreateBox(root); - abox.Text = endText; - } } return root; @@ -96,168 +90,115 @@ public static CssBox ParseDocument(string source) /// Adding box also for text that contains only whitespaces because we don't know yet if /// the box is preformatted. At later stage they will be removed if not relevant. /// - /// the html source to parse - /// the start of the html part - /// the index of the next html tag + /// the html token to parse /// the current box in html tree parsing - private static void AddTextBox(string source, int startIdx, int tagIdx, ref CssBox curBox) + private static void AddTextBox(HtmlDataToken token, ref CssBox curBox) { - var text = tagIdx > startIdx ? new SubString(source, startIdx, tagIdx - startIdx) : null; - if (text != null) + var text = token.Data; + + if (text == null) return; + + // HTML drops a single newline directly after the
        ,  or