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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 } | 540 } |
541 | 541 |
542 void ImageLoader::timerFired(TimerBase*) | 542 void ImageLoader::timerFired(TimerBase*) |
543 { | 543 { |
544 m_keepAlive.clear(); | 544 m_keepAlive.clear(); |
545 } | 545 } |
546 | 546 |
547 void ImageLoader::dispatchPendingEvent(ImageEventSender* eventSender) | 547 void ImageLoader::dispatchPendingEvent(ImageEventSender* eventSender) |
548 { | 548 { |
549 RESOURCE_LOADING_DVLOG(1) << "ImageLoader::dispatchPendingEvent " << this; | 549 RESOURCE_LOADING_DVLOG(1) << "ImageLoader::dispatchPendingEvent " << this; |
550 ASSERT(eventSender == &loadEventSender() || eventSender == &errorEventSender
()); | |
551 const AtomicString& eventType = eventSender->eventType(); | 550 const AtomicString& eventType = eventSender->eventType(); |
552 if (eventType == EventTypeNames::load) | 551 if (eventType == EventTypeNames::load) |
553 dispatchPendingLoadEvent(); | 552 dispatchPendingLoadEvent(); |
554 if (eventType == EventTypeNames::error) | 553 if (eventType == EventTypeNames::error) |
555 dispatchPendingErrorEvent(); | 554 dispatchPendingErrorEvent(); |
| 555 if (eventType == EventTypeNames::loadend) |
| 556 dispatchPendingLoadendEvent(); |
556 } | 557 } |
557 | 558 |
558 void ImageLoader::dispatchPendingLoadEvent() | 559 void ImageLoader::dispatchPendingLoadEvent() |
559 { | 560 { |
560 if (!m_hasPendingLoadEvent) | 561 if (!m_hasPendingLoadEvent) |
561 return; | 562 return; |
562 if (!m_image) | 563 if (!m_image) |
563 return; | 564 return; |
564 m_hasPendingLoadEvent = false; | 565 m_hasPendingLoadEvent = false; |
565 if (element()->document().frame()) | 566 if (element()->document().frame()) |
(...skipping 11 matching lines...) Expand all Loading... |
577 m_hasPendingErrorEvent = false; | 578 m_hasPendingErrorEvent = false; |
578 | 579 |
579 if (element()->document().frame()) | 580 if (element()->document().frame()) |
580 element()->dispatchEvent(Event::create(EventTypeNames::error)); | 581 element()->dispatchEvent(Event::create(EventTypeNames::error)); |
581 | 582 |
582 // Only consider updating the protection ref-count of the Element immediatel
y before returning | 583 // 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. | 584 // from this function as doing so might result in the destruction of this Im
ageLoader. |
584 updatedHasPendingEvent(); | 585 updatedHasPendingEvent(); |
585 } | 586 } |
586 | 587 |
| 588 void ImageLoader::dispatchPendingLoadendEvent() |
| 589 { |
| 590 if (element()->document().frame()) { |
| 591 dispatchLoadendEvent(); |
| 592 } |
| 593 |
| 594 updatedHasPendingEvent(); |
| 595 } |
| 596 |
587 bool ImageLoader::getImageAnimationPolicy(ImageAnimationPolicy& policy) | 597 bool ImageLoader::getImageAnimationPolicy(ImageAnimationPolicy& policy) |
588 { | 598 { |
589 if (!element()->document().settings()) | 599 if (!element()->document().settings()) |
590 return false; | 600 return false; |
591 | 601 |
592 policy = element()->document().settings()->imageAnimationPolicy(); | 602 policy = element()->document().settings()->imageAnimationPolicy(); |
593 return true; | 603 return true; |
594 } | 604 } |
595 | 605 |
596 void ImageLoader::dispatchPendingLoadEvents() | 606 void ImageLoader::dispatchPendingLoadEvents() |
597 { | 607 { |
598 loadEventSender().dispatchPendingEvents(); | 608 loadEventSender().dispatchPendingEvents(); |
599 } | 609 } |
600 | 610 |
601 void ImageLoader::dispatchPendingErrorEvents() | 611 void ImageLoader::dispatchPendingErrorEvents() |
602 { | 612 { |
603 errorEventSender().dispatchPendingEvents(); | 613 errorEventSender().dispatchPendingEvents(); |
604 } | 614 } |
605 | 615 |
606 void ImageLoader::elementDidMoveToNewDocument() | 616 void ImageLoader::elementDidMoveToNewDocument() |
607 { | 617 { |
608 if (m_loadDelayCounter) | 618 if (m_loadDelayCounter) |
609 m_loadDelayCounter->documentChanged(m_element->document()); | 619 m_loadDelayCounter->documentChanged(m_element->document()); |
610 clearFailedLoadURL(); | 620 clearFailedLoadURL(); |
611 setImage(0); | 621 setImage(0); |
612 } | 622 } |
613 | 623 |
614 } // namespace blink | 624 } // namespace blink |
OLD | NEW |