RESOLVED FIXED 176034
REGRESSION(r220278): Web Inspector: ContextMenu items are not getting triggered
https://bugs.webkit.org/show_bug.cgi?id=176034
Summary REGRESSION(r220278): Web Inspector: ContextMenu items are not getting triggered
Joseph Pecoraro
Reported 2017-08-28 13:45:46 PDT
REGRESSION: Web Inspector: Checkbox ContextMenu items are not getting triggered Steps to Reproduce: 1. Inspect this page 2. Show Console 3. Evaluate something in the console so it is non-empty 4. Right click empty space and "Clear Log" => Doesn't work Steps to Reproduce: 1. Inspect this page 2. Show Network Tab 3. Right click the header and try to toggle any column => Doesn't work Notes: • InspectorFrontendAPI's contextMenuItemSelected is not getting called.
Attachments
[PATCH] Proposed Fix (1.53 KB, patch)
2017-08-28 16:10 PDT, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2017-08-28 13:54:00 PDT
This appears to have regressed with: r220278 https://trac.webkit.org/changeset/220278/webkit
Joseph Pecoraro
Comment 2 2017-08-28 14:03:41 PDT
- if (!ScriptGlobalObject::get(state, "InspectorFrontendAPI", frontendApiObject)) { + auto value = state.lexicalGlobalObject()->get(&state, JSC::Identifier::fromString(&state.vm(), "InspectorFrontendHost")); InspectorFrontendAPI turned into InspectorFrontendHost!
Joseph Pecoraro
Comment 3 2017-08-28 16:09:30 PDT
I spent a bunch of time seeing what it would take to write a test for this. In general it seems we lack tests for selecting context menu items. There are some LayoutTests to show a ContextMenu that use `eventSender.contextClick`. There are no LayoutTests to select an item in the ContextMenu, which seems okay given there might be platform differences there. In this case the Web Inspector page, not the inspected test page, is what is triggering context menus. It doesn't have `eventSender`, `internals`, etc. We can show a ContextMenu with `InspectorFrontendHost.showContextMenu`, but selecting an item is not immediately possible. My best idea would be to introduce `InspectorFrontendHost.testContextMenuSelectItemAtIndex` but I don't like that. It adds surface area to an object we want try to keep as small as possible since its APIs extend the power of the Inspector frontend page.
Joseph Pecoraro
Comment 4 2017-08-28 16:10:33 PDT
Created attachment 319215 [details] [PATCH] Proposed Fix
Devin Rousso
Comment 5 2017-08-28 16:20:32 PDT
Comment on attachment 319215 [details] [PATCH] Proposed Fix r=me
WebKit Commit Bot
Comment 6 2017-08-28 17:27:58 PDT
Comment on attachment 319215 [details] [PATCH] Proposed Fix Clearing flags on attachment: 319215 Committed r221283: <http://trac.webkit.org/changeset/221283>
WebKit Commit Bot
Comment 7 2017-08-28 17:28:00 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2017-08-28 17:29:16 PDT
Note You need to log in before you can comment on or make changes to this bug.