| 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. All r
ights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. | 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. |
| 10 * | 10 * |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 if (hasBoxDecorations() || hasMask()) | 154 if (hasBoxDecorations() || hasMask()) |
| 155 RenderReplaced::imageChanged(newImage, rect); | 155 RenderReplaced::imageChanged(newImage, rect); |
| 156 | 156 |
| 157 if (!m_imageResource) | 157 if (!m_imageResource) |
| 158 return; | 158 return; |
| 159 | 159 |
| 160 if (newImage != m_imageResource->imagePtr()) | 160 if (newImage != m_imageResource->imagePtr()) |
| 161 return; | 161 return; |
| 162 | 162 |
| 163 // FIXME: this is a quick fix for crbug.com/328069. Perhaps this is reasonab
le to keep for the long term, or | |
| 164 // perhaps it's too aggressive, and we need to identify when the image *real
ly* changed before issuing this call? | |
| 165 document().view()->scheduleAnimation(); | |
| 166 | |
| 167 // Per the spec, we let the server-sent header override srcset/other sources
of dpr. | 163 // Per the spec, we let the server-sent header override srcset/other sources
of dpr. |
| 168 // https://github.com/igrigorik/http-client-hints/blob/master/draft-grigorik
-http-client-hints-01.txt#L255 | 164 // https://github.com/igrigorik/http-client-hints/blob/master/draft-grigorik
-http-client-hints-01.txt#L255 |
| 169 if (m_imageResource->cachedImage() && m_imageResource->cachedImage()->hasDev
icePixelRatioHeaderValue()) | 165 if (m_imageResource->cachedImage() && m_imageResource->cachedImage()->hasDev
icePixelRatioHeaderValue()) |
| 170 m_imageDevicePixelRatio = 1 / m_imageResource->cachedImage()->devicePixe
lRatioHeaderValue(); | 166 m_imageDevicePixelRatio = 1 / m_imageResource->cachedImage()->devicePixe
lRatioHeaderValue(); |
| 171 | 167 |
| 172 if (!m_didIncrementVisuallyNonEmptyPixelCount) { | 168 if (!m_didIncrementVisuallyNonEmptyPixelCount) { |
| 173 // At a zoom level of 1 the image is guaranteed to have an integer size. | 169 // At a zoom level of 1 the image is guaranteed to have an integer size. |
| 174 view()->frameView()->incrementVisuallyNonEmptyPixelCount(flooredIntSize(
m_imageResource->imageSize(1.0f))); | 170 view()->frameView()->incrementVisuallyNonEmptyPixelCount(flooredIntSize(
m_imageResource->imageSize(1.0f))); |
| 175 m_didIncrementVisuallyNonEmptyPixelCount = true; | 171 m_didIncrementVisuallyNonEmptyPixelCount = true; |
| 176 } | 172 } |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 return 0; | 626 return 0; |
| 631 | 627 |
| 632 ImageResource* cachedImage = m_imageResource->cachedImage(); | 628 ImageResource* cachedImage = m_imageResource->cachedImage(); |
| 633 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) | 629 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) |
| 634 return toSVGImage(cachedImage->image())->embeddedContentBox(); | 630 return toSVGImage(cachedImage->image())->embeddedContentBox(); |
| 635 | 631 |
| 636 return 0; | 632 return 0; |
| 637 } | 633 } |
| 638 | 634 |
| 639 } // namespace WebCore | 635 } // namespace WebCore |
| OLD | NEW |