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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.cpp

Issue 2121973002: Fallback to 300x150 instead of 0x0 size for SVG inside content() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 4 years, 5 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) 1999 Lars Knoll <knoll@kde.org> 2 * Copyright (C) 1999 Lars Knoll <knoll@kde.org>
3 * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org> 3 * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org>
4 * Copyright (C) 2000 Dirk Mueller <mueller@kde.org> 4 * Copyright (C) 2000 Dirk Mueller <mueller@kde.org>
5 * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> 5 * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com>
6 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 6 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> 9 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
10 * 10 *
(...skipping 10 matching lines...) Expand all
21 * You should have received a copy of the GNU Library General Public License 21 * You should have received a copy of the GNU Library General Public License
22 * along with this library; see the file COPYING.LIB. If not, write to 22 * along with this library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA. 24 * Boston, MA 02110-1301, USA.
25 * 25 *
26 */ 26 */
27 27
28 #include "core/layout/LayoutImageResourceStyleImage.h" 28 #include "core/layout/LayoutImageResourceStyleImage.h"
29 29
30 #include "core/fetch/ImageResource.h" 30 #include "core/fetch/ImageResource.h"
31 #include "core/layout/LayoutReplaced.h"
31 #include "core/style/StyleFetchedImage.h" 32 #include "core/style/StyleFetchedImage.h"
32 33
33 namespace blink { 34 namespace blink {
34 35
35 LayoutImageResourceStyleImage::LayoutImageResourceStyleImage(StyleImage* styleIm age) 36 LayoutImageResourceStyleImage::LayoutImageResourceStyleImage(StyleImage* styleIm age)
36 : m_styleImage(styleImage) 37 : m_styleImage(styleImage)
37 { 38 {
38 ASSERT(m_styleImage); 39 ASSERT(m_styleImage);
39 } 40 }
40 41
(...skipping 20 matching lines...) Expand all
61 } 62 }
62 63
63 PassRefPtr<Image> LayoutImageResourceStyleImage::image(const IntSize& size, floa t zoom) const 64 PassRefPtr<Image> LayoutImageResourceStyleImage::image(const IntSize& size, floa t zoom) const
64 { 65 {
65 // Generated content may trigger calls to image() while we're still pending, don't assert but gracefully exit. 66 // Generated content may trigger calls to image() while we're still pending, don't assert but gracefully exit.
66 if (m_styleImage->isPendingImage()) 67 if (m_styleImage->isPendingImage())
67 return nullptr; 68 return nullptr;
68 return m_styleImage->image(*m_layoutObject, size, zoom); 69 return m_styleImage->image(*m_layoutObject, size, zoom);
69 } 70 }
70 71
72 LayoutSize LayoutImageResourceStyleImage::imageSize(float multiplier) const
73 {
74 // TODO(davve): Find out the correct default object size in this context.
75 return m_styleImage->imageSize(*m_layoutObject, multiplier, LayoutSize(Layou tReplaced::defaultWidth, LayoutReplaced::defaultHeight));
76 }
77
71 DEFINE_TRACE(LayoutImageResourceStyleImage) 78 DEFINE_TRACE(LayoutImageResourceStyleImage)
72 { 79 {
73 visitor->trace(m_styleImage); 80 visitor->trace(m_styleImage);
74 LayoutImageResource::trace(visitor); 81 LayoutImageResource::trace(visitor);
75 } 82 }
76 83
77 } // namespace blink 84 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698