[webkit-reviews] review granted: [Bug 23816] Clean up RenderSVGRoot.cpp : [Attachment 27445] Cleanup patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 9 11:10:51 PST 2009


Eric Seidel <eric at webkit.org> has granted Rob Buis <rwlbuis at gmail.com>'s
request for review:
Bug 23816: Clean up RenderSVGRoot.cpp
https://bugs.webkit.org/show_bug.cgi?id=23816

Attachment 27445: Cleanup patch
https://bugs.webkit.org/attachment.cgi?id=27445&action=review

------- Additional Comments from Eric Seidel <eric at webkit.org>
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.


More information about the webkit-reviews mailing list