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

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

Issue 191933003: [SVG] Missing image loader update on re-insert. (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 | « LayoutTests/svg/custom/image-reinsert-expected.html ('k') | no next file » | 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, 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 { 201 {
202 SVGGraphicsElement::insertedInto(rootParent); 202 SVGGraphicsElement::insertedInto(rootParent);
203 if (!rootParent->inDocument()) 203 if (!rootParent->inDocument())
204 return InsertionDone; 204 return InsertionDone;
205 205
206 // We can only resolve base URIs properly after tree insertion - hence, URI mutations while 206 // We can only resolve base URIs properly after tree insertion - hence, URI mutations while
207 // detached are deferred until this point. 207 // detached are deferred until this point.
208 if (m_needsLoaderURIUpdate) { 208 if (m_needsLoaderURIUpdate) {
209 m_imageLoader.updateFromElementIgnoringPreviousError(); 209 m_imageLoader.updateFromElementIgnoringPreviousError();
210 m_needsLoaderURIUpdate = false; 210 m_needsLoaderURIUpdate = false;
211 } else {
212 // A previous loader update may have failed to actually fetch the image if the document
213 // was inactive. In that case, force a re-update (but don't clear previo us errors).
214 if (!m_imageLoader.image() || !m_imageLoader.image()->hasImage())
pdr. 2014/03/09 00:12:41 The !m_imageLoader.image() check looks right to me
f(malita) 2014/03/09 01:35:20 Not for this particular failure - it's me getting
215 m_imageLoader.updateFromElement();
211 } 216 }
212 217
213 return InsertionDone; 218 return InsertionDone;
214 } 219 }
215 220
216 const AtomicString SVGImageElement::imageSourceURL() const 221 const AtomicString SVGImageElement::imageSourceURL() const
217 { 222 {
218 return AtomicString(hrefString()); 223 return AtomicString(hrefString());
219 } 224 }
220 225
221 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) 226 void SVGImageElement::didMoveToNewDocument(Document& oldDocument)
222 { 227 {
223 m_imageLoader.elementDidMoveToNewDocument(); 228 m_imageLoader.elementDidMoveToNewDocument();
224 SVGGraphicsElement::didMoveToNewDocument(oldDocument); 229 SVGGraphicsElement::didMoveToNewDocument(oldDocument);
225 } 230 }
226 231
227 } 232 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/image-reinsert-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698