| 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 |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 19 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 20 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 20 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 22 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #include "core/html/ImageDocument.h" | 25 #include "core/html/ImageDocument.h" |
| 26 | 26 |
| 27 #include <limits> |
| 27 #include "bindings/core/v8/ExceptionState.h" | 28 #include "bindings/core/v8/ExceptionState.h" |
| 28 #include "core/HTMLNames.h" | 29 #include "core/HTMLNames.h" |
| 29 #include "core/dom/RawDataDocumentParser.h" | 30 #include "core/dom/RawDataDocumentParser.h" |
| 30 #include "core/events/EventListener.h" | 31 #include "core/events/EventListener.h" |
| 31 #include "core/events/MouseEvent.h" | 32 #include "core/events/MouseEvent.h" |
| 32 #include "core/frame/FrameHost.h" | 33 #include "core/frame/FrameHost.h" |
| 33 #include "core/frame/FrameView.h" | 34 #include "core/frame/FrameView.h" |
| 34 #include "core/frame/LocalDOMWindow.h" | 35 #include "core/frame/LocalDOMWindow.h" |
| 35 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
| 36 #include "core/frame/Settings.h" | 37 #include "core/frame/Settings.h" |
| 37 #include "core/frame/UseCounter.h" | 38 #include "core/frame/UseCounter.h" |
| 38 #include "core/frame/VisualViewport.h" | 39 #include "core/frame/VisualViewport.h" |
| 39 #include "core/html/HTMLBodyElement.h" | 40 #include "core/html/HTMLBodyElement.h" |
| 40 #include "core/html/HTMLContentElement.h" | 41 #include "core/html/HTMLContentElement.h" |
| 41 #include "core/html/HTMLDivElement.h" | 42 #include "core/html/HTMLDivElement.h" |
| 42 #include "core/html/HTMLHeadElement.h" | 43 #include "core/html/HTMLHeadElement.h" |
| 43 #include "core/html/HTMLHtmlElement.h" | 44 #include "core/html/HTMLHtmlElement.h" |
| 44 #include "core/html/HTMLImageElement.h" | 45 #include "core/html/HTMLImageElement.h" |
| 45 #include "core/html/HTMLMetaElement.h" | 46 #include "core/html/HTMLMetaElement.h" |
| 46 #include "core/layout/LayoutObject.h" | 47 #include "core/layout/LayoutObject.h" |
| 47 #include "core/loader/DocumentLoader.h" | 48 #include "core/loader/DocumentLoader.h" |
| 48 #include "core/loader/FrameLoader.h" | 49 #include "core/loader/FrameLoader.h" |
| 49 #include "core/loader/FrameLoaderClient.h" | 50 #include "core/loader/FrameLoaderClient.h" |
| 50 #include "core/loader/resource/ImageResource.h" | 51 #include "core/loader/resource/ImageResource.h" |
| 51 #include "core/page/Page.h" | 52 #include "core/page/Page.h" |
| 52 #include "platform/HostWindow.h" | 53 #include "platform/HostWindow.h" |
| 53 #include "wtf/text/StringBuilder.h" | 54 #include "wtf/text/StringBuilder.h" |
| 54 #include <limits> | |
| 55 | 55 |
| 56 using namespace std; | 56 using namespace std; |
| 57 | 57 |
| 58 namespace { | 58 namespace { |
| 59 | 59 |
| 60 // The base square size is set to 10 because it rounds nicely for both the | 60 // The base square size is set to 10 because it rounds nicely for both the |
| 61 // minimum scale (0.1) and maximum scale (5.0). | 61 // minimum scale (0.1) and maximum scale (5.0). |
| 62 const int kBaseCheckerSize = 10; | 62 const int kBaseCheckerSize = 10; |
| 63 | 63 |
| 64 } // namespace | 64 } // namespace |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 } | 625 } |
| 626 | 626 |
| 627 bool ImageEventListener::operator==(const EventListener& listener) const { | 627 bool ImageEventListener::operator==(const EventListener& listener) const { |
| 628 if (const ImageEventListener* imageEventListener = | 628 if (const ImageEventListener* imageEventListener = |
| 629 ImageEventListener::cast(&listener)) | 629 ImageEventListener::cast(&listener)) |
| 630 return m_doc == imageEventListener->m_doc; | 630 return m_doc == imageEventListener->m_doc; |
| 631 return false; | 631 return false; |
| 632 } | 632 } |
| 633 | 633 |
| 634 } // namespace blink | 634 } // namespace blink |
| OLD | NEW |