Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Unified Diff: third_party/WebKit/Source/core/svg/SVGSVGElement.cpp

Issue 1827793003: Support currentScale for embedded SVG (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..4979582d4a3f10660b88c3673ec9c3727cec8374 100644
--- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
@@ -122,12 +122,7 @@ float SVGSVGElement::currentScale() const
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();
+ return frame->pageZoomFactor();
}
void SVGSVGElement::setCurrentScale(float scale)
@@ -140,14 +135,6 @@ void SVGSVGElement::setCurrentScale(float scale)
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);
}

Powered by Google App Engine
This is Rietveld 408576698