Bug 45934 - Cleanup: Extract common border radii expansion code in RenderBoxModelObject::paintBoxShadow() into function
Summary: Cleanup: Extract common border radii expansion code in RenderBoxModelObject::...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-16 16:31 PDT by Daniel Bates
Modified: 2010-09-20 21:28 PDT (History)
3 users (show)

See Also:


Attachments
Patch (4.96 KB, patch)
2010-09-16 16:42 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 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.
Comment 1 Daniel Bates 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.
Comment 2 Daniel Bates 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>
Comment 3 Daniel Bates 2010-09-20 21:28:06 PDT
All reviewed patches have been landed.  Closing bug.