diff options
author | Steve Block <steveblock@google.com> | 2009-10-08 17:19:54 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-20 00:41:58 +0100 |
commit | 231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch) | |
tree | a6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /WebCore/loader/ImageDocument.cpp | |
parent | e196732677050bd463301566a68a643b6d14b907 (diff) | |
download | external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2 |
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'WebCore/loader/ImageDocument.cpp')
-rw-r--r-- | WebCore/loader/ImageDocument.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/WebCore/loader/ImageDocument.cpp b/WebCore/loader/ImageDocument.cpp index 08f2e9a..9b5598d 100644 --- a/WebCore/loader/ImageDocument.cpp +++ b/WebCore/loader/ImageDocument.cpp @@ -54,10 +54,24 @@ using namespace HTMLNames; class ImageEventListener : public EventListener { public: static PassRefPtr<ImageEventListener> create(ImageDocument* document) { return adoptRef(new ImageEventListener(document)); } - virtual void handleEvent(Event*, bool isWindowEvent); + static const ImageEventListener* cast(const EventListener* listener) + { + return listener->type() == ImageEventListenerType + ? static_cast<const ImageEventListener*>(listener) + : 0; + } + + virtual bool operator==(const EventListener& other); private: - ImageEventListener(ImageDocument* document) : m_doc(document) { } + ImageEventListener(ImageDocument* document) + : EventListener(ImageEventListenerType) + , m_doc(document) + { + } + + virtual void handleEvent(ScriptExecutionContext*, Event*); + ImageDocument* m_doc; }; @@ -344,7 +358,7 @@ bool ImageDocument::shouldShrinkToFit() const // -------- -void ImageEventListener::handleEvent(Event* event, bool) +void ImageEventListener::handleEvent(ScriptExecutionContext*, Event* event) { if (event->type() == eventNames().resizeEvent) m_doc->windowSizeChanged(); @@ -354,6 +368,13 @@ void ImageEventListener::handleEvent(Event* event, bool) } } +bool ImageEventListener::operator==(const EventListener& listener) +{ + if (const ImageEventListener* imageEventListener = ImageEventListener::cast(&listener)) + return m_doc == imageEventListener->m_doc; + return false; +} + // -------- ImageDocumentElement::~ImageDocumentElement() |