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

Dean Edwards dean at edwards.name
Wed Jul 20 10:24:59 PDT 2005


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




More information about the whatwg mailing list