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

[whatwg] [html5] window.print() undefined

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Tue, 19 Jul 2005 06:06:58 -0400
Message-ID: <42DCD0C2.7070509@earthlink.net>
Dean Edwards wrote:
> OK, we don't switch media. But when I press "print" or invoke the print 
> method, a copy of the DOM is sent to the printer. If I have altered the 
> DOM by adding elements or by changing the style property then I would 
> like to be able to undo those changes before my DOM goes to the printer. 
> It is not good enough to say that I should start messing about with 
> classes and so forth or that it is bad practice to amend the style 
> property directly. So long as I can do these things I want a way to undo 
> them before my DOM is sent to a print device.

   I know this isn't how you meant it, but this all seems a bit user
hostile. The user sees something on the screen he/she wants to print,
but an event is called at the last minute that changes the content to
something else before the user can print. So if I select the part of the
page you want to "undo" and tried to print the selection, I'd get a
blank page? And in theory, the entire page could be hidden. Sounds like
print-specific DRM to me.

   Perhaps what you really want is a media-specific way of setting
styling properties:

| element.style.media("print").display = "block";
Received on Tuesday, 19 July 2005 03:06:58 UTC

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