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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 { | 123 { |
124 if (!length) | 124 if (!length) |
125 return; | 125 return; |
126 | 126 |
127 Frame* frame = document()->frame(); | 127 Frame* frame = document()->frame(); |
128 Settings* settings = frame->settings(); | 128 Settings* settings = frame->settings(); |
129 if (!frame->loader().client()->allowImage(!settings || settings->imagesEnabl
ed(), document()->url())) | 129 if (!frame->loader().client()->allowImage(!settings || settings->imagesEnabl
ed(), document()->url())) |
130 return; | 130 return; |
131 | 131 |
132 document()->cachedImage()->appendData(data, length); | 132 document()->cachedImage()->appendData(data, length); |
| 133 // Make sure the image renderer gets created because we need the renderer |
| 134 // to read the aspect ratio. See crbug.com/320244 |
| 135 document()->updateStyleIfNeeded(); |
133 document()->imageUpdated(); | 136 document()->imageUpdated(); |
134 } | 137 } |
135 | 138 |
136 void ImageDocumentParser::finish() | 139 void ImageDocumentParser::finish() |
137 { | 140 { |
138 if (!isStopped() && document()->imageElement()) { | 141 if (!isStopped() && document()->imageElement()) { |
139 ImageResource* cachedImage = document()->cachedImage(); | 142 ImageResource* cachedImage = document()->cachedImage(); |
140 cachedImage->finish(); | 143 cachedImage->finish(); |
141 cachedImage->setResponse(document()->frame()->loader().documentLoader()-
>response()); | 144 cachedImage->setResponse(document()->frame()->loader().documentLoader()-
>response()); |
142 | 145 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 385 } |
383 | 386 |
384 bool ImageEventListener::operator==(const EventListener& listener) | 387 bool ImageEventListener::operator==(const EventListener& listener) |
385 { | 388 { |
386 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) | 389 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) |
387 return m_doc == imageEventListener->m_doc; | 390 return m_doc == imageEventListener->m_doc; |
388 return false; | 391 return false; |
389 } | 392 } |
390 | 393 |
391 } | 394 } |
OLD | NEW |