diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/svg/RenderSVGContainer.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/rendering/svg/RenderSVGContainer.cpp')
-rw-r--r-- | Source/WebCore/rendering/svg/RenderSVGContainer.cpp | 29 |
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) |