Changeset 187324 in webkit
- Timestamp:
- Jul 24, 2015, 12:54:42 AM (11 years ago)
- Location:
- branches/safari-601.1-branch/Source/WebKit2
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/WebPage/ios/WebPageIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-601.1-branch/Source/WebKit2/ChangeLog
r187323 r187324 1 2015-07-24 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r187250. rdar://problem/21968460 4 5 2015-07-23 Beth Dakin <bdakin@apple.com> 6 7 Should not allow previews of 1x1 images 8 https://bugs.webkit.org/show_bug.cgi?id=147237 9 -and corresponding- 10 rdar://problem/21968460 11 12 Reviewed by Tim Horton. 13 14 1x1 images are used on some sites to cover actual images, which leads to a 15 misleading preview experience. There is not any reason why you would really 16 want to preview an image this small nor any reason to believe that the 17 preview would result in anything useful. 18 * WebProcess/WebPage/ios/WebPageIOS.mm: 19 (WebKit::WebPage::getPositionInformation): 20 1 21 2015-07-24 Matthew Hanson <matthew_hanson@apple.com> 2 22 -
branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r187311 r187324 2185 2185 auto& renderImage = downcast<RenderImage>(*(element->renderer())); 2186 2186 if (renderImage.cachedImage() && !renderImage.cachedImage()->errorOccurred()) { 2187 info.imageURL = [(NSURL *)element->document().completeURL(renderImage.cachedImage()->url()) absoluteString];2188 2187 if (Image* image = renderImage.cachedImage()->imageForRenderer(&renderImage)) { 2189 info.isAnimatedImage = image->isAnimated(); 2190 FloatSize screenSizeInPixels = screenSize(); 2191 screenSizeInPixels.scale(corePage()->deviceScaleFactor()); 2192 FloatSize scaledSize = largestRectWithAspectRatioInsideRect(image->size().width() / image->size().height(), FloatRect(0, 0, screenSizeInPixels.width(), screenSizeInPixels.height())).size(); 2193 FloatSize bitmapSize = scaledSize.width() < image->size().width() ? scaledSize : image->size(); 2194 if (RefPtr<ShareableBitmap> sharedBitmap = ShareableBitmap::createShareable(IntSize(bitmapSize), ShareableBitmap::SupportsAlpha)) { 2195 auto graphicsContext = sharedBitmap->createGraphicsContext(); 2196 graphicsContext->drawImage(image, ColorSpaceDeviceRGB, FloatRect(0, 0, bitmapSize.width(), bitmapSize.height())); 2197 info.image = sharedBitmap; 2188 if (image->width() > 1 && image->height() > 1) { 2189 info.imageURL = [(NSURL *)element->document().completeURL(renderImage.cachedImage()->url()) absoluteString]; 2190 info.isAnimatedImage = image->isAnimated(); 2191 FloatSize screenSizeInPixels = screenSize(); 2192 screenSizeInPixels.scale(corePage()->deviceScaleFactor()); 2193 FloatSize scaledSize = largestRectWithAspectRatioInsideRect(image->size().width() / image->size().height(), FloatRect(0, 0, screenSizeInPixels.width(), screenSizeInPixels.height())).size(); 2194 FloatSize bitmapSize = scaledSize.width() < image->size().width() ? scaledSize : image->size(); 2195 if (RefPtr<ShareableBitmap> sharedBitmap = ShareableBitmap::createShareable(IntSize(bitmapSize), ShareableBitmap::SupportsAlpha)) { 2196 auto graphicsContext = sharedBitmap->createGraphicsContext(); 2197 graphicsContext->drawImage(image, ColorSpaceDeviceRGB, FloatRect(0, 0, bitmapSize.width(), bitmapSize.height())); 2198 info.image = sharedBitmap; 2199 } 2198 2200 } 2199 2201 }
Note:
See TracChangeset
for help on using the changeset viewer.