Bug 221156

Summary: [macOS] Remove support for image controls
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: PlatformAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, cdumez, changseok, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, hi, joepeck, kangil.han, kondapallykalyan, macpherson, menard, pdr, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
For EWS
thorton: review+, ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch for landing none

Description Wenson Hsieh 2021-01-29 14:01:38 PST
Remove support for image controls
Comment 1 Wenson Hsieh 2021-01-29 16:04:31 PST
Created attachment 418780 [details]
For EWS
Comment 2 Tim Horton 2021-01-29 16:19:20 PST
Comment on attachment 418780 [details]
For EWS

View in context: https://bugs.webkit.org/attachment.cgi?id=418780&action=review

> Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:100
> -@property (nonatomic, setter=_setImageControlsEnabled:) BOOL _imageControlsEnabled WK_API_AVAILABLE(macos(10.12));
> +@property (nonatomic, setter=_setImageControlsEnabled:) BOOL _imageControlsEnabled WK_API_DEPRECATED("Image controls are no longer supported", macos(10.12, WK_MAC_TBA));

Don't we have pretty strong evidence that we can just delete this?
Comment 3 Wenson Hsieh 2021-01-29 16:50:27 PST
Comment on attachment 418780 [details]
For EWS

View in context: https://bugs.webkit.org/attachment.cgi?id=418780&action=review

>> Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:100
>> +@property (nonatomic, setter=_setImageControlsEnabled:) BOOL _imageControlsEnabled WK_API_DEPRECATED("Image controls are no longer supported", macos(10.12, WK_MAC_TBA));
> 
> Don't we have pretty strong evidence that we can just delete this?

Ah, so after some more digging, it looks like Mail actually turns on this SPI for some of their web views, but then never attempts to set the corresponding attribute (x-webkit-imagemenu) on any image elements. When using web inspector to manually add the attribute, I'm able to get a button to show up when hovering over images, but it doesn't have any effect.

As such, it seems that use of this SPI by Mail was unintentional, so while we can't remove the SPI quite yet, marking it as deprecated is probably a good first step.
Comment 4 Wenson Hsieh 2021-01-29 19:44:41 PST
Created attachment 418803 [details]
Patch
Comment 5 EWS 2021-01-29 21:27:38 PST
commit-queue failed to commit attachment 418803 [details] to WebKit repository.
Comment 6 Wenson Hsieh 2021-01-30 08:31:09 PST
Created attachment 418815 [details]
Patch for landing
Comment 7 EWS 2021-01-30 10:47:49 PST
Committed r272117: <https://trac.webkit.org/changeset/272117>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418815 [details].
Comment 8 Radar WebKit Bug Importer 2021-01-30 10:48:13 PST
<rdar://problem/73794193>