<!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>[187024] trunk</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/187024">187024</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-07-20 10:42:01 -0700 (Mon, 20 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Add selection-changed signal to the WebKit2 API
https://bugs.webkit.org/show_bug.cgi?id=137116

Patch by Tomas Popela &lt;tpopela@redhat.com&gt; on 2015-07-20
Reviewed by Carlos Garcia Campos.

Source/WebKit2:

Add a new object WebKitWebEditor where the editing capabilities of a
WebPage will be grouped and exposed. Add the selection-changed signal
there (we used the same name as in WK1 API).

* PlatformGTK.cmake:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp: Added.
(didChangeSelection):
(webkitWebEditorCreate):
(webkit_web_editor_get_page):
* WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkitWebPageGetPage):
(webkit_web_page_get_editor):
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h:
* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:

Tools:

Add a new WebProcess test TestEditor that is testing the WebKitWebEditor
(namely the selection-changed signal).

* TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:
* TestWebKitAPI/Tests/WebKit2Gtk/EditorTest.cpp: Added.
(WebKitWebEditorTest::create):
(WebKitWebEditorTest::selectionChangedCallback):
(WebKitWebEditorTest::testSelectionSelectAll):
(WebKitWebEditorTest::testSelectionCollapse):
(WebKitWebEditorTest::testSelectionModifyMove):
(WebKitWebEditorTest::testSelectionModifyExtend):
(WebKitWebEditorTest::testSelectionUnselect):
(registerTests):
* TestWebKitAPI/Tests/WebKit2Gtk/TestEditor.cpp: Added.
(testWebKitWebEditorSelectionChanged):
(beforeAll):
(afterAll):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtk40sectionstxt">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebPagecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebPageh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebPagePrivateh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkwebkitwebextensionh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkCMakeListstxt">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebEditorcpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebEditorh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebEditorPrivateh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkEditorTestcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/EditorTest.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestEditorcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestEditor.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (187023 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-07-20 17:08:10 UTC (rev 187023)
+++ trunk/Source/WebKit2/ChangeLog        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2015-07-20  Tomas Popela  &lt;tpopela@redhat.com&gt;
+
+        [GTK] Add selection-changed signal to the WebKit2 API
+        https://bugs.webkit.org/show_bug.cgi?id=137116
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add a new object WebKitWebEditor where the editing capabilities of a
+        WebPage will be grouped and exposed. Add the selection-changed signal
+        there (we used the same name as in WK1 API).
+
+        * PlatformGTK.cmake:
+        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
+        * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp: Added.
+        (didChangeSelection):
+        (webkitWebEditorCreate):
+        (webkit_web_editor_get_page):
+        * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h: Added.
+        * WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h: Added.
+        * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
+        (webkitWebPageGetPage):
+        (webkit_web_page_get_editor):
+        * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
+        * WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h:
+        * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
+
</ins><span class="cx"> 2015-07-16  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebsiteDataStore operations need to grab background assertions
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (187023 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2015-07-20 17:08:10 UTC (rev 187023)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -314,6 +314,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp
</span><span class="cx">     WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp
</span><ins>+    WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp
</ins><span class="cx">     WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp
</span><span class="cx">     WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp
</span><span class="cx">     WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp
</span><span class="lines">@@ -418,6 +419,7 @@
</span><span class="cx"> set(WebKit2WebExtension_INSTALLED_HEADERS
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitFrame.h
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h
</span><ins>+    ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h
</ins><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.h
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtk40sectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt (187023 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt        2015-07-20 17:08:10 UTC (rev 187023)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -1202,6 +1202,7 @@
</span><span class="cx"> webkit_web_page_get_id
</span><span class="cx"> webkit_web_page_get_uri
</span><span class="cx"> webkit_web_page_get_main_frame
</span><ins>+webkit_web_page_get_editor
</ins><span class="cx"> 
</span><span class="cx"> &lt;SUBSECTION Standard&gt;
</span><span class="cx"> WebKitWebPageClass
</span><span class="lines">@@ -1218,6 +1219,25 @@
</span><span class="cx"> &lt;/SECTION&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;SECTION&gt;
</span><ins>+&lt;FILE&gt;WebKitWebEditor&lt;/FILE&gt;
+WebKitWebEditor
+webkit_web_editor_get_page
+
+&lt;SUBSECTION Standard&gt;
+WebKitWebEditorClass
+WEBKIT_TYPE_WEB_EDITOR
+WEBKIT_WEB_EDITOR
+WEBKIT_IS_WEB_EDITOR
+WEBKIT_WEB_EDITOR_CLASS
+WEBKIT_IS_WEB_EDITOR_CLASS
+WEBKIT_WEB_EDITOR_GET_CLASS
+
+&lt;SUBSECTION Private&gt;
+WebKitWebEditorPrivate
+webkit_web_editor_get_type
+&lt;/SECTION&gt;
+
+&lt;SECTION&gt;
</ins><span class="cx"> &lt;FILE&gt;WebKitFrame&lt;/FILE&gt;
</span><span class="cx"> WebKitFrame
</span><span class="cx"> webkit_frame_is_main_frame
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebEditorcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp (0 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+/*
+ * Copyright (C) 2015 Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2,1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebKitWebEditor.h&quot;
+
+#include &quot;WebKitPrivate.h&quot;
+#include &quot;WebKitWebEditorPrivate.h&quot;
+#include &quot;WebKitWebPagePrivate.h&quot;
+#include &quot;WKBundleAPICast.h&quot;
+
+using namespace WebKit;
+using namespace WebCore;
+
+/**
+ * SECTION: WebKitWebEditor
+ * @Short_description: Access to editing capabilities of a #WebKitWebPage
+ * @Title: WebKitWebEditor
+ * @See_also: #WebKitWebPage
+ *
+ * The WebKitWebEditor provides access to various editing capabilities of
+ * a #WebKitWebPage such as a possibility to react to the current selection in
+ * #WebKitWebPage.
+ *
+ * Since: 2.10
+ */
+enum {
+    SELECTION_CHANGED,
+
+    LAST_SIGNAL
+};
+
+struct _WebKitWebEditorPrivate {
+    WebKitWebPage* webPage;
+};
+
+static guint signals[LAST_SIGNAL] = { 0, };
+
+WEBKIT_DEFINE_TYPE(WebKitWebEditor, webkit_web_editor, G_TYPE_OBJECT)
+
+static void webkit_web_editor_class_init(WebKitWebEditorClass* klass)
+{
+    /**
+     * WebKitWebEditor::selection-changed:
+     * @editor: the #WebKitWebEditor on which the signal is emitted
+     *
+     * This signal is emitted for every selection change inside a #WebKitWebPage
+     * as well as for every caret position change as the caret is a collapsed
+     * selection.
+     *
+     * Since: 2.10
+     */
+    signals[SELECTION_CHANGED] = g_signal_new(
+        &quot;selection-changed&quot;,
+        G_TYPE_FROM_CLASS(klass),
+        G_SIGNAL_RUN_LAST,
+        0, nullptr, nullptr,
+        g_cclosure_marshal_VOID__VOID,
+        G_TYPE_NONE, 0);
+}
+
+static void didChangeSelection(WKBundlePageRef, WKStringRef /* notificationName */, const void* clientInfo)
+{
+    g_signal_emit(WEBKIT_WEB_EDITOR(clientInfo), signals[SELECTION_CHANGED], 0);
+}
+
+WebKitWebEditor* webkitWebEditorCreate(WebKitWebPage* webPage)
+{
+    WebKitWebEditor* editor = WEBKIT_WEB_EDITOR(g_object_new(WEBKIT_TYPE_WEB_EDITOR, nullptr));
+    editor-&gt;priv-&gt;webPage = webPage;
+
+    WKBundlePageEditorClientV0 editorClient = {
+        {
+            0, // version
+            editor, // clientInfo
+        },
+        nullptr, // shouldBeginEditing
+        nullptr, // shouldEndEditing
+        nullptr, // shouldInsertNode
+        nullptr, // shouldInsertText
+        nullptr, // shouldDeleteRange
+        nullptr, // shouldChangeSelectedRange
+        nullptr, // shouldApplyStyle
+        nullptr, // didBeginEditing
+        nullptr, // didEndEditing
+        nullptr, // didChange
+        didChangeSelection
+    };
+    WKBundlePageSetEditorClient(toAPI(webkitWebPageGetPage(webPage)), &amp;editorClient.base);
+
+    return editor;
+}
+
+/**
+ * webkit_web_editor_get_page:
+ * @editor: a #WebKitWebEditor
+ *
+ * Gets the #WebKitWebPage that is associated with the #WebKitWebEditor that can
+ * be used to access the #WebKitDOMDocument currently loaded into it.
+ *
+ * Returns: (transfer none): the associated #WebKitWebPage
+ *
+ * Since: 2.10
+ */
+WebKitWebPage* webkit_web_editor_get_page(WebKitWebEditor* editor)
+{
+    return editor-&gt;priv-&gt;webPage;
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebEditorh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h (0 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2015 Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2,1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT_WEB_EXTENSION_H_INSIDE__) &amp;&amp; !defined(WEBKIT2_COMPILATION)
+#error &quot;Only &lt;webkit2/webkit-web-extension.h&gt; can be included directly.&quot;
+#endif
+
+#ifndef WebKitWebEditor_h
+#define WebKitWebEditor_h
+
+#include &lt;glib-object.h&gt;
+#include &lt;webkit2/WebKitDefines.h&gt;
+#include &lt;webkit2/WebKitWebPage.h&gt;
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_WEB_EDITOR               (webkit_web_editor_get_type())
+#define WEBKIT_WEB_EDITOR(obj)               (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_EDITOR, WebKitWebEditor))
+#define WEBKIT_IS_WEB_EDITOR(obj)            (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_EDITOR))
+#define WEBKIT_WEB_EDITOR_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_WEB_EDITOR, WebKitWebEditorClass))
+#define WEBKIT_IS_WEB_EDITOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_WEB_EDITOR))
+#define WEBKIT_WEB_EDITOR_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_WEB_EDITOR, WebKitWebEditorClass))
+
+typedef struct _WebKitWebEditor        WebKitWebEditor;
+typedef struct _WebKitWebEditorClass   WebKitWebEditorClass;
+typedef struct _WebKitWebEditorPrivate WebKitWebEditorPrivate;
+
+/* Forward declarations */
+typedef struct _WebKitWebPage          WebKitWebPage;
+
+struct _WebKitWebEditor {
+    GObject parent;
+
+    WebKitWebEditorPrivate *priv;
+};
+
+struct _WebKitWebEditorClass {
+    GObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_web_editor_get_type (void);
+
+WEBKIT_API WebKitWebPage *
+webkit_web_editor_get_page (WebKitWebEditor *editor);
+
+G_END_DECLS
+
+#endif // WebKitWebEditor_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebEditorPrivatehfromrev187023trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebPagePrivateh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h (from rev 187023, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h) (0 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2015 Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitWebEditorPrivate_h
+#define WebKitWebEditorPrivate_h
+
+#include &quot;WebKitWebEditor.h&quot;
+#include &quot;WebKitWebPage.h&quot;
+
+WebKitWebEditor* webkitWebEditorCreate(WebKitWebPage*);
+
+#endif // WebKitWebEditor_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp (187023 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp        2015-07-20 17:08:10 UTC (rev 187023)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;WebKitScriptWorldPrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitURIRequestPrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitURIResponsePrivate.h&quot;
</span><ins>+#include &quot;WebKitWebEditorPrivate.h&quot;
</ins><span class="cx"> #include &quot;WebKitWebHitTestResultPrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitWebPagePrivate.h&quot;
</span><span class="cx"> #include &quot;WebProcess.h&quot;
</span><span class="lines">@@ -70,6 +71,8 @@
</span><span class="cx">     WebPage* webPage;
</span><span class="cx"> 
</span><span class="cx">     CString uri;
</span><ins>+
+    GRefPtr&lt;WebKitWebEditor&gt; webEditor;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static guint signals[LAST_SIGNAL] = { 0, };
</span><span class="lines">@@ -394,6 +397,11 @@
</span><span class="cx">         WEBKIT_TYPE_WEB_HIT_TEST_RESULT);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WebPage* webkitWebPageGetPage(WebKitWebPage *webPage)
+{
+    return webPage-&gt;priv-&gt;webPage;
+}
+
</ins><span class="cx"> WebKitWebPage* webkitWebPageCreate(WebPage* webPage)
</span><span class="cx"> {
</span><span class="cx">     WebKitWebPage* page = WEBKIT_WEB_PAGE(g_object_new(WEBKIT_TYPE_WEB_PAGE, NULL));
</span><span class="lines">@@ -575,3 +583,23 @@
</span><span class="cx"> 
</span><span class="cx">     return webkitFrameGetOrCreate(webPage-&gt;priv-&gt;webPage-&gt;mainWebFrame());
</span><span class="cx"> }
</span><ins>+
+/**
+ * webkit_web_page_get_editor:
+ * @web_page: a #WebKitWebPage
+ *
+ * Gets the #WebKitWebEditor of a #WebKitWebPage.
+ *
+ * Returns: (transfer none): the #WebKitWebEditor
+ *
+ * Since: 2.10
+ */
+WebKitWebEditor* webkit_web_page_get_editor(WebKitWebPage* webPage)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_PAGE(webPage), nullptr);
+
+    if (!webPage-&gt;priv-&gt;webEditor)
+        webPage-&gt;priv-&gt;webEditor = adoptGRef(webkitWebEditorCreate(webPage));
+
+    return webPage-&gt;priv-&gt;webEditor.get();
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h (187023 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h        2015-07-20 17:08:10 UTC (rev 187023)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &lt;glib-object.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitDefines.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitFrame.h&gt;
</span><ins>+#include &lt;webkit2/WebKitWebEditor.h&gt;
</ins><span class="cx"> #include &lt;webkitdom/webkitdom.h&gt;
</span><span class="cx"> 
</span><span class="cx"> G_BEGIN_DECLS
</span><span class="lines">@@ -42,6 +43,9 @@
</span><span class="cx"> typedef struct _WebKitWebPageClass   WebKitWebPageClass;
</span><span class="cx"> typedef struct _WebKitWebPagePrivate WebKitWebPagePrivate;
</span><span class="cx"> 
</span><ins>+/* Forward declarations */
+typedef struct _WebKitWebEditor      WebKitWebEditor;
+
</ins><span class="cx"> struct _WebKitWebPage {
</span><span class="cx">     GObject parent;
</span><span class="cx"> 
</span><span class="lines">@@ -67,6 +71,9 @@
</span><span class="cx"> WEBKIT_API WebKitFrame *
</span><span class="cx"> webkit_web_page_get_main_frame   (WebKitWebPage *web_page);
</span><span class="cx"> 
</span><ins>+WEBKIT_API WebKitWebEditor *
+webkit_web_page_get_editor       (WebKitWebPage *web_page);
+
</ins><span class="cx"> G_END_DECLS
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebPagePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h (187023 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h        2015-07-20 17:08:10 UTC (rev 187023)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -26,5 +26,6 @@
</span><span class="cx"> 
</span><span class="cx"> WebKitWebPage* webkitWebPageCreate(WebKit::WebPage*);
</span><span class="cx"> void webkitWebPageDidReceiveMessage(WebKitWebPage*, const String&amp; messageName, API::Dictionary&amp; message);
</span><ins>+WebKit::WebPage* webkitWebPageGetPage(WebKitWebPage*);
</ins><span class="cx"> 
</span><span class="cx"> #endif // WebKitWebPagePrivate_h
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkwebkitwebextensionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h (187023 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h        2015-07-20 17:08:10 UTC (rev 187023)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &lt;webkit2/WebKitURIRequest.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitURIResponse.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitVersion.h&gt;
</span><ins>+#include &lt;webkit2/WebKitWebEditor.h&gt;
</ins><span class="cx"> #include &lt;webkit2/WebKitWebExtension.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitWebHitTestResult.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitWebPage.h&gt;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (187023 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-07-20 17:08:10 UTC (rev 187023)
+++ trunk/Tools/ChangeLog        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2015-07-20  Tomas Popela  &lt;tpopela@redhat.com&gt;
+
+        [GTK] Add selection-changed signal to the WebKit2 API
+        https://bugs.webkit.org/show_bug.cgi?id=137116
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add a new WebProcess test TestEditor that is testing the WebKitWebEditor
+        (namely the selection-changed signal).
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:
+        * TestWebKitAPI/Tests/WebKit2Gtk/EditorTest.cpp: Added.
+        (WebKitWebEditorTest::create):
+        (WebKitWebEditorTest::selectionChangedCallback):
+        (WebKitWebEditorTest::testSelectionSelectAll):
+        (WebKitWebEditorTest::testSelectionCollapse):
+        (WebKitWebEditorTest::testSelectionModifyMove):
+        (WebKitWebEditorTest::testSelectionModifyExtend):
+        (WebKitWebEditorTest::testSelectionUnselect):
+        (registerTests):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestEditor.cpp: Added.
+        (testWebKitWebEditorSelectionChanged):
+        (beforeAll):
+        (afterAll):
+
</ins><span class="cx"> 2015-07-20  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Resurrect CMake build on Windows.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt (187023 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt        2015-07-20 17:08:10 UTC (rev 187023)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> endmacro()
</span><span class="cx"> 
</span><span class="cx"> ADD_WK2_TEST_WEB_EXTENSION(WebExtensionTest WebExtensionTest.cpp)
</span><del>-ADD_WK2_TEST_WEB_EXTENSION(WebProcessTest DOMNodeTest.cpp DOMNodeFilterTest.cpp DOMXPathNSResolverTest.cpp FrameTest.cpp WebProcessTest.cpp)
</del><ins>+ADD_WK2_TEST_WEB_EXTENSION(WebProcessTest DOMNodeTest.cpp DOMNodeFilterTest.cpp DOMXPathNSResolverTest.cpp FrameTest.cpp WebProcessTest.cpp EditorTest.cpp)
</ins><span class="cx"> 
</span><span class="cx"> ADD_WK2_TEST(InspectorTestServer InspectorTestServer.cpp)
</span><span class="cx"> ADD_WK2_TEST(TestAuthentication TestAuthentication.cpp)
</span><span class="lines">@@ -119,6 +119,7 @@
</span><span class="cx"> ADD_WK2_TEST(TestWebKitWebContext TestWebKitWebContext.cpp)
</span><span class="cx"> ADD_WK2_TEST(TestWebKitWebView TestWebKitWebView.cpp)
</span><span class="cx"> ADD_WK2_TEST(TestWebKitUserContentManager TestWebKitUserContentManager.cpp)
</span><ins>+ADD_WK2_TEST(TestEditor TestEditor.cpp)
</ins><span class="cx"> 
</span><span class="cx"> if (ATSPI_FOUND)
</span><span class="cx">     ADD_WK2_TEST(AccessibilityTestServer AccessibilityTestServer.cpp)
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkEditorTestcpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/EditorTest.cpp (0 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/EditorTest.cpp                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/EditorTest.cpp        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -0,0 +1,131 @@
</span><ins>+/*
+ * Copyright (C) 2015 Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+
+#include &quot;WebProcessTest.h&quot;
+#include &lt;webkit2/webkit-web-extension.h&gt;
+
+#define WEBKIT_DOM_USE_UNSTABLE_API
+#include &lt;webkitdom/WebKitDOMDOMSelection.h&gt;
+#include &lt;webkitdom/WebKitDOMDOMWindowUnstable.h&gt;
+
+class WebKitWebEditorTest : public WebProcessTest {
+public:
+    static std::unique_ptr&lt;WebProcessTest&gt; create() { return std::unique_ptr&lt;WebProcessTest&gt;(new WebKitWebEditorTest()); }
+
+private:
+    static void selectionChangedCallback(bool* selectionChanged)
+    {
+        *selectionChanged = true;
+    }
+
+    void testSelectionSelectAll(WebKitWebPage* page)
+    {
+        WebKitDOMDocument* document = webkit_web_page_get_dom_document(page);
+        g_assert(WEBKIT_DOM_IS_DOCUMENT(document));
+
+        webkit_dom_document_exec_command(document, &quot;SelectAll&quot;, false, &quot;&quot;);
+    }
+
+    void testSelectionCollapse(WebKitWebPage* page)
+    {
+        WebKitDOMDocument* document = webkit_web_page_get_dom_document(page);
+        g_assert(WEBKIT_DOM_IS_DOCUMENT(document));
+        GRefPtr&lt;WebKitDOMDOMWindow&gt; domWindow = adoptGRef(webkit_dom_document_get_default_view(document));
+        g_assert(WEBKIT_DOM_IS_DOM_WINDOW(domWindow.get()));
+        GRefPtr&lt;WebKitDOMDOMSelection&gt; domSelection = adoptGRef(webkit_dom_dom_window_get_selection(domWindow.get()));
+        g_assert(WEBKIT_DOM_IS_DOM_SELECTION(domSelection.get()));
+
+        webkit_dom_dom_selection_collapse_to_start(domSelection.get(), nullptr);
+    }
+
+    void testSelectionModifyMove(WebKitWebPage* page)
+    {
+        WebKitDOMDocument* document = webkit_web_page_get_dom_document(page);
+        g_assert(WEBKIT_DOM_IS_DOCUMENT(document));
+        GRefPtr&lt;WebKitDOMDOMWindow&gt; domWindow = adoptGRef(webkit_dom_document_get_default_view(document));
+        g_assert(WEBKIT_DOM_IS_DOM_WINDOW(domWindow.get()));
+        GRefPtr&lt;WebKitDOMDOMSelection&gt; domSelection = adoptGRef(webkit_dom_dom_window_get_selection(domWindow.get()));
+        g_assert(WEBKIT_DOM_IS_DOM_SELECTION(domSelection.get()));
+
+        webkit_dom_dom_selection_modify(domSelection.get(), &quot;move&quot;, &quot;forward&quot;, &quot;character&quot;);
+    }
+
+    void testSelectionModifyExtend(WebKitWebPage* page)
+    {
+        WebKitDOMDocument* document = webkit_web_page_get_dom_document(page);
+        g_assert(WEBKIT_DOM_IS_DOCUMENT(document));
+        GRefPtr&lt;WebKitDOMDOMWindow&gt; domWindow = adoptGRef(webkit_dom_document_get_default_view(document));
+        g_assert(WEBKIT_DOM_IS_DOM_WINDOW(domWindow.get()));
+        GRefPtr&lt;WebKitDOMDOMSelection&gt; domSelection = adoptGRef(webkit_dom_dom_window_get_selection(domWindow.get()));
+        g_assert(WEBKIT_DOM_IS_DOM_SELECTION(domSelection.get()));
+
+        webkit_dom_dom_selection_modify(domSelection.get(), &quot;extend&quot;, &quot;forward&quot;, &quot;word&quot;);
+    }
+
+    void testSelectionUnselect(WebKitWebPage* page)
+    {
+        WebKitDOMDocument* document = webkit_web_page_get_dom_document(page);
+        g_assert(WEBKIT_DOM_IS_DOCUMENT(document));
+
+        webkit_dom_document_exec_command(document, &quot;Unselect&quot;, false, &quot;&quot;);
+    }
+
+    bool runTest(const char* testName, WebKitWebPage* page) override
+    {
+        if (!strcmp(testName, &quot;selection-changed&quot;)) {
+            bool selectionChanged = false;
+
+            WebKitWebEditor* editor = webkit_web_page_get_editor(page);
+            g_assert(WEBKIT_IS_WEB_EDITOR(editor));
+            assertObjectIsDeletedWhenTestFinishes(G_OBJECT(editor));
+            g_signal_connect_swapped(editor, &quot;selection-changed&quot;, G_CALLBACK(selectionChangedCallback), &amp;selectionChanged);
+
+            testSelectionSelectAll(page);
+            g_assert(selectionChanged);
+
+            selectionChanged = false;
+            testSelectionCollapse(page);
+            g_assert(selectionChanged);
+
+            selectionChanged = false;
+            testSelectionModifyMove(page);
+            g_assert(selectionChanged);
+
+            selectionChanged = false;
+            testSelectionModifyExtend(page);
+            g_assert(selectionChanged);
+
+            selectionChanged = false;
+            testSelectionUnselect(page);
+            g_assert(selectionChanged);
+
+            return true;
+        }
+
+        g_assert_not_reached();
+        return false;
+    }
+};
+
+static void __attribute__((constructor)) registerTests()
+{
+    REGISTER_TEST(WebKitWebEditorTest, &quot;WebKitWebEditor/selection-changed&quot;);
+}
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestEditorcppfromrev187023trunkSourceWebKit2WebProcessInjectedBundleAPIgtkwebkitwebextensionh"></a>
<div class="copfile"><h4>Copied: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestEditor.cpp (from rev 187023, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h) (0 => 187024)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestEditor.cpp                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestEditor.cpp        2015-07-20 17:42:01 UTC (rev 187024)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2015 Red Hat Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2,1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+
+#include &quot;WebViewTest.h&quot;
+#include &lt;gtk/gtk.h&gt;
+#include &lt;webkit2/webkit2.h&gt;
+
+static void testWebKitWebEditorSelectionChanged(WebViewTest* test, gconstpointer)
+{
+    static const gchar* testHTML = &quot;&lt;html&gt;&lt;body&gt;All work and no play make Jack a dull boy.&lt;/body&gt;&lt;/html&gt;&quot;;
+    test-&gt;loadHtml(testHTML, nullptr);
+    test-&gt;waitUntilLoadFinished();
+
+    g_assert(test-&gt;runWebProcessTest(&quot;WebKitWebEditor&quot;, &quot;selection-changed&quot;));
+}
+
+void beforeAll()
+{
+    WebViewTest::add(&quot;WebKitWebEditor&quot;, &quot;selection-changed&quot;, testWebKitWebEditorSelectionChanged);
+}
+
+void afterAll()
+{
+}
</ins></span></pre>
</div>
</div>

</body>
</html>