Bug 98890 - EventHandler::handleGestureLongPress breaks compilation if CONTEXT_MENUS isn't set
Summary: EventHandler::handleGestureLongPress breaks compilation if CONTEXT_MENUS isn'...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Luciano Wolf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-10 05:45 PDT by Luciano Wolf
Modified: 2012-10-10 11:08 PDT (History)
4 users (show)

See Also:


Attachments
Proposed patch (1.58 KB, patch)
2012-10-10 05:53 PDT, Luciano Wolf
no flags Details | Formatted Diff | Diff
Another proposed patch (2.69 KB, patch)
2012-10-10 07:46 PDT, Luciano Wolf
no flags Details | Formatted Diff | Diff
Another proposed patch (1.32 KB, patch)
2012-10-10 09:11 PDT, Luciano Wolf
no flags Details | Formatted Diff | Diff
Patch for landing (1.33 KB, patch)
2012-10-10 09:54 PDT, Luciano Wolf
no flags Details | Formatted Diff | Diff
Patch for landing (1.33 KB, patch)
2012-10-10 10:03 PDT, Luciano Wolf
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luciano Wolf 2012-10-10 05:45:34 PDT
If CONTEXT_MENU isn't enabled there will be a call to "sendContextMenuEventForGesture(gestureEvent);" that is wrapped with "#if ENABLE(CONTEXT_MENU)" and the code won't compile.
Comment 1 Luciano Wolf 2012-10-10 05:53:46 PDT
Created attachment 167984 [details]
Proposed patch

Enable EventHandler::handleGestureLongPress only if CONTEXT_MENU is set
Comment 2 Build Bot 2012-10-10 05:58:30 PDT
Comment on attachment 167984 [details]
Proposed patch

Attachment 167984 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14238708
Comment 3 WebKit Review Bot 2012-10-10 05:59:31 PDT
Comment on attachment 167984 [details]
Proposed patch

Attachment 167984 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14248495
Comment 4 Early Warning System Bot 2012-10-10 06:00:42 PDT
Comment on attachment 167984 [details]
Proposed patch

Attachment 167984 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/14245514
Comment 5 Early Warning System Bot 2012-10-10 06:00:52 PDT
Comment on attachment 167984 [details]
Proposed patch

Attachment 167984 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/14252183
Comment 6 Peter Beverloo (cr-android ews) 2012-10-10 06:06:14 PDT
Comment on attachment 167984 [details]
Proposed patch

Attachment 167984 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/14245517
Comment 7 Caio Marcelo de Oliveira Filho 2012-10-10 06:31:59 PDT
Comment on attachment 167984 [details]
Proposed patch

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

> Source/WebCore/page/EventHandler.cpp:2573
> +#if ENABLE(CONTEXT_MENU)

This ifdef is in the wrong place. Shouldn't it be protecting the sendContextMenuEventForGesture() call?
Comment 8 Luciano Wolf 2012-10-10 07:46:54 PDT
Created attachment 167997 [details]
Another proposed patch
Comment 9 Luciano Wolf 2012-10-10 08:37:11 PDT
(In reply to comment #7)
> (From update of attachment 167984 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=167984&action=review
> 
> > Source/WebCore/page/EventHandler.cpp:2573
> > +#if ENABLE(CONTEXT_MENU)
> 
> This ifdef is in the wrong place. Shouldn't it be protecting the sendContextMenuEventForGesture() call?

But in this case we've to return something. If you're not ANDROID the only line remaining is this sendContextMenuEventForGesture(). Should we just return "false" (after moving ENABLE(CONTEXT_MENUS) to the proper place)?
Comment 10 Caio Marcelo de Oliveira Filho 2012-10-10 08:48:22 PDT
Comment on attachment 167984 [details]
Proposed patch

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

>>> Source/WebCore/page/EventHandler.cpp:2573
>>> +#if ENABLE(CONTEXT_MENU)
>> 
>> This ifdef is in the wrong place. Shouldn't it be protecting the sendContextMenuEventForGesture() call?
> 
> But in this case we've to return something. If you're not ANDROID the only line remaining is this sendContextMenuEventForGesture(). Should we just return "false" (after moving ENABLE(CONTEXT_MENUS) to the proper place)?

Yes. But sendContextMenuEventForGesture() is only declared if we have CONTEXT_MENUS (see EventHandler.h), so you need to guard it.

My understanding from the event handling is that if it's not defined you can simply return false here. So add an else case for the #if ENABLE(CONTEXT_MENUS) returning false should be enough.
Comment 11 Luciano Wolf 2012-10-10 09:11:50 PDT
Created attachment 168010 [details]
Another proposed patch
Comment 12 Caio Marcelo de Oliveira Filho 2012-10-10 09:48:17 PDT
Comment on attachment 168010 [details]
Another proposed patch

Let's wait the EWS just in case :-)
Comment 13 Luciano Wolf 2012-10-10 09:54:22 PDT
Created attachment 168020 [details]
Patch for landing
Comment 14 Luciano Wolf 2012-10-10 10:03:48 PDT
Created attachment 168022 [details]
Patch for landing
Comment 15 WebKit Review Bot 2012-10-10 10:50:01 PDT
Comment on attachment 168022 [details]
Patch for landing

Rejecting attachment 168022 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
it2/ChangeLog
Auto-merging Source/WebKit2/win/WebKit2.def
Failed to merge in the changes.
Patch failed at 0001 Needs internal API to return distributed nodes for InsertionPoint

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/origin/master: command returned error: 1

Died at Tools/Scripts/update-webkit line 164.

Full output: http://queues.webkit.org/results/14260093
Comment 16 Caio Marcelo de Oliveira Filho 2012-10-10 11:08:56 PDT
Committed r130930: <http://trac.webkit.org/changeset/130930>