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.
Retitled the bug based on the description.