Skip to content

Commit

Permalink
#587 Move nowrap test into auto test runner with proof.
Browse files Browse the repository at this point in the history
  • Loading branch information
danfickle committed Oct 28, 2020
1 parent 45a5c75 commit 7a4c521
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 21 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<html>
<head>
<style>
@page {
size: 21cm 9cm;
}
/* Unrelated workaround for bug where top/bottom margin
* on page does not collapse correctly. */
p:first-child {
margin-top: 0;
}
p:last-child {
margin-bottom: 0;
}
</style>
</head>
<body style="border: 1px solid black;">
<div style="width:90%; line-height: 1.3;">
<p>
Some text.Some text.Some text.Some text.Some text.Some text.Some text.Some text.
<span style="white-space: nowrap; border-bottom: 1px solid red;">This text should be at next line.</span>
Other text. Other text. Other text. Other text. Other text. Other text. Other text.
</p>
<p>
Some text.Some text.
<span style="white-space: nowrap; border-bottom: 1px solid red;">This text should not be at next line.</span>
Other text. Other text. Other text. Other text. Other text. Other text. Other text.
</p>
<p>
Some text.Some text.Some text.Some text.Some text.Some text.Some text.Some text.
<span style="white-space: nowrap; border-bottom: 1px solid red;">This is a very very very very very very very very very very very very very very very very very very very very very very long nowrap text.</span>
Other text. Other text. Other text. Other text. Other text. Other text. Other text.
</p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ public void testPr587LineWrapNoWrapSpanNested() throws IOException {
assertTrue(run("line-wrap-nowrap-span-nested"));
}

/**
* Test provided with pr#587, fix for break before nowrap span.
*/
@Test
public void testPr587FixForBreakBeforeNoWrap() throws IOException {
assertTrue(run("nowrap"));
}

/**
* Tests that an element boundary is NOT seen as a line break opportunity by itself (eg. mid word). Issue 39.
*/
Expand Down
21 changes: 0 additions & 21 deletions openhtmltopdf-examples/src/test/resources/nowrap.html

This file was deleted.

0 comments on commit 7a4c521

Please # to comment.