Bug 138400 - Disable interaction with action menu page previews
Summary: Disable interaction with action menu page previews
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Conrad Shultz
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-11-04 18:53 PST by Conrad Shultz
Modified: 2014-11-05 12:09 PST (History)
8 users (show)

See Also:


Attachments
Patch (7.20 KB, patch)
2014-11-04 19:09 PST, Conrad Shultz
no flags Details | Formatted Diff | Diff
Patch (7.04 KB, patch)
2014-11-05 10:39 PST, Conrad Shultz
no flags Details | Formatted Diff | Diff
Patch (7.29 KB, patch)
2014-11-05 11:04 PST, Conrad Shultz
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Conrad Shultz 2014-11-04 18:53:41 PST
Previews should ignore all mouse events except scrolling.
Comment 1 Radar WebKit Bug Importer 2014-11-04 18:55:07 PST
<rdar://problem/18876437>
Comment 2 Conrad Shultz 2014-11-04 19:09:19 PST
Created attachment 240996 [details]
Patch
Comment 3 Anders Carlsson 2014-11-05 08:44:39 PST
Comment on attachment 240996 [details]
Patch

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

> Source/WebKit2/UIProcess/API/mac/WKView.mm:1211
> -    if ([self shouldIgnoreMouseEvents])
> +    if ([self _shouldIgnoreWheelEvents])

What does this do if _ignoreNonWheelMouseEvents returns false but shouldIgnoreMouseEvents returns true?
Comment 4 Conrad Shultz 2014-11-05 08:54:47 PST
(In reply to comment #3)
> Comment on attachment 240996 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=240996&action=review
> 
> > Source/WebKit2/UIProcess/API/mac/WKView.mm:1211
> > -    if ([self shouldIgnoreMouseEvents])
> > +    if ([self _shouldIgnoreWheelEvents])
> 
> What does this do if _ignoreNonWheelMouseEvents returns false but
> shouldIgnoreMouseEvents returns true?

-_shouldIgnoreWheelEvents contains the same logic that used to be in -shouldIgnoreMouseEvents.

In the new implementation, the only way the above condition can occur is if have a thumbnail view, in which case -_shouldIgnoreWheelEvents will also return true.
Comment 5 Anders Carlsson 2014-11-05 09:46:26 PST
(In reply to comment #4)
> (In reply to comment #3)
> > Comment on attachment 240996 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=240996&action=review
> > 
> > > Source/WebKit2/UIProcess/API/mac/WKView.mm:1211
> > > -    if ([self shouldIgnoreMouseEvents])
> > > +    if ([self _shouldIgnoreWheelEvents])
> > 
> > What does this do if _ignoreNonWheelMouseEvents returns false but
> > shouldIgnoreMouseEvents returns true?
> 
> -_shouldIgnoreWheelEvents contains the same logic that used to be in
> -shouldIgnoreMouseEvents.
> 
> In the new implementation, the only way the above condition can occur is if
> have a thumbnail view, in which case -_shouldIgnoreWheelEvents will also
> return true.

Does that mean that an existing WKView subclass who overrides shouldIgnoreMouseEvents and returns true will stop working?
Comment 6 Conrad Shultz 2014-11-05 10:05:16 PST
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > Comment on attachment 240996 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=240996&action=review
> > > 
> > > > Source/WebKit2/UIProcess/API/mac/WKView.mm:1211
> > > > -    if ([self shouldIgnoreMouseEvents])
> > > > +    if ([self _shouldIgnoreWheelEvents])
> > > 
> > > What does this do if _ignoreNonWheelMouseEvents returns false but
> > > shouldIgnoreMouseEvents returns true?
> > 
> > -_shouldIgnoreWheelEvents contains the same logic that used to be in
> > -shouldIgnoreMouseEvents.
> > 
> > In the new implementation, the only way the above condition can occur is if
> > have a thumbnail view, in which case -_shouldIgnoreWheelEvents will also
> > return true.
> 
> Does that mean that an existing WKView subclass who overrides
> shouldIgnoreMouseEvents and returns true will stop working?

In spite of the non-prefixed method name, -shouldIgnoreMouseEvents is purely internal and shouldn't be overridden by subclasses.
Comment 7 Anders Carlsson 2014-11-05 10:16:53 PST
Comment on attachment 240996 [details]
Patch

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

Patch looks good other than the declaration being in WKWebViewPrivate instead of WKWebViewinternal.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:157
> +@property (nonatomic, setter=_setIgnoresNonWheelMouseEvents:) BOOL _ignoresNonWheelMouseEvents;

If this is only used internally, it should go into WKWebViewInternal instead.

>>>>> Source/WebKit2/UIProcess/API/mac/WKView.mm:1211
>>>>> +    if ([self _shouldIgnoreWheelEvents])
>>>> 
>>>> What does this do if _ignoreNonWheelMouseEvents returns false but shouldIgnoreMouseEvents returns true?
>>> 
>>> -_shouldIgnoreWheelEvents contains the same logic that used to be in -shouldIgnoreMouseEvents.
>>> 
>>> In the new implementation, the only way the above condition can occur is if have a thumbnail view, in which case -_shouldIgnoreWheelEvents will also return true.
>> 
>> Does that mean that an existing WKView subclass who overrides shouldIgnoreMouseEvents and returns true will stop working?
> 
> In spite of the non-prefixed method name, -shouldIgnoreMouseEvents is purely internal and shouldn't be overridden by subclasses.

Fair enough, let's hope nobody replies on it.
Comment 8 Conrad Shultz 2014-11-05 10:30:30 PST
(In reply to comment #7)
> Comment on attachment 240996 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=240996&action=review
> 
> Patch looks good other than the declaration being in WKWebViewPrivate
> instead of WKWebViewinternal.
> 
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:157
> > +@property (nonatomic, setter=_setIgnoresNonWheelMouseEvents:) BOOL _ignoresNonWheelMouseEvents;
> 
> If this is only used internally, it should go into WKWebViewInternal instead.

Thanks, will post a new patch that fixes this.
Comment 9 Conrad Shultz 2014-11-05 10:39:36 PST
Created attachment 241040 [details]
Patch
Comment 10 Anders Carlsson 2014-11-05 10:51:54 PST
Comment on attachment 241040 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:103
> +    [webView _setIgnoresNonWheelMouseEvents:YES];

This should use property syntax.
Comment 11 Conrad Shultz 2014-11-05 11:01:42 PST
(In reply to comment #10)
> Comment on attachment 241040 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=241040&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:103
> > +    [webView _setIgnoresNonWheelMouseEvents:YES];
> 
> This should use property syntax.

That should actually be using a RetainPtr; will post a patch that addresses this.
Comment 12 Conrad Shultz 2014-11-05 11:04:34 PST
Created attachment 241043 [details]
Patch
Comment 13 WebKit Commit Bot 2014-11-05 12:09:26 PST
Comment on attachment 241043 [details]
Patch

Clearing flags on attachment: 241043

Committed r175630: <http://trac.webkit.org/changeset/175630>
Comment 14 WebKit Commit Bot 2014-11-05 12:09:30 PST
All reviewed patches have been landed.  Closing bug.