| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 LocalFrame* frame = document()->frame(); | 130 LocalFrame* frame = document()->frame(); |
| 131 Settings* settings = frame->settings(); | 131 Settings* settings = frame->settings(); |
| 132 if (!frame->loader().client()->allowImage(!settings || settings->imagesEnabl
ed(), document()->url())) | 132 if (!frame->loader().client()->allowImage(!settings || settings->imagesEnabl
ed(), document()->url())) |
| 133 return; | 133 return; |
| 134 | 134 |
| 135 if (document()->cachedImage()) { | 135 if (document()->cachedImage()) { |
| 136 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max()); | 136 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max()); |
| 137 document()->cachedImage()->appendData(data, length); | 137 document()->cachedImage()->appendData(data, length); |
| 138 } | 138 } |
| 139 // Make sure the image renderer gets created because we need the renderer | 139 // Make sure the image layoutObject gets created because we need the layoutO
bject |
| 140 // to read the aspect ratio. See crbug.com/320244 | 140 // to read the aspect ratio. See crbug.com/320244 |
| 141 document()->updateLayoutTreeIfNeeded(); | 141 document()->updateLayoutTreeIfNeeded(); |
| 142 document()->imageUpdated(); | 142 document()->imageUpdated(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void ImageDocumentParser::finish() | 145 void ImageDocumentParser::finish() |
| 146 { | 146 { |
| 147 if (!isStopped() && document()->imageElement() && document()->cachedImage())
{ | 147 if (!isStopped() && document()->imageElement() && document()->cachedImage())
{ |
| 148 ImageResource* cachedImage = document()->cachedImage(); | 148 ImageResource* cachedImage = document()->cachedImage(); |
| 149 cachedImage->finish(); | 149 cachedImage->finish(); |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } | 425 } |
| 426 | 426 |
| 427 bool ImageEventListener::operator==(const EventListener& listener) | 427 bool ImageEventListener::operator==(const EventListener& listener) |
| 428 { | 428 { |
| 429 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) | 429 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) |
| 430 return m_doc == imageEventListener->m_doc; | 430 return m_doc == imageEventListener->m_doc; |
| 431 return false; | 431 return false; |
| 432 } | 432 } |
| 433 | 433 |
| 434 } | 434 } |
| OLD | NEW |