Merge r167883 - [GTK] Crash in debug build with removing windowed plugin child widgets from the view
https://bugs.webkit.org/show_bug.cgi?id=132252

Reviewed by Philippe Normand.

It crashes due to an assert in HashTable that checks the iterators
validity. The problem is that we are iterating the children map
and the callback called on every iteration might modify the map,
making the iterators invalid. This happens when the WebView is
destroyed, GtkContainer calls gtk_container_foreach() with
gtk_widget_destroy as callback. When a widget inside a container
is destroyed, it's removed from the container, and in our case,
the child widget is removed from the map. This fixes several
crashes when running layout tests in debug bot.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseContainerForall): Use copyKeysToVector() instead
of using a range iterator for the map keys and check in every
iteration that the child widget from the keys vector is still
present in the map before calling the callback.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@168257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r167884 - [GTK][WK2] Missing return statement in webkit_plugin_get_description()
https://bugs.webkit.org/show_bug.cgi?id=132263

Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/WebKitPlugin.cpp:
(webkit_plugin_get_description): Actually return the data of the cached
plugin description CString.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@168258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r167885 - [WK2][X11] NetscapePluginModule::scanPlugin() should write UTF-8 strings to stdout
https://bugs.webkit.org/show_bug.cgi?id=132245

Reviewed by Carlos Garcia Campos.

NetscapePluginModule::scanPlugin(), in the helper writeLine function, takes each character
of the given string and writes it out as a UChar, doing two fputc calls for each byte of the
16-bit type.

This fails badly with characters with integer value less than 256 as the most significant byte
of the UChar is written out as a null character. This effectively chops the output that's gathered
in the UIProcess and is parsed in PluginProcessProxy::scanPlugin().

To avoid all this, the UTF-8 encoding of the string is written out in the PluginProcess, and
String::fromUTF8() is called in the UIProcess to properly decode the received string.

* Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
(WebKit::writeCharacter):
(WebKit::writeLine):
(WebKit::writeByte): Deleted.
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::scanPlugin):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@168259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Revert r159826 - "Finally fix some obvious Bartlett bugs"

This reverts r159826.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@168261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r166049 - HTMLFrameOwnerElement should obey the SubframeLoadingDisabler when creating subframes
<rdar://problem/15675780>

Merge Blink r156744 by Adam Klein.

Source/WebCore:

Test: fast/frames/set-iframe-src-in-pagehide-crash.html

* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadSubframe):

LayoutTests:

* fast/frames/set-iframe-src-in-pagehide-crash-expected.txt: Added.
* fast/frames/set-iframe-src-in-pagehide-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@168262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r166236 - Hold a reference to firstSuccessfulSubmitButton in HTMLFormElement::submit
<http://webkit.org/b/130713>
<rdar://problem/15661876>

Reviewed by Darin Adler.

Merged from Blink (patch by Ian Beer):
http://crbug.com/303657
https://src.chromium.org/viewvc/blink?view=rev&revision=158938

Source/WebCore:

Test: fast/forms/form-submission-crash-successful-submit-button.html

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submit):

LayoutTests:

* fast/forms/form-submission-crash-successful-submit-button-expected.txt: Added.
* fast/forms/form-submission-crash-successful-submit-button.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@168264 268f45cc-cd09-0410-ab3c-d52691b4dbfc