Percentages and Properties

This is an attempt to summarise in an understandable fashion the rules related to the resolution of percentages in property values. The page is organised such that the major subheadings group a set of related rules together. Rules are considered related if the underlying resolution algorithm is logically the same. Under each subheading the individual rules using the text as stated in the XSL-FO specification and the properties they apply to are shown.

For each property the current status of the implementation is shown.

The construction of this page was driven by the need to look at and improve the current implementation of the percentage resolution mechanism (see http://marc.theaimsgroup.com/?l=fop-dev&m=110630658730554&w=2).

The XSL-FO rules related to determining the base value on which to perform percentage calculations can be put into 3 broad classes:

  1. Rules referring to properties in the fo element or its parent
  2. Rules referring to area dimensions
  3. Other rules not covered by 1. or 2.

1. Rules referring to properties in the fo element or parent fo element

Percentage values in this group are resolved relative to properties on the same or the parent element. These values can be resolved during fo tree construction as they do not require any input from the area tree.

Suggestion: Change the percentage implementation such that these properties are resolved at fo tree construction time. This would allow to dispose of the property lists earlier (see also http://marc.theaimsgroup.com/?l=fop-dev&m=110442946030972&w=2).

XSL-FO Rule: refer to the font size of the element itself

Properties

XSL-FO Rule: refer to font's em-height

Properties

XSL-FO Rule: refer to parent element's font size

Properties

XSL-FO Rule: refer to the "line-height" of the element itself

Properties

XSL-FO Rule: refer to the corresponding height or width of the page-viewport-area

Although this rule refers to an area, the dimensions of a page-viewport-area are taken straight from the corresponding page-width / page-height properties. Therefore it should be possible to calculate these during fo tree construction.

Properties

XSL-FO Rule: refer to the "line-height" of the parent area

Not sure about this one - I assume taking the line-height from the parent fo element would be OK?

Properties

2. Rules referring to dimensions of an area

The rules in this class fall into the following groups:

  1. Rules referring to the 'closest ancestor block area'
  2. Rules referring to the 'parent area'
  3. Rules referring to the 'reference area'
  4. Rules referring to the 'area created by the element'
  5. Rules referring to tables

To resolve percentages on property values for any properties in this class access to the area tree and the dimensions on those areas is required.

2.1 Rules referring to the 'closest ancestor block area'

The XSL-FO specification uses the definitions 'containing block' and 'closest ancestor block area that is not a line area' interchangebly. The term 'containing block' is used in the context of CSS derived properties while 'closest ancestor block area that is not a line area' is used for XSL-FO properties. Care must be taking that the design for this rule group handles the exceptions noted in http://www.w3.org/TR/xsl/slice7.html#percrule correctly.

XSL-FO Rule: refer to inline-progression-dimension of closest ancestor block area that is not a line area

Properties

XSL-FO Rule: refer to width of containing block

Properties

XSL-FO Rule: refer to height of containing block

Properties

XSL-FO Rule: calculated with respect to the height of the generated box's containing block

Properties

XSL-FO Rule: corresponding dimension of the closest area ancestor that was generated by a block-level formatting object

I assume 'closest area ancestor that was generated by a block-level formatting object' is the same as 'closest ancestor block area that is not a line area'.

Properties

2.2 Rules referring to the 'parent area'

The difference to 'containing block' is that the 'parent area' could be a 'line area' Therefore 'parent area' and 'containing block' may not be the same.

XSL-FO Rule: refer to inline-progression-dimension of content-rectangle of parent area

Properties

2.3 Rules referring to the containing reference area

XSL-FO Rule: refer to inline-progression-dimension of containing reference area

Properties

2.4 Rules refering to the area generated by the fo element itself

XSL-FO Rule: refer to size of padding-rectangle

Actually percentages for these properties do refer to both the size of the padding rectangle AND the intrinsic size of the background image.

Properties

XSL-FO Rule: see prose

Properties

The only rule in this group refers the table width. It should be possible to obtain this through the area tree. However, the actual percentage calculation is a fairly special case.

XSL-FO Rule: refer to width of table

Properties

3. Other rules not covered above

Rules refering to an elements intrinsic sizes

These apply to external-graphic and instream-foreign-object objects only. They can be calculated the moment the intrinsic dimensions of the e-g or i-f-o are known.

XSL-FO Rule: refer to intrinsic height

Properties

XSL-FO Rule: refer to intrinsic width

Properties

XSL-FO Rule: refer to width of the region being divided into columns

The value is a percentage of the inline-progression-dimension of the content-rectangle of the region.

Properties

PropertyHandling/Percentages (last edited 2009-09-20 23:52:18 by localhost)