-void RenderSVGRoot::calcViewport()
-{
- SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
-
- if (!svg->hasSetContainerSize()) {
- // In the normal case of <svg> being stand-alone or in a CSSBoxModel object we use
- // RenderBox::width()/height() (which pulls data from RenderStyle)
- m_viewportSize = FloatSize(width(), height());
- return;
- }
-
- // In the SVGImage case grab the SVGLength values off of SVGSVGElement and use
- // the special relativeWidthValue accessors which respect the specified containerSize
- // FIXME: Check how SVGImage + zooming is supposed to be handled?
- SVGLength width = svg->width();
- SVGLength height = svg->height();
- m_viewportSize = FloatSize(width.unitType() == LengthTypePercentage ? svg->relativeWidthValue() : width.value(svg),
- height.unitType() == LengthTypePercentage ? svg->relativeHeightValue() : height.value(svg));
-}
-