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

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

Issue 33353003: Have Frame::tree() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 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
« no previous file with comments | « Source/core/rendering/TextAutosizer.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGSVGElement.cpp
diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
index 7c6bef2ac40dcb63a7aa7ed73ef1c12e7d37e106..4fefa5b4a54a71ad8c36b2adb36990855cd66f98 100644
--- a/Source/core/svg/SVGSVGElement.cpp
+++ b/Source/core/svg/SVGSVGElement.cpp
@@ -183,13 +183,12 @@ float SVGSVGElement::currentScale() const
if (!frame)
return 1;
- FrameTree* frameTree = frame->tree();
- ASSERT(frameTree);
+ 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 renderer, 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 frameTree.parent() ? 1 : frame->pageZoomFactor();
}
void SVGSVGElement::setCurrentScale(float scale)
@@ -201,13 +200,12 @@ void SVGSVGElement::setCurrentScale(float scale)
if (!frame)
return;
- FrameTree* frameTree = frame->tree();
- ASSERT(frameTree);
+ 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())
+ if (frameTree.parent())
return;
frame->setPageZoomFactor(scale);
« no previous file with comments | « Source/core/rendering/TextAutosizer.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698