| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 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 29 matching lines...) Expand all Loading... |
| 40 const DocumentInit& initializer = DocumentInit()) { | 40 const DocumentInit& initializer = DocumentInit()) { |
| 41 return new ImageDocument(initializer); | 41 return new ImageDocument(initializer); |
| 42 } | 42 } |
| 43 | 43 |
| 44 ImageResource* cachedImage(); | 44 ImageResource* cachedImage(); |
| 45 HTMLImageElement* imageElement() const { return m_imageElement.get(); } | 45 HTMLImageElement* imageElement() const { return m_imageElement.get(); } |
| 46 | 46 |
| 47 void windowSizeChanged(); | 47 void windowSizeChanged(); |
| 48 void imageUpdated(); | 48 void imageUpdated(); |
| 49 void imageClicked(int x, int y); | 49 void imageClicked(int x, int y); |
| 50 void imageLoaded(); |
| 51 void updateImageStyle(); |
| 50 | 52 |
| 51 DECLARE_VIRTUAL_TRACE(); | 53 DECLARE_VIRTUAL_TRACE(); |
| 52 | 54 |
| 53 private: | 55 private: |
| 54 explicit ImageDocument(const DocumentInit&); | 56 explicit ImageDocument(const DocumentInit&); |
| 55 | 57 |
| 56 DocumentParser* createParser() override; | 58 DocumentParser* createParser() override; |
| 57 | 59 |
| 58 void createDocumentStructure(); | 60 void createDocumentStructure(); |
| 59 | 61 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 71 | 73 |
| 72 // Whether enough of the image has been loaded to determine its size | 74 // Whether enough of the image has been loaded to determine its size |
| 73 bool m_imageSizeIsKnown; | 75 bool m_imageSizeIsKnown; |
| 74 | 76 |
| 75 // Whether the image is shrunk to fit or not | 77 // Whether the image is shrunk to fit or not |
| 76 bool m_didShrinkImage; | 78 bool m_didShrinkImage; |
| 77 | 79 |
| 78 // Whether the image should be shrunk or not | 80 // Whether the image should be shrunk or not |
| 79 bool m_shouldShrinkImage; | 81 bool m_shouldShrinkImage; |
| 80 | 82 |
| 83 // Whether the image has finished loading or not |
| 84 bool m_imageIsLoaded; |
| 85 |
| 86 // Whether the checkerboard size has been initialized |
| 87 bool m_checkerSizeInitialized; |
| 88 |
| 89 // Width of the div parent of the image |
| 90 int m_divWidth; |
| 91 |
| 81 enum ShrinkToFitMode { Viewport, Desktop }; | 92 enum ShrinkToFitMode { Viewport, Desktop }; |
| 82 ShrinkToFitMode m_shrinkToFitMode; | 93 ShrinkToFitMode m_shrinkToFitMode; |
| 83 }; | 94 }; |
| 84 | 95 |
| 85 DEFINE_DOCUMENT_TYPE_CASTS(ImageDocument); | 96 DEFINE_DOCUMENT_TYPE_CASTS(ImageDocument); |
| 86 | 97 |
| 87 } // namespace blink | 98 } // namespace blink |
| 88 | 99 |
| 89 #endif // ImageDocument_h | 100 #endif // ImageDocument_h |
| OLD | NEW |