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 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 RenderSVGImage::imageChanged(CachedImage* image) { RenderImage::imageChanged(image); // We override to invalidate a larger rect, since SVG images can draw outside their "bounds" repaintRectangle(absoluteClippedOverflowRect()); }
void RenderSVGImage::imageChanged(WrappedImagePtr image, const IntRect* rect) { RenderImage::imageChanged(image, rect); // We override to invalidate a larger rect, since SVG images can draw outside their "bounds" repaintRectangle(absoluteClippedOverflowRect()); // FIXME: Isn't this just repaint()? }
void RenderFrameSet::layout() { ASSERT(needsLayout()); bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout(); IntRect oldBounds; if (doFullRepaint) oldBounds = absoluteClippedOverflowRect(); if (!parent()->isFrameSet() && !document()->printing()) { setWidth(view()->viewWidth()); setHeight(view()->viewHeight()); } size_t cols = frameSet()->totalCols(); size_t rows = frameSet()->totalRows(); if (m_rows.m_sizes.size() != rows || m_cols.m_sizes.size() != cols) { m_rows.resize(rows); m_cols.resize(cols); } int borderThickness = frameSet()->border(); layOutAxis(m_rows, frameSet()->rowLengths(), height() - (rows - 1) * borderThickness); layOutAxis(m_cols, frameSet()->colLengths(), width() - (cols - 1) * borderThickness); if (flattenFrameSet()) positionFramesWithFlattening(); else positionFrames(); RenderBox::layout(); computeEdgeInfo(); if (doFullRepaint) { view()->repaintViewRectangle(oldBounds); IntRect newBounds = absoluteClippedOverflowRect(); if (newBounds != oldBounds) view()->repaintViewRectangle(newBounds); } setNeedsLayout(false); }
void RenderPath::layout() { // FIXME: using m_absoluteBounds breaks if containerForRepaint() is not the root LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout(), &m_absoluteBounds); calculateLocalTransform(); setPath(static_cast<SVGStyledTransformableElement*>(element())->toPathData()); m_absoluteBounds = absoluteClippedOverflowRect(); repainter.repaintAfterLayout(); 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 RenderForeignObject::layout() { ASSERT(needsLayout()); // Arbitrary affine transforms are incompatible with LayoutState. view()->disableLayoutState(); // FIXME: using m_absoluteBounds breaks if containerForRepaint() is not the root LayoutRepainter repainter(*this, checkForRepaintDuringLayout(), &m_absoluteBounds); calculateLocalTransform(); RenderBlock::layout(); m_absoluteBounds = absoluteClippedOverflowRect(); repainter.repaintAfterLayout(); 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); }
void RenderSVGContainer::absoluteQuads(Vector<FloatQuad>& quads, bool topLevel) { quads.append(absoluteClippedOverflowRect()); }
void RenderSVGContainer::absoluteRects(Vector<IntRect>& rects, int, int, bool) { rects.append(absoluteClippedOverflowRect()); }
void RenderSVGContainer::calcBounds() { m_width = calcReplacedWidth(); m_height = calcReplacedHeight(); m_absoluteBounds = absoluteClippedOverflowRect(); }
void RenderPath::absoluteQuads(Vector<FloatQuad>& quads, bool) { quads.append(absoluteClippedOverflowRect()); }
void RenderSVGImage::absoluteQuads(Vector<FloatQuad>& quads) { quads.append(FloatRect(absoluteClippedOverflowRect())); }
void RenderSVGImage::absoluteRects(Vector<IntRect>& rects, int, int) { rects.append(absoluteClippedOverflowRect()); }
void RenderFrameSet::layout() { ASSERT(needsLayout()); bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout(); IntRect oldBounds; if (doFullRepaint) oldBounds = absoluteClippedOverflowRect(); if (!parent()->isFrameSet() && !document()->printing()) { #ifdef FLATTEN_FRAMESET // Force a grid recalc. m_gridCalculated = false; #endif m_width = view()->viewWidth(); m_height = view()->viewHeight(); } size_t cols = frameSet()->totalCols(); size_t rows = frameSet()->totalRows(); if (m_rows.m_sizes.size() != rows || m_cols.m_sizes.size() != cols) { m_rows.resize(rows); m_cols.resize(cols); #ifdef FLATTEN_FRAMESET m_gridCalculated = false; #endif } #ifdef FLATTEN_FRAMESET if (!m_gridCalculated) { m_gridCalculated = true; // Make all the child framesets recalculate their grid. RenderObject* child = firstChild(); for (; child; child = child->nextSibling()) { if (child->isFrameSet()) static_cast<RenderFrameSet*>(child)->setGridNeedsLayout(); } #endif int borderThickness = frameSet()->border(); layOutAxis(m_rows, frameSet()->rowLengths(), m_height - (rows - 1) * borderThickness); layOutAxis(m_cols, frameSet()->colLengths(), m_width - (cols - 1) * borderThickness); #ifdef FLATTEN_FRAMESET } #endif positionFrames(); RenderContainer::layout(); computeEdgeInfo(); if (doFullRepaint) { view()->repaintViewRectangle(oldBounds); IntRect newBounds = absoluteClippedOverflowRect(); if (newBounds != oldBounds) view()->repaintViewRectangle(newBounds); } setNeedsLayout(false); }
void RenderSVGModelObject::absoluteQuads(Vector<FloatQuad>& quads) { quads.append(absoluteClippedOverflowRect()); }
void RenderPath::absoluteRects(Vector<IntRect>& rects, int _tx, int _ty, bool) { rects.append(absoluteClippedOverflowRect()); }