| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 ImageResource* ImageDocument::cachedImage() | 355 ImageResource* ImageDocument::cachedImage() |
| 356 { | 356 { |
| 357 if (!m_imageElement) | 357 if (!m_imageElement) |
| 358 createDocumentStructure(); | 358 createDocumentStructure(); |
| 359 | 359 |
| 360 return m_imageElement->cachedImage(); | 360 return m_imageElement->cachedImage(); |
| 361 } | 361 } |
| 362 | 362 |
| 363 bool ImageDocument::shouldShrinkToFit() const | 363 bool ImageDocument::shouldShrinkToFit() const |
| 364 { | 364 { |
| 365 return frame()->settings()->shrinksStandaloneImagesToFit() && frame()->page(
)->mainFrame() == frame(); | 365 return frame()->settings()->shrinksStandaloneImagesToFit() && frame()->isMai
nFrame(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void ImageDocument::dispose() | 368 void ImageDocument::dispose() |
| 369 { | 369 { |
| 370 m_imageElement = 0; | 370 m_imageElement = 0; |
| 371 HTMLDocument::dispose(); | 371 HTMLDocument::dispose(); |
| 372 } | 372 } |
| 373 | 373 |
| 374 // -------- | 374 // -------- |
| 375 | 375 |
| 376 void ImageEventListener::handleEvent(ExecutionContext*, Event* event) | 376 void ImageEventListener::handleEvent(ExecutionContext*, Event* event) |
| 377 { | 377 { |
| 378 if (event->type() == EventTypeNames::resize) | 378 if (event->type() == EventTypeNames::resize) |
| 379 m_doc->windowSizeChanged(); | 379 m_doc->windowSizeChanged(); |
| 380 else if (event->type() == EventTypeNames::click && event->isMouseEvent()) { | 380 else if (event->type() == EventTypeNames::click && event->isMouseEvent()) { |
| 381 MouseEvent* mouseEvent = toMouseEvent(event); | 381 MouseEvent* mouseEvent = toMouseEvent(event); |
| 382 m_doc->imageClicked(mouseEvent->x(), mouseEvent->y()); | 382 m_doc->imageClicked(mouseEvent->x(), mouseEvent->y()); |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 | 385 |
| 386 bool ImageEventListener::operator==(const EventListener& listener) | 386 bool ImageEventListener::operator==(const EventListener& listener) |
| 387 { | 387 { |
| 388 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) | 388 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) |
| 389 return m_doc == imageEventListener->m_doc; | 389 return m_doc == imageEventListener->m_doc; |
| 390 return false; | 390 return false; |
| 391 } | 391 } |
| 392 | 392 |
| 393 } | 393 } |
| OLD | NEW |