RESOLVED WONTFIX 111882
[Chromium] Switch ContextMenu implementation to CROSS_PLATFORM_CONTEXT_MENU
https://bugs.webkit.org/show_bug.cgi?id=111882
Summary [Chromium] Switch ContextMenu implementation to CROSS_PLATFORM_CONTEXT_MENU
Jesus Sanchez-Palencia
Reported 2013-03-08 12:07:12 PST
Chromium could easily switch to Cross platform context menu implementation and reduce Context Menu related code significantly.
Attachments
Patch (16.18 KB, patch)
2013-03-13 13:41 PDT, Jesus Sanchez-Palencia
no flags
Patch (15.99 KB, patch)
2013-03-14 13:39 PDT, Jesus Sanchez-Palencia
no flags
Patch (16.05 KB, patch)
2013-04-03 07:45 PDT, Jesus Sanchez-Palencia
benjamin: review-
Jesus Sanchez-Palencia
Comment 1 2013-03-13 13:41:13 PDT
Jesus Sanchez-Palencia
Comment 2 2013-03-14 13:39:36 PDT
Caio Marcelo de Oliveira Filho
Comment 3 2013-03-15 10:19:05 PDT
Comment on attachment 193177 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=193177&action=review What about making a ContextMenu(Item)?Common.cpp that have empty implementations for the ports that do not make use of the platform hooks for context menu? This would prevent us for having stub-only file for both EFL and Chromium here. I also think those should not be marked as NotImplemented, since it is simply a hook that will not be used. > Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:189 > - return 0; > + return defaultMenu; This looks like a change from previous behavior of this function, is it intended? > Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:374 > - return 0; > + return defaultMenu; Same as above.
Jesus Sanchez-Palencia
Comment 4 2013-03-15 10:34:29 PDT
(In reply to comment #3) > (From update of attachment 193177 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=193177&action=review > > What about making a ContextMenu(Item)?Common.cpp that have empty implementations for the ports that do not make use of the platform hooks for context menu? > > This would prevent us for having stub-only file for both EFL and Chromium here. I also think those should not be marked as NotImplemented, since it is simply a hook that will not be used. Yes sure, but there are a lot of places in WebCore where we could use stub (common) .cpp files but we just don't, so that is why I haven't added one. I will do that. > > > Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:189 > > - return 0; > > + return defaultMenu; > > This looks like a change from previous behavior of this function, is it intended? > > > Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:374 > > - return 0; > > + return defaultMenu; > > Same as above. At a first glance I thought that this wouldn't change anything since Chromium will use customizeMenu() to display the ContextMenu anyway, but now I believe that ContextMenuController should know about this null ptr just in case. I will have a look and fix that if needed.
Adam Barth
Comment 5 2013-03-21 13:32:52 PDT
Comment on attachment 193177 [details] Patch This looks great!
Adam Barth
Comment 6 2013-03-21 13:33:45 PDT
> I will have a look and fix that if needed. Ok. Sounds like we should wait for that before landing this patch.
Jesus Sanchez-Palencia
Comment 7 2013-03-22 06:59:28 PDT
(In reply to comment #6) > > I will have a look and fix that if needed. > > Ok. Sounds like we should wait for that before landing this patch. I had a better look at ContextMenuController and I believe the patch is correct the way it is. This doesn't change any behavior. The nullptr was used there to set m_contextMenu->setPlatformDescription, which in Chromium was an empty implementation. ContextMenuController always rely on having a valid m_contextMenu, and the valid checks are actually related to its items vector size. Returning the same defaultMenu here is only a way to say that there was no need to customize the menu. (In reply to comment #4) > (In reply to comment #3) > > (From update of attachment 193177 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=193177&action=review > > > > What about making a ContextMenu(Item)?Common.cpp that have empty implementations for the ports that do not make use of the platform hooks for context menu? > > > > This would prevent us for having stub-only file for both EFL and Chromium here. I also think those should not be marked as NotImplemented, since it is simply a hook that will not be used. > > Yes sure, but there are a lot of places in WebCore where we could use stub (common) .cpp files but we just don't, so that is why I haven't added one. I will do that. I will leave this for another patch, after I'm done with the other ports. Thanks for having a looking at this patch!
Jesus Sanchez-Palencia
Comment 8 2013-04-03 07:45:39 PDT
Note You need to log in before you can comment on or make changes to this bug.