Address review feedback in https://github.com/WebKit/WebKit/pull/1928: This function WebPageProxy::iconForAttachment is confusing. 1) 'imageAndSize' and 'image' should be renamed to 'iconAndSize' and 'icon' since the type is IconAndSize and the data member is .icon. 2) 'size' should be part of the return value. It's super subtle that 'size' is an out parameter -- but only on one platform! 3) Look into creating an API test for this
<rdar://problem/96315732>
https://github.com/WebKit/WebKit/blob/6b7f7447287dd93b8742b5e24ab12047cf6edf48/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm#L356-L366 current code RefPtr<WebCore::ShareableBitmap> WebPageProxy::iconForAttachment(const String& fileName, const String& contentType, const String& title, FloatSize& size) { #if PLATFORM(IOS_FAMILY) auto imageAndSize = RenderThemeIOS::iconForAttachment(fileName, contentType, title); auto image = imageAndSize.icon; size = imageAndSize.size; #else auto image = RenderThemeMac::iconForAttachment(fileName, contentType, title); #endif return convertPlatformImageToBitmap(image.get(), iconSize); } Adding GoodFirstBug