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

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

Issue 192143002: Use isSVG*Element() helpers more in SVG code (Part 2) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 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
« no previous file with comments | « Source/core/svg/SVGPatternElement.cpp ('k') | Source/core/svg/SVGTextContentElement.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 5be8b3959de2f1e5ecbdefa92f1332f58b58d4c8..b5065d4515e00e282c525ac9ab7a194550d63237 100644
--- a/Source/core/svg/SVGSVGElement.cpp
+++ b/Source/core/svg/SVGSVGElement.cpp
@@ -776,13 +776,11 @@ void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element*
// or MyDrawing.svg#xpointer(id('MyView'))) then the closest ancestor ‘svg’ element is displayed in the viewport.
// Any view specification attributes included on the given ‘view’ element override the corresponding view specification
// attributes on the closest ancestor ‘svg’ element.
- if (anchorNode && anchorNode->hasTagName(SVGNames::viewTag)) {
- SVGViewElement* viewElement = toSVGViewElement(anchorNode);
- if (!viewElement)
- return;
+ if (isSVGViewElement(anchorNode)) {
+ SVGViewElement& viewElement = toSVGViewElement(*anchorNode);
- if (SVGSVGElement* svg = viewElement->ownerSVGElement()) {
- svg->inheritViewAttributes(viewElement);
+ if (SVGSVGElement* svg = viewElement.ownerSVGElement()) {
+ svg->inheritViewAttributes(&viewElement);
if (RenderObject* renderer = svg->renderer())
RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
« no previous file with comments | « Source/core/svg/SVGPatternElement.cpp ('k') | Source/core/svg/SVGTextContentElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698