There's some code that does some stuff similar to what you're asking in nsPrintEngine::GetPageRangeForSelection. You can use nsIPresShell::GetPrimaryFrameFor to get the primary frame for a content node, and nsIFrame::GetContent to get the content for a frame. Note that one piece of content may correspond to multiple frames, so things can get a bit complicated in some cases.
-Eli _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

