To reproduce: 1. go to maps.google.com 2. search for some particular address (e.g. "Cupertino, CA") 3. Select Print from the File menu 4. click Preview (to avoid wasting paper) In the built-in Safari on Tiger (or 10.4.1), this works fine. In Safari on tip of tree, I get an error message from Preview ("File error. couldn't open the file."), and the Safari page changes to show the default maps.google.com image of the U.S.
This is also in Radar as <rdar://problem/4141569>
It turns out that all printing is broken, including Preview and Save as PDF. I suspect something broke in the SPI reshuffling just before we open-sourced WebKit.
It turns out (it sure keeps turning) that not all printing is broken, but printing of images is broken. Printing a page consisting of nothing but text and form elements works fine. Printing a page with only a single image fails (even the missing image image).
Turns out this is a bug due to a subtle issue with graphics contexts. If you retain a pointer to the graphics context, you break printing. And we were using autoreleased NSGraphicsContext pointers. Fix is simple.
Created attachment 2282 [details] adds autorelease pools to fix the bug; also change tabs to spaces This patch fixes the bug, and also changes the various tabs in this file to spaces.
r=me
Verified with TOT WebKit (6/18) under 10.4.1. Marking Verified.