Bug 53947

Summary: REGRESSION (r78201): -webkit-font-smoothing:antialiased turns off ClearType
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: andersca, mitz
Priority: P2 Keywords: InRadar, PlatformOnly, Regression
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
URL: http://www.bbc.co.uk/news/science-environment-12911806
Attachments:
Description Flags
Part of apple.com/startpage with the old drawing area
none
Part of apple.com/startpage with the new drawing area none

Description Adam Roben (:aroben) 2011-02-07 14:51:12 PST
To reproduce:

1. Go to http://www.apple.com/startpage/ and look at the text
2. Set WEBKIT2_USE_NEW_DRAWING_AREA=1, relaunch, and go back to apple.com/startpage

The text is less bold with the new drawing area. See screenshots.
Comment 1 Adam Roben (:aroben) 2011-02-07 14:51:33 PST
Created attachment 81528 [details]
Part of apple.com/startpage with the old drawing area
Comment 2 Adam Roben (:aroben) 2011-02-07 14:51:45 PST
Created attachment 81529 [details]
Part of apple.com/startpage with the new drawing area
Comment 3 Adam Roben (:aroben) 2011-02-07 14:52:43 PST
<rdar://problem/8968347>
Comment 4 Adam Roben (:aroben) 2011-02-07 14:53:42 PST
The new drawing area won't be on by default until bug 53805 is fixed.
Comment 5 Adam Roben (:aroben) 2011-02-08 06:44:27 PST
It looks like we're not getting subpixel antialiasing when using the new drawing area.
Comment 6 Adam Roben (:aroben) 2011-02-08 07:06:25 PST
I tried changing ShareableBitmap::createGraphicsContext to pass kCGImageAlphaNoneSkipFirst to CGBitmapContextCreate, but that had no effect on this bug.
Comment 7 mitz 2011-02-08 07:12:42 PST
Text on apple.com/startpage should not be subpixel-antialiased, since the page specifies "-webkit-font-smoothing: antialiased;" on its body element. It is not subpixel-antialiased in Safari 5.0.3 on Mac OS X. Nice progression.
Comment 8 Adam Roben (:aroben) 2011-02-08 07:51:34 PST
Thanks for the clarification, Dan. I guess it is technically a progression in this case, but it seems likely to be a regression in other cases. Disabling that -webkit-font-smoothing rule in the Inspector doesn't restore the subpixel antialiasing.
Comment 9 Adam Roben (:aroben) 2011-02-08 07:57:35 PST
It looks like -webkit-font-smoothing:antialiased isn't respected for GDI text, even in WebKit1. I filed bug 54004 about this.
Comment 10 Adam Roben (:aroben) 2011-02-08 08:01:28 PST
The text on webkit.org is subpixel-antialiased, even with the new drawing area. I wonder what makes the text on apple.com/startpage different?
Comment 11 Adam Roben (:aroben) 2011-02-08 08:04:32 PST
I have a sneaking suspicion that the underlying issue here is that the GraphicsContext that DrawingAreaImpl draws the page into isn't backed by an HDC/HBITMAP.
Comment 12 Adam Roben (:aroben) 2011-02-10 04:49:00 PST
Now that the new drawing area is on by default (see bug 53805), it's easiest to just compare the rendering to WebKit1.
Comment 13 mitz 2011-02-10 08:21:27 PST
This bug should probably be retitled to describe a real issue and not a case of correct behavior.
Comment 14 Adam Roben (:aroben) 2011-03-31 06:56:59 PDT
Here's a much better example: http://www.bbc.co.uk/news/science-environment-12911806

That page has subpixel antialiasing in WebKit1, but not in WebKit2.
Comment 15 Adam Roben (:aroben) 2011-05-10 10:04:30 PDT
(In reply to comment #14)
> Here's a much better example: http://www.bbc.co.uk/news/science-environment-12911806
> 
> That page has subpixel antialiasing in WebKit1, but not in WebKit2.

This page specifies "-webkit-font-smoothing: antialiased", too, so is a progression from WebKit1.

I guess we don't have any evidence that there is a bug here. There is definitely a change in behavior. (GDI text is now affected by -webkit-font-smoothing, but wasn't previously.)
Comment 16 Adam Roben (:aroben) 2011-05-10 10:05:45 PDT
Presumably the sites that are using -webkit-font-smoothing were testing on Mac or with CG font rendering on Windows, since it had no effect with GDI font rendering in Safari 5. It's hard to say whether the new behavior is better than the old behavior from a compatibility standpoint, though it's obviously more correct.