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

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

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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/SVGSVGElement.h ('k') | Source/core/svg/SVGScriptElement.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 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 REGISTER_LOCAL_ANIMATED_PROPERTY(x) 72 REGISTER_LOCAL_ANIMATED_PROPERTY(x)
73 REGISTER_LOCAL_ANIMATED_PROPERTY(y) 73 REGISTER_LOCAL_ANIMATED_PROPERTY(y)
74 REGISTER_LOCAL_ANIMATED_PROPERTY(width) 74 REGISTER_LOCAL_ANIMATED_PROPERTY(width)
75 REGISTER_LOCAL_ANIMATED_PROPERTY(height) 75 REGISTER_LOCAL_ANIMATED_PROPERTY(height)
76 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) 76 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
77 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) 77 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox)
78 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) 78 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
79 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) 79 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
80 END_REGISTER_ANIMATED_PROPERTIES 80 END_REGISTER_ANIMATED_PROPERTIES
81 81
82 inline SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc) 82 inline SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document& doc)
83 : SVGGraphicsElement(tagName, doc) 83 : SVGGraphicsElement(tagName, doc)
84 , m_x(LengthModeWidth) 84 , m_x(LengthModeWidth)
85 , m_y(LengthModeHeight) 85 , m_y(LengthModeHeight)
86 , m_width(LengthModeWidth, "100%") 86 , m_width(LengthModeWidth, "100%")
87 , m_height(LengthModeHeight, "100%") 87 , m_height(LengthModeHeight, "100%")
88 , m_useCurrentView(false) 88 , m_useCurrentView(false)
89 , m_zoomAndPan(SVGZoomAndPanMagnify) 89 , m_zoomAndPan(SVGZoomAndPanMagnify)
90 , m_timeContainer(SMILTimeContainer::create(this)) 90 , m_timeContainer(SMILTimeContainer::create(this))
91 { 91 {
92 ASSERT(hasTagName(SVGNames::svgTag)); 92 ASSERT(hasTagName(SVGNames::svgTag));
93 ScriptWrappable::init(this); 93 ScriptWrappable::init(this);
94 registerAnimatedPropertiesForSVGSVGElement(); 94 registerAnimatedPropertiesForSVGSVGElement();
95 } 95 }
96 96
97 PassRefPtr<SVGSVGElement> SVGSVGElement::create(const QualifiedName& tagName, Do cument* document) 97 PassRefPtr<SVGSVGElement> SVGSVGElement::create(const QualifiedName& tagName, Do cument& document)
98 { 98 {
99 return adoptRef(new SVGSVGElement(tagName, document)); 99 return adoptRef(new SVGSVGElement(tagName, document));
100 } 100 }
101 101
102 SVGSVGElement::~SVGSVGElement() 102 SVGSVGElement::~SVGSVGElement()
103 { 103 {
104 if (m_viewSpec) 104 if (m_viewSpec)
105 m_viewSpec->resetContextElement(); 105 m_viewSpec->resetContextElement();
106 // There are cases where removedFromDocument() is not called. 106 // There are cases where removedFromDocument() is not called.
107 // see ContainerNode::removeAllChildren, called by its destructor. 107 // see ContainerNode::removeAllChildren, called by its destructor.
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 continue; 769 continue;
770 770
771 Element* element = toElement(node); 771 Element* element = toElement(node);
772 if (element->getIdAttribute() == id) 772 if (element->getIdAttribute() == id)
773 return element; 773 return element;
774 } 774 }
775 return 0; 775 return 0;
776 } 776 }
777 777
778 } 778 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGSVGElement.h ('k') | Source/core/svg/SVGScriptElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698