I'm trying to figure out where a browser, specifically firefox or chrome, would insert page breaks when printing or print previewing an HTML document. For now I do not want to avoid the breaks, nor do I want to define where exactly to put a break. I'm aware of the page-break-* elements as defined in CSS 2.1 and CSS 3.0. I really want to figure out the last element on the current page and the first element on the next page and relate them to the actual HTML code.
As far as I know there are no events or signals I could register for. The next thing I thought of is to patch webkit or gecko and add a custom signal/event. But this is only possible, if the page break code is not scattered over too many files and members.
I'm not asking for a complete solution, rather any thoughts or hints how this could be accomplished at all.
Thanks in advance for any suggestions and ideas :)
UPDATE: I need to figure out the position of the page breaks programmatically as I want to modify and manipulate the original HTML file depending on the result.