Bug 40509

Summary: incorrect rendering of CSS border-radius creates pixellated look
Product: WebKit Reporter: Dave <webkit>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.6   

Description Dave 2010-06-11 17:22:07 PDT
When an element with both a background and a border has a CSS border radius applied to it, the element's corners look pixellated.

Upon closer inspection, it looks like what's going on is that the background is being antialiased in such a way that it bleeds through the border on top of it, appearing to spill outside the border. (It may be that they're being antialiased the same way, but that the semitransparent nature of antialiased pixels results in the background showing through.)

One possible fix might be to draw the background so it extends only halfway to the edge of the border (0.5px for a 1px border), and figure the actual pixels based on that. Dunno if that would work.

In the interim I've only been able to think of one workaround: use two HTML elements. Do the "border" as a background on the outer element. Make the inner element 1px smaller on each side, and use its background for the actual background of the box. It's border radius then needs to be 1px smaller than that of the outer element.

You can see the problem in action by flipping through the jQuery themes at http://tinyurl.com/dbqg2t
Comment 1 Alexey Proskuryakov 2010-06-12 23:19:11 PDT
Duplicate of bug 21819? We actually have lots of bugs that seem to be duplicates - someone who has an idea about how these are drawn should clean those up. Just search for open bugs with "border radius" words in title.
Comment 2 Simon Fraser (smfr) 2010-10-07 10:49:20 PDT

*** This bug has been marked as a duplicate of bug 21819 ***