summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/svg/RenderSVGContainer.cpp')
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGContainer.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/Source/WebCore/rendering/svg/RenderSVGContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
index 71c7bcc00..ccdf24f9c 100644
--- a/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
@@ -22,11 +22,10 @@
*/
#include "config.h"
-
-#if ENABLE(SVG)
#include "RenderSVGContainer.h"
#include "GraphicsContext.h"
+#include "HitTestRequest.h"
#include "LayoutRepainter.h"
#include "RenderIterator.h"
#include "RenderSVGResourceFilter.h"
@@ -38,8 +37,8 @@
namespace WebCore {
-RenderSVGContainer::RenderSVGContainer(SVGElement& element, PassRef<RenderStyle> style)
- : RenderSVGModelObject(element, std::move(style))
+RenderSVGContainer::RenderSVGContainer(SVGElement& element, RenderStyle&& style)
+ : RenderSVGModelObject(element, WTFMove(style))
, m_objectBoundingBoxValid(false)
, m_needsBoundariesUpdate(true)
{
@@ -103,13 +102,13 @@ void RenderSVGContainer::removeChild(RenderObject& child)
bool RenderSVGContainer::selfWillPaint()
{
- SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(*this);
+ auto* resources = SVGResourcesCache::cachedResourcesForRenderer(*this);
return resources && resources->filter();
}
void RenderSVGContainer::paint(PaintInfo& paintInfo, const LayoutPoint&)
{
- if (paintInfo.context->paintingDisabled())
+ if (paintInfo.context().paintingDisabled())
return;
// Spec: groups w/o children still may render filter content.
@@ -122,7 +121,7 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, const LayoutPoint&)
PaintInfo childPaintInfo(paintInfo);
{
- GraphicsContextStateSaver stateSaver(*childPaintInfo.context);
+ GraphicsContextStateSaver stateSaver(childPaintInfo.context());
// Let the RenderSVGViewportContainer subclass clip if necessary
applyViewportClip(childPaintInfo);
@@ -144,20 +143,20 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, const LayoutPoint&)
}
// FIXME: This really should be drawn from local coordinates, but currently we hack it
- // to avoid our clip killing our outline rect. Thus we translate our
+ // to avoid our clip killing our outline rect. Thus we translate our
// outline rect into parent coords before drawing.
// 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 == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style().outlineWidth() && style().visibility() == VISIBLE) {
+ if (paintInfo.phase == PaintPhaseSelfOutline && style().outlineWidth() && style().visibility() == VISIBLE) {
IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRect));
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<LayoutRect>& rects, const LayoutPoint&, const RenderLayerModelObject*)
{
- IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates()));
+ LayoutRect paintRectInParent = LayoutRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates()));
if (!paintRectInParent.isEmpty())
rects.append(paintRectInParent);
}
@@ -174,21 +173,21 @@ bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest
if (!pointIsInsideViewportClip(pointInParent))
return false;
- FloatPoint localPoint = localToParentTransform().inverse().mapPoint(pointInParent);
+ FloatPoint localPoint = localToParentTransform().inverse().value_or(AffineTransform()).mapPoint(pointInParent);
if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
return false;
for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
if (child->nodeAtFloatPoint(request, result, localPoint, hitTestAction)) {
- updateHitTestResult(result, roundedLayoutPoint(localPoint));
+ updateHitTestResult(result, LayoutPoint(localPoint));
return true;
}
}
// Accessibility wants to return SVG containers, if appropriate.
if (request.type() & HitTestRequest::AccessibilityHitTest && m_objectBoundingBox.contains(localPoint)) {
- updateHitTestResult(result, roundedLayoutPoint(localPoint));
+ updateHitTestResult(result, LayoutPoint(localPoint));
return true;
}
@@ -198,5 +197,3 @@ bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest
}
}
-
-#endif // ENABLE(SVG)