[webkit-dev] Duplicate page: Implementing Print Preview

David Hyatt hyatt at apple.com
Thu May 28 14:21:39 PDT 2009


On May 28, 2009, at 1:13 PM, Marc-Antoine Ruel wrote:

> To clarify Sverrir and my intent;
>
> PDF (or EMF as it's currently done on the windows port of Chromium)  
> snapshot is fine for a static print preview but useless for a  
> dynamic one. We'd prefer to have something interactive. If a user  
> changes the layout or the page setup, the print preview is  
> immediately updated. To do that, we need to make the print preview  
> application modal (because of javascript interactions) and I think  
> it defeats the purpose of tabbed browsing.
>
> (Please correct me if I'm mistaken)
> The goal is to make the print preview in its own tab and not modal  
> anymore. So the idea is to duplicate the Document/Frame along with  
> RenderView and all their children into a new WebView, disable their  
> javascript, timers and url request ability. This copy would be used  
> to regenerate the print preview/printed document.
>
> That's quite a daunting task, we'd like to know if we missed  
> something obvious (or already existing!) and if not, if anyone else  
> would like to see the same feature.
>

I don't think you actually have to clone the render tree explicitly.    
You could use DOM operations to clone the DOM and let new renderers  
get constructed by that process.

dave



More information about the webkit-dev mailing list