Gecko:PrintPreview: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
 
Line 5: Line 5:
* Currently print preview is completely modal, because we can't allow the underlying document to change while we're print previewing it.
* Currently print preview is completely modal, because we can't allow the underlying document to change while we're print previewing it.
* We don't allow any interaction with the print preview, such as changing margins or scaling.
* We don't allow any interaction with the print preview, such as changing margins or scaling.
* The entire contents of the print preview window, including page shadows and any UI (well, there isn't any, but still...) are defined in Gecko print-related frame code. This is a big problem for Firefox front-end people who want to enhance print preview.
* The entire contents of the print preview window, including page shadows and any UI (well, there isn't any, but still...) are defined in Gecko print-related frame code. This is a big problem for anyone who might want to enhance print preview.
* The print preview presentation doesn't necessarily have the same layout as the print presentation. In many ways it's still a screen presentation.
* The print preview presentation doesn't necessarily have the same layout as the print presentation. In many ways it's still a screen presentation.


Line 12: Line 12:
* Fix the modality problem by cloning the document (and any subdocuments) and using the clone for printing/print preview.
* Fix the modality problem by cloning the document (and any subdocuments) and using the clone for printing/print preview.
** Replace plugins with an image snapshot of the current plugin state
** Replace plugins with an image snapshot of the current plugin state
** We could implement "print selection" and "print subset of frames" by modifying the clone.
** This is basically done.
* Reimplement "print selection" and "print subset of frames" by modifying the clone before we print/print preview.
* Do away with the print preview presentation. Instead, implement print preview by building the print presentation and then rendering snapshots of it to the screen.
* Do away with the print preview presentation. Instead, implement print preview by building the print presentation and then rendering snapshots of it to the screen.
* Make the print preview window a XUL chrome document containing a list of XUL <page> elements. These elements are leaf elements that simply render pages from some stored print presentation.
** Make the print preview window a XUL chrome document containing a list of XUL <page> elements. These elements are leaf elements that simply render pages from some stored print presentation.
** There will be some API to determine (or possibly set) the properties of each page and how many pages are used by the print presentation; the chrome UI is responsible for creating/destroying page elements as needed.
** There will be some API to determine (or possibly set) the properties of each page and how many pages are used by the print presentation; the chrome UI is responsible for creating/destroying page elements as needed.
** Chrome UI is responsible for rendering page shadows and all other window decorations.
** Chrome UI is responsible for rendering page shadows and all other window decorations.
Line 21: Line 22:
== Benefits ==
== Benefits ==


* Eliminates the "print preview" presentation, simplifying layout
* Provides great flexibility to UI implementors
* Provides great flexibility to UI implementors
* Enables new features
* Enables new features
* Should shrink the printing/print preview code
* Not too hard to implement since we don't need to stuff the cloned document into a window
* Guaranteed consistency between print preview and printing
* Guaranteed consistency between print preview and printing
1,295

edits

Navigation menu