WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
23816
Clean up RenderSVGRoot.cpp
https://bugs.webkit.org/show_bug.cgi?id=23816
Summary
Clean up RenderSVGRoot.cpp
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+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
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.
Top of Page
Format For Printing
XML
Clone This Bug