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

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

Issue 189463005: Generate the isSVG*Element() / toSVG*Element() helper functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove blank line change 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGEllipseElement.h » ('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, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org>
3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 27 matching lines...) Expand all
38 #include "core/events/Event.h" 38 #include "core/events/Event.h"
39 #include "core/html/HTMLElement.h" 39 #include "core/html/HTMLElement.h"
40 #include "core/rendering/RenderObject.h" 40 #include "core/rendering/RenderObject.h"
41 #include "core/rendering/svg/RenderSVGResourceContainer.h" 41 #include "core/rendering/svg/RenderSVGResourceContainer.h"
42 #include "core/svg/SVGCursorElement.h" 42 #include "core/svg/SVGCursorElement.h"
43 #include "core/svg/SVGDocumentExtensions.h" 43 #include "core/svg/SVGDocumentExtensions.h"
44 #include "core/svg/SVGElementInstance.h" 44 #include "core/svg/SVGElementInstance.h"
45 #include "core/svg/SVGElementRareData.h" 45 #include "core/svg/SVGElementRareData.h"
46 #include "core/svg/SVGGraphicsElement.h" 46 #include "core/svg/SVGGraphicsElement.h"
47 #include "core/svg/SVGSVGElement.h" 47 #include "core/svg/SVGSVGElement.h"
48 #include "core/svg/SVGTitleElement.h"
48 #include "core/svg/SVGUseElement.h" 49 #include "core/svg/SVGUseElement.h"
49 50
50 #include "wtf/TemporaryChange.h" 51 #include "wtf/TemporaryChange.h"
51 52
52 namespace WebCore { 53 namespace WebCore {
53 54
54 using namespace HTMLNames; 55 using namespace HTMLNames;
55 using namespace SVGNames; 56 using namespace SVGNames;
56 57
57 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName ToIdMap, const QualifiedName& attrName) 58 void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName ToIdMap, const QualifiedName& attrName)
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 245
245 // If the <use> title is not empty we found the title to use. 246 // If the <use> title is not empty we found the title to use.
246 String useTitle(useElement->title()); 247 String useTitle(useElement->title());
247 if (!useTitle.isEmpty()) 248 if (!useTitle.isEmpty())
248 return useTitle; 249 return useTitle;
249 } 250 }
250 } 251 }
251 252
252 // If we aren't an instance in a <use> or the <use> title was not found, the n find the first 253 // If we aren't an instance in a <use> or the <use> title was not found, the n find the first
253 // <title> child of this element. 254 // <title> child of this element.
254 Element* titleElement = ElementTraversal::firstWithin(*this);
255 for (; titleElement; titleElement = ElementTraversal::nextSkippingChildren(* titleElement, this)) {
256 if (titleElement->hasTagName(SVGNames::titleTag) && titleElement->isSVGE lement())
257 break;
258 }
259
260 // If a title child was found, return the text contents. 255 // If a title child was found, return the text contents.
261 if (titleElement) 256 if (Element* titleElement = Traversal<SVGTitleElement>::firstChild(*this))
262 return titleElement->innerText(); 257 return titleElement->innerText();
263 258
264 // Otherwise return a null/empty string. 259 // Otherwise return a null/empty string.
265 return String(); 260 return String();
266 } 261 }
267 262
268 PassRefPtrWillBeRawPtr<CSSValue> SVGElement::getPresentationAttribute(const Atom icString& name) 263 PassRefPtrWillBeRawPtr<CSSValue> SVGElement::getPresentationAttribute(const Atom icString& name)
269 { 264 {
270 if (!hasAttributesWithoutUpdate()) 265 if (!hasAttributesWithoutUpdate())
271 return nullptr; 266 return nullptr;
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 animatableAttributes.add(SVGNames::zAttr); 1133 animatableAttributes.add(SVGNames::zAttr);
1139 } 1134 }
1140 1135
1141 if (name == classAttr) 1136 if (name == classAttr)
1142 return true; 1137 return true;
1143 1138
1144 return animatableAttributes.contains(name); 1139 return animatableAttributes.contains(name);
1145 } 1140 }
1146 #endif 1141 #endif
1147 } 1142 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGEllipseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698