I've just stumbled over the testcase block_margin_inherit while fixing
problems revealed by the test suite after having space-resolution work
on blocks. Here's how it looks like:

        <fo:flow flow-name="xsl-region-body">
          <fo:block margin="5%" background-color="yellow">
            <fo:block margin="inherit" background-color="blue">
               margin="inherit" - should have the same margin as the enclosing 
          <fo:block>Yellow block has margin="5%" - 18pt margin based on 5in 
page width</fo:block>

The 5% in this case evaluate to 18000mpt. "margin", as a short-hand,
results in space-before and space-after of 18000mpt each, and that for
both blocks. In terms of 4.3.1 Space-resolution Rules, we have two
sequences of space-specifiers due to stacking constraints. On the before
edge, we have case 1 (under 4.2.5 Stacking Constraints), and on the
after edge, we have case 2.

All space-specifiers are not conditional, because of 5.3.2 (last
sentence in first paragraph). So, rule 1 in 4.3.1 does not suppress any
space-specifiers. Rule 2 doesn't apply, either, since no space-specifier
is forcing. Going on to rule 3 we have to collapse the two
space-specifiers to one.

What's the effect? The test now fails because the space-resolution
wasn't taken into account. Furthermore, the result looks funny due to
the background colors. Both times it's the last space-specifier that
survives (rule 3, second part) and I'm strictly taking the last by
looking at the block-progression-direction here.

So this may be a somewhat unexpected result but I think it's correct. If
anyone could verify that, I'd be grateful.

I'm attaching the PDF output of my local code.

Jeremias Maerki

Attachment: block_margin_inherit.xml.head.pdf
Description: Binary data

Reply via email to