void RenderSVGRoot::layout() { ASSERT(needsLayout()); // Arbitrary affine transforms are incompatible with LayoutState. LayoutStateDisabler layoutStateDisabler(view()); bool needsLayout = selfNeedsLayout(); LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout); IntSize oldSize(width(), height()); negotiateSizeWithHostDocumentIfNeeded(); computeLogicalWidth(); computeLogicalHeight(); calcViewport(); SVGSVGElement* svg = static_cast<SVGSVGElement*>(node()); m_isLayoutSizeChanged = svg->hasRelativeLengths() && oldSize != size(); SVGRenderSupport::layoutChildren(this, needsLayout); m_isLayoutSizeChanged = false; // At this point LayoutRepainter already grabbed the old bounds, // recalculate them now so repaintAfterLayout() uses the new bounds. if (m_needsBoundariesOrTransformUpdate) { updateCachedBoundaries(); m_needsBoundariesOrTransformUpdate = false; } repainter.repaintAfterLayout(); setNeedsLayout(false); }
void RenderSVGRoot::layout() { StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); m_resourcesNeedingToInvalidateClients.clear(); // Arbitrary affine transforms are incompatible with LayoutState. LayoutStateDisabler layoutStateDisabler(view()); bool needsLayout = selfNeedsLayout(); LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout); LayoutSize oldSize = size(); updateLogicalWidth(); updateLogicalHeight(); buildLocalToBorderBoxTransform(); SVGSVGElement* svg = toSVGSVGElement(node()); ASSERT(svg); m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size()); SVGRenderSupport::layoutChildren(this, needsLayout || SVGRenderSupport::filtersForceContainerLayout(this)); if (!m_resourcesNeedingToInvalidateClients.isEmpty()) { // Invalidate resource clients, which may mark some nodes for layout. HashSet<RenderSVGResourceContainer*>::iterator end = m_resourcesNeedingToInvalidateClients.end(); for (HashSet<RenderSVGResourceContainer*>::iterator it = m_resourcesNeedingToInvalidateClients.begin(); it != end; ++it) (*it)->removeAllClientsFromCache(); m_isLayoutSizeChanged = false; SVGRenderSupport::layoutChildren(this, false); } // At this point LayoutRepainter already grabbed the old bounds, // recalculate them now so repaintAfterLayout() uses the new bounds. if (m_needsBoundariesOrTransformUpdate) { updateCachedBoundaries(); m_needsBoundariesOrTransformUpdate = false; } updateLayerTransform(); repainter.repaintAfterLayout(); setNeedsLayout(false); }
void RenderSVGRoot::layout() { ASSERT(needsLayout()); // Arbitrary affine transforms are incompatible with LayoutState. LayoutStateDisabler layoutStateDisabler(*this); bool needsLayout = selfNeedsLayout(); LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout); LayoutSize oldSize = size(); updateLogicalWidth(); updateLogicalHeight(); buildLocalToBorderBoxTransform(); SVGRenderSupport::layoutResourcesIfNeeded(this); SVGSVGElement* svg = toSVGSVGElement(node()); ASSERT(svg); m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size()); SVGRenderSupport::layoutChildren(this, needsLayout || SVGRenderSupport::filtersForceContainerLayout(this)); // At this point LayoutRepainter already grabbed the old bounds, // recalculate them now so repaintAfterLayout() uses the new bounds. if (m_needsBoundariesOrTransformUpdate) { updateCachedBoundaries(); m_needsBoundariesOrTransformUpdate = false; } m_overflow.clear(); addVisualEffectOverflow(); if (!shouldApplyViewportClip()) { FloatRect contentRepaintRect = repaintRectInLocalCoordinates(); contentRepaintRect = m_localToBorderBoxTransform.mapRect(contentRepaintRect); addVisualOverflow(enclosingLayoutRect(contentRepaintRect)); } updateLayerTransform(); m_hasBoxDecorations = isDocumentElement() ? calculateHasBoxDecorations() : hasBoxDecorations(); invalidateBackgroundObscurationStatus(); repainter.repaintAfterLayout(); clearNeedsLayout(); }
void RenderSVGRoot::layout() { ASSERT(needsLayout()); // Arbitrary affine transforms are incompatible with LayoutState. ForceHorriblySlowRectMapping slowRectMapping(*this); bool needsLayout = selfNeedsLayout(); LayoutSize oldSize = size(); updateLogicalWidth(); updateLogicalHeight(); buildLocalToBorderBoxTransform(); SVGRenderSupport::layoutResourcesIfNeeded(this); SVGSVGElement* svg = toSVGSVGElement(node()); ASSERT(svg); m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size()); SVGRenderSupport::layoutChildren(this, needsLayout || SVGRenderSupport::filtersForceContainerLayout(this)); if (m_needsBoundariesOrTransformUpdate) { updateCachedBoundaries(); m_needsBoundariesOrTransformUpdate = false; } m_overflow.clear(); addVisualEffectOverflow(); if (!shouldApplyViewportClip()) { FloatRect contentRepaintRect = paintInvalidationRectInLocalCoordinates(); contentRepaintRect = m_localToBorderBoxTransform.mapRect(contentRepaintRect); addVisualOverflow(enclosingLayoutRect(contentRepaintRect)); } updateLayerTransformAfterLayout(); m_hasBoxDecorationBackground = isDocumentElement() ? calculateHasBoxDecorations() : hasBoxDecorationBackground(); invalidateBackgroundObscurationStatus(); clearNeedsLayout(); }
void RenderSVGRoot::layout() { ASSERT(needsLayout()); // Arbitrary affine transforms are incompatible with LayoutState. LayoutStateDisabler layoutStateDisabler(view()); bool needsLayout = selfNeedsLayout(); LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout); LayoutSize oldSize(width(), height()); computeLogicalWidth(); computeLogicalHeight(); SVGSVGElement* svg = static_cast<SVGSVGElement*>(node()); m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size()); if (view() && view()->frameView() && view()->frameView()->embeddedContentBox()) { if (!m_needsSizeNegotiationWithHostDocument) m_needsSizeNegotiationWithHostDocument = !m_everHadLayout || oldSize != size(); } else ASSERT(!m_needsSizeNegotiationWithHostDocument); SVGRenderSupport::layoutChildren(this, needsLayout || SVGRenderSupport::filtersForceContainerLayout(this)); m_isLayoutSizeChanged = false; // At this point LayoutRepainter already grabbed the old bounds, // recalculate them now so repaintAfterLayout() uses the new bounds. if (m_needsBoundariesOrTransformUpdate) { updateCachedBoundaries(); m_needsBoundariesOrTransformUpdate = false; } repainter.repaintAfterLayout(); setNeedsLayout(false); }