Bug 41894 - fo:block-container: percentage-lengths + width/height->ipd/bpd
Summary: fo:block-container: percentage-lengths + width/height->ipd/bpd
Status: CLOSED WORKSFORME
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: trunk
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-19 12:36 UTC by Andreas L. Delmelle
Modified: 2012-04-01 13:47 UTC (History)
0 users



Attachments
source FO (1.88 KB, text/plain)
2007-03-19 12:37 UTC, Andreas L. Delmelle
Details
proposed fix (4.00 KB, patch)
2007-03-19 12:38 UTC, Andreas L. Delmelle
Details | Diff
PDF result after applying the patch (4.78 KB, application/pdf)
2007-03-19 12:39 UTC, Andreas L. Delmelle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas L. Delmelle 2007-03-19 12:36:08 UTC
Reported by Daniel Noll on fop-users@

The FO in attachment currently fails w/ FOP trunk, because the percentages for top/right/bottom/left 
are not resolved correctly.

I think I've found a fix, patch also attached for reference.

Can anyone confirm that the output PDF is the result one would expect? I think it's a correct 
interpretation of the Rec., but I'm not sure. With my fix, the percentages are based on the height/width 
of the outer block-container (which would generate the nearest ancestor reference area?)
Comment 1 Andreas L. Delmelle 2007-03-19 12:37:12 UTC
Created attachment 19744 [details]
source FO
Comment 2 Andreas L. Delmelle 2007-03-19 12:38:40 UTC
Created attachment 19745 [details]
proposed fix
Comment 3 Andreas L. Delmelle 2007-03-19 12:39:37 UTC
Created attachment 19746 [details]
PDF result after applying the patch
Comment 4 Jeremias Maerki 2007-04-04 02:56:40 UTC
I think this is a step in the right direction, but I believe the PercentBase
shouldn't be LengthBase.CONTAINING_REFAREA_HEIGHT but
LengthBase.CONTAINING_BLOCK_HEIGHT. i-p-d, b-p-d, width and height are all using
CONTAINING_BLOCK_WIDTH/HEIGHT as per the spec. top, left etc. are also defined
in terms of the containing block, not the nearest ancestor reference area.

In your example, that would place all three inner b-cs at the upper edge of the
block-container's content area because the block they are enclosed in doesn't
have a height in this case. Only if you remove the block between the inner and
outer b-c will the vertical positioning work again. It's what I would expect in
terms of behaviour.
Comment 5 Andreas L. Delmelle 2007-04-05 12:54:54 UTC
(In reply to comment #4)
> I think this is a step in the right direction, but I believe the PercentBase
> shouldn't be LengthBase.CONTAINING_REFAREA_HEIGHT but
> LengthBase.CONTAINING_BLOCK_HEIGHT. i-p-d, b-p-d, width and height are all using
> CONTAINING_BLOCK_WIDTH/HEIGHT as per the spec. top, left etc. are also defined
> in terms of the containing block, not the nearest ancestor reference area.

Aaah, OK, now I think I get it.
The spec (I only checked 1.1) explicitly alters the original CSS wording 'containing block' to 'nearest 
ancestor reference area' for interpreting top/left/bottom/right (and in the absolute-position property), 
but only where it comes to the positioning (100% to the left of /what/?), not in the definition of the 
percent-base (100% of /what/ to the left of ...?)

Subtle one, I must say. :-)

I'll adapt shortly.
Comment 6 Andreas L. Delmelle 2008-09-20 12:53:34 UTC
Re-ran the example file through FOP Trunk, and I agree with the interpretation. Removing the surrounding fo:block leads to an expected placement of the block-containers.

So, nothing to fix. Just one less Bugzilla entry to worry about...
Comment 7 Glenn Adams 2012-04-01 13:47:48 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs