[iOS WebKit2] Enable optimization to mmap downloaded resources once they become file-backed.
<https://webkit.org/b/132171>
<rdar://problem/16720733>

Source/WebCore:
Add a missing export for the USE(CFNETWORK) + WebKit2 combo.

Reviewed by Antti Koivisto.

* WebCore.exp.in:

Source/WebKit2:
Implement a CFNetwork-based version of NetworkResourceLoader::willCacheResponseAsync()
and activate the DiskCacheMonitor code path. This means that once resources go into
file system cache, we get notified and mmap them from disk, saving heaps of memory.

Reviewed by Antti Koivisto.

* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/mac/DiskCacheMonitor.mm:
* NetworkProcess/mac/NetworkResourceLoaderMac.mm:
(WebKit::NetworkResourceLoader::willCacheResponseAsync):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERTION FAILED: "!m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction" in svg/custom/use-instanceRoot-event-listeners.xhtml
https://bugs.webkit.org/show_bug.cgi?id=132148

Reviewed by Andreas Kling.

Changed how JSCustomMarkFunction generation works. Instead of leaving out
the generated visitChildren function, just generate a call to visitAdditionalChildren.
This eliminates the need to repeat boilerplate.

The fix for the above bug was to correct mistaken logic where JSSVGElementInstance
had a visitChildren that did not properly mark event listeners because it explicitly
did not call through to the base class visitChildren. The new arrangement makes that
mistake impossible.

* bindings/js/JSAttrCustom.cpp:
(WebCore::JSAttr::visitAdditionalChildren): Use this instead of visitChildren.
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::visitAdditionalChildren): Ditto.
* bindings/js/JSAudioTrackListCustom.cpp:
(WebCore::JSAudioTrackList::visitAdditionalChildren): Ditto.
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::JSCSSRule::visitAdditionalChildren): Ditto.
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::visitAdditionalChildren): Ditto.
* bindings/js/JSCanvasRenderingContextCustom.cpp:
(WebCore::JSCanvasRenderingContext::visitAdditionalChildren): Ditto.
* bindings/js/JSCryptoKeyPairCustom.cpp:
(WebCore::JSCryptoKeyPair::visitAdditionalChildren): Ditto.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::visitAdditionalChildren): Ditto.
* bindings/js/JSMessageChannelCustom.cpp:
(WebCore::JSMessageChannel::visitAdditionalChildren): Ditto.
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::visitAdditionalChildren): Ditto.
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::visitAdditionalChildren): Ditto.
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::visitAdditionalChildren): Ditto.
* bindings/js/JSNodeIteratorCustom.cpp:
(WebCore::JSNodeIterator::visitAdditionalChildren): Ditto.
* bindings/js/JSSVGElementInstanceCustom.cpp:
(WebCore::JSSVGElementInstance::visitAdditionalChildren): Ditto.
* bindings/js/JSSharedWorkerCustom.cpp:
(WebCore::JSSharedWorker::visitAdditionalChildren): Ditto.
* bindings/js/JSStyleSheetCustom.cpp:
(WebCore::JSStyleSheet::visitAdditionalChildren): Ditto.
* bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::JSTextTrackCue::visitAdditionalChildren): Ditto.
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::visitAdditionalChildren): Ditto.
* bindings/js/JSTextTrackListCustom.cpp:
(WebCore::JSTextTrackList::visitAdditionalChildren): Ditto.
* bindings/js/JSTreeWalkerCustom.cpp:
(WebCore::JSTreeWalker::visitAdditionalChildren): Ditto.
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::visitAdditionalChildren): Ditto.
* bindings/js/JSVideoTrackListCustom.cpp:
(WebCore::JSVideoTrackList::visitAdditionalChildren): Ditto.
* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::JSWebGLRenderingContext::visitAdditionalChildren): Ditto.
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::visitAdditionalChildren): Ditto.
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::visitAdditionalChildren): Ditto.
* bindings/js/JSXPathResultCustom.cpp:
(WebCore::JSXPathResult::visitAdditionalChildren): Ditto.

* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::visitChildren): Rewrote to use modern for loops.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader): Generate declaration of visitAdditionalChildren.
(GenerateImplementation): Generate call to visitAdditionalChildren.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Plugin process crashes with GTK2 windowed plugins
https://bugs.webkit.org/show_bug.cgi?id=132127

Reviewed by Martin Robinson.

It happens sometimes because the socket is used before the plug
has been added. A runtime critical warnings is shown and it
sometimes ends up crashing.

* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
(WebKit::NetscapePlugin::platformPostInitializeWindowed): Do not
show the plug widget until the socket is connected.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Incomplete body painting when using blend modes
https://bugs.webkit.org/show_bug.cgi?id=131889

Source/WebCore:
The incomplete painting was caused by the transparency layer created for
the root renderer. We can safely skip creating this transparency layer at
the root level, as there is nothing else being painted behind this layer that
could be used erroneously as a backdrop.

Patch by Ion Rosca <rosca@adobe.com> on 2014-04-25
Reviewed by Simon Fraser.

Test: css3/compositing/blend-mode-with-body.html

* rendering/RenderLayer.h:
Changing RenderLayer::paintsWithTransparency so that it will not
return true when the root renderer needs to isolate blending.

LayoutTests:
Patch by Ion Rosca <rosca@adobe.com> on 2014-04-25
Reviewed by Simon Fraser.

* css3/compositing/blend-mode-with-body-expected.html: Added.
* css3/compositing/blend-mode-with-body.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement Array.prototype.find()
https://bugs.webkit.org/show_bug.cgi?id=130966

Reviewed by Oliver Hunt.

Source/JavaScriptCore:
Implement Array.prototype.find() and Array.prototype.findIndex() as proposed in the Harmony spec.

* builtins/Array.prototype.js:
(find):
(findIndex):
* runtime/ArrayPrototype.cpp:

LayoutTests:
* js/Object-getOwnPropertyNames-expected.txt:
* js/array-find-expected.txt: Added.
* js/array-find.html: Added.
* js/array-findIndex-expected.txt: Added.
* js/array-findIndex.html: Added.
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/array-find.js: Added.
* js/script-tests/array-findIndex.js: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove two unused SVGDocument functions.
<https://webkit.org/b/132178>

Reviewed by Antti Koivisto.

* svg/SVGDocument.cpp:
(WebCore::SVGDocument::dispatchZoomEvent): Deleted.
(WebCore::SVGDocument::dispatchScrollEvent): Deleted.
* svg/SVGDocument.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167798 268f45cc-cd09-0410-ab3c-d52691b4dbfc