OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. |
8 * All rights reserved. | 8 * All rights reserved. |
9 * Copyright (C) 2010 Google Inc. All rights reserved. | 9 * Copyright (C) 2010 Google Inc. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. |
(...skipping 11 matching lines...) Expand all Loading... |
22 * You should have received a copy of the GNU Library General Public License | 22 * You should have received a copy of the GNU Library General Public License |
23 * along with this library; see the file COPYING.LIB. If not, write to | 23 * along with this library; see the file COPYING.LIB. If not, write to |
24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
25 * Boston, MA 02110-1301, USA. | 25 * Boston, MA 02110-1301, USA. |
26 * | 26 * |
27 */ | 27 */ |
28 | 28 |
29 #include "core/layout/LayoutImage.h" | 29 #include "core/layout/LayoutImage.h" |
30 | 30 |
31 #include "core/HTMLNames.h" | 31 #include "core/HTMLNames.h" |
32 #include "core/fetch/ImageResource.h" | 32 #include "core/fetch/ImageResourceContent.h" |
33 #include "core/frame/FrameView.h" | 33 #include "core/frame/FrameView.h" |
34 #include "core/frame/LocalFrame.h" | 34 #include "core/frame/LocalFrame.h" |
35 #include "core/frame/UseCounter.h" | 35 #include "core/frame/UseCounter.h" |
36 #include "core/html/HTMLAreaElement.h" | 36 #include "core/html/HTMLAreaElement.h" |
37 #include "core/html/HTMLImageElement.h" | 37 #include "core/html/HTMLImageElement.h" |
38 #include "core/layout/HitTestResult.h" | 38 #include "core/layout/HitTestResult.h" |
39 #include "core/layout/LayoutView.h" | 39 #include "core/layout/LayoutView.h" |
40 #include "core/paint/ImagePainter.h" | 40 #include "core/paint/ImagePainter.h" |
41 #include "core/svg/graphics/SVGImage.h" | 41 #include "core/svg/graphics/SVGImage.h" |
42 | 42 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 if (imageResource() && imageResource()->maybeAnimated()) | 172 if (imageResource() && imageResource()->maybeAnimated()) |
173 setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull); | 173 setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull); |
174 else | 174 else |
175 setShouldDoFullPaintInvalidation(PaintInvalidationFull); | 175 setShouldDoFullPaintInvalidation(PaintInvalidationFull); |
176 | 176 |
177 // Tell any potential compositing layers that the image needs updating. | 177 // Tell any potential compositing layers that the image needs updating. |
178 contentChanged(ImageChanged); | 178 contentChanged(ImageChanged); |
179 } | 179 } |
180 | 180 |
181 void LayoutImage::imageNotifyFinished(ImageResource* newImage) { | 181 void LayoutImage::imageNotifyFinished(ImageResourceContent* newImage) { |
182 if (!m_imageResource) | 182 if (!m_imageResource) |
183 return; | 183 return; |
184 | 184 |
185 if (documentBeingDestroyed()) | 185 if (documentBeingDestroyed()) |
186 return; | 186 return; |
187 | 187 |
188 invalidateBackgroundObscurationStatus(); | 188 invalidateBackgroundObscurationStatus(); |
189 | 189 |
190 if (newImage == m_imageResource->cachedImage()) { | 190 if (newImage == m_imageResource->cachedImage()) { |
191 // tell any potential compositing layers | 191 // tell any potential compositing layers |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 bool LayoutImage::needsPreferredWidthsRecalculation() const { | 314 bool LayoutImage::needsPreferredWidthsRecalculation() const { |
315 if (LayoutReplaced::needsPreferredWidthsRecalculation()) | 315 if (LayoutReplaced::needsPreferredWidthsRecalculation()) |
316 return true; | 316 return true; |
317 return embeddedReplacedContent(); | 317 return embeddedReplacedContent(); |
318 } | 318 } |
319 | 319 |
320 LayoutReplaced* LayoutImage::embeddedReplacedContent() const { | 320 LayoutReplaced* LayoutImage::embeddedReplacedContent() const { |
321 if (!m_imageResource) | 321 if (!m_imageResource) |
322 return nullptr; | 322 return nullptr; |
323 | 323 |
324 ImageResource* cachedImage = m_imageResource->cachedImage(); | 324 ImageResourceContent* cachedImage = m_imageResource->cachedImage(); |
325 if (cachedImage && cachedImage->getImage() && | 325 if (cachedImage && cachedImage->getImage() && |
326 cachedImage->getImage()->isSVGImage()) | 326 cachedImage->getImage()->isSVGImage()) |
327 return toSVGImage(cachedImage->getImage())->embeddedReplacedContent(); | 327 return toSVGImage(cachedImage->getImage())->embeddedReplacedContent(); |
328 | 328 |
329 return nullptr; | 329 return nullptr; |
330 } | 330 } |
331 | 331 |
332 } // namespace blink | 332 } // namespace blink |
OLD | NEW |