void RenderSVGText::layout() { ASSERT(needsLayout()); IntRect oldBounds; IntRect oldOutlineBox; bool checkForRepaint = checkForRepaintDuringLayout(); if (checkForRepaint) { oldBounds = m_absoluteBounds; oldOutlineBox = absoluteOutlineBox(); } // FIXME: need to allow floating point positions SVGTextElement* text = static_cast<SVGTextElement*>(element()); int xOffset = (int)(text->x()->getFirst().value()); int yOffset = (int)(text->y()->getFirst().value()); setPos(xOffset, yOffset); RenderBlock::layout(); m_absoluteBounds = absoluteClippedOverflowRect(); bool repainted = false; if (checkForRepaint) repainted = repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox); setNeedsLayout(false); }
void RenderForeignObject::layout() { ASSERT(needsLayout()); // Arbitrary affine transforms are incompatible with LayoutState. view()->disableLayoutState(); IntRect oldBounds; IntRect oldOutlineBox; bool checkForRepaint = checkForRepaintDuringLayout(); if (checkForRepaint) { oldBounds = m_absoluteBounds; oldOutlineBox = absoluteOutlineBox(); } calculateLocalTransform(); RenderBlock::layout(); m_absoluteBounds = absoluteClippedOverflowRect(); if (checkForRepaint) repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox); view()->enableLayoutState(); setNeedsLayout(false); }
void RenderSVGText::layout() { ASSERT(needsLayout()); // FIXME: This is a hack to avoid the RenderBlock::layout() partial repainting code which is not (yet) SVG aware setNeedsLayout(true); IntRect oldBounds; IntRect oldOutlineBox; bool checkForRepaint = checkForRepaintDuringLayout(); if (checkForRepaint) { oldBounds = m_absoluteBounds; oldOutlineBox = absoluteOutlineBox(); } // Best guess for a relative starting point SVGTextElement* text = static_cast<SVGTextElement*>(element()); int xOffset = (int)(text->x()->getFirst().value(text)); int yOffset = (int)(text->y()->getFirst().value(text)); setPos(xOffset, yOffset); calculateLocalTransform(); RenderBlock::layout(); m_absoluteBounds = absoluteClippedOverflowRect(); bool repainted = false; if (checkForRepaint) repainted = repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox); setNeedsLayout(false); }
void RenderSVGContainer::layout() { ASSERT(needsLayout()); calcViewport(); // Arbitrary affine transforms are incompatible with LayoutState. view()->disableLayoutState(); IntRect oldBounds; IntRect oldOutlineBox; bool checkForRepaint = checkForRepaintDuringLayout(); if (selfNeedsLayout() && checkForRepaint) { oldBounds = m_absoluteBounds; oldOutlineBox = absoluteOutlineBox(); } RenderObject* child = firstChild(); while (child) { if (!child->isRenderPath() || static_cast<RenderPath*>(child)->hasRelativeValues()) child->setNeedsLayout(true); child->layoutIfNeeded(); ASSERT(!child->needsLayout()); child = child->nextSibling(); } calcWidth(); calcHeight(); m_absoluteBounds = absoluteClippedOverflowRect(); if (!parent()->isSVGContainer()) { SVGSVGElement* svg = static_cast<SVGSVGElement*>(element()); m_width = static_cast<int>(static_cast<float>(m_width) * svg->currentScale()); m_height = static_cast<int>(static_cast<float>(m_height) * svg->currentScale()); } if (selfNeedsLayout() && checkForRepaint) repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox); view()->enableLayoutState(); setNeedsLayout(false); }
void RenderPath::layout() { IntRect oldBounds; IntRect oldOutlineBox; bool checkForRepaint = checkForRepaintDuringLayout(); if (selfNeedsLayout() && checkForRepaint) { oldBounds = m_absoluteBounds; oldOutlineBox = absoluteOutlineBox(); } setPath(static_cast<SVGStyledElement*>(element())->toPathData()); m_absoluteBounds = absoluteClippedOverflowRect(); setWidth(m_absoluteBounds.width()); setHeight(m_absoluteBounds.height()); if (selfNeedsLayout() && checkForRepaint) repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox); setNeedsLayout(false); }
void RenderReplaced::layout() { ASSERT(needsLayout()); IntRect oldBounds; IntRect oldOutlineBox; bool checkForRepaint = checkForRepaintDuringLayout(); if (checkForRepaint) { oldBounds = absoluteClippedOverflowRect(); oldOutlineBox = absoluteOutlineBox(); } m_height = minimumReplacedHeight(); calcWidth(); calcHeight(); adjustOverflowForBoxShadow(); if (checkForRepaint) repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox); setNeedsLayout(false); }