<!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>[226264] 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/226264">226264</a></dd>
<dt>Author</dt> <dd>mcatanzaro@igalia.com</dd>
<dt>Date</dt> <dd>2017-12-22 08:11:15 -0800 (Fri, 22 Dec 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WPE][GTK] Deprecate and replace webkit_form_submission_request_get_text_fields
https://bugs.webkit.org/show_bug.cgi?id=176725

Reviewed by Carlos Garcia Campos.

Source/WebKit:

The problem is this function returns results in a GHashTable, but many fields can have the
same name, or no name at all, and those fields are currently just dropped. It's impossible
to fix, since the GHashTable is part of the API, so deprecate it and add a new function that
returns two GPtrArrays instead.

* UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:
(webkitFormSubmissionRequestCreate):
(webkit_form_submission_request_get_text_fields):
(webkit_form_submission_request_list_text_fields):
* UIProcess/API/gtk/WebKitFormSubmissionRequest.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitFormSubmissionRequest.h:

Tools:

Test the new function.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewSubmitForm):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIglibWebKitFormSubmissionRequestcpp">trunk/Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkWebKitFormSubmissionRequesth">trunk/Source/WebKit/UIProcess/API/gtk/WebKitFormSubmissionRequest.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkdocswebkit2gtk40sectionstxt">trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIwpeWebKitFormSubmissionRequesth">trunk/Source/WebKit/UIProcess/API/wpe/WebKitFormSubmissionRequest.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitGLibTestWebKitWebViewcpp">trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (226263 => 226264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2017-12-22 14:43:38 UTC (rev 226263)
+++ trunk/Source/WebKit/ChangeLog       2017-12-22 16:11:15 UTC (rev 226264)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2017-12-21  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [WPE][GTK] Deprecate and replace webkit_form_submission_request_get_text_fields
+        https://bugs.webkit.org/show_bug.cgi?id=176725
+
+        Reviewed by Carlos Garcia Campos.
+
+        The problem is this function returns results in a GHashTable, but many fields can have the
+        same name, or no name at all, and those fields are currently just dropped. It's impossible
+        to fix, since the GHashTable is part of the API, so deprecate it and add a new function that
+        returns two GPtrArrays instead.
+
+        * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:
+        (webkitFormSubmissionRequestCreate):
+        (webkit_form_submission_request_get_text_fields):
+        (webkit_form_submission_request_list_text_fields):
+        * UIProcess/API/gtk/WebKitFormSubmissionRequest.h:
+        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
+        * UIProcess/API/wpe/WebKitFormSubmissionRequest.h:
+
</ins><span class="cx"> 2017-12-21  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         ServiceWorkerThreadProxy should set the correct cookie and cache partitioning options
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIglibWebKitFormSubmissionRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp (226263 => 226264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp   2017-12-22 14:43:38 UTC (rev 226263)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitFormSubmissionRequest.cpp      2017-12-22 16:11:15 UTC (rev 226264)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #include "WebFormSubmissionListenerProxy.h"
</span><span class="cx"> #include "WebKitFormSubmissionRequestPrivate.h"
</span><span class="cx"> #include <wtf/glib/GRefPtr.h>
</span><ins>+#include <wtf/glib/GUniquePtr.h>
</ins><span class="cx"> #include <wtf/glib/WTFGType.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx"> 
</span><span class="lines">@@ -38,15 +39,15 @@
</span><span class="cx">  * When a form is about to be submitted in a #WebKitWebView, the
</span><span class="cx">  * #WebKitWebView::submit-form signal is emitted. Its request argument
</span><span class="cx">  * contains information about the text fields of the form, that are
</span><del>- * typically used to store login information, returned in a
- * #GHashTable by the webkit_form_submission_request_get_text_fields()
- * method, and you can finally submit the form with
- * webkit_form_submission_request_submit().
- *
</del><ins>+ * typically used to store login information, returned as lists by
+ * webkit_form_submission_request_list_text_fields(). You can submit the
+ * form with webkit_form_submission_request_submit().
</ins><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> struct _WebKitFormSubmissionRequestPrivate {
</span><span class="cx">     RefPtr<WebFormSubmissionListenerProxy> listener;
</span><ins>+    GRefPtr<GPtrArray> textFieldNames;
+    GRefPtr<GPtrArray> textFieldValues;
</ins><span class="cx">     GRefPtr<GHashTable> values;
</span><span class="cx">     bool handledRequest;
</span><span class="cx"> };
</span><span class="lines">@@ -74,9 +75,12 @@
</span><span class="cx"> {
</span><span class="cx">     WebKitFormSubmissionRequest* request = WEBKIT_FORM_SUBMISSION_REQUEST(g_object_new(WEBKIT_TYPE_FORM_SUBMISSION_REQUEST, nullptr));
</span><span class="cx">     if (values.size()) {
</span><del>-        request->priv->values = adoptGRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free));
-        for (const auto& pair : values)
-            g_hash_table_insert(request->priv->values.get(), g_strdup(pair.first.utf8().data()), g_strdup(pair.second.utf8().data()));
</del><ins>+        request->priv->textFieldNames = adoptGRef(g_ptr_array_new_full(values.size(), g_free));
+        request->priv->textFieldValues = adoptGRef(g_ptr_array_new_full(values.size(), g_free));
+        for (size_t i = 0; i < values.size(); i++) {
+            g_ptr_array_add(request->priv->textFieldNames.get(), g_strdup(values[i].first.utf8().data()));
+            g_ptr_array_add(request->priv->textFieldValues.get(), g_strdup(values[i].second.utf8().data()));
+        }
</ins><span class="cx">     }
</span><span class="cx">     request->priv->listener = WTFMove(listener);
</span><span class="cx">     return request;
</span><span class="lines">@@ -87,19 +91,63 @@
</span><span class="cx">  * @request: a #WebKitFormSubmissionRequest
</span><span class="cx">  *
</span><span class="cx">  * Get a #GHashTable with the values of the text fields contained in the form
</span><del>- * associated to @request.
</del><ins>+ * associated to @request. Note that fields will be missing if the form
+ * contains multiple text input elements with the same name, so this
+ * function does not reliably return all text fields.
</ins><span class="cx">  *
</span><del>- * Returns: (transfer none): a #GHashTable with the form text fields, or %NULL if the
- *    form doesn't contain text fields.
</del><ins>+ * Returns: (allow-none) (transfer none): a #GHashTable with the form
+ *    text fields, or %NULL if the form doesn't contain text fields.
+ *
+ * Deprecated: 2.20. Use webkit_form_submission_request_list_text_fields() instead.
</ins><span class="cx">  */
</span><span class="cx"> GHashTable* webkit_form_submission_request_get_text_fields(WebKitFormSubmissionRequest* request)
</span><span class="cx"> {
</span><span class="cx">     g_return_val_if_fail(WEBKIT_IS_FORM_SUBMISSION_REQUEST(request), nullptr);
</span><span class="cx"> 
</span><ins>+    if (!request->priv->values && request->priv->textFieldNames->len) {
+        request->priv->values = adoptGRef(g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free));
+        for (unsigned i = 0; i < request->priv->textFieldNames->len; i++) {
+            GUniquePtr<char> name(g_strdup(static_cast<char*>(request->priv->textFieldNames->pdata[i])));
+            GUniquePtr<char> value(g_strdup(static_cast<char*>(request->priv->textFieldValues->pdata[i])));
+            g_hash_table_insert(request->priv->values.get(), name.release(), value.release());
+        }
+    }
+
</ins><span class="cx">     return request->priv->values.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * webkit_form_submission_request_list_text_fields:
+ * @request: a #WebKitFormSubmissionRequest
+ * @field_names: (out) (optional) (element-type utf8) (transfer none):
+ *    names of the text fields in the form
+ * @field_values: (out) (optional) (element-type utf8) (transfer none):
+ *    values of the text fields in the form
+ *
+ * Get lists with the names and values of the text fields contained in
+ * the form associated to @request. Note that names and values may be
+ * %NULL.
+ *
+ * If this function returns %FALSE, then both @field_names and
+ * @field_values will be empty.
+ *
+ * Returns: %TRUE if the form contains text fields, or %FALSE otherwise
+ *
+ * Since: 2.20
+ */
+gboolean webkit_form_submission_request_list_text_fields(WebKitFormSubmissionRequest* request, GPtrArray** fieldNames, GPtrArray** fieldValues)
+{
+    g_return_val_if_fail(WEBKIT_IS_FORM_SUBMISSION_REQUEST(request), FALSE);
+
+    if (fieldNames)
+        *fieldNames = request->priv->textFieldNames.get();
+    if (fieldValues)
+        *fieldValues = request->priv->textFieldValues.get();
+
+    return !!request->priv->textFieldNames->len;
+}
+
+/**
</ins><span class="cx">  * webkit_form_submission_request_submit:
</span><span class="cx">  * @request: a #WebKitFormSubmissionRequest
</span><span class="cx">  *
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkWebKitFormSubmissionRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitFormSubmissionRequest.h (226263 => 226264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitFormSubmissionRequest.h      2017-12-22 14:43:38 UTC (rev 226263)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitFormSubmissionRequest.h 2017-12-22 16:11:15 UTC (rev 226264)
</span><span class="lines">@@ -57,13 +57,18 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WEBKIT_API GType
</span><del>-webkit_form_submission_request_get_type        (void);
</del><ins>+webkit_form_submission_request_get_type         (void);
</ins><span class="cx"> 
</span><del>-WEBKIT_API GHashTable *
-webkit_form_submission_request_get_text_fields (WebKitFormSubmissionRequest *request);
</del><ins>+WEBKIT_DEPRECATED_FOR(webkit_form_submission_request_list_text_fields) GHashTable *
+webkit_form_submission_request_get_text_fields  (WebKitFormSubmissionRequest  *request);
</ins><span class="cx"> 
</span><ins>+WEBKIT_API gboolean
+webkit_form_submission_request_list_text_fields (WebKitFormSubmissionRequest  *request,
+                                                 GPtrArray                   **field_names,
+                                                 GPtrArray                   **field_values);
+
</ins><span class="cx"> WEBKIT_API void
</span><del>-webkit_form_submission_request_submit          (WebKitFormSubmissionRequest *request);
</del><ins>+webkit_form_submission_request_submit           (WebKitFormSubmissionRequest  *request);
</ins><span class="cx"> 
</span><span class="cx"> G_END_DECLS
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkdocswebkit2gtk40sectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt (226263 => 226264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt   2017-12-22 14:43:38 UTC (rev 226263)
+++ trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt      2017-12-22 16:11:15 UTC (rev 226264)
</span><span class="lines">@@ -1238,6 +1238,7 @@
</span><span class="cx"> <FILE>WebKitFormSubmissionRequest</FILE>
</span><span class="cx"> WebKitFormSubmissionRequest
</span><span class="cx"> webkit_form_submission_request_get_text_fields
</span><ins>+webkit_form_submission_request_list_text_fields
</ins><span class="cx"> webkit_form_submission_request_submit
</span><span class="cx"> 
</span><span class="cx"> <SUBSECTION Standard>
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIwpeWebKitFormSubmissionRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/wpe/WebKitFormSubmissionRequest.h (226263 => 226264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/wpe/WebKitFormSubmissionRequest.h      2017-12-22 14:43:38 UTC (rev 226263)
+++ trunk/Source/WebKit/UIProcess/API/wpe/WebKitFormSubmissionRequest.h 2017-12-22 16:11:15 UTC (rev 226264)
</span><span class="lines">@@ -57,13 +57,18 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WEBKIT_API GType
</span><del>-webkit_form_submission_request_get_type        (void);
</del><ins>+webkit_form_submission_request_get_type         (void);
</ins><span class="cx"> 
</span><del>-WEBKIT_API GHashTable *
-webkit_form_submission_request_get_text_fields (WebKitFormSubmissionRequest *request);
</del><ins>+WEBKIT_DEPRECATED_FOR(webkit_form_submission_request_list_text_fields) GHashTable *
+webkit_form_submission_request_get_text_fields  (WebKitFormSubmissionRequest  *request);
</ins><span class="cx"> 
</span><ins>+WEBKIT_API gboolean
+webkit_form_submission_request_list_text_fields (WebKitFormSubmissionRequest  *request,
+                                                 GPtrArray                   **field_names,
+                                                 GPtrArray                   **field_values);
+
</ins><span class="cx"> WEBKIT_API void
</span><del>-webkit_form_submission_request_submit          (WebKitFormSubmissionRequest *request);
</del><ins>+webkit_form_submission_request_submit           (WebKitFormSubmissionRequest  *request);
</ins><span class="cx"> 
</span><span class="cx"> G_END_DECLS
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (226263 => 226264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2017-12-22 14:43:38 UTC (rev 226263)
+++ trunk/Tools/ChangeLog       2017-12-22 16:11:15 UTC (rev 226264)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-12-21  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [WPE][GTK] Deprecate and replace webkit_form_submission_request_get_text_fields
+        https://bugs.webkit.org/show_bug.cgi?id=176725
+
+        Reviewed by Carlos Garcia Campos.
+
+        Test the new function.
+
+        * TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
+        (testWebViewSubmitForm):
+
</ins><span class="cx"> 2017-12-22  Jonathan Bedard  <jbedard@apple.com>
</span><span class="cx"> 
</span><span class="cx">         webkitpy: Refactor simulator code (Part 1)
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitGLibTestWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp (226263 => 226264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp 2017-12-22 14:43:38 UTC (rev 226263)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp    2017-12-22 16:11:15 UTC (rev 226264)
</span><span class="lines">@@ -475,12 +475,28 @@
</span><span class="cx">         quitMainLoop();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    GHashTable* waitUntilFormSubmittedAndGetTextFields()
</del><ins>+    GHashTable* getTextFieldsAsHashTable()
</ins><span class="cx">     {
</span><del>-        g_main_loop_run(m_mainLoop);
</del><ins>+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
</ins><span class="cx">         return webkit_form_submission_request_get_text_fields(m_request.get());
</span><ins>+#pragma GCC diagnostic pop
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    GPtrArray* getTextFieldNames()
+    {
+        GPtrArray* names;
+        webkit_form_submission_request_list_text_fields(m_request.get(), &names, nullptr);
+        return names;
+    }
+
+    GPtrArray* getTextFieldValues()
+    {
+        GPtrArray* values;
+        webkit_form_submission_request_list_text_fields(m_request.get(), nullptr, &values);
+        return values;
+    }
+
</ins><span class="cx">     static gboolean doClickIdleCallback(FormClientTest* test)
</span><span class="cx">     {
</span><span class="cx">         test->clickMouseButton(test->m_submitPositionX, test->m_submitPositionY, 1);
</span><span class="lines">@@ -492,6 +508,7 @@
</span><span class="cx">         m_submitPositionX = x;
</span><span class="cx">         m_submitPositionY = y;
</span><span class="cx">         g_idle_add(reinterpret_cast<GSourceFunc>(doClickIdleCallback), this);
</span><ins>+        g_main_loop_run(m_mainLoop);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     int m_submitPositionX;
</span><span class="lines">@@ -508,6 +525,8 @@
</span><span class="cx">         " <form action='#'>"
</span><span class="cx">         "  <input type='text' name='text1' value='value1'>"
</span><span class="cx">         "  <input type='text' name='text2' value='value2'>"
</span><ins>+        "  <input type='text' value='value3'>"
+        "  <input type='text' name='text2'>"
</ins><span class="cx">         "  <input type='password' name='password' value='secret'>"
</span><span class="cx">         "  <textarea cols='5' rows='5' name='textarea'>Text</textarea>"
</span><span class="cx">         "  <input type='hidden' name='hidden1' value='hidden1'>"
</span><span class="lines">@@ -519,12 +538,31 @@
</span><span class="cx">     test->waitUntilLoadFinished();
</span><span class="cx"> 
</span><span class="cx">     test->submitFormAtPosition(5, 5);
</span><del>-    GHashTable* values = test->waitUntilFormSubmittedAndGetTextFields();
</del><ins>+    GHashTable* tableValues = test->getTextFieldsAsHashTable();
+    g_assert(tableValues);
+    g_assert_cmpuint(g_hash_table_size(tableValues), ==, 4);
+    g_assert_cmpstr(static_cast<char*>(g_hash_table_lookup(tableValues, "text1")), ==, "value1");
+    g_assert_cmpstr(static_cast<char*>(g_hash_table_lookup(tableValues, "")), ==, "value3");
+    g_assert_cmpstr(static_cast<char*>(g_hash_table_lookup(tableValues, "text2")), ==, "");
+    g_assert_cmpstr(static_cast<char*>(g_hash_table_lookup(tableValues, "password")), ==, "secret");
+
+    GPtrArray* names = test->getTextFieldNames();
+    g_assert(names);
+    g_assert_cmpuint(names->len, ==, 5);
+    g_assert_cmpstr(static_cast<char*>(names->pdata[0]), ==, "text1");
+    g_assert_cmpstr(static_cast<char*>(names->pdata[1]), ==, "text2");
+    g_assert_cmpstr(static_cast<char*>(names->pdata[2]), ==, "");
+    g_assert_cmpstr(static_cast<char*>(names->pdata[3]), ==, "text2");
+    g_assert_cmpstr(static_cast<char*>(names->pdata[4]), ==, "password");
+
+    GPtrArray* values = test->getTextFieldValues();
</ins><span class="cx">     g_assert(values);
</span><del>-    g_assert_cmpuint(g_hash_table_size(values), ==, 3);
-    g_assert_cmpstr(static_cast<char*>(g_hash_table_lookup(values, "text1")), ==, "value1");
-    g_assert_cmpstr(static_cast<char*>(g_hash_table_lookup(values, "text2")), ==, "value2");
-    g_assert_cmpstr(static_cast<char*>(g_hash_table_lookup(values, "password")), ==, "secret");
</del><ins>+    g_assert_cmpuint(values->len, ==, 5);
+    g_assert_cmpstr(static_cast<char*>(values->pdata[0]), ==, "value1");
+    g_assert_cmpstr(static_cast<char*>(values->pdata[1]), ==, "value2");
+    g_assert_cmpstr(static_cast<char*>(values->pdata[2]), ==, "value3");
+    g_assert_cmpstr(static_cast<char*>(values->pdata[3]), ==, "");
+    g_assert_cmpstr(static_cast<char*>(values->pdata[4]), ==, "secret");
</ins><span class="cx"> }
</span><span class="cx"> #endif // PLATFORM(GTK)
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>