| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 if (eventType == EventTypeNames::error) | 554 if (eventType == EventTypeNames::error) |
| 555 dispatchPendingErrorEvent(); | 555 dispatchPendingErrorEvent(); |
| 556 } | 556 } |
| 557 | 557 |
| 558 void ImageLoader::dispatchPendingLoadEvent() | 558 void ImageLoader::dispatchPendingLoadEvent() |
| 559 { | 559 { |
| 560 if (!m_hasPendingLoadEvent) | 560 if (!m_hasPendingLoadEvent) |
| 561 return; | 561 return; |
| 562 if (!m_image) | 562 if (!m_image) |
| 563 return; | 563 return; |
| 564 m_hasPendingLoadEvent = false; | |
| 565 if (element()->document().frame()) | 564 if (element()->document().frame()) |
| 566 dispatchLoadEvent(); | 565 dispatchLoadEvent(); |
| 567 | 566 |
| 568 // Only consider updating the protection ref-count of the Element immediatel
y before returning | 567 // Only consider updating the protection ref-count of the Element immediatel
y before returning |
| 569 // from this function as doing so might result in the destruction of this Im
ageLoader. | 568 // from this function as doing so might result in the destruction of this Im
ageLoader. |
| 570 updatedHasPendingEvent(); | 569 updatedHasPendingEvent(); |
| 571 } | 570 } |
| 572 | 571 |
| 573 void ImageLoader::dispatchPendingErrorEvent() | 572 void ImageLoader::dispatchPendingErrorEvent() |
| 574 { | 573 { |
| 575 if (!m_hasPendingErrorEvent) | 574 if (!m_hasPendingErrorEvent) |
| 576 return; | 575 return; |
| 577 m_hasPendingErrorEvent = false; | |
| 578 | 576 |
| 579 if (element()->document().frame()) | 577 if (element()->document().frame()) |
| 580 element()->dispatchEvent(Event::create(EventTypeNames::error)); | 578 element()->dispatchEvent(Event::create(EventTypeNames::error)); |
| 581 | 579 |
| 582 // Only consider updating the protection ref-count of the Element immediatel
y before returning | 580 // Only consider updating the protection ref-count of the Element immediatel
y before returning |
| 583 // from this function as doing so might result in the destruction of this Im
ageLoader. | 581 // from this function as doing so might result in the destruction of this Im
ageLoader. |
| 584 updatedHasPendingEvent(); | 582 updatedHasPendingEvent(); |
| 585 } | 583 } |
| 586 | 584 |
| 587 bool ImageLoader::getImageAnimationPolicy(ImageAnimationPolicy& policy) | 585 bool ImageLoader::getImageAnimationPolicy(ImageAnimationPolicy& policy) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 605 | 603 |
| 606 void ImageLoader::elementDidMoveToNewDocument() | 604 void ImageLoader::elementDidMoveToNewDocument() |
| 607 { | 605 { |
| 608 if (m_loadDelayCounter) | 606 if (m_loadDelayCounter) |
| 609 m_loadDelayCounter->documentChanged(m_element->document()); | 607 m_loadDelayCounter->documentChanged(m_element->document()); |
| 610 clearFailedLoadURL(); | 608 clearFailedLoadURL(); |
| 611 setImage(0); | 609 setImage(0); |
| 612 } | 610 } |
| 613 | 611 |
| 614 } // namespace blink | 612 } // namespace blink |
| OLD | NEW |