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

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

Issue 963733002: [svg2] Make 'width' and 'height' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline some EX tests [Mac Win] Created 5 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
« no previous file with comments | « Source/core/layout/svg/SVGPathData.cpp ('k') | Source/core/svg/SVGLengthContext.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, 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 imageLoader().updateFromElement(ImageLoader::UpdateIgnorePreviousErr or); 152 imageLoader().updateFromElement(ImageLoader::UpdateIgnorePreviousErr or);
153 else 153 else
154 m_needsLoaderURIUpdate = true; 154 m_needsLoaderURIUpdate = true;
155 return; 155 return;
156 } 156 }
157 157
158 LayoutObject* renderer = this->layoutObject(); 158 LayoutObject* renderer = this->layoutObject();
159 if (!renderer) 159 if (!renderer)
160 return; 160 return;
161 161
162 if (isLengthAttribute) { 162 if (isLengthAttribute || attrName == SVGNames::preserveAspectRatioAttr) {
163 if (toLayoutSVGImage(renderer)->updateImageViewport()) 163 // FIXME: if isLengthAttribute then we should avoid this
164 markForLayoutAndParentResourceInvalidation(renderer); 164 // call if the viewport didn't change, however since we don't
165 return; 165 // have the computed style yet we can't use updateImageViewport.
166 } 166 // See http://crbug.com/466200.
167
168 if (attrName == SVGNames::preserveAspectRatioAttr) {
169 markForLayoutAndParentResourceInvalidation(renderer); 167 markForLayoutAndParentResourceInvalidation(renderer);
170 return; 168 return;
171 } 169 }
172 170
173 ASSERT_NOT_REACHED(); 171 ASSERT_NOT_REACHED();
174 } 172 }
175 173
176 bool SVGImageElement::selfHasRelativeLengths() const 174 bool SVGImageElement::selfHasRelativeLengths() const
177 { 175 {
178 return m_x->currentValue()->isRelative() 176 return m_x->currentValue()->isRelative()
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 return AtomicString(hrefString()); 227 return AtomicString(hrefString());
230 } 228 }
231 229
232 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) 230 void SVGImageElement::didMoveToNewDocument(Document& oldDocument)
233 { 231 {
234 imageLoader().elementDidMoveToNewDocument(); 232 imageLoader().elementDidMoveToNewDocument();
235 SVGGraphicsElement::didMoveToNewDocument(oldDocument); 233 SVGGraphicsElement::didMoveToNewDocument(oldDocument);
236 } 234 }
237 235
238 } // namespace blink 236 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/svg/SVGPathData.cpp ('k') | Source/core/svg/SVGLengthContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698