#include "core/frame/Settings.h"
#include "core/rendering/GraphicsContextAnnotator.h"
-#include "core/rendering/LayoutRepainter.h"
#include "core/rendering/RenderView.h"
#include "core/rendering/svg/SVGRenderSupport.h"
#include "core/rendering/svg/SVGRenderingContext.h"
#include "platform/graphics/GraphicsContextCullSaver.h"
#include "platform/graphics/GraphicsContextStateSaver.h"
-namespace WebCore {
+namespace blink {
RenderSVGContainer::RenderSVGContainer(SVGElement* node)
: RenderSVGModelObject(node)
{
}
+void RenderSVGContainer::trace(Visitor* visitor)
+{
+ visitor->trace(m_children);
+ RenderSVGModelObject::trace(visitor);
+}
+
void RenderSVGContainer::layout()
{
ASSERT(needsLayout());
- // RenderSVGRoot disables layoutState for the SVG rendering tree.
- ASSERT(!view()->layoutStateCachedOffsetsEnabled());
-
- LayoutRepainter repainter(*this, SVGRenderSupport::checkForSVGRepaintDuringLayout(this) || selfWillPaint());
-
// Allow RenderSVGViewportContainer to update its viewport.
calcViewport();
if (everHadLayout() && needsLayout())
SVGResourcesCache::clientLayoutChanged(this);
- // At this point LayoutRepainter already grabbed the old bounds,
- // recalculate them now so repaintAfterLayout() uses the new bounds.
if (m_needsBoundariesUpdate || updatedTransform) {
updateCachedBoundaries();
m_needsBoundariesUpdate = false;
RenderSVGModelObject::setNeedsBoundariesUpdate();
}
- repainter.repaintAfterLayout();
clearNeedsLayout();
}
{
ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
- if (paintInfo.context->paintingDisabled())
- return;
-
// Spec: groups w/o children still may render filter content.
if (!firstChild() && !selfWillPaint())
return;
- FloatRect repaintRect = paintInvalidationRectInLocalCoordinates();
- if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(repaintRect, localToParentTransform(), paintInfo))
+ FloatRect paintInvalidationRect = paintInvalidationRectInLocalCoordinates();
+ if (!SVGRenderSupport::paintInfoIntersectsPaintInvalidationRect(paintInvalidationRect, localToParentTransform(), paintInfo))
return;
PaintInfo childPaintInfo(paintInfo);
// FIXME: This means our focus ring won't share our rotation like it should.
// We should instead disable our clip during PaintPhaseOutline
if (paintInfo.phase == PaintPhaseForeground && style()->outlineWidth() && style()->visibility() == VISIBLE) {
- IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRect));
+ IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(paintInvalidationRect));
paintOutline(paintInfo, paintRectInParent);
}
}
// addFocusRingRects is called from paintOutline and needs to be in the same coordinates as the paintOuline call
-void RenderSVGContainer::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint&, const RenderLayerModelObject*)
+void RenderSVGContainer::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint&, const RenderLayerModelObject*) const
{
IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(paintInvalidationRectInLocalCoordinates()));
if (!paintRectInParent.isEmpty())
void RenderSVGContainer::updateCachedBoundaries()
{
- SVGRenderSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m_objectBoundingBoxValid, m_strokeBoundingBox, m_repaintBoundingBox);
- SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingBox);
+ SVGRenderSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m_objectBoundingBoxValid, m_strokeBoundingBox, m_paintInvalidationBoundingBox);
+ SVGRenderSupport::intersectPaintInvalidationRectWithResources(this, m_paintInvalidationBoundingBox);
}
bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
if (!pointIsInsideViewportClip(pointInParent))
return false;
- FloatPoint localPoint = localToParentTransform().inverse().mapPoint(pointInParent);
-
- if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
+ FloatPoint localPoint;
+ if (!SVGRenderSupport::transformToUserSpaceAndCheckClipping(this, localToParentTransform(), pointInParent, localPoint))
return false;
for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {