Add nsIWebBrowserPrint.printPreviewCurrentPageNumber
Categories
(Core :: Printing: Setup, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: jwatt, Assigned: hiro)
References
(Blocks 1 open bug)
Details
(Whiteboard: [print2020_v81])
Attachments
(4 files, 1 obsolete file)
We currently have nsIWebBrowserPrint.printPreviewScrollToPage to allow the frontend to implement UI to allow the user to jump (scroll) to a specific page (sheet). However, if the user scrolls with the mouse wheel, say, the frontend has no way to know which page is currently being displayed.
The new tab-modal print UI should display the current page number to the user to help them locate where they are in document, but currently there is no way for the frontend code to determine the information that it needs. We should provide this information to the frontend code.
The most obvious solution seem to be to add an nsIWebBrowserPrint.printPreviewCurrentPageNumber
attribute.
Reporter | ||
Comment 1•4 years ago
|
||
I guess if we're adding a printPreviewCurrentPageNumber
attribute, then at that point it might make sense to make the attribute mutable, and to remove printPreviewScrollToPage
. The navigation constants that are passed to that function aren't really necessary. We could have:
printPreviewCurrentPageNumber -= 1 # instead of PRINTPREVIEW_PREV_PAGE
printPreviewCurrentPageNumber += 1 # instead of PRINTPREVIEW_NEXT_PAGE
printPreviewCurrentPageNumber = 0 # instead of PRINTPREVIEW_HOME
printPreviewCurrentPageNumber = -1 # (or =printPreviewNumPages) instead of PRINTPREVIEW_END
As long as we support that functionality, we could do the actual removal of printPreviewScrollToPage
later in a separate bug once the frontend has been switched over.
Reporter | ||
Comment 2•4 years ago
•
|
||
Regarding the criteria for what constitutes the "current page", I would guess it makes sense to make it whichever PrintedSheetFrame intersects (or is closest to) the top edge of the viewport.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Okay, I am going to simply add the "current page" as an initial step.
If there is an on-going asyncronous scrolling happening, the number wouldn't match the visually showing page, that would be OK?
CCing mstriemer, if you have any concerns please let me know.
Assignee | ||
Comment 4•4 years ago
|
||
Assignee | ||
Comment 5•4 years ago
|
||
Since bug 1652278, it's not a page frame.
Depends on D86147
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D86148
Assignee | ||
Comment 7•4 years ago
|
||
I am going to use it for printPreviewCurrentPageNumber function.
Depends on D86149
Assignee | ||
Comment 8•4 years ago
|
||
Depends on D86150
Updated•4 years ago
|
Pushed by hikezoe.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3d6e70da931e Rename `pt` to `currentScrollPosition` in PrintPreviewScrollToPage. r=jwatt https://hg.mozilla.org/integration/autoland/rev/961b5198a1ea Rename `pageFrame` to `sheetFrame` in PrintPreviewScrollToPage. r=TYLin https://hg.mozilla.org/integration/autoland/rev/007497d442be Constify some nsIDocumentViewerPrint methods. r=jwatt https://hg.mozilla.org/integration/autoland/rev/9eb50000762d Add nsIWebBrowserPrint.printPreviewCurrentPageNumber. r=emilio
Comment 10•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3d6e70da931e
https://hg.mozilla.org/mozilla-central/rev/961b5198a1ea
https://hg.mozilla.org/mozilla-central/rev/007497d442be
https://hg.mozilla.org/mozilla-central/rev/9eb50000762d
Comment 11•4 years ago
|
||
Pushed by malexandru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/35c4666eb742 Fix bustages regarding nsDocumentViewer.cpp and 'pageCount'. a=bustage-fix
Comment 12•4 years ago
|
||
bugherder |
Description
•