<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[213801] releases/WebKitGTK/webkit-2.16</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/213801">213801</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2017-03-13 03:09:01 -0700 (Mon, 13 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/213278">r213278</a> - [WK2] Keyboard menu key should show context menu
https://bugs.webkit.org/show_bug.cgi?id=72099

Source/WebCore:

Reviewed by Carlos Garcia Campos.

Show the context menu when the GtkWidget::popup-menu signal is
emitted. This signal is triggered by pressing a key (usually
the Menu key or the Shift + F10 shortcut) or it could be emitted on
WebKitWebView.

Test: fast/events/context-activated-by-key-event.html

Also could be tested by:

ManualTests/keyboard-menukey-event.html
ManualTests/win/contextmenu-key.html
ManualTests/win/contextmenu-key2.html

* page/EventHandler.cpp:
(WebCore::EventHandler::sendContextMenuEventForKey):
Correctly send the mouse event that used for showing the context menu.
Previously the event was immediately dispatched as it is, but this was
only the right way if some element was focused on the page. If there
was no focused element or non-empty text range then the event lacked
the right node, where it was supposed to be shown. The correct node
is determined and added to the event in the sendContextMenuEvent() so
we have to use this function to send the event.

Also use absoluteBoundingBoxRect() instead of
pixelSnappedAbsoluteClippedOverflowRect() when determining
a coordinate where to show the context menu for the currently focus
element. The latter is not returning a right box (it is bigger) which
could lead to the situation that no menu will be displayed at all,
because the HitTest won't contain the right element as the
determined coordinates could be outside of the element.
* page/EventHandler.h:

Source/WebKit2:

Reviewed by Carlos Garcia Campos.

Show the context menu when the GtkWidget::popup-menu signal is
emitted. This signal is triggered by pressing a key (usually
the Menu key or the Shift + F10 shortcut) or it could be emitted on
WebKitWebView.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
(webkit_web_view_class_init): Update the documentation for the
context-menu signal
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBasePopupMenu): Connect to the popup-menu signal and
save the event that was used to trigger the signal. If there is no
such event create a new GdkEvent with GDK_NOTHING type.
(webkitWebViewBasePopupMenu):
(webkit_web_view_base_class_init):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleContextMenuKeyEvent):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::contextMenuForKeyEvent):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Show the context menu when the GtkWidget::popup-menu signal is
emitted. This signal is triggered by pressing a key (usually
the Menu key or the Shift + F10 shortcut) or it could be emitted on
WebKitWebView.

Reviewed by Carlos Garcia Campos.

* TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp:
(testContextMenuDefaultMenu):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(WebViewTest::emitPopupMenuSignal):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h:

LayoutTests:

Reviewed by Carlos Garcia Campos.

Skip the fast/events/context-activated-by-key-event.html on Mac as it
does not have a key to activate the context menu and on iOS as well.

* platform/ios-simulator-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit216LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCorepageEventHandlercpp">releases/WebKitGTK/webkit-2.16/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCorepageEventHandlerh">releases/WebKitGTK/webkit-2.16/Source/WebCore/page/EventHandler.h</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebKit2ChangeLog">releases/WebKitGTK/webkit-2.16/Source/WebKit2/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebKit2UIProcessAPIgtkWebKitWebViewcpp">releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp">releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebKit2UIProcessWebPageProxycpp">releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebKit2UIProcessWebPageProxyh">releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebKit2WebProcessWebPageWebPagecpp">releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebKit2WebProcessWebPageWebPageh">releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebKit2WebProcessWebPageWebPagemessagesin">releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#releasesWebKitGTKwebkit216ToolsChangeLog">releases/WebKitGTK/webkit-2.16/Tools/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit216ToolsTestWebKitAPITestsWebKit2GtkTestContextMenucpp">releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit216ToolsTestWebKitAPIgtkWebKit2GtkWebViewTestcpp">releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit216ToolsTestWebKitAPIgtkWebKit2GtkWebViewTesth">releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit216LayoutTestsfasteventscontextactivatedbykeyeventexpectedtxt">releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/context-activated-by-key-event-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit216LayoutTestsfasteventscontextactivatedbykeyeventhtml">releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/context-activated-by-key-event.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit216LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2017-03-02  Tomas Popela  &lt;tpopela@redhat.com&gt;
+
+        [WK2] Keyboard menu key should show context menu
+        https://bugs.webkit.org/show_bug.cgi?id=72099
+
+        Reviewed by Carlos Garcia Campos.
+
+        Skip the fast/events/context-activated-by-key-event.html on Mac as it
+        does not have a key to activate the context menu and on iOS as well.
+
+        * platform/ios-simulator-wk2/TestExpectations:
+        * platform/mac-wk2/TestExpectations:
+        * platform/mac/TestExpectations:
+
</ins><span class="cx"> 2017-03-01  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216LayoutTestsfasteventscontextactivatedbykeyeventexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/context-activated-by-key-event-expected.txt (0 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/context-activated-by-key-event-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/context-activated-by-key-event-expected.txt        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+This tests whether the context menu is displayed on the menu key press.
+example.com
+PASS WINDOW
+PASS CONTENTEDITABLE
+PASS ELEMENT
+PASS CONTENTEDITABLE SELECTION
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit216LayoutTestsfasteventscontextactivatedbykeyeventhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/context-activated-by-key-event.html (0 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/context-activated-by-key-event.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/context-activated-by-key-event.html        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+&lt;html&gt;
+&lt;body&gt;
+&lt;div id=&quot;contenteditable&quot; contenteditable&gt;This tests whether the context menu is displayed on the menu key press.&lt;/div&gt;
+&lt;a id=&quot;link&quot; href=&quot;example.com&quot;&gt;example.com&lt;/a&gt;
+&lt;p id='result'&gt;&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+
+
+&lt;script&gt;
+function log(text) {
+  document.getElementById('result').appendChild(document.createTextNode(text));
+  document.getElementById('result').appendChild(document.createElement(&quot;br&quot;));
+}
+
+function onWindowContextMenu(event) {
+  log('PASS WINDOW');
+  event.stopPropagation();
+}
+function onContentEditableContextMenu(event) {
+  if (window.getSelection().toString())
+    log('PASS CONTENTEDITABLE SELECTION');
+  else
+    log('PASS CONTENTEDITABLE');
+  event.stopPropagation();
+}
+function onFocusedElementContextMenu(event) {
+  log('PASS ELEMENT');
+  event.stopPropagation();
+}
+
+window.addEventListener('contextmenu', onWindowContextMenu);
+document.getElementById('contenteditable').addEventListener('contextmenu', onContentEditableContextMenu);
+document.getElementById('link').addEventListener('contextmenu', onFocusedElementContextMenu);
+
+if (window.testRunner) {
+  eventSender.keyDown('menu');
+
+  var rect = document.getElementById('contenteditable').getBoundingClientRect();
+  var x = rect.left + rect.width / 2;
+  var y = rect.top + rect.height / 2;
+  eventSender.mouseMoveTo(x, y);
+  eventSender.mouseDown();
+  eventSender.mouseUp();
+  eventSender.keyDown('menu');
+
+  document.getElementById('link').focus();
+  eventSender.keyDown('menu');
+
+  window.getSelection().selectAllChildren(document.getElementById('contenteditable'));
+  eventSender.keyDown('menu');
+
+  testRunner.dumpAsText();
+}
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2017-03-02  Tomas Popela  &lt;tpopela@redhat.com&gt;
+
+        [WK2] Keyboard menu key should show context menu
+        https://bugs.webkit.org/show_bug.cgi?id=72099
+
+        Reviewed by Carlos Garcia Campos.
+
+        Show the context menu when the GtkWidget::popup-menu signal is
+        emitted. This signal is triggered by pressing a key (usually
+        the Menu key or the Shift + F10 shortcut) or it could be emitted on
+        WebKitWebView.
+
+        Test: fast/events/context-activated-by-key-event.html
+
+        Also could be tested by:
+
+        ManualTests/keyboard-menukey-event.html
+        ManualTests/win/contextmenu-key.html
+        ManualTests/win/contextmenu-key2.html
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::sendContextMenuEventForKey):
+        Correctly send the mouse event that used for showing the context menu.
+        Previously the event was immediately dispatched as it is, but this was
+        only the right way if some element was focused on the page. If there
+        was no focused element or non-empty text range then the event lacked
+        the right node, where it was supposed to be shown. The correct node
+        is determined and added to the event in the sendContextMenuEvent() so
+        we have to use this function to send the event.
+
+        Also use absoluteBoundingBoxRect() instead of
+        pixelSnappedAbsoluteClippedOverflowRect() when determining
+        a coordinate where to show the context menu for the currently focus
+        element. The latter is not returning a right box (it is bigger) which
+        could lead to the situation that no menu will be displayed at all,
+        because the HitTest won't contain the right element as the
+        determined coordinates could be outside of the element.
+        * page/EventHandler.h:
+
</ins><span class="cx"> 2017-03-02  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Crash in WebCore::CoordinatedGraphicsLayer::notifyFlushRequired
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/page/EventHandler.cpp (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/page/EventHandler.cpp        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/page/EventHandler.cpp        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -2899,8 +2899,9 @@
</span><span class="cx">         RenderBoxModelObject* box = focusedElement-&gt;renderBoxModelObject();
</span><span class="cx">         if (!box)
</span><span class="cx">             return false;
</span><del>-        IntRect clippedRect = box-&gt;pixelSnappedAbsoluteClippedOverflowRect();
-        location = IntPoint(clippedRect.x(), clippedRect.maxY() - 1);
</del><ins>+
+        IntRect boundingBoxRect = box-&gt;absoluteBoundingBoxRect(true);
+        location = IntPoint(boundingBoxRect.x(), boundingBoxRect.maxY() - 1);
</ins><span class="cx">     } else {
</span><span class="cx">         location = IntPoint(
</span><span class="cx">             rightAligned ? view-&gt;contentsWidth() - kContextMenuMargin : kContextMenuMargin,
</span><span class="lines">@@ -2932,7 +2933,7 @@
</span><span class="cx"> 
</span><span class="cx">     PlatformMouseEvent platformMouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick, NoTap);
</span><span class="cx"> 
</span><del>-    return !dispatchMouseEvent(eventNames().contextmenuEvent, targetNode, true, 0, platformMouseEvent, false);
</del><ins>+    return sendContextMenuEvent(platformMouseEvent);
</ins><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(CONTEXT_MENUS)
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebCorepageEventHandlerh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/page/EventHandler.h (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/page/EventHandler.h        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/page/EventHandler.h        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -234,7 +234,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx">     WEBCORE_EXPORT bool sendContextMenuEvent(const PlatformMouseEvent&amp;);
</span><del>-    bool sendContextMenuEventForKey();
</del><ins>+    WEBCORE_EXPORT bool sendContextMenuEventForKey();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void setMouseDownMayStartAutoscroll() { m_mouseDownMayStartAutoscroll = true; }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/ChangeLog (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/ChangeLog        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/ChangeLog        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2017-03-02  Tomas Popela  &lt;tpopela@redhat.com&gt;
+
+        [WK2] Keyboard menu key should show context menu
+        https://bugs.webkit.org/show_bug.cgi?id=72099
+
+        Reviewed by Carlos Garcia Campos.
+
+        Show the context menu when the GtkWidget::popup-menu signal is
+        emitted. This signal is triggered by pressing a key (usually
+        the Menu key or the Shift + F10 shortcut) or it could be emitted on
+        WebKitWebView.
+
+        * UIProcess/API/gtk/WebKitWebView.cpp:
+        (webkit_web_view_class_init):
+        (webkit_web_view_class_init): Update the documentation for the
+        context-menu signal
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBasePopupMenu): Connect to the popup-menu signal and
+        save the event that was used to trigger the signal. If there is no
+        such event create a new GdkEvent with GDK_NOTHING type.
+        (webkitWebViewBasePopupMenu):
+        (webkit_web_view_base_class_init):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::handleContextMenuKeyEvent):
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::contextMenuForKeyEvent):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
</ins><span class="cx"> 2017-03-01  Tomas Popela  &lt;tpopela@redhat.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Fix problems found by Coverity scan in WebPrintOperationGtk.cpp
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebKit2UIProcessAPIgtkWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -1616,6 +1616,21 @@
</span><span class="cx">      * &lt;/para&gt;&lt;/listitem&gt;
</span><span class="cx">      * &lt;/itemizedlist&gt;
</span><span class="cx">      *
</span><ins>+     * The @event is expected to be one of the following types:
+     * &lt;itemizedlist&gt;
+     * &lt;listitem&gt;&lt;para&gt;
+     * a #GdkEventButton of type %GDK_BUTTON_PRESS when the context menu
+     * was triggered with mouse.
+     * &lt;listitem&gt;&lt;para&gt;
+     * a #GdkEventKey of type %GDK_KEY_PRESS if the keyboard was used to show
+     * the menu.
+     * &lt;/para&gt;&lt;/listitem&gt;
+     * &lt;listitem&gt;&lt;para&gt;
+     * a generic #GdkEvent of type %GDK_NOTHING when the #GtkWidget:popup-menu
+     * signal was used to show the context menu.
+     * &lt;/para&gt;&lt;/listitem&gt;
+     * &lt;/itemizedlist&gt;
+     *
</ins><span class="cx">      * If the signal handler returns %FALSE the context menu represented by @context_menu
</span><span class="cx">      * will be shown, if it return %TRUE the context menu will not be shown.
</span><span class="cx">      *
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -807,6 +807,20 @@
</span><span class="cx">     return TRUE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static gboolean webkitWebViewBasePopupMenu(GtkWidget* widget)
+{
+    WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);
+    WebKitWebViewBasePrivate* priv = webViewBase-&gt;priv;
+
+    GdkEvent* currentEvent = gtk_get_current_event();
+    if (!currentEvent)
+        currentEvent = gdk_event_new(GDK_NOTHING);
+    priv-&gt;contextMenuEvent.reset(currentEvent);
+    priv-&gt;pageProxy-&gt;handleContextMenuKeyEvent();
+
+    return TRUE;
+}
+
</ins><span class="cx"> static gboolean webkitWebViewBaseMotionNotifyEvent(GtkWidget* widget, GdkEventMotion* event)
</span><span class="cx"> {
</span><span class="cx">     WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);
</span><span class="lines">@@ -1121,6 +1135,7 @@
</span><span class="cx">     widgetClass-&gt;button_press_event = webkitWebViewBaseButtonPressEvent;
</span><span class="cx">     widgetClass-&gt;button_release_event = webkitWebViewBaseButtonReleaseEvent;
</span><span class="cx">     widgetClass-&gt;scroll_event = webkitWebViewBaseScrollEvent;
</span><ins>+    widgetClass-&gt;popup_menu = webkitWebViewBasePopupMenu;
</ins><span class="cx">     widgetClass-&gt;motion_notify_event = webkitWebViewBaseMotionNotifyEvent;
</span><span class="cx">     widgetClass-&gt;enter_notify_event = webkitWebViewBaseCrossingNotifyEvent;
</span><span class="cx">     widgetClass-&gt;leave_notify_event = webkitWebViewBaseCrossingNotifyEvent;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/WebPageProxy.cpp (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/WebPageProxy.cpp        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/WebPageProxy.cpp        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -4675,6 +4675,11 @@
</span><span class="cx"> 
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
</span><span class="cx"> }
</span><ins>+
+void WebPageProxy::handleContextMenuKeyEvent()
+{
+    m_process-&gt;send(Messages::WebPage::ContextMenuForKeyEvent(), m_pageID);
+}
</ins><span class="cx"> #endif // ENABLE(CONTEXT_MENUS)
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/WebPageProxy.h (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/WebPageProxy.h        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/UIProcess/WebPageProxy.h        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -897,6 +897,7 @@
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx">     // Called by the WebContextMenuProxy.
</span><span class="cx">     void contextMenuItemSelected(const WebContextMenuItemData&amp;);
</span><ins>+    void handleContextMenuKeyEvent();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // Called by the WebOpenPanelResultListenerProxy.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -2192,6 +2192,16 @@
</span><span class="cx"> 
</span><span class="cx">     return handled;
</span><span class="cx"> }
</span><ins>+
+void WebPage::contextMenuForKeyEvent()
+{
+    corePage()-&gt;contextMenuController().clearContextMenu();
+
+    Frame&amp; frame = m_page-&gt;focusController().focusedOrMainFrame();
+    bool handled = frame.eventHandler().sendContextMenuEventForKey();
+    if (handled)
+        contextMenu()-&gt;show();
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> static bool handleMouseEvent(const WebMouseEvent&amp; mouseEvent, WebPage* page, bool onlyUpdateScrollbars)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.h (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.h        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.h        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -1059,6 +1059,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx">     void contextMenuHidden() { m_isShowingContextMenu = false; }
</span><ins>+    void contextMenuForKeyEvent();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -121,6 +121,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx">     ContextMenuHidden()
</span><ins>+    ContextMenuForKeyEvent()
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216ToolsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Tools/ChangeLog (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Tools/ChangeLog        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Tools/ChangeLog        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-03-02  Tomas Popela  &lt;tpopela@redhat.com&gt;
+
+        [WK2] Keyboard menu key should show context menu
+        https://bugs.webkit.org/show_bug.cgi?id=72099
+
+        Show the context menu when the GtkWidget::popup-menu signal is
+        emitted. This signal is triggered by pressing a key (usually
+        the Menu key or the Shift + F10 shortcut) or it could be emitted on
+        WebKitWebView.
+
+        Reviewed by Carlos Garcia Campos.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp:
+        (testContextMenuDefaultMenu):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
+        (WebViewTest::emitPopupMenuSignal):
+        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h:
+
</ins><span class="cx"> 2017-02-22  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Better handle Thread and RunLoop initialization
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216ToolsTestWebKitAPITestsWebKit2GtkTestContextMenucpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -33,10 +33,24 @@
</span><span class="cx">     void checkContextMenuEvent(GdkEvent* event)
</span><span class="cx">     {
</span><span class="cx">         g_assert(event);
</span><del>-        g_assert_cmpint(event-&gt;type, ==, GDK_BUTTON_PRESS);
-        g_assert_cmpint(event-&gt;button.button, ==, 3);
-        g_assert_cmpint(event-&gt;button.x, ==, m_menuPositionX);
-        g_assert_cmpint(event-&gt;button.y, ==, m_menuPositionY);
</del><ins>+        g_assert_cmpint(event-&gt;type, ==, m_expectedEventType);
+
+        switch (m_expectedEventType) {
+        case GDK_BUTTON_PRESS:
+            g_assert_cmpint(event-&gt;button.button, ==, 3);
+            g_assert_cmpint(event-&gt;button.x, ==, m_menuPositionX);
+            g_assert_cmpint(event-&gt;button.y, ==, m_menuPositionY);
+            break;
+        case GDK_KEY_PRESS:
+            g_assert_cmpint(event-&gt;key.keyval, ==, GDK_KEY_Menu);
+            break;
+        case GDK_NOTHING:
+            // GDK_NOTHING means that the context menu was triggered by the
+            // popup-menu signal. We don't have anything to check here.
+            break;
+        default:
+            g_assert_not_reached();
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static gboolean contextMenuCallback(WebKitWebView* webView, WebKitContextMenu* contextMenu, GdkEvent* event, WebKitHitTestResult* hitTestResult, ContextMenuTest* test)
</span><span class="lines">@@ -58,6 +72,7 @@
</span><span class="cx">     ContextMenuTest()
</span><span class="cx">         : m_menuPositionX(0)
</span><span class="cx">         , m_menuPositionY(0)
</span><ins>+        , m_expectedEventType(GDK_BUTTON_PRESS)
</ins><span class="cx">     {
</span><span class="cx">         g_signal_connect(m_webView, &quot;context-menu&quot;, G_CALLBACK(contextMenuCallback), this);
</span><span class="cx">         g_signal_connect(m_webView, &quot;context-menu-dismissed&quot;, G_CALLBACK(contextMenuDismissedCallback), this);
</span><span class="lines">@@ -199,6 +214,7 @@
</span><span class="cx"> 
</span><span class="cx">     void showContextMenuAndWaitUntilFinished()
</span><span class="cx">     {
</span><ins>+        m_expectedEventType = GDK_BUTTON_PRESS;
</ins><span class="cx">         showContextMenuAtPositionAndWaitUntilFinished(0, 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -214,8 +230,35 @@
</span><span class="cx">         g_main_loop_run(m_mainLoop);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static gboolean emitPopupMenuSignalIdleCallback(ContextMenuTest* test)
+    {
+        test-&gt;emitPopupMenuSignal();
+        return FALSE;
+    }
+
+    void showContextMenuTriggeredByPopupEventAndWaitUntilFinished()
+    {
+        m_expectedEventType = GDK_NOTHING;
+        g_idle_add(reinterpret_cast&lt;GSourceFunc&gt;(emitPopupMenuSignalIdleCallback), this);
+        g_main_loop_run(m_mainLoop);
+    }
+
+    static gboolean simulateMenuKeyIdleCallback(ContextMenuTest* test)
+    {
+        test-&gt;keyStroke(GDK_KEY_Menu);
+        return FALSE;
+    }
+
+    void showContextMenuTriggeredByContextMenuKeyAndWaitUntilFinished()
+    {
+        m_expectedEventType = GDK_KEY_PRESS;
+        g_idle_add(reinterpret_cast&lt;GSourceFunc&gt;(simulateMenuKeyIdleCallback), this);
+        g_main_loop_run(m_mainLoop);
+    }
+
</ins><span class="cx">     double m_menuPositionX;
</span><span class="cx">     double m_menuPositionY;
</span><ins>+    GdkEventType m_expectedEventType;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class ContextMenuDefaultTest: public ContextMenuTest {
</span><span class="lines">@@ -365,10 +408,8 @@
</span><span class="cx">     DefaultMenuType m_expectedMenuType;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static void testContextMenuDefaultMenu(ContextMenuDefaultTest* test, gconstpointer)
</del><ins>+static void prepareContextMenuTestView(ContextMenuDefaultTest* test)
</ins><span class="cx"> {
</span><del>-    test-&gt;showInWindowAndWaitUntilMapped();
-
</del><span class="cx">     GUniquePtr&lt;char&gt; baseDir(g_strdup_printf(&quot;file://%s/&quot;, Test::getResourcesDir().data()));
</span><span class="cx">     const char* linksHTML =
</span><span class="cx">         &quot;&lt;html&gt;&lt;body&gt;&quot;
</span><span class="lines">@@ -388,7 +429,14 @@
</span><span class="cx">         &quot;&lt;/body&gt;&lt;/html&gt;&quot;;
</span><span class="cx">     test-&gt;loadHtml(linksHTML, baseDir.get());
</span><span class="cx">     test-&gt;waitUntilLoadFinished();
</span><ins>+}
</ins><span class="cx"> 
</span><ins>+static void testContextMenuDefaultMenu(ContextMenuDefaultTest* test, gconstpointer)
+{
+    test-&gt;showInWindowAndWaitUntilMapped();
+
+    prepareContextMenuTestView(test);
+
</ins><span class="cx">     // Context menu for selection.
</span><span class="cx">     // This test should always be the first because any other click removes the selection.
</span><span class="cx">     test-&gt;m_expectedMenuType = ContextMenuDefaultTest::Selection;
</span><span class="lines">@@ -427,6 +475,26 @@
</span><span class="cx">     test-&gt;showContextMenuAtPositionAndWaitUntilFinished(5, 35);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void testPopupEventSignal(ContextMenuDefaultTest* test, gconstpointer)
+{
+    test-&gt;showInWindowAndWaitUntilMapped();
+
+    prepareContextMenuTestView(test);
+
+    test-&gt;m_expectedMenuType = ContextMenuDefaultTest::Selection;
+    test-&gt;showContextMenuTriggeredByPopupEventAndWaitUntilFinished();
+}
+
+static void testContextMenuKey(ContextMenuDefaultTest* test, gconstpointer)
+{
+    test-&gt;showInWindowAndWaitUntilMapped();
+
+    prepareContextMenuTestView(test);
+
+    test-&gt;m_expectedMenuType = ContextMenuDefaultTest::Selection;
+    test-&gt;showContextMenuTriggeredByContextMenuKeyAndWaitUntilFinished();
+}
+
</ins><span class="cx"> class ContextMenuCustomTest: public ContextMenuTest {
</span><span class="cx"> public:
</span><span class="cx">     MAKE_GLIB_TEST_FIXTURE(ContextMenuCustomTest);
</span><span class="lines">@@ -917,6 +985,8 @@
</span><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><span class="cx">     ContextMenuDefaultTest::add(&quot;WebKitWebView&quot;, &quot;default-menu&quot;, testContextMenuDefaultMenu);
</span><ins>+    ContextMenuDefaultTest::add(&quot;WebKitWebView&quot;, &quot;context-menu-key&quot;, testContextMenuKey);
+    ContextMenuDefaultTest::add(&quot;WebKitWebView&quot;, &quot;popup-event-signal&quot;, testPopupEventSignal);
</ins><span class="cx">     ContextMenuCustomTest::add(&quot;WebKitWebView&quot;, &quot;populate-menu&quot;, testContextMenuPopulateMenu);
</span><span class="cx">     ContextMenuCustomFullTest::add(&quot;WebKitWebView&quot;, &quot;custom-menu&quot;, testContextMenuCustomMenu);
</span><span class="cx">     ContextMenuDisabledTest::add(&quot;WebKitWebView&quot;, &quot;disable-menu&quot;, testContextMenuDisableMenu);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216ToolsTestWebKitAPIgtkWebKit2GtkWebViewTestcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -333,6 +333,15 @@
</span><span class="cx">     doMouseButtonEvent(GDK_BUTTON_RELEASE, x, y, button, mouseModifiers);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewTest::emitPopupMenuSignal()
+{
+    GtkWidget* viewWidget = GTK_WIDGET(m_webView);
+    g_assert(gtk_widget_get_realized(viewWidget));
+
+    gboolean handled;
+    g_signal_emit_by_name(viewWidget, &quot;popup-menu&quot;, &amp;handled);
+}
+
</ins><span class="cx"> void WebViewTest::keyStroke(unsigned keyVal, unsigned keyModifiers)
</span><span class="cx"> {
</span><span class="cx">     g_assert(m_parentWindow);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216ToolsTestWebKitAPIgtkWebKit2GtkWebViewTesth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h (213800 => 213801)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h        2017-03-13 09:55:26 UTC (rev 213800)
+++ releases/WebKitGTK/webkit-2.16/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.h        2017-03-13 10:09:01 UTC (rev 213801)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx">     void clickMouseButton(int x, int y, unsigned button = 1, unsigned mouseModifiers = 0);
</span><span class="cx">     void keyStroke(unsigned keyVal, unsigned keyModifiers = 0);
</span><span class="cx"> 
</span><ins>+    void emitPopupMenuSignal();
+
</ins><span class="cx">     WebKitJavascriptResult* runJavaScriptAndWaitUntilFinished(const char* javascript, GError**);
</span><span class="cx">     WebKitJavascriptResult* runJavaScriptFromGResourceAndWaitUntilFinished(const char* resource, GError**);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>