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

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