The trick used in http://neugierig.org/software/chromium/notes/2010/07/clipping.html to support antialiased clips doesn't work when printing to Skia's PDF backend because the backend does not support inverted paths (PDF does not support it natively meaning Skia would need a full geometry engine to support it). This manifests as rounded buttons not being drawn when printing, tracked as Chrome bug 79519. However, when the output is a vector device, like PDF, we don't need antialiased clips - it's up to the PDF rendering engine to do that. So we can simply disable the antialiased clip code if the output is a vector device. I think the fix isn't testable because it requires examining the printed output.
Created attachment 99885 [details] Don't use clip antialias hack when printing.
Attachment 99885 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 99887 [details] Don't use clip antialias hack when printing.
James, can you take a look at this change?
Why can't we test printed output?
As far as I'm aware, there's not a PDF renderer available in the testing pipeline.
Who's working on fixing that?
Have you tried layoutTestController.setPrinting()? There are a few examples of this in the tree (e.g., printing/compositing-layer-printing.html and printing/media-queries-print.html). It might only work on Mac, which probably doesn't go through this code path, in which case you can ignore me.
Hamaji may have other ideas on how to test printing.
There's a bug in Skia, assigned to me: http://code.google.com/p/skia/issues/detail?id=246 For awhile the plan was to use Chrome's PDF plugin, but licensing didn't work out on that. I investigated using ghostscript, but it has some very strange rendering quirks for the existing skia test set. Ben Wagner recently proposed some code to use lib poppler, which we may use, though it does not handle shaders or soft masks correctly.
LayoutTests/platform/chromium/test_expectations.txt skips printing/compositing-layer-printing.html and printing/media-queries-print.html for the chromium port. With the comment: // These tests try to print a PDF file as the expected result. I don't think // we plan on supporting this anytime soon. I think Eric said before that automated testing of printing with DumpRenderTree is not possible.
Yup, printing tests were a dream. But never a reality. PDFs (at least on OS X) include all sorts of per-machine information, making them a poor reference image format.
Comment on attachment 99887 [details] Don't use clip antialias hack when printing. OK, but please add a descriptive comment in the changelog and inline to explain what is going on.
Created attachment 100036 [details] Adding descriptive comment in changelog and inline for Steve
Comment on attachment 100036 [details] Adding descriptive comment in changelog and inline for Steve Thanks for the explanation, I'm sure the next person to debug through this bit of code will appreciate it greatly.
Comment on attachment 100036 [details] Adding descriptive comment in changelog and inline for Steve Clearing flags on attachment: 100036 Committed r90599: <http://trac.webkit.org/changeset/90599>
All reviewed patches have been landed. Closing bug.