<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>176034</bug_id>
          
          <creation_ts>2017-08-28 13:45:46 -0700</creation_ts>
          <short_desc>REGRESSION(r220278): Web Inspector: ContextMenu items are not getting triggered</short_desc>
          <delta_ts>2017-08-28 17:29:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Joseph Pecoraro">joepeck</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>hi</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>joepeck</cc>
    
    <cc>sam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1342925</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2017-08-28 13:45:46 -0700</bug_when>
    <thetext>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 &quot;Clear Log&quot;
  =&gt; Doesn&apos;t work


Steps to Reproduce:
1. Inspect this page
2. Show Network Tab
3. Right click the header and try to toggle any column
  =&gt; Doesn&apos;t work

Notes:
• InspectorFrontendAPI&apos;s contextMenuItemSelected is not getting called.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1342930</commentid>
    <comment_count>1</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2017-08-28 13:54:00 -0700</bug_when>
    <thetext>This appears to have regressed with: r220278
https://trac.webkit.org/changeset/220278/webkit</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1342935</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2017-08-28 14:03:41 -0700</bug_when>
    <thetext>-    if (!ScriptGlobalObject::get(state, &quot;InspectorFrontendAPI&quot;, frontendApiObject)) {
+    auto value = state.lexicalGlobalObject()-&gt;get(&amp;state, JSC::Identifier::fromString(&amp;state.vm(), &quot;InspectorFrontendHost&quot;));

InspectorFrontendAPI turned into InspectorFrontendHost!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1342973</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2017-08-28 16:09:30 -0700</bug_when>
    <thetext>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&apos;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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1342974</commentid>
    <comment_count>4</comment_count>
      <attachid>319215</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2017-08-28 16:10:33 -0700</bug_when>
    <thetext>Created attachment 319215
[PATCH] Proposed Fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1342979</commentid>
    <comment_count>5</comment_count>
      <attachid>319215</attachid>
    <who name="Devin Rousso">hi</who>
    <bug_when>2017-08-28 16:20:32 -0700</bug_when>
    <thetext>Comment on attachment 319215
[PATCH] Proposed Fix

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1342996</commentid>
    <comment_count>6</comment_count>
      <attachid>319215</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-08-28 17:27:58 -0700</bug_when>
    <thetext>Comment on attachment 319215
[PATCH] Proposed Fix

Clearing flags on attachment: 319215

Committed r221283: &lt;http://trac.webkit.org/changeset/221283&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1342997</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-08-28 17:28:00 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1343000</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-08-28 17:29:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/34122845&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>319215</attachid>
            <date>2017-08-28 16:10:33 -0700</date>
            <delta_ts>2017-08-28 17:27:58 -0700</delta_ts>
            <desc>[PATCH] Proposed Fix</desc>
            <filename>context-menu-1.patch</filename>
            <type>text/plain</type>
            <size>1562</size>
            <attacher name="Joseph Pecoraro">joepeck</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAxOWFhNzgwZDg4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