| 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 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 m_imageComplete = !newImage; | 316 m_imageComplete = !newImage; |
| 317 | 317 |
| 318 updateRenderer(); | 318 updateRenderer(); |
| 319 // If newImage exists and is cached, addClient() will result in the load
event | 319 // If newImage exists and is cached, addClient() will result in the load
event |
| 320 // being queued to fire. Ensure this happens after beforeload is dispatc
hed. | 320 // being queued to fire. Ensure this happens after beforeload is dispatc
hed. |
| 321 if (newImage) | 321 if (newImage) |
| 322 newImage->addClient(this); | 322 newImage->addClient(this); |
| 323 | 323 |
| 324 if (oldImage) | 324 if (oldImage) |
| 325 oldImage->removeClient(this); | 325 oldImage->removeClient(this); |
| 326 } else if (updateBehavior == UpdateSizeChanged && m_element->renderer() && m
_element->renderer()->isImage()) { | 326 } else if (updateBehavior == UpdateSizeChanged && m_element->layoutObject()
&& m_element->layoutObject()->isImage()) { |
| 327 toLayoutImage(m_element->renderer())->intrinsicSizeChanged(); | 327 toLayoutImage(m_element->layoutObject())->intrinsicSizeChanged(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 if (LayoutImageResource* imageResource = layoutImageResource()) | 330 if (LayoutImageResource* imageResource = layoutImageResource()) |
| 331 imageResource->resetAnimation(); | 331 imageResource->resetAnimation(); |
| 332 | 332 |
| 333 // Only consider updating the protection ref-count of the Element immediatel
y before returning | 333 // Only consider updating the protection ref-count of the Element immediatel
y before returning |
| 334 // from this function as doing so might result in the destruction of this Im
ageLoader. | 334 // from this function as doing so might result in the destruction of this Im
ageLoader. |
| 335 updatedHasPendingEvent(); | 335 updatedHasPendingEvent(); |
| 336 } | 336 } |
| 337 | 337 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 // Only consider updating the protection ref-count of the Element immedi
ately before returning | 431 // Only consider updating the protection ref-count of the Element immedi
ately before returning |
| 432 // from this function as doing so might result in the destruction of thi
s ImageLoader. | 432 // from this function as doing so might result in the destruction of thi
s ImageLoader. |
| 433 updatedHasPendingEvent(); | 433 updatedHasPendingEvent(); |
| 434 return; | 434 return; |
| 435 } | 435 } |
| 436 loadEventSender().dispatchEventSoon(this); | 436 loadEventSender().dispatchEventSoon(this); |
| 437 } | 437 } |
| 438 | 438 |
| 439 LayoutImageResource* ImageLoader::layoutImageResource() | 439 LayoutImageResource* ImageLoader::layoutImageResource() |
| 440 { | 440 { |
| 441 LayoutObject* renderer = m_element->renderer(); | 441 LayoutObject* renderer = m_element->layoutObject(); |
| 442 | 442 |
| 443 if (!renderer) | 443 if (!renderer) |
| 444 return 0; | 444 return 0; |
| 445 | 445 |
| 446 // We don't return style generated image because it doesn't belong to the Im
ageLoader. | 446 // We don't return style generated image because it doesn't belong to the Im
ageLoader. |
| 447 // See <https://bugs.webkit.org/show_bug.cgi?id=42840> | 447 // See <https://bugs.webkit.org/show_bug.cgi?id=42840> |
| 448 if (renderer->isImage() && !static_cast<LayoutImage*>(renderer)->isGenerated
Content()) | 448 if (renderer->isImage() && !static_cast<LayoutImage*>(renderer)->isGenerated
Content()) |
| 449 return toLayoutImage(renderer)->imageResource(); | 449 return toLayoutImage(renderer)->imageResource(); |
| 450 | 450 |
| 451 if (renderer->isSVGImage()) | 451 if (renderer->isSVGImage()) |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 #endif | 599 #endif |
| 600 } | 600 } |
| 601 | 601 |
| 602 #if ENABLE(OILPAN) | 602 #if ENABLE(OILPAN) |
| 603 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() | 603 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() |
| 604 { | 604 { |
| 605 m_loader.willRemoveClient(m_client); | 605 m_loader.willRemoveClient(m_client); |
| 606 } | 606 } |
| 607 #endif | 607 #endif |
| 608 } | 608 } |
| OLD | NEW |