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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 if (!isDetached()) | 150 if (!isDetached()) |
151 document()->imageUpdated(); | 151 document()->imageUpdated(); |
152 } | 152 } |
153 | 153 |
154 void ImageDocumentParser::finish() | 154 void ImageDocumentParser::finish() |
155 { | 155 { |
156 if (!isStopped() && document()->imageElement() && document()->cachedImage())
{ | 156 if (!isStopped() && document()->imageElement() && document()->cachedImage())
{ |
157 ImageResource* cachedImage = document()->cachedImage(); | 157 ImageResource* cachedImage = document()->cachedImage(); |
158 DocumentLoader* loader = document()->loader(); | 158 DocumentLoader* loader = document()->loader(); |
159 cachedImage->setResponse(loader->response()); | 159 cachedImage->setResponse(loader->response()); |
160 cachedImage->setLoadFinishTime(loader->timing().responseEnd()); | 160 cachedImage->finish(loader->timing().responseEnd()); |
161 cachedImage->finish(); | |
162 | 161 |
163 // Report the natural image size in the page title, regardless of zoom l
evel. | 162 // Report the natural image size in the page title, regardless of zoom l
evel. |
164 // At a zoom level of 1 the image is guaranteed to have an integer size. | 163 // At a zoom level of 1 the image is guaranteed to have an integer size. |
165 IntSize size = flooredIntSize(cachedImage->imageSize(LayoutObject::shoul
dRespectImageOrientation(document()->imageElement()->layoutObject()), 1.0f)); | 164 IntSize size = flooredIntSize(cachedImage->imageSize(LayoutObject::shoul
dRespectImageOrientation(document()->imageElement()->layoutObject()), 1.0f)); |
166 if (size.width()) { | 165 if (size.width()) { |
167 // Compute the title, we use the decoded filename of the resource, f
alling | 166 // Compute the title, we use the decoded filename of the resource, f
alling |
168 // back on the (decoded) hostname if there is no path. | 167 // back on the (decoded) hostname if there is no path. |
169 String fileName = decodeURLEscapeSequences(document()->url().lastPat
hComponent()); | 168 String fileName = decodeURLEscapeSequences(document()->url().lastPat
hComponent()); |
170 if (fileName.isEmpty()) | 169 if (fileName.isEmpty()) |
171 fileName = document()->url().host(); | 170 fileName = document()->url().host(); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 } | 442 } |
444 | 443 |
445 bool ImageEventListener::operator==(const EventListener& listener) const | 444 bool ImageEventListener::operator==(const EventListener& listener) const |
446 { | 445 { |
447 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) | 446 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) |
448 return m_doc == imageEventListener->m_doc; | 447 return m_doc == imageEventListener->m_doc; |
449 return false; | 448 return false; |
450 } | 449 } |
451 | 450 |
452 } // namespace blink | 451 } // namespace blink |
OLD | NEW |