W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2005

[whatwg] [html5] onbeforeprint/onafterprint (was window.print() undefined)

From: Dean Edwards <dean@edwards.name>
Date: Wed, 20 Jul 2005 18:24:59 +0100
Message-ID: <42DE88EB.3030904@edwards.name>
Matthew Raymond wrote:
> Dean Edwards wrote:
> 
>>Matthew Raymond wrote:
>>
>>>| if (documentchanged) {
>>>|   printClone = document.clone();
>>>|   prepareForPrinting(printClone);
>>>| }
>>>|
>>>| printClone.print();
>>
>>This seems less practical than print events.
> 
> 
>    I don't see how:
> 
> | OnBeforePrintEventFunction() {
> |   prepareForPrinting(document);
> | }
> |
> | OnAfterPrintEventFunction() {
> |   restoreForScreen(document);
> | }
> 

I mean less practical in terms of memory management. Cloning a document 
every time you alter it would likely lead to terrible performance. 
Granted, the JavaScript looks slightly neater.

-dean
Received on Wednesday, 20 July 2005 10:24:59 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:42 UTC