We fall into a slow path when drawing a border for an element with nonzero border-radius. If the rounded corners are outside the clip rect, however, we can set their radius to zero without visual effect.
Created attachment 100939 [details] proposed patch
<rdar://problem/9326550>
Comment on attachment 100939 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=100939&action=review Let's see one more version. I'd also like to see an interactive testcase attached to the bug (maybe a roundrect inside a scrollable overflow region) so that behavior can be checked manually. > Source/WebCore/ChangeLog:8 > + No new tests, behavior is unaffected. Well, behavior is affected, but not in a way that should affect visible rendering. > Source/WebCore/rendering/RenderBoxModelObject.cpp:1425 > + // If one of the corners falls outside the clip region, pretend it has no radius. The comment should mention that this is done for performance reasons. > Source/WebCore/rendering/RenderBoxModelObject.cpp:1450 > + outerBorder.setRadii(adjustedOuterRadii); You could avoid setting this if you didn't change any corners. I think you should also skip this entire block if rect is entirely inside the clip.
Created attachment 101007 [details] test case Here's a test case—normal, dotted, and dashed borders with positive border-radius in overflow: scroll divs.
Created attachment 101011 [details] updated patch Addressed Simon's comments and moved the corner-adjusting code into a separate static function.
Comment on attachment 101011 [details] updated patch Nice.
Comment on attachment 101011 [details] updated patch Clearing flags on attachment: 101011 Committed r91090: <http://trac.webkit.org/changeset/91090>
All reviewed patches have been landed. Closing bug.