Changeset 147024 in webkit
- Timestamp:
- Mar 27, 2013 5:02:59 PM (11 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r146961 r147024 2319 2319 context.setFlag(Platform::WebContext::IsImage); 2320 2320 // FIXME: At the mean time, we only show "Save Image" when the image data is available. 2321 if (Cached Resource* cachedResource = imageElement->cachedImage()) {2322 if (cached Resource->isLoaded() && cachedResource->resourceBuffer()) {2321 if (CachedImage* cachedImage = imageElement->cachedImage()) { 2322 if (cachedImage->isLoaded() && cachedImage->resourceBuffer()) { 2323 2323 String url = stripLeadingAndTrailingHTMLSpaces(imageElement->getAttribute(HTMLNames::srcAttr).string()); 2324 2324 context.setSrc(node->document()->completeURL(url).string()); 2325 2326 String mimeType = cachedImage->response().mimeType(); 2327 if (mimeType.isEmpty()) { 2328 StringBuilder builder; 2329 String extension = cachedImage->image()->filenameExtension(); 2330 builder.append("image/"); 2331 if (extension.isEmpty()) 2332 builder.append("unknown"); 2333 else if (extension == "jpg") 2334 builder.append("jpeg"); 2335 else 2336 builder.append(extension); 2337 mimeType = builder.toString(); 2338 } 2339 context.setMimeType(mimeType); 2325 2340 } 2326 2341 } … … 5168 5183 if (!database) 5169 5184 return; 5170 5185 5171 5186 Vector<String> pluginDirectories = database->pluginDirectories(); 5172 5187 if (path.empty() || pluginDirectories.contains(String(path))) -
trunk/Source/WebKit/blackberry/ChangeLog
r146961 r147024 1 2013-03-27 Arvid Nilsson <anilsson@rim.com> 2 3 [BlackBerry] Populate the mime type of the WebContext for images 4 https://bugs.webkit.org/show_bug.cgi?id=113272 5 6 Reviewed by George Staikos. 7 8 PR 278967 9 10 Populate the mime type using the file extension reported by the image 11 decoder. This way we benefit from file type sniffing, instead of 12 relying on the mime type reported by the resource response. 13 14 * Api/WebPage.cpp: 15 (BlackBerry::WebKit::WebPagePrivate::webContext): 16 1 17 2013-03-26 Hayato Ito <hayato@chromium.org> 2 18
Note: See TracChangeset
for help on using the changeset viewer.