Chromium Code Reviews| Index: third_party/WebKit/Source/core/svg/SVGSVGElement.cpp |
| diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp |
| index 6e7ed43b997b1079d1b84a0118bdb129dc68c824..c3cc7465efaf94ba9a0c827f01f064f9eb8d38c9 100644 |
| --- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp |
| +++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp |
| @@ -69,6 +69,7 @@ inline SVGSVGElement::SVGSVGElement(Document& doc) |
| , m_useCurrentView(false) |
| , m_timeContainer(SMILTimeContainer::create(*this)) |
| , m_translation(SVGPoint::create()) |
| + , m_currentScale(1.0) |
|
fs
2016/03/31 10:53:04
Nit: Just 1 should do (and is what coding style pr
Shanmuga Pandi
2016/03/31 11:53:35
Done.
|
| { |
| m_width->setDefaultValueAsString("100%"); |
| m_height->setDefaultValueAsString("100%"); |
| @@ -113,42 +114,14 @@ SVGViewSpec* SVGSVGElement::currentView() |
| return m_viewSpec.get(); |
| } |
| -float SVGSVGElement::currentScale() const |
| -{ |
| - if (!inDocument() || !isOutermostSVGSVGElement()) |
| - return 1; |
| - |
| - LocalFrame* frame = document().frame(); |
| - if (!frame) |
| - return 1; |
| - |
| - const FrameTree& frameTree = frame->tree(); |
| - |
| - // The behaviour of currentScale() is undefined, when we're dealing with non-standalone SVG documents. |
| - // If the svg is embedded, the scaling is handled by the host layoutObject, so when asking from inside |
| - // the SVG document, a scale value of 1 seems reasonable, as it doesn't know anything about the parent scale. |
| - return frameTree.parent() ? 1 : frame->pageZoomFactor(); |
| -} |
| - |
| void SVGSVGElement::setCurrentScale(float scale) |
| { |
| ASSERT(std::isfinite(scale)); |
| if (!inDocument() || !isOutermostSVGSVGElement()) |
| return; |
| - LocalFrame* frame = document().frame(); |
| - if (!frame) |
| - return; |
| - |
| - const FrameTree& frameTree = frame->tree(); |
| - |
| - // The behaviour of setCurrentScale() is undefined, when we're dealing with non-standalone SVG documents. |
| - // We choose the ignore this call, it's pretty useless to support calling setCurrentScale() from within |
| - // an embedded SVG document, for the same reasons as in currentScale() - needs resolution by SVG WG. |
| - if (frameTree.parent()) |
| - return; |
| - |
| - frame->setPageZoomFactor(scale); |
| + m_currentScale = scale; |
| + updateCurrentTranslate(); |
|
fs
2016/03/31 10:53:04
I'd suggest you rename this to make this look slig
Shanmuga Pandi
2016/03/31 11:53:35
Done.
|
| } |
| class SVGCurrentTranslateTearOff : public SVGPointTearOff { |