Bug 45934

Summary: Cleanup: Extract common border radii expansion code in RenderBoxModelObject::paintBoxShadow() into function
Product: WebKit Reporter: Daniel Bates <dbates>
Component: Layout and RenderingAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, hyatt, mitz
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Daniel Bates
Reported 2010-09-16 16:31:54 PDT
There are three places in RenderBoxModelObject::paintBoxShadow() that use almost verbatim code to expand the border radii rects and clamp their dimensions to non-negative values. http://trac.webkit.org/browser/trunk/WebCore/rendering/RenderBoxModelObject.cpp?rev=66170#L1641 http://trac.webkit.org/browser/trunk/WebCore/rendering/RenderBoxModelObject.cpp?rev=66170#L1660 http://trac.webkit.org/browser/trunk/WebCore/rendering/RenderBoxModelObject.cpp?rev=66170#L1737 We should extract the common code into a function, say uniformlyExpandBorderRadii, to remove duplication and shorten the function body of RenderBoxModelObject::paintBoxShadow(), which is long.
Attachments
Patch (4.96 KB, patch)
2010-09-16 16:42 PDT, Daniel Bates
no flags
Daniel Bates
Comment 1 2010-09-16 16:42:07 PDT
Created attachment 67860 [details] Patch I was not sure what to call the function or how best to incorporate the knowledge that we also clamp the rects to non-negative dimensions. Some name ideas were uniformlyExpandAndClampToNonNegativeDimensionsBorderRadii, uniformlyExpandAndClampNegativeToZeroBorderRadii, and uniformlyExpandBorderRadiiAndClampToNonNegativeDimensions. I felt these were a bit verbose and didn't read well so I went with uniformlyExpandBorderRadii. I am open to suggestions.
Daniel Bates
Comment 2 2010-09-20 21:27:54 PDT
Comment on attachment 67860 [details] Patch Clearing flags on attachment: 67860 Committed r67921: <http://trac.webkit.org/changeset/67921>
Daniel Bates
Comment 3 2010-09-20 21:28:06 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.