Bug 16297 - WebView must be contained in NSWindow for printing
Summary: WebView must be contained in NSWindow for printing
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://lists.webkit.org/pipermail/web...
Depends on:
Reported: 2007-12-04 13:52 PST by Christian Plessl
Modified: 2007-12-04 16:30 PST (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Christian Plessl 2007-12-04 13:52:03 PST
In the WebKit version shipped with Mac OS X 10.5.1 a WebView cannot be printed to PDF unless is are contained in an NSWindow.

This is a problem for applications render WebViews offscreen, e.g. for my open-source command line tool wkpdf (http://wkpdf.plesslweb.ch) that renders a website to a PDF document. When trying to print a WebView that is not contained in a  NSWindow runOperation (method of NSPrintOperation) fails with the assertion:

*** Assertion failure in -[WebHTMLView lockFocusIfCanDraw],

The WebView in WebKit versions shipped with OS X 10.4.x did not have this dependency on NSWindow.

A detailed problem description with relevant source code snippets is available in my posting to webkit-dev:http://lists.webkit.org/pipermail/webkit-dev/2007-December/002946.html

I'm not sufficiently familiar with Cocoa to know, whether other NSView subclasses also depend on NSWindow. But Darin Adler suggested in his answer to my mailing list posting, that this behavior could be considered a bug.
Comment 1 mitz 2007-12-04 16:30:43 PST
Retitled the bug based on the description.