Stylus Studio XML Editor

Table of contents

Appendices

7.2 XSL Areas and the CSS Box Model

XSL Areas and the CSS Box Model

This section describes how to interpret property descriptions which incorporate the CSS2 definition of the same property. In CSS2, "boxes" are generated by "elements" in the same way that XSL areas are generated by formatting objects. Any references in the CSS2 definition to "boxes" are to be taken as referring to "areas" in the XSL area model, and where "element" appears in a CSS2 definition, except in the "Applies to" summary, it should be taken to refer to a "formatting object".

The CSS term, positioned element will in XSL be taken as referring to an XSL FO that has one of the following: an "absolute-position" property with a computed value other than "auto" and/or a "relative-position" property with a computed value other than "static".

NOTE: 

Since in XSL, the "position" property is a shorthand for the "absolute-position" and "relative-position" properties, this is equivalent to the CSS definition.

The position and size of a box are normally taken to refer to the position and size of the area's content-rectangle. Additional correspondences between the CSS2 Box Model and the XSL Area Model are contained in the following table.

lefttopBoxArealefttoplefttoplefttoplefttoplefttoplefttoplefttoplefttoplefttoplefttoplefttoplefttop
11lefttoptop content edge11lefttoptop edge of the content-rectangle
11lefttoppadding edge11lefttoppadding-rectangle
11lefttopcontent area11lefttopinterior of the content-rectangle
11lefttoppadding area11lefttopregion between the content-rectangle and the padding-rectangle
11lefttopborder area11lefttopregion between the padding-rectangle and the border-rectangle
11lefttopbackground11lefttopbackground
11lefttopcontaining block11lefttopclosest ancestor block-area that is not a line-area (see below for additional information when the "containing block" is used as a reference for percentage calculations)
11lefttopcaption11lefttoparea generated by fo:table-caption
11lefttopinline box11lefttopinline-area
11lefttopline box11lefttopline-area
11lefttopblock box11lefttopblock-area which is not a line-area
11lefttoppage box11lefttoppage-area

Box margins map to area traits in accordance with the description of how area traits are computed from property values in [refinement] .