# Space resolution rules

• From: grig <grig@renderx.com>
• Date: Wed, 17 Apr 2002 10:08:14 -0400 (EDT)
• Message-ID: <10222340363.20020417180759@renderx.com>
```Dear XSL editors,

I have got troubles understanding the algorithm of conditional
space resolution [4.3.1. "Space-resolution Rules"]. The spec

"1. If any of the space-specifiers in S' is conditional,
and begins a reference-area or line-area, then it is
suppressed, which means that its resolved space-specifier is zero."

A definition of a space specifier that begins a reference area
is given in the last but one paragraph of 4.2.5 "Stacking constraints":

"An area A begins an area P if A is a descendant of P
and P and A have either a block-stacking constraint or
an inline-stacking constraint. <...> A space-specifier
which applies to the leading edge is also defined to begin P."

Ergo: any space specifier at the leading edge of a reference-area
shall count as if it has zero size while merging space.

But, all of a sudden, the next phrase reads:

"Further, any conditional space-specifiers which consecutively
follow it in the sequence are also suppressed."

O-o-p-s, it sounds redundant. Specifiers being in the same sequence
implies a stacking constraint between respective areas; therefore,
if one space-specifier in a sequence begins an area, all other
also begin the same area. Why do we need this clause about consecutive
blocks?

Ah, I guess: the first sentence should read "...is first in a sequence
of space-specifiers that begin a reference-area...". Then the second
sentence makes sense. The example in the same chapter reconfirms it:
conditional spaces in a sequence are zeroed only until the first
non-conditional space.

But this creates some strange patterns. Consider this example:

<fo:block space-before="12pt"
space-before.conditionality="retain">
<fo:block space-before="24pt"
Foo Bar Bazzzzz
</fo:block>
</fo:block>

If I resolve it using the current rules (i.e. without "first in
a sequence" correction), the second space is suppressed
because of conditionality, and the first prevails.

If I resolve it along the guidelines of the example in 4.3.1,
the second space is retained because it is preceded by a
non-conditional space-specifier, and wins because it is larger.
Which of the two is correct?

Frankly speaking, the last variant looks a bit awkward:
the value of the space specifier comes from one block,
while the conditionality is imposed from another one.
Is it intuitive? What are use cases that require such
complication?

Best regards,
Nikolai Grigoriev
RenderX
```

Received on Wednesday, 17 April 2002 10:20:24 UTC