Add ArgumentEncoder support to PageState and friends
https://bugs.webkit.org/show_bug.cgi?id=134128

Reviewed by Andreas Kling.

Change the classes to structs, get rid of the constructors/destructors
and add encode member functions.

* Shared/SessionState.cpp:
(WebKit::HTTPBody::Element::encode):
(WebKit::HTTPBody::encode):
(WebKit::FrameState::encode):
(WebKit::PageState::encode):
(WebKit::HTTPBody::Element::Element): Deleted.
(WebKit::HTTPBody::Element::~Element): Deleted.
(WebKit::FrameState::FrameState): Deleted.
(WebKit::FrameState::~FrameState): Deleted.
(WebKit::PageState::PageState): Deleted.
(WebKit::PageState::~PageState): Deleted.
* Shared/SessionState.h:
(WebKit::HTTPBody::Element::type): Deleted.

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

* Shared/SessionState.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Always use XPC on iOS
https://bugs.webkit.org/show_bug.cgi?id=134130

Reviewed by Sam Weinig.

* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::platformGetLaunchOptions):
(WebKit::shouldUseXPC): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix lots of WK2 test crashes.

We don't always have a ScrollingCoordinator.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit delegate methods should document their default behaviors
https://bugs.webkit.org/show_bug.cgi?id=134132

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/API/Cocoa/WKUIDelegate.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WKThumbnailView should only use live layer trees before the snapshot arrives for parented WKViews
https://bugs.webkit.org/show_bug.cgi?id=134129
<rdar://problem/17401591>

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView initWithFrame:fromWKView:]):
Add a white background to WKThumbnailView, so that if we have no snapshot and no layer tree,
the view isn't transparent.

* UIProcess/API/mac/WKView.mm:
(-[WKView _updateThumbnailViewLayer]):
We currently pull the live layer tree into the WKThumbnailView even in snapshot mode,
before the snapshot arrives, to avoid flashing when transitioning a live WKView to a thumbnail view.
This is, however, not useful for unparented WKViews, because their layer tree will be detached
and we'll flash anyway. So, only do that when the WKView is parented.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Snapshotting WKThumbnailViews should not tell Web processes backing unparented WKViews that they're in window
https://bugs.webkit.org/show_bug.cgi?id=134134
<rdar://problem/17402119>

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView _setThumbnailView:]):
Re-evaluating our in-window state is only useful if we're going to use the live layer tree;
snapshots can be taken of unparented views with no trouble. Plus, doing so sets off a chain of
expensive things in the Web process which we can avoid if using snapshots.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
iOS WebKit2: selection handles become too large when zooming a page.
https://bugs.webkit.org/show_bug.cgi?id=134084
<rdar://problem/16799164>

Reviewed by Benjamin Poulain.

Since the document view is zoomed, we add a subview that has the inverse transform
of the document view. This new view becomes the root for the selection hierarchy.
The new view has zero size, not to interfere with the existing gestures on the WKContenView
therefore we implement hitTest to detect interaction with the selection elements.

* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView unscaledView]):
(-[WKContentView inverseScale]):
(-[WKContentView _updateUnscaledView]):
(-[WKContentView hitTest:withEvent:::]):
(-[WKContentView selectedTextRange]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce a WKSessionStateRef object
https://bugs.webkit.org/show_bug.cgi?id=134136

Reviewed by Tim Horton.

WKSessionStateRef is going to hold session state, making it possible to migrate state from one
webpage to another without having to do any serialization/deserialization.

* Shared/API/c/WKBase.h:
* Shared/APIObject.h:
* Shared/SessionState.cpp:
(WebKit::SessionState::encode):
* Shared/SessionState.h:
* UIProcess/API/APISessionState.cpp: Added.
(API::SessionState::create):
(API::SessionState::SessionState):
(API::SessionState::~SessionState):
* UIProcess/API/APISessionState.h:
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKSessionStateRef.cpp:
(WKSessionStateCreateFromData):
* UIProcess/API/C/WKSessionStateRef.h:
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::LegacySessionStateDecoder::LegacySessionStateDecoder):
(WebKit::LegacySessionStateDecoder::~LegacySessionStateDecoder):
(WebKit::LegacySessionStateDecoder::decodeSessionState):
* UIProcess/mac/LegacySessionStateCoding.h:
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce RenderLayer::offsetFromAncestorLayer() to make convertToLayerCoords() calls with
LayoutPoint(0, 0) as parameter more explicit.
https://bugs.webkit.org/show_bug.cgi?id=134092

Reviewed by Simon Fraser.

Most of the RenderLayer::convertToLayerCoords() callers are only interested in
the offset from the ancestor layer by passing LayoutPoint(0, 0) as the coordinate to convert.
Introducing offsetFromAncestorLayer() makes those calls more explicit/self-explanatory.
It helps simplifying the callsite's code.

No change in functionality.

* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::mapToContainer):
(WebCore::RenderGeometryMap::pushMappingsToAncestor):
(WebCore::RenderGeometryMap::push):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::computeOffsetFromRoot):
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::expandClipRectForRegionAndReflection):
(WebCore::expandClipRectForDescendantsAndReflection):
(WebCore::transparencyClipBox):
(WebCore::RenderLayer::convertToPixelSnappedLayerCoords):
(WebCore::accumulateOffsetTowardsAncestor):
(WebCore::RenderLayer::convertToLayerCoords):
(WebCore::RenderLayer::offsetFromAncestorLayer):
(WebCore::RenderLayer::clipToRect):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintLayerByApplyingTransform):
(WebCore::RenderLayer::collectFragments):
(WebCore::RenderLayer::paintTransformedLayerIntoFragments):
(WebCore::RenderLayer::createLocalTransformState):
(WebCore::RenderLayer::hitTestTransformedLayerInFragments):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::repaintInCompositedAncestor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Name moving. Unreviewed.

* Scripts/webkitpy/common/config/contributors.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] No way to get the main frame’s main resource’s data
https://bugs.webkit.org/show_bug.cgi?id=134113

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _getMainResourceDataWithCompletionHandler:]): Added. Calls
WebPageProxy::getMainResourceDataOfFrame and invokes the completion handler form the
callback.
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getMainResourceDataOfFrame): Made it safe to pass a NULL frame into
this function.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. build fix for the cmake based ports since r170188

* CMakeLists.txt: Added LegacySessionState.cpp in source list.

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