diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/svg/SVGSVGElement.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/svg/SVGSVGElement.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/3rdparty/webkit/WebCore/svg/SVGSVGElement.cpp b/src/3rdparty/webkit/WebCore/svg/SVGSVGElement.cpp index 29e72b8..2d5008b 100644 --- a/src/3rdparty/webkit/WebCore/svg/SVGSVGElement.cpp +++ b/src/3rdparty/webkit/WebCore/svg/SVGSVGElement.cpp @@ -66,7 +66,10 @@ SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc) , m_x(this, SVGNames::xAttr, LengthModeWidth) , m_y(this, SVGNames::yAttr, LengthModeHeight) , m_width(this, SVGNames::widthAttr, LengthModeWidth, "100%") - , m_height(this, SVGNames::heightAttr, LengthModeHeight, "100%") + , m_height(this, SVGNames::heightAttr, LengthModeHeight, "100%") + , m_externalResourcesRequired(this, SVGNames::externalResourcesRequiredAttr, false) + , m_viewBox(this, SVGNames::viewBoxAttr) + , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create()) , m_useCurrentView(false) , m_timeContainer(SMILTimeContainer::create(this)) , m_viewSpec(0) @@ -261,7 +264,7 @@ void SVGSVGElement::parseMappedAttribute(MappedAttribute* attr) return; if (SVGExternalResourcesRequired::parseMappedAttribute(attr)) return; - if (SVGFitToViewBox::parseMappedAttribute(attr)) + if (SVGFitToViewBox::parseMappedAttribute(document(), attr)) return; if (SVGZoomAndPan::parseMappedAttribute(attr)) return; @@ -513,13 +516,8 @@ TransformationMatrix SVGSVGElement::viewBoxToViewTransform(float viewWidth, floa viewBoxRect = currentView()->viewBox(); } else viewBoxRect = viewBox(); - if (!viewBoxRect.width() || !viewBoxRect.height()) - return TransformationMatrix(); - - TransformationMatrix ctm = preserveAspectRatio()->getCTM(viewBoxRect.x(), - viewBoxRect.y(), viewBoxRect.width(), viewBoxRect.height(), - 0, 0, viewWidth, viewHeight); + TransformationMatrix ctm = SVGFitToViewBox::viewBoxToViewTransform(viewBoxRect, preserveAspectRatio(), viewWidth, viewHeight); if (useCurrentView() && currentView()) return currentView()->transform()->concatenate().matrix() * ctm; |