Ejemplo n.º 1
0
void SVGImage::setContainerSize(const FloatSize& size)
{
    if (!m_page || !usesContainerSize())
        return;

    SVGSVGElement* rootElement = toSVGDocument(m_page->mainFrame().document())->rootElement();
    if (!rootElement)
        return;
    RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer());
    if (!renderer)
        return;

    FrameView* view = frameView();
    view->resize(this->containerSize());

    renderer->setContainerSize(IntSize(size));
}
Ejemplo n.º 2
0
void SVGImage::setContainerSize(const FloatSize& size)
{
    if (!usesContainerSize())
        return;

    SVGSVGElement* rootElement = this->rootElement();
    if (!rootElement)
        return;
    auto* renderer = downcast<RenderSVGRoot>(rootElement->renderer());
    if (!renderer)
        return;

    FrameView* view = frameView();
    view->resize(this->containerSize());

    renderer->setContainerSize(IntSize(size));
}
void SVGImage::setContainerSize(const IntSize& size)
{
    if (!usesContainerSize())
        return;

    SVGSVGElement* rootElement = svgRootElement(m_page.get());
    if (!rootElement)
        return;

    FrameView* view = frameView();
    view->resize(this->containerSize());

    LayoutSVGRoot* layoutObject = toLayoutSVGRoot(rootElement->layoutObject());
    if (!layoutObject)
        return;
    layoutObject->setContainerSize(size);
}