[Mac] Difficulty gesture scrolling vertically with trackpad after scrolling horizontally 
https://bugs.webkit.org/show_bug.cgi?id=131959
<rdar://problem/16654523>

Reviewed by Simon Fraser.

* page/mac/EventHandlerMac.mm:
(WebCore::deltaIsPredominantlyVertical): Added.
(WebCore::scrolledToEdgeInDominantDirection): Only consider current mouse wheel event. We don't care about
overall history when deciding if we are bumping against the edge of a scrollable region. Short-circuit if
the element style indicates that overflow is hidden, since this means there is no scroll possible in that
direction.
(WebCore::EventHandler::platformPrepareForWheelEvents): Update for new signature.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: WebCore part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
https://bugs.webkit.org/show_bug.cgi?id=131939

Reviewed by David Kilzer.

* WebCore.exp.in: Exported WebCore::ResourceHandle::setDefersLoading.

* loader/ResourceLoadScheduler.cpp:
(WebCore::ResourceLoadScheduler::setDefersLoading): Added a no-op implementation.
* loader/ResourceLoadScheduler.h: Declared new virtual member function setDefersLoading.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::setDefersLoading): Added a call to the above function.

Source/WebKit2: WebKit part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
https://bugs.webkit.org/show_bug.cgi?id=131939

Reviewed by David Kilzer.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setDefersLoading): Added. Forwards the message to
the NetworkResourceLoader.
* NetworkProcess/NetworkConnectionToWebProcess.h:

* NetworkProcess/NetworkConnectionToWebProcess.messages.in: Added SetDefersLoading message.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize new member variable
m_defersLoading from the new field in the loader parameters.
(WebKit::NetworkResourceLoader::start): Added. Like WebCore::ResourceLoader, if loading is
deferred, keep the request in m_deferredRequest and bail out.
(WebKit::NetworkResourceLoader::setDefersLoading): Added. Similar to
WebCore::ResourceLoader::setDefersLoading.
* NetworkProcess/NetworkResourceLoader.h:
(WebKit::NetworkResourceLoader::defersLoading):

* Shared/Network/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): Initialize new field
defersLoading to false.
(WebKit::NetworkResourceLoadParameters::encode): Encode new field.
(WebKit::NetworkResourceLoadParameters::decode): Decode new field.
* Shared/Network/NetworkResourceLoadParameters.h: Added defersLoading field.

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad): Populate defersLoading field in the load
parameters.
(WebKit::WebResourceLoadScheduler::setDefersLoading): Send a message to the Network process.
* WebProcess/Network/WebResourceLoadScheduler.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167635 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for Mountain Lion.

* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::SerializedPlatformRepresentationMac::deserialize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r166784): Gradient at background of iCloud login page doesn’t go all the way to the bottom
https://bugs.webkit.org/show_bug.cgi?id=131924

Computing tile dimension for contain/cover requires higher precision than what LayoutUnit has. Switching to floats.

Reviewed by Simon Fraser.

Source/WebCore:
Test: fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateFillTileSize):

LayoutTests:
* fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision-expected.html: Added.
* fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't try to use a null connection()->xpcConnection()
https://bugs.webkit.org/show_bug.cgi?id=131961

Reviewed by Dan Bernstein.

If running with -WebKit2UseXPCServiceForWebProcess NO, connection()->xpcConnection()
is null and xpc_connection_get_pid() would crash, so null-check the xpcConnection.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didFinishLaunching):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167638 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE][Mac] AVSampleBufferDisplayLayer and AudioRenderer is overretained.
https://bugs.webkit.org/show_bug.cgi?id=131963

Reviewed by Jon Honeycutt.

Adopt the results of -[[class alloc] init] rather than retaining them.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::hasVideo):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move CoordinatedGraphics related codes out of CMakeLists.txt
https://bugs.webkit.org/show_bug.cgi?id=131931

Reviewed by Gyuyoung Kim.

Move CoordinatedGraphics related files to PlatformEfl.cmake because they are not common files.

* CMakeLists.txt:
* PlatformEfl.cmake:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Arguments objects shouldn't need a destructor
https://bugs.webkit.org/show_bug.cgi?id=131899

Reviewed by Oliver Hunt.

This patch rids Arguments objects of their destructors. It does this by
switching their backing stores to use CopiedSpace rather than malloc memory.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateArguments): Fix the code emitted for inline
Arguments allocation so that it only emits an extra write for strict mode code rather
than unconditionally.
* heap/CopyToken.h: New CopyTokens for the two different types of Arguments backing stores.
* runtime/Arguments.cpp:
(JSC::Arguments::visitChildren): We need to tell the collector to copy the back stores now.
(JSC::Arguments::copyBackingStore): Do the actual copying of the backing stores.
(JSC::Arguments::deletePropertyByIndex): Update all the accesses to SlowArgumentData and m_registerArray.
(JSC::Arguments::deleteProperty):
(JSC::Arguments::defineOwnProperty):
(JSC::Arguments::allocateRegisterArray):
(JSC::Arguments::tearOff):
(JSC::Arguments::destroy): Deleted. We don't need the destructor any more.
* runtime/Arguments.h:
(JSC::Arguments::registerArraySizeInBytes):
(JSC::Arguments::SlowArgumentData::SlowArgumentData): Switch SlowArgumentData to being allocated
in CopiedSpace. Now the SlowArgumentData and its backing store are a single contiguous CopiedSpace
allocation.
(JSC::Arguments::SlowArgumentData::slowArguments):
(JSC::Arguments::SlowArgumentData::bytecodeToMachineCaptureOffset):
(JSC::Arguments::SlowArgumentData::setBytecodeToMachineCaptureOffset):
(JSC::Arguments::SlowArgumentData::sizeForNumArguments):
(JSC::Arguments::Arguments):
(JSC::Arguments::allocateSlowArguments):
(JSC::Arguments::tryDeleteArgument):
(JSC::Arguments::isDeletedArgument):
(JSC::Arguments::isArgument):
(JSC::Arguments::argument):
(JSC::Arguments::finishCreation):
* runtime/SymbolTable.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167641 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Followup from http://trac.webkit.org/changeset/167624

Reviewed by Darin Adler.

Fixing incorrect use of ? : syntax.

* editing/VisibleUnits.cpp:
(WebCore::characterBeforePosition):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Should have the ability to output composited contents during layout testing
https://bugs.webkit.org/show_bug.cgi?id=131864

Reviewed by Philippe Normand.

* WebKitTestRunner/cairo/TestInvocationCairo.cpp:
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Add a path that paints the widget contents
to an image surface. We run the main loop a bit to match the implementation from WebKit1 and EFL.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::windowSnapshotImage): Use the new UI-process path on GTK+.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove a unnecessary forward-declared class from TiledCoreAnimationDrawingArea.

Rubber-stamped by Simon Fraser.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] Don't send intrinsic content size updates with dirty layout
https://bugs.webkit.org/show_bug.cgi?id=131964
<rdar://problem/14292718>

Reviewed by Simon Fraser.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
(WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeTimerFired): Deleted.
Instead of using a timer (which can fire while layout is dirty) to coalesce
intrinsic content size changes, send them only from flushLayers, just after updating layout.
This ensures that we never get intermediate intrinsic content sizes that won't be painted.


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