diff --git a/Source/Test/HtmlRenderer.IntegrationTest/Layout/BoxGenerationIntegrationTests.cs b/Source/Test/HtmlRenderer.IntegrationTest/Layout/BoxGenerationIntegrationTests.cs index 6d1dc46fd..073f53331 100644 --- a/Source/Test/HtmlRenderer.IntegrationTest/Layout/BoxGenerationIntegrationTests.cs +++ b/Source/Test/HtmlRenderer.IntegrationTest/Layout/BoxGenerationIntegrationTests.cs @@ -257,6 +257,21 @@ public void DisplayNone_GeneratesNoBoxAndTakesNoSpace() Assert.AreEqual(LayoutHarness.FindById(root, "a")!.ActualBottom, LayoutHarness.FindById(root, "b")!.Location.Y, Delta); } + [Ignore("Gap, see Spec/css21.yml")] + [TestMethod] + [Spec("css21", "visuren.html#display-prop")] + [Spec("css-display-3", "#box-generation")] + [Spec("css-display-4", "#box-generation")] + [DataRow("b")] + [DataRow("b")] + public void DisplayNone_HidesATableRow(string hidden) + { + var (root, _) = LayoutHarness.Layout(LayoutHarness.Wrap( + $"{hidden}
a
c
")); + + Assert.AreEqual(LayoutHarness.FindById(root, "a")!.ActualBottom, LayoutHarness.FindById(root, "c")!.Location.Y, Delta); + } + [TestMethod] [Spec("css21", "visuren.html#display-prop")] public void UnknownElement_IsInlineByDefault() diff --git a/Source/Test/HtmlRenderer.IntegrationTest/Text/CssText3IntegrationTests.cs b/Source/Test/HtmlRenderer.IntegrationTest/Text/CssText3IntegrationTests.cs index 7709aa9d5..122648583 100644 --- a/Source/Test/HtmlRenderer.IntegrationTest/Text/CssText3IntegrationTests.cs +++ b/Source/Test/HtmlRenderer.IntegrationTest/Text/CssText3IntegrationTests.cs @@ -48,6 +48,29 @@ public void Normal_BreaksBetweenCjkCharacters() Assert.IsGreaterThan(1, LinesWithText(p)); } + [Ignore("Gap, see Spec/css-text-3.yml")] + [TestMethod] + [Spec("css-text-3", "#line-breaking")] + [Spec("css-text-4", "#line-breaking")] + public void Normal_BreaksBetweenKana() + { + var p = Paragraph("

あいうえおかきくけこさしすせそ

"); + + Assert.IsGreaterThan(1, LinesWithText(p)); + } + + [Ignore("Gap, see Spec/css-text-3.yml")] + [TestMethod] + [Spec("css-text-3", "#line-breaking")] + [Spec("css-text-4", "#line-breaking")] + public void CjkComma_DoesntStartALine() + { + var p = Paragraph("

中文中文中文中,中文中文

"); + + Assert.IsGreaterThan(1, LinesWithText(p)); + Assert.IsFalse(p.LineBoxes.Any(lb => lb.Words.FirstOrDefault(w => !w.IsSpaces)?.Text.StartsWith(',') == true)); + } + [Ignore("Gap, see Spec/css-text-3.yml")] [TestMethod] [Spec("css-text-3", "#word-break-property")] diff --git a/Source/Test/HtmlRenderer.IntegrationTest/Text/TextAlignIntegrationTests.cs b/Source/Test/HtmlRenderer.IntegrationTest/Text/TextAlignIntegrationTests.cs index b5ea961f5..32dda06e2 100644 --- a/Source/Test/HtmlRenderer.IntegrationTest/Text/TextAlignIntegrationTests.cs +++ b/Source/Test/HtmlRenderer.IntegrationTest/Text/TextAlignIntegrationTests.cs @@ -192,6 +192,24 @@ public void Justify_DoesntAlterPreservedWhiteSpace() Assert.AreEqual(a.Right, space.Left, Delta); } + [Ignore("Gap, see Spec/css21.yml")] + [TestMethod] + [Spec("css21", "text.html#alignment-prop")] + [Spec("css-text-3", "#expanding-text")] + [Spec("css-text-4", "#expanding-text")] + [DataRow("The HTMLrenderer", "HTML", "rend")] + [DataRow("The HTMLrenderer", "rend", "erer")] + [DataRow("The non-public", "non-", "public")] + public void Justify_DoesntStretchWithinAWord(string start, string first, string second) + { + var words = Words($"

{start} ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor

"); + var a = words.First(w => w.Text.Trim() == first); + var b = words.First(w => w.Text.Trim() == second); + + Assert.AreEqual(a.Top, b.Top, Delta); + Assert.AreEqual(a.Right, b.Left, Delta); + } + private static List Words(string bodyHtml) { var (root, _) = LayoutHarness.Layout(LayoutHarness.Wrap(bodyHtml)); diff --git a/Source/Test/HtmlRenderer.Test/Html/TablesTests.cs b/Source/Test/HtmlRenderer.Test/Html/TablesTests.cs index ed1b37b55..90a97503c 100644 --- a/Source/Test/HtmlRenderer.Test/Html/TablesTests.cs +++ b/Source/Test/HtmlRenderer.Test/Html/TablesTests.cs @@ -59,6 +59,17 @@ public void Tfoot_IsPlacedAfterAllBodies() Assert.IsLessThan(b[0].Location.Y, b[2].Location.Y); } + [TestMethod] + [Ignore("Gap, see Spec/html.yml")] + [Spec("html", "tables.html#forming-a-table")] + public void Cell_SkipsTheSlotsOfRowspansFromDifferentRows() + { + var b = Table("abcd" + + "efg", "x", "y"); + + Assert.AreEqual(b[0].Location.X, b[1].Location.X, 0.01); + } + [TestMethod] [Spec("html", "tables.html#attributes-common-to-td-and-th-elements")] [Spec("html", "tables.html#forming-a-table")] diff --git a/Spec/css-display-3.yml b/Spec/css-display-3.yml index d56891a26..fdf98fc95 100644 --- a/Spec/css-display-3.yml +++ b/Spec/css-display-3.yml @@ -38,6 +38,7 @@ sections: status: partial gaps: - "'contents' is ignored, the element keeps its own box" + - "'none' on a table row or row group is ignored, see CSS 2.1 9.2.4" '#legacy-display': title: 2.6 Precomposed Inline-level Display Values status: partial diff --git a/Spec/css-display-4.yml b/Spec/css-display-4.yml index ee1161b27..09420b5f6 100644 --- a/Spec/css-display-4.yml +++ b/Spec/css-display-4.yml @@ -36,6 +36,7 @@ sections: status: partial gaps: - "'contents' is ignored, the element keeps its own box" + - "'none' on a table row or row group is ignored, see CSS 2.1 9.2.4" '#legacy-display': title: 2.6 Precomposed Inline-level Display Values status: partial diff --git a/Spec/css-text-3.yml b/Spec/css-text-3.yml index 79e97d448..59080bb17 100644 --- a/Spec/css-text-3.yml +++ b/Spec/css-text-3.yml @@ -59,6 +59,9 @@ sections: '#line-breaking': title: 5 Line Breaking and Word Boundaries status: partial + gaps: + - Only CJK ideographs from U+4E00 to U+FA2D are break opportunities, a run of kana doesn't break and overflows the line + - CJK punctuation like the fullwidth comma sticks to the next character instead of the previous one, so a line can start with it '#word-break-property': title: '5.1 Breaking Rules for Letters: the word-break property' status: partial @@ -113,6 +116,7 @@ sections: status: partial gaps: - Preserved spaces in pre and pre-wrap text are stretched too, see CSS 2.1 16.2 + - Justification also stretches within a word that is split by an inline element or after a hyphen, see CSS 2.1 16.2 '#justify-symbols': title: 6.4.2 Handling Symbols and Punctuation status: n/a diff --git a/Spec/css-text-4.yml b/Spec/css-text-4.yml index 5c6ab06cf..4440c62c7 100644 --- a/Spec/css-text-4.yml +++ b/Spec/css-text-4.yml @@ -96,6 +96,9 @@ sections: '#line-breaking': title: 6 Line Breaking and Word Boundaries status: partial + gaps: + - Only CJK ideographs from U+4E00 to U+FA2D are break opportunities, a run of kana doesn't break and overflows the line + - CJK punctuation like the fullwidth comma sticks to the next character instead of the previous one, so a line can start with it '#word-break-property': title: '6.1 Breaking Rules for Letters: the word-break property' status: partial @@ -186,6 +189,7 @@ sections: status: partial gaps: - Preserved spaces in pre and pre-wrap text are stretched too, see CSS 2.1 16.2 + - Justification also stretches within a word that is split by an inline element or after a hyphen, see CSS 2.1 16.2 '#justify-symbols': title: 7.5.2 Handling Symbols and Punctuation status: n/a diff --git a/Spec/css21.yml b/Spec/css21.yml index feb2d1201..f8d795004 100644 --- a/Spec/css21.yml +++ b/Spec/css21.yml @@ -376,7 +376,9 @@ sections: status: n/a visuren.html#display-prop: title: 9.2.4 The 'display' property - status: supported + status: partial + gaps: + - "'display: none' on a table row or row group is ignored, the row is still laid out and painted" visuren.html#positioning-scheme: title: 9.3 Positioning schemes status: partial @@ -857,6 +859,7 @@ sections: - "The initial value acts as 'left' also when 'direction' is 'rtl'" - "'justify' stretches preserved white space in 'pre' and 'pre-wrap' text" - "'right' and 'center' leave out the end padding and border of an inline box at the end of the line, so they stick out past the content edge" + - "'justify' also stretches within a word that is split by an inline element or after a hyphen, e.g. HTMLrenderer and non-public" text.html#decoration: title: 16.3 Decoration status: partial diff --git a/Spec/html.yml b/Spec/html.yml index 8fc571108..b9d412b64 100644 --- a/Spec/html.yml +++ b/Spec/html.yml @@ -900,6 +900,7 @@ sections: - span, colspan and rowspan with trailing characters, e.g. 2px, count as 1 instead of using the leading digits - A span with a fraction is rounded instead of cut off, e.g. 1.5 counts as 2 - A rowspan reaching past its row group continues into the next one + - A cell after slots covered by rowspans that start in different rows is placed in one of those slots instead of after them tables.html#header-and-data-cell-semantics: title: 4.9.12.2 Forming relationships between data cells and header cells status: n/a