I just uploaded a patch which add support for percentages and calculations on percentages to bugzilla.
I don't think that the patch is quite right in its attempt to find the correct base length to combine with the percentage. Some of my confusion comes from the fact that I can't tell the different boxes/areas/blocks apart.
How f.ex. are these specifications different: - ipd of closest area generated by a block-level fo - width of containing block - ipd of closest ancestor block-area.
Perhaps somebody who understand the spec better then me can describe what boxes and sizes that are to used.
I went through the spec and came up with these descriptions of the bases for the properties that support percentage:
top, bottom, height, max-height: height of containing block if explicit. Auto otherwise.
left, right, padding-*, margin-[left,right], max-width, min-width, width, text-indent: width of containing block
background-position-horizontal, background-position-vertical: Size of padding-rectangle. Relative values.
font-size: inherited font-size.
margin-[top,bottom]: width of containing block, except for page context where it is page box height.
[start,end]-indent: ipd of containing reference-area.
space-[end,start], line-line-end-indent: ipd of closest ancestor block-area.
alignment-adjust: 'height' if fo:external-graphics or fo:instream-foreign-object, 'font-size' if fo:character and 'line-height' otherwise.
baseline-shift: 'line-height' of the parent-area.
block-progression-dimension: corresponding dimension of closest area generated by a block-level fo. Auto if not specified explicit.
content-[height,width] intrinsic height and width
inline-progression-dimension: corresponding dimension of closest area generated by a block-level fo. Auto if not specified explicit.
min-height: height of containing.
leader-pattern-width, leader-length: ipd of content-rect of parent area.
column-gap: width of region being divided into columns.
extent: corresponding height or width of the page.
column-width: width of table.
text-altitude, text-depth: fonts em-height.
provisional-label-seperation, provisional-distance-between-starts: ipd of closest block-area that is not a line-area