summaryrefslogtreecommitdiffstats
path: root/WebCore/svg/SVGSVGElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/svg/SVGSVGElement.cpp')
-rw-r--r--WebCore/svg/SVGSVGElement.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index b7f9717..bc669a3 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -78,6 +78,11 @@ SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc)
doc->registerForDocumentActivationCallbacks(this);
}
+PassRefPtr<SVGSVGElement> SVGSVGElement::create(const QualifiedName& tagName, Document* document)
+{
+ return adoptRef(new SVGSVGElement(tagName, document));
+}
+
SVGSVGElement::~SVGSVGElement()
{
document()->unregisterForDocumentActivationCallbacks(this);
@@ -181,8 +186,7 @@ void SVGSVGElement::setUseCurrentView(bool currentView)
SVGViewSpec* SVGSVGElement::currentView() const
{
if (!m_viewSpec)
- m_viewSpec.set(new SVGViewSpec(this));
-
+ m_viewSpec = adoptPtr(new SVGViewSpec(this));
return m_viewSpec.get();
}
@@ -472,6 +476,12 @@ AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGLocatable::CTMSc
// RenderSVGRoot::localToBorderBoxTransform() (called through mapLocalToContainer(), called from localToAbsolute())
// also takes the viewBoxToViewTransform() into account, so we have to subtract it here (original cause of bug #27183)
transform.translate(location.x() - viewBoxTransform.e(), location.y() - viewBoxTransform.f());
+
+ // Respect scroll offset.
+ if (FrameView* view = document()->view()) {
+ IntSize scrollOffset = view->scrollOffset();
+ transform.translate(-scrollOffset.width(), -scrollOffset.height());
+ }
}
}