Move responsibility for remote layer tree committing to RemoteLayerTreeDrawingArea
https://bugs.webkit.org/show_bug.cgi?id=126501

Source/WebCore:

Reviewed by Sam Weinig.

Add type-safe casting to GraphicsLayer.

* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::isGraphicsLayerCA):
(WebCore::GraphicsLayer::isGraphicsLayerCARemote):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::isGraphicsLayerCA):

Source/WebKit2:

Reviewed by Sam Weinig.

Soon we shall need to do atomic commits of both the remote layer tree, and
the remote scrolling tree. Pave the way by moving responsibility for remote
layer tree committing to RemoteLayerTreeDrawingArea.

So move the flushing logic from RemoteLayerTreeHost to RemoteLayerTreeDrawingArea.
After this change, RemoteLayerTreeHost doesn't do much and could possibly be
removed in future.

Also add type-safe casting to GraphicsLayer and DrawingArea.

* DerivedSources.make: Out with RemoteLayerTreeHost, in with RemoteLayerTreeDrawingAreaProxy
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
(WebKit::RemoteLayerTreeDrawingAreaProxy::remoteLayerTreeHost):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.messages.in: Renamed from Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.messages.in.
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): Add message receiver.
(WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy): Remove message receiver.
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): Hand the transaction off to the layer
tree host.
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::RemoteLayerTreeHost): No longer a message receiver.
(WebKit::RemoteLayerTreeHost::~RemoteLayerTreeHost):
(WebKit::RemoteLayerTreeHost::updateLayerTree):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::type):
* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::RemoteLayerTreeContext):
(WebKit::RemoteLayerTreeContext::flushOutOfTreeLayers):
(WebKit::RemoteLayerTreeContext::buildTransaction):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
(WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
(WebKit::RemoteLayerTreeDrawingArea::forceRepaint):
(WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
(WebKit::RemoteLayerTreeDrawingArea::layerFlushTimerFired):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][CMake] Add support for building the GTK+ port with cmake to build-webkit
https://bugs.webkit.org/show_bug.cgi?id=126212

Reviewed by Daniel Bates.

Allow building the GTK+ cmake port with --gtkcmake.

* Scripts/build-webkit: Use the new isGtkCMake function to head down the CMake path
when appropriate. Skip the autotoos path when isGtkAutotools is false.
* Scripts/webkitdirs.pm: Add an isGtkCMake path in addition to the newly renamed isGtkAutotools.
Add isGtk which checks isGtkCMake || isGtkAutotools
(determineArchitecture): Use the CMake path for GTK+ when appropriate.
(argumentsForConfiguration): use --gtkcmake when appropriate.
(jscProductDir): Look in the CMake directory when appropriate.
(builtDylibPathForName): CMake builds the library into a different directory, so handle that.
(determineIsGtkCMake): Added.
(isGtkCMake): Added.
(isGtkAutotools): Renamed from isGtk.
(isGtk): New function which returns isGtkAutotools || isGtkCMake.
(determineIsGtkAutotools): Renamed from determineIsGtk.
(cmakeBasedPortName): Added a GTK+ path.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add encoding of ViewportConstraint and ScrollingParameter types
https://bugs.webkit.org/show_bug.cgi?id=126497

Reviewed by Andreas Kling.

Add encoding/decoding of ScrollableAreaParameters, FixedPositionViewportConstraints
and StickyPositionViewportConstraints.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<WebCore::ScrollableAreaParameters>::encode):
(IPC::ArgumentCoder<WebCore::ScrollableAreaParameters>::decode):
(IPC::ArgumentCoder<WebCore::FixedPositionViewportConstraints>::encode):
(IPC::ArgumentCoder<WebCore::FixedPositionViewportConstraints>::decode):
(IPC::ArgumentCoder<WebCore::StickyPositionViewportConstraints>::encode):
(IPC::ArgumentCoder<WebCore::StickyPositionViewportConstraints>::decode):
* Shared/WebCoreArgumentCoders.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[JS] Implement Promise.race()
https://bugs.webkit.org/show_bug.cgi?id=126506

Reviewed by Oliver Hunt.

Source/JavaScriptCore: 

* runtime/CommonIdentifiers.h:
Add identifier for "cast".
    
* runtime/JSPromiseConstructor.cpp:
(JSC::abruptRejection):
Helper for the RejectIfAbrupt abstract operation.
  
(JSC::JSPromiseConstructorFuncRace):
Add implementation of Promise.race()

LayoutTests: 

Enabled and fix the existing Promise.race() test case.
- Promise.race() and Promise.race({}) should reject by my reading of the spec.

* js/dom/Promise-static-race-expected.txt:
* js/dom/Promise-static-race.html:


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