I'm afraid that you're wrong here. It's true that s-p-m and region-body
don't directly generate reference areas but they also can't, because
they are only used as a template for each new page. For for each page
they serve as FOs that generate reference areas.

But let me give you another example where this is clearer and so you see
that your argument doesn't really count in this discussion. Please open
test/layoutengine/testcases/block-container3.xml. That test case I wrote
specifically to demostrate the effect we're discussing here. You can't
deny that block-container generates a reference area directly. So in
this test case the block inside the b-c has an effective start-indent of
20pt (10pt + 10pt) much like in Luca's example.

If you look at the checks at the end of block-container3.xml you will
realize that there is no "20000" (millipoints) anywhere. It's simply the
effect from the reference area which results in the double indent. So if
you wanted to have both text-generating blocks left-aligned at the same
position you'd have to specify start-indent="0pt" on the block-container
or on its nested block to reset the start-indent to "0pt".

BTW, I anticipated that I'd have this argument sooner or later. I was
rather baffled when I found out how it is supposed to work. So don't
worry about wasting my time in this case. I simply hope we can then put
it to rest once and for all, ideally documented in a nice Wiki or Web
page, so that if that question comes up again, we can simply point
people to that page.

(additional comments inline)

On 16.02.2005 05:02:30 Glen Mazza wrote:
<snip/>
> > together with the
> > parent's start-indent accumulates 100pt because each
> > of the FOs are
> > generating a reference area. 
> 
> I don't think so here--I don't believe either fo:s-p-m
> or fo:region-body generate reference areas--indeed, I
> don't think anything located outside of
> fo:page-sequence does.  The spec says they are *used*
> to create a reference area, but they don't generate
> one themselves.  So maybe your calculations here may
> need changing--because different formulae in 5.3.2
> would hence be activated.
> 
> Section 6.1 [1] says "There are three kinds of
> formatting objects: (1) those that generate areas, (2)
> those that return areas, but do not generate them, and
> (3) those that are used in the generation of areas."
> 
> fo:s-p-m and fo:region-body are type (3), not type
> (1).
> 
> fo:s-p-m text:  The fo:simple-page-master formatting
> object generates no area directly. It is used in the
> generation of pages by an fo:page-sequence. type (3)
> 
> fo:r-b text:  The fo:region-body formatting object is
> used to generate one region-viewport-area and one
> region-reference-area whenever an
> fo:simple-page-master that has an fo:region-body as a
> child is used to generate a page.  (i.e., type 3)
> 
> 
> [1]
> http://www.w3.org/TR/2001/REC-xsl-20011015/slice6.html#fo-section
> 
> 
> > So in your case you could specify
> > a margin="0pt" on
> > the region-body which triggers the first formula
> > given in 5.3.2. 
> 
> Again, I don't think so because fo:region-body never
> generates a reference-area.  Hence, with no explicit
> specification of margin properites, the third set of
> formulas then activates:
> 
> margin-corresponding = start-indent -
> inherited_value_of(start-indent) -
> padding-corresponding - border-corresponding-width
> 
> with the additional rule that:  "If the "start-indent"
> or "end-indent" properties are not specified their
> inherited value is used in these formulae."
> 
> Since start-indent and end-indent were not specified,
> then we have:
> 
> margin-corresponding =
> inherited_value_of(start-indent) -
> inherited_value_of(start-indent) -
> padding-corresponding - border-corresponding-width,

This formula is only used to calculate margin-corresponding. It is not
used to calculate the effective indent. Corresponding properties should
not be used directly to do the actual calculations that define the
layout. Ask yourself: How would you decide when to use what property to
calculate the actual indents? That's why the formulas are there to
derive start|end-indent from the corresponding properties. The formula
you're refferring to here is actually used inside IndentPropertyMaker.
It is used to create the "margin-corresponding" value which is used in
the formula sets 1 and 2.

> or zero for the margin properties on fo:region-body. 
> (i.e., we just rely on the 50pt. on
> simple-page-master.)
> 
> So Luca is correct that both fo:simple-page-masters
> should generate the same overall margins of 50 pt.
> each, no?

No. :-)


Jeremias Maerki

Reply via email to