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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGImageElement.cpp

Issue 2344563002: Remove the lifetime hack in ImageLoader where it keeps its assoc element alive
Patch Set: fix Created 4 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
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, 2007, 2008, 2009 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Rob Buis <buis@kde.org>
4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> 4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
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 13 matching lines...) Expand all
24 #include "core/CSSPropertyNames.h" 24 #include "core/CSSPropertyNames.h"
25 #include "core/dom/StyleChangeReason.h" 25 #include "core/dom/StyleChangeReason.h"
26 #include "core/layout/LayoutImageResource.h" 26 #include "core/layout/LayoutImageResource.h"
27 #include "core/layout/svg/LayoutSVGImage.h" 27 #include "core/layout/svg/LayoutSVGImage.h"
28 28
29 namespace blink { 29 namespace blink {
30 30
31 inline SVGImageElement::SVGImageElement(Document& document) 31 inline SVGImageElement::SVGImageElement(Document& document)
32 : SVGGraphicsElement(SVGNames::imageTag, document) 32 : SVGGraphicsElement(SVGNames::imageTag, document)
33 , SVGURIReference(this) 33 , SVGURIReference(this)
34 , ActiveScriptWrappable(this)
34 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(SVG LengthMode::Width))) 35 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(SVG LengthMode::Width)))
35 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(SVG LengthMode::Height))) 36 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(SVG LengthMode::Height)))
36 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr eate(SVGLengthMode::Width))) 37 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr eate(SVGLengthMode::Width)))
37 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength:: create(SVGLengthMode::Height))) 38 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength:: create(SVGLengthMode::Height)))
38 , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(this, SVGName s::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())) 39 , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(this, SVGName s::preserveAspectRatioAttr, SVGPreserveAspectRatio::create()))
39 , m_imageLoader(SVGImageLoader::create(this)) 40 , m_imageLoader(SVGImageLoader::create(this))
40 , m_needsLoaderURIUpdate(true) 41 , m_needsLoaderURIUpdate(true)
41 { 42 {
42 addToPropertyMap(m_x); 43 addToPropertyMap(m_x);
43 addToPropertyMap(m_y); 44 addToPropertyMap(m_y);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 return AtomicString(hrefString()); 201 return AtomicString(hrefString());
201 } 202 }
202 203
203 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) 204 void SVGImageElement::didMoveToNewDocument(Document& oldDocument)
204 { 205 {
205 imageLoader().elementDidMoveToNewDocument(); 206 imageLoader().elementDidMoveToNewDocument();
206 SVGGraphicsElement::didMoveToNewDocument(oldDocument); 207 SVGGraphicsElement::didMoveToNewDocument(oldDocument);
207 } 208 }
208 209
209 } // namespace blink 210 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGImageElement.h ('k') | third_party/WebKit/Source/core/svg/SVGImageElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698