W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 2005

Re: 5.3.2 Margin, Space, and Indent Properties

From: Peter B. West <lists@pbw.id.au>
Date: Fri, 01 Apr 2005 02:14:17 +1000
Message-ID: <424C21D9.80205@pbw.id.au>
To: Liam Quin <liam@w3.org>
CC: xsl-editors <xsl-editors@w3.org>
Liam Quin wrote:
> Peter,
> 
> You wrote,
>     If (padding-corresponding + border-corresponding) > 0, we are left
>     with a negative margin-corresponding.
> 
> That's correct.
> 
> The Working Group reviewed your comment, and their response is that
> a negative margin-corresponding is not a problem, and the suggested
> change is therefore not needed.
> 
> Please let us know if that doesn't answer yuor question!

Liam,

The response does not answer the question.  What I was commenting on 
that the margin is _necessarily_ <= zero when neither the 
margin-corresponding nor the start-indent is specified, because the 
reference indent is eliminated from the equation.


I prefix my remarks by saying that I find this section very difficult to 
grapple with, and am well aware that I may have overlooked important 
related information or simply mis-interpreted the Recommendation.

Let me elaborate on the reasons for my earlier suggestion. It seems to 
me that the discussion in 5.3.2 is incomplete.  There are
two implied matrices of possibilities; one for FOs which generate
reference-areas, and one for those which do not.

Reference-area generating FOs
         indent
         spec-
         ified
        +-----+----------------------------+----------------------------+
margin-|     |                            |                            |
corres |     |                            |                            |
spec-  |     |           Yes              |            No              |
ified  |     |                            |                            |
        +-----+----------------------------+----------------------------+
        |     | Margin property takes      | Not specifically discussed.|
        | Yes | precedence over relative   |                            |
        |     | property. Handled as       |                            |
        |     | below.                     |                            |
        +-----+----------------------------+----------------------------+
        |     | Explicitly discussed in    | Not specifically discussed.|
        | No  | 5.3.2. Indent computed as  |                            |
        |     | margin-c + padding-c +     |                            |
        |     | border-c-width             |                            |
        +-----+----------------------------+----------------------------+


Non-reference-area generating FOs
         indent
         spec-
         ified
        +-----+----------------------------+----------------------------+
margin-|     |                            |                            |
corres |     |                            |                            |
spec-  |     |           Yes              |            No              |
ified  |     |                            |                            |
        +-----+----------------------------+----------------------------+
        |     | Margin property takes      | Explicitly discussed in    |
        | Yes | precedence over relative   | 5.3.2. Margin computed as  |
        |     | property. Handled as       | indent - inherited-value(  |
        |     | below.                     |  indent) - padding-c -     |
        |     |                            |  border-c-width            |
        +-----+----------------------------+----------------------------+
        |     | Explicitly discussed in    | Implicitly discussed in    |
        | No  | 5.3.2. Indent computed as  | 5.3.2. Margin computed as  |
        |     | inherited-value(indent) +  | inherited-value(indent) -  |
        |     | margin-c + padding-c +     | inherited-value(indent) -  |
        |     | border-c-width             | padding-c - border-c-width |
        +-----+----------------------------+----------------------------+

Could the WG please verify this analysis and fill in the blanks for me? 
  (See also my comment at the end of the message.)

My understanding of some aspects of this part of the recommendation is 
illustrated in the accompanying PDF diagrams.

Figure 1 illustrates the following part of sction 5.3.2:

<quote>
If the corresponding absolute "margin" property is specified on the 
formatting object and the formatting object does not generate a 
reference area, the computed value of the margin and the computed values 
of the corresponding "border-X-width" and "padding-X" properties are 
used to calculate the computed value of the corresponding "Y-indent" 
property. The formulae for "start-indent" and "end-indent" are:

start-indent = inherited_value_of(start-indent) + margin-corresponding + 
padding-corresponding + border-corresponding-width
</quote>

In this case, the margin-corresponding is explicitly set to 0pt.

Figure 2 illustrates the next formula:

<quote>
If the corresponding absolute margin property is not explicitly 
specified, or if the corresponding relative property is specified on the 
formatting object and the absolute property only specified by the 
expansion of a shorthand, the corresponding absolute margin property is 
calculated according to the following formulae:

margin-corresponding = start-indent - inherited_value_of(start-indent) - 
padding-corresponding - border-corresponding-width

margin-corresponding = end-indent - inherited_value_of(end-indent) - 
padding-corresponding - border-corresponding-width

Note:

If the "start-indent" or "end-indent" properties are not specified their 
inherited value is used in these formulae.
</quote>

In this case, the "Note" comes into play because neither the 
margin-corresponding nor the start-indent is specified.  Therefore, 
although the initial value of margin-left is 0pt, the _specified_ values 
of border-corresponding-width and padding-corresponding are effectively 
eliminated.  These values are eliminated no matter what they are 
specified as, because they will always be neutralized by an equal and 
opposite computed value of margin-corresponding.  This seems to me to be 
bizarre.

Considering these cases in more detail for this response, I have come 
the the conclusion that my original suggestion for addressing this 
difficulty was misguided.

The formulae for non-reference-area generating FOs show that indent 
accumulates on the descendants of reference-areas.  Where margin is 
specified, the sum of margin, border and padding is added to the 
inherited indent.

The question is which property, margin-correspondng or indent, is the 
reference property when neither are specified.  The current wording (the 
Note) implies that the margin-corresponding is calculated on the basis 
of the inherited value of the indent, but using the formula obliterates 
any possible increment to the indent, orthogonally to the expectations 
aroused by all other cases.

Given that indent accumulates, it seems sensible, when neither property 
is specified, to take the inherited indent as a base and calculate the 
indent increment on the basis of the the computed margin, border and 
padding properties.

I therefore propose the following changes to 5.3.2.

<original>
If
<added>a) either </added>
the corresponding absolute "margin" property is specified on the 
formatting object
<added>
or neither the corresponding absolute "margin" property nor the 
corresponding relative property is specified on the formatting object
</added>
and
<added>b) </added>
the formatting object does not generate a reference area, the computed 
value of the margin and the computed values of the corresponding 
"border-X-width" and "padding-X" properties are used to calculate the 
computed value of the corresponding "Y-indent" property. The formulae 
for "start-indent" and "end-indent" are:

start-indent = inherited_value_of(start-indent) + margin-corresponding + 
padding-corresponding + border-corresponding-width

end-indent = inherited_value_of(end-indent) + margin-corresponding + 
padding-corresponding + border-corresponding-width

If the
<added>
corresponding relative property is specified and the
</added>
corresponding absolute margin property is not explicitly specified, or 
if the corresponding relative property is specified on the formatting 
object and the absolute property only specified by the expansion of a 
shorthand, the corresponding absolute margin property is calculated 
according to the following formulae:

margin-corresponding = start-indent - inherited_value_of(start-indent) - 
padding-corresponding - border-corresponding-width

margin-corresponding = end-indent - inherited_value_of(end-indent) - 
padding-corresponding - border-corresponding-width

<deleted>
Note:

If the "start-indent" or "end-indent" properties are not specified their 
inherited value is used in these formulae.
</deleted>

</original>

As a result of preparing this response, I have come to the conclusion 
that the cases "not specifically discussed" in the matrix at the 
beginning of this message are irrelevant.  Those cases apply to 
reference-area-generating FOs, where the margin-corresponding has not 
been specified.  It seems to me now that the indent must be "reset" on 
such FOs, and reset according to the computed margin, border and padding 
properties, so that the descendants of the FO have a "clean slate" 
against which to express or calculate their accumulating indents.

If this is the case, some mention of it in 5.3.2 would greatly assist 
the understanding of this section.  If it is not the case, this message 
is an example of the confusion that can arise from the current wording.

Yours faithfully,
-- 
Peter B. West <http://cv.pbw.id.au/>
Folio <http://defoe.sourceforge.net/folio/> <http://folio.bkbits.net/>


-- 
Peter B. West <http://cv.pbw.id.au/>
Folio <http://defoe.sourceforge.net/folio/> <http://folio.bkbits.net/>


Received on Thursday, 31 March 2005 16:14:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:58 GMT