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

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

Issue 192133002: Use isSVG*Element() helpers more in SVG code (Part 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/SVGAltGlyphItemElement.cpp ('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 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 24 matching lines...) Expand all
35 namespace WebCore { 35 namespace WebCore {
36 36
37 SVGDocument::SVGDocument(const DocumentInit& initializer) 37 SVGDocument::SVGDocument(const DocumentInit& initializer)
38 : XMLDocument(initializer, XMLDocumentClass | SVGDocumentClass) 38 : XMLDocument(initializer, XMLDocumentClass | SVGDocumentClass)
39 { 39 {
40 } 40 }
41 41
42 SVGSVGElement* SVGDocument::rootElement(const Document& document) 42 SVGSVGElement* SVGDocument::rootElement(const Document& document)
43 { 43 {
44 Element* elem = document.documentElement(); 44 Element* elem = document.documentElement();
45 if (elem && elem->hasTagName(SVGNames::svgTag)) 45 return isSVGSVGElement(elem) ? toSVGSVGElement(elem) : 0;
46 return toSVGSVGElement(elem);
47
48 return 0;
49 } 46 }
50 47
51 SVGSVGElement* SVGDocument::rootElement() const 48 SVGSVGElement* SVGDocument::rootElement() const
52 { 49 {
53 return rootElement(*this); 50 return rootElement(*this);
54 } 51 }
55 52
56 void SVGDocument::dispatchZoomEvent(float prevScale, float newScale) 53 void SVGDocument::dispatchZoomEvent(float prevScale, float newScale)
57 { 54 {
58 RefPtr<SVGZoomEvent> event = SVGZoomEvent::create(); 55 RefPtr<SVGZoomEvent> event = SVGZoomEvent::create();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 renderer()->repaint(); 94 renderer()->repaint();
98 } 95 }
99 } 96 }
100 97
101 PassRefPtr<Document> SVGDocument::cloneDocumentWithoutChildren() 98 PassRefPtr<Document> SVGDocument::cloneDocumentWithoutChildren()
102 { 99 {
103 return create(DocumentInit(url())); 100 return create(DocumentInit(url()));
104 } 101 }
105 102
106 } 103 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGAltGlyphItemElement.cpp ('k') | Source/core/svg/SVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698