Bug 40230 - Invalid extra page break creates an undesired empty page
Summary: Invalid extra page break creates an undesired empty page
Status: REOPENED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: page-master/layout (show other bugs)
Version: trunk
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-11 08:08 UTC by Vincent Hennebert
Modified: 2012-04-07 01:51 UTC (History)
0 users



Attachments
Sample file demonstrating the problem (620 bytes, text/plain)
2006-08-11 08:10 UTC, Vincent Hennebert
Details
Testcase showing the regression (1.90 KB, text/plain)
2009-06-25 04:13 UTC, Vincent Hennebert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Hennebert 2006-08-11 08:08:38 UTC
When there is an <fo:block break-after="page"/> and nothing after it in the
flow, a new page is still created, whereas section 7.19.1 of the recommendation
states that it should be the case only if there is material to typeset
afterwards. See the attached fo sample.
The result is the same if we replace break-after by break-before.
Same result also if we remove the indenting such that all the closing tags after
the block are sticked together, so this is not a whitespace handling issue.

I guess that a Knuth penalty of value -infinity is generated for such a block,
and this doesn't play well with the (infinite glue, -infinite penalty) pair
which is probably added at the end of the page sequence. The penalty should
probably be only generated if there is also some box after it, and before the
ending pair.

If nobody takes this bug I'll have a look at it after the GSoC.
Comment 1 Vincent Hennebert 2006-08-11 08:10:25 UTC
Created attachment 18697 [details]
Sample file demonstrating the problem
Comment 2 Andreas L. Delmelle 2006-08-11 17:36:52 UTC
(Here I go again :))
I think this could be handled before layout even kicks off...

FOTreeBuilder could keep track of whether the currentFObj has area-generating content --shouldn't 
prove too hard to come up with a set of conditions that have to be satisfied.
I'm thinking much in the same direction as the 'inMarker' instance member I recently added to 
FOEventHandler: a switch that is updated in the start- or endElement() event for each FObj. If it does 
not have any content, and the currentPropertyList contains a break-before/break-after property, 
instruct the current or the previous FO to discard that property (maybe log a warning, because it's not 
incorrect to specify it)
Maybe we'd have to add a reference to the previousFObj/previousPropertyList to FOTreeBuilder as well, 
but that would be a small price to pay, and may open up perspectives in other areas.

Sorry if I keep nagging about these 'normalizations' in the FOTree... :/

I guess my underlying goal is: whatever layoutengine/renderer combination processes our FOTree, we 
should try to offer it a representation of the tree that would be difficult to 'misrender'.
Comment 3 Jeremias Maerki 2007-11-27 00:52:30 UTC
Should be fixed by:
http://svn.apache.org/viewvc?rev=598558&view=rev
Comment 4 Vincent Hennebert 2009-06-25 04:12:11 UTC
(In reply to comment #3)
> Should be fixed by:
> http://svn.apache.org/viewvc?rev=598558&view=rev 

This change introduces a regression: if a block has break-after="odd-page" and a child block that has break-after="page", the following content will be on the next page instead of the next odd page. See upcoming attachment.
Comment 5 Vincent Hennebert 2009-06-25 04:13:54 UTC
Created attachment 23877 [details]
Testcase showing the regression
Comment 6 Glenn Adams 2012-04-01 19:08:01 UTC
vincent, should this stay open, or is it waiting for an assignment to a dev to fix?
Comment 7 Vincent Hennebert 2012-04-04 09:28:46 UTC
It (In reply to comment #6)
> vincent, should this stay open, or is it waiting for an assignment to a dev to
> fix?

It still needs to be fixed.
Comment 8 Glenn Adams 2012-04-07 01:42:44 UTC
resetting P2 open bugs to P3 pending further review