Open Bug 469728 Opened 17 years ago Updated 4 years ago

Offsets of contents after pagination

Categories

(Core :: Layout, enhancement)

enhancement

Tracking

()

People

(Reporter: kantha, Unassigned)

References

()

Details

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618) Build Identifier: We have a application that uses mozilla componenets for converting HTML Pages to PDF, RTF and other formats. The applicaiton is in production at http://gecko.dynalivery.com and currently uses Gecko 1.8.1. We support hyperlinks in the output PDF. We paginate the html page using PrintPreview and then caluclate the offset of the link w.r.t. the page origin. We do that by getting the Primary Frame for the Content and then add the offsets of parent frames till we reach PageFrame. We convert this offsets from twips to dev units. The above method worked well. We are planning to move our application to mozilla 1.9 and we are having trouble converting the App units to the dev units. It looks like in mozilla 1.9 the screen resolution is also coming into picture. I was wondering if it is possible to add an API that would return the offsets of the Content after Pagination w.r.t the page origins, similar to GetboundingClientRect. Can anyone point out a proper way of converting the app units to dev units. Reproducible: Always Steps to Reproduce: 1. 2. 3.
For reference, see this newsgroup thread, which spawned this bug: http://groups.google.com/group/mozilla.dev.tech.layout/browse_thread/thread/c2a85685a23afb45
OS: Windows Vista → All
Product: Firefox → Core
QA Contact: general → general
Hardware: PC → All
Version: unspecified → Trunk
Component: General → Layout
QA Contact: general → layout
Confirming. We basically want something that would make sense in projection, print, print preview, etc.
Status: UNCONFIRMED → NEW
Ever confirmed: true
We wouldn't need a new API for this if we ditched separate presentations and had a cloned document for printing --- which we absolutely do want to do.
I'm not sure I follow. What would "client" coordinates look like, as you see it? This bug is looking for a way to get coordinates relative to a given page. If client coordinates are relative to a page, which page should be used for an element that spans multiple pages?
The coordinate system used for pages in a print presentation is somewhat arbitrary. The best thing to do might be to treat the coordinate space as one long vertical strip with pages positioned to form a continuous vertical sequence, so that the bottom margin of page N is adjacent to the top margin of page N+1. We would then need an API that returns the page margin boxes, but we probably need that anyway.
Ah, ok. Sounds like this bug should be about making getBoundingClientRect and company behave as described in comment 5 even in print preview, then?
It does already behave like that in print preview. If you're crawling the frame tree you should be able to get the offsets of boxes from pages. Figuring out how they map to the actual print presentation would be tricky though.
I thought we had gaps between the pages in print preview. Do we not count those in computing the client offsets?
We do, but if you're just computing the offset of each box from its page, the gaps don't matter.
Right, but that involves groveling the frame tree, then. The point here is to have API that doesn't require that.
Any further thoughts or plans on this issue.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.