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

Side by Side Diff: Source/core/svg/SVGElement.h

Issue 27096003: Use DEFINE_NODE_TYPE_CASTS instead of using manual toSVGFooElement() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « Source/core/svg/SVGClipPathElement.h ('k') | Source/core/svg/SVGElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 { 200 {
201 if (key.hasPrefix()) { 201 if (key.hasPrefix()) {
202 QualifiedNameComponents components = { nullAtom.impl(), key.localNam e().impl(), key.namespaceURI().impl() }; 202 QualifiedNameComponents components = { nullAtom.impl(), key.localNam e().impl(), key.namespaceURI().impl() };
203 return hashComponents(components); 203 return hashComponents(components);
204 } 204 }
205 return DefaultHash<QualifiedName>::Hash::hash(key); 205 return DefaultHash<QualifiedName>::Hash::hash(key);
206 } 206 }
207 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a .matches(b); } 207 static bool equal(const QualifiedName& a, const QualifiedName& b) { return a .matches(b); }
208 }; 208 };
209 209
210 inline SVGElement* toSVGElement(Node* node) 210 DEFINE_NODE_TYPE_CASTS(SVGElement, isSVGElement());
211 {
212 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isSVGElement());
213 return static_cast<SVGElement*>(node);
214 }
215
216 inline const SVGElement* toSVGElement(const Node* node)
217 {
218 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isSVGElement());
219 return static_cast<const SVGElement*>(node);
220 }
221 211
222 } 212 }
223 213
224 #endif 214 #endif
OLDNEW
« no previous file with comments | « Source/core/svg/SVGClipPathElement.h ('k') | Source/core/svg/SVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698