Merge r172442 - [GTK] The plugins metadata cache doesn't work if the user cache directory doesn't exist
https://bugs.webkit.org/show_bug.cgi?id=135834

Reviewed by Philippe Normand.

Make sure the user cache directory exists. If creating the
directory fails for whatever reason, do not try to save the cache
to disk.

* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::PluginInfoCache):
(WebKit::PluginInfoCache::updatePluginInfo):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r172828 - [GTK] WebkitWebProcess crashing navigating away from ogg video element
https://bugs.webkit.org/show_bug.cgi?id=135348

Reviewed by Philippe Normand.

Source/WebCore:

Let GraphicsLayerTextureMapper know it needs to detach the platform
layer when a MediaPlayerPrivateGStreamerBase is destroyed.

No new test since media/restore-from-page-cache.html covers it.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):

Source/WebKit2:

When a page is cached, by default doesn't recreate the backing store
(an optimization added in r89316).

Not all the ports uses that optimization. For example IOS port doesn't
use it (r161185).

In the case of the GTK port, the MediaPlayerPrivateGStreamer, not only
processes video buffers, also display them, because it is a
TextureMapperPlatformLayer too.

Nevertheless, in r153937, when a page is cached, the player is
destroyed. But our player has a backing store and the render tree
doesn't know that the player has gone. Hence, when the page is redraw,
the TextureMapper tree visits the video element, which doesn't exist
anymore, a segmentation fault occurs.

So, as our media player renders, and as we cannot trust that the
player exists when a page is painted, we cannot rely in the r89316
optimization.

Disabling the backing stores optimization fixes the problem.

Covered by existing tests.

* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformSetCacheModel): Enable the backing store
clearing when page caching for GTK.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r172592 - WebKit2GTK - WebKitWebProcess assertion fails when dragging and dropping a file into the view
https://bugs.webkit.org/show_bug.cgi?id=127576

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2014-08-14
Reviewed by Carlos Garcia Campos.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::performDragControllerAction): Assume read access
to any file that has been dragged into the web view when compiling for
GTK, since we don't support sandbox extensions.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r172896 - [GTK] Toggle buttons visually broken with GTK+ 3.13.7
https://bugs.webkit.org/show_bug.cgi?id=136130

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2014-08-24
Reviewed by Martin Robinson.

No new tests. Hopefully covered by existing tests, and our tests only
run with GTK+ 3.6 anyway.

* platform/gtk/RenderThemeGtk3.cpp:
(WebCore::paintToggle): use GTK_STATE_FLAG_CHECKED when compiling for
GTK+ 3.13.7 and above to ensure toggle buttons display as toggled.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r172341 - [GTK] Do not use GtkWindow:resize-grip-visible with recent GTK+ versions
https://bugs.webkit.org/show_bug.cgi?id=135699

Reviewed by Philippe Normand.

Resize grips support have been removed from GTK+ since 3.13.4, the
API has been deprecated and does nothing.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseSetToplevelOnScreenWindow):
(resizeWebKitWebViewBaseFromAllocation):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r172472 - [GStreamer] playback rate is rounded to integer
https://bugs.webkit.org/show_bug.cgi?id=135802

Patch by Fabien Vallée <fvallee@connected-labs.com> on 2014-08-12
Reviewed by Philippe Normand.

Source/WebCore:

Test: media/video-ended-event-slow-motion-playback.html

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setRate):

LayoutTests:

add test to ensure playback is actually working
in slow motion (playback rate = 0.5): Player
should reach EOS and dispatch ended event.

* media/video-ended-event-slow-motion-playback-expected.txt: Added.
* media/video-ended-event-slow-motion-playback.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r172707 - Completed iterator can be revived by adding more than one new entry to the target object
https://bugs.webkit.org/show_bug.cgi?id=129993

Patch by Diego Pino Garcia <dpino@igalia.com> on 2014-08-18
Reviewed by Oliver Hunt.

Source/JavaScriptCore:

When iterator reaches end, finish iterator.

* runtime/JSMapIterator.h:
(JSC::JSMapIterator::finish):
* runtime/JSSetIterator.h:
(JSC::JSSetIterator::finish):
* runtime/MapData.h:
(JSC::MapData::const_iterator::finish): set index of iterator to max
Int32.
* runtime/MapIteratorPrototype.cpp:
(JSC::MapIteratorPrototypeFuncNext):
* runtime/SetIteratorPrototype.cpp:
(JSC::SetIteratorPrototypeFuncNext):

LayoutTests:

Test a Map or Set iterator should remain dead after using it.

* js/basic-map-expected.txt:
* js/basic-set-expected.txt:
* js/script-tests/basic-map.js:
(set var):
(set map):
* js/script-tests/basic-set.js:
(keys.set keys):
(set add.set add):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r172317 - HTML <sub> and <sup> elements do not work in some 64-bit builds
https://bugs.webkit.org/show_bug.cgi?id=135736

Reviewed by Tim Horton.

RootInlineBox::verticalPositionForBox() had some implicit conversions between
LayoutUnit and int that caused overflow, and resulted in different comparison
behavior with an int constant in different architectures, since overflow behavior
is undefined.

Specifically, VerticalPositionCache was written in terms of ints with a special
0x80000000 "not found" value. However, 0x80000000 was being assigned to
a LayoutUnit, which multiplies by 64 causing overflow. The result was then
compared again with 0x80000000 which could pass or fail depending on overflow
behavior.

Fix by converting VerticalPositionCache to use LayoutUnits, and to have a bool
return value with a result out param, instead of a special return value.

Not easily testable, since the difference does not show in DRT output,
and a ref test would be flakey.

* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::ascentAndDescentForBox):
* rendering/VerticalPositionCache.h:
(WebCore::VerticalPositionCache::get):
(WebCore::VerticalPositionCache::set):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r171794 - [GTK] GLib tests fail with recent GTK+ due to runtime warning about deprecated properties
https://bugs.webkit.org/show_bug.cgi?id=135411

Reviewed by Sergio Villar Senin.

Recent versions of GTK+ now warn at runtime when a deprecated
property or signal is used. A diagnostic mode was added that is
enabled by default, but that can be disabled by setting
G_ENABLE_DIAGNOSTIC=0. Runtime warnings are considered test
failures by gtester, so we need to run the tests with the
diganostic mode disabled.

* TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp:
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r172903 - Add support for little-endian PowerPC64
https://bugs.webkit.org/show_bug.cgi?id=135647

Patch by Tomas Popela <tpopela@redhat.com> on 2014-08-25
Reviewed by Oliver Hunt.

* wtf/Platform.h:
* wtf/dtoa/utils.h:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r172919 - [GTK] Should check if a plugin mixes GTK+ symbols earlier
https://bugs.webkit.org/show_bug.cgi?id=136214

Reviewed by Philippe Normand.

We are currently checking if the plugin module and the plugin
process mix GTK symbols after the plugin has been loaded and
initialized. This is too late in many cases, since plugins can use
GTK methods in the NP_Initialize implementation. This is causing
the apps using WebKitGTK+ 2.4 to freeze when the plugin process
scans the plugins and there's a plugin using GTK+3 installed. We
should move the check earlier, once the module is loaded but
before calling NP_Initialize.

* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::moduleMixesGtkSymbols):
(WebKit::NetscapePluginModule::tryLoad):
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
(WebKit::NetscapePlugin::platformPostInitialize):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r172920 - [GTK] Older versions of WebKit should use the plugins cache in read only mode
https://bugs.webkit.org/show_bug.cgi?id=136215

Reviewed by Philippe Normand.

Now that WebKitGTK+ 2.4 and 2.5 are parallel installable, since
they use different versions of the plugins cache, apps using 2.4
might override the plugins cache file. We should prevent this from
happening by making older versions use the plugin cache, but not
downgrade it.

* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::PluginInfoCache):
(WebKit::PluginInfoCache::updatePluginInfo):
* UIProcess/Plugins/gtk/PluginInfoCache.h:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@172924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Update NEWS and Versions.m4 for 2.4.5 release.

.:

* Source/autotools/Versions.m4: Bump version numbers.

Source/WebKit/gtk:

* NEWS: Added release notes for 2.4.5.

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