Bug 23816

Summary: Clean up RenderSVGRoot.cpp
Product: WebKit Reporter: Rob Buis <rwlbuis>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Cleanup patch eric: review+

Rob Buis
Reported 2009-02-07 06:58:42 PST
RenderSVGRoot has some unneeded includes and unneeded if tests, clean that up.
Attachments
Cleanup patch (4.22 KB, patch)
2009-02-07 07:00 PST, Rob Buis
eric: review+
Rob Buis
Comment 1 2009-02-07 07:00:28 PST
Created attachment 27445 [details] Cleanup patch Straightforward cleanup of RenderSVGRoot.cpp. Cheers, Rob.
Eric Seidel (no email)
Comment 2 2009-02-09 11:10:51 PST
Comment on attachment 27445 [details] Cleanup patch Looks fine. You could even handle the hasSetContainerSize() case up front. That would result in more code, but might be cleaner. if (svg-> hasSetContainerSize()) { m_viewport = FloatRect(0, 0, width.value(svg), height.value(svg)); return; } Then the rest could be a terinary: w = (width.unitType() == LengthTypePercent) ? svg->relativeWidthValue() : width.value(svg); h = (height.unitType() == LengthTypePercent) ? svg->relativeHeightValue() : height.value(svg); m_viewport = FloatRect(0, 0, w, h); I'm not sure if that's cleaner or not though. Either way, looks great and doesn't need any further review.
Rob Buis
Comment 3 2009-02-09 12:55:59 PST
Hi Eric, (In reply to comment #2) > (From update of attachment 27445 [details] [review]) > Looks fine. You could even handle the hasSetContainerSize() case up front. > That would result in more code, but might be cleaner. > > if (svg-> hasSetContainerSize()) { > m_viewport = FloatRect(0, 0, width.value(svg), height.value(svg)); > return; > } > > Then the rest could be a terinary: > > w = (width.unitType() == LengthTypePercent) ? svg->relativeWidthValue() : > width.value(svg); > h = (height.unitType() == LengthTypePercent) ? svg->relativeHeightValue() : > height.value(svg); > m_viewport = FloatRect(0, 0, w, h); > > I'm not sure if that's cleaner or not though. Either way, looks great and > doesn't need any further review. Thanks for the thumbs up, I did try to clean it up that way in my final commit. Cheers, Rob.
Note You need to log in before you can comment on or make changes to this bug.