<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[160520] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/160520">160520</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2013-12-12 17:36:15 -0800 (Thu, 12 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>[wk2] Handle pinch-to-zoom gesture
https://bugs.webkit.org/show_bug.cgi?id=125604

Reviewed by Simon Fraser.

Add the concept of a &quot;transient&quot; zoom to DrawingArea, which is a zoom
that affects the content, but does not cause repaint, as would be used
for a live pinch-zoom gesture.

Add ViewGestureController, which currently only handles magnification
gestures, and keeps track of the current gesture's scale and origin, and
forwards relevant events on to the DrawingArea via the transient zoom mechanism.

* DerivedSources.make:
Add ViewGestureController to the list of message receivers.

* UIProcess/API/Cocoa/WKViewPrivate.h:
Add shouldHandleMagnificationGesture property, which controls whether WKView will
attempt to handle magnifyWithEvent:.

* UIProcess/API/mac/WKView.mm:
(-[WKView waitForAsyncDrawingAreaSizeUpdate]):
Fix a typo.

(-[WKView _ensureGestureController]):
Create our ViewGestureController if it doesn't already exist.

(-[WKView setAllowsMagnification:]):
(-[WKView allowsMagnification]):
SPI to enable/disable handling the magnification gesture.

(-[WKView setMagnification:centeredAtPoint:]):
(-[WKView setMagnification:]):
(-[WKView magnification]):
Adjust or retrieve the current page scale.
The variant of setMagnification that does not take an origin uses the view's center.

(-[WKView magnifyWithEvent:]):

(-[WKView endGestureWithEvent:]):
Forward gesture methods to ViewGestureController.

* UIProcess/mac/ViewGestureController.cpp: Added.
(WebKit::ViewGestureController::create):
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::~ViewGestureController):
(WebKit::resistanceForDelta):
Compute a resistance factor, which makes it feel &quot;hard&quot; to zoom out past
scale=1, and accelerates scaling out before you hit scale=1.

(WebKit::ViewGestureController::scaledMagnificationOrigin):
Compute the origin of the magnification gesture with the transient zoom unapplied.

(WebKit::ViewGestureController::handleMagnificationGesture):
The first magnification gesture will send a message to the WebProcess
to retrieve the visible content rect. Subsequent gestures will
hand the new magnification and origin to the DrawingArea to apply.

(WebKit::ViewGestureController::didBeginTransientZoom):
Callback from the WebProcess, with the current visible content rect.
Subsequent magnification gestures will forward the scale and origin to the DrawingArea.

(WebKit::ViewGestureController::endMagnificationGesture):
Commit the current transient scale as the actual page scale, which will cause
a repaint and bring in all the tiles.

(WebKit::ViewGestureController::endActiveGesture):
If we have an active gesture, call its end function.

* UIProcess/mac/ViewGestureController.h: Added.
* UIProcess/mac/ViewGestureController.messages.in: Added.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::beginTransientZoom):
Call back to ViewGestureController with the visibleContentRect.

(WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
Scale and translate the RenderView's PlatformCALayer.
Reaching into the layer tree like this is scary, we should consider
teaching RenderLayerCompositor about transient zoom.
Hide the content shadow layer for now.

(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
Clear our custom transform on the RenderView's layer, and
change the actual page scale, causing a repaint.
Un-hide the shadow layer.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::beginTransientZoom):
(WebKit::DrawingAreaProxy::adjustTransientZoom):
(WebKit::DrawingAreaProxy::commitTransientZoom):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::beginTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::beginTransientZoom):
(WebKit::DrawingArea::adjustTransientZoom):
(WebKit::DrawingArea::commitTransientZoom):
* WebProcess/WebPage/DrawingArea.messages.in:
Generic plumbing for {begin, adjust, end}TransientZoom.

* WebCore.exp.in:
Export some TransformationMatrix functions.

* WebCore.xcodeproj/project.pbxproj:
Make some headers private so that RenderLayerCompositor/Backing can be used from WebKit2.

* rendering/RenderLayerCompositor.h:
(WebCore::RenderLayerCompositor::layerForContentShadow):
Add a getter for the content shadow layer.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
Enable handling of the magnification gesture in Minibrowser WebKit2 windows.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorh">trunk/Source/WebCore/rendering/RenderLayerCompositor.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DerivedSourcesmake">trunk/Source/WebKit2/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDrawingAreaProxyh">trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacTiledCoreAnimationDrawingAreaProxyh">trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacTiledCoreAnimationDrawingAreaProxymm">trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreamessagesin">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsMiniBrowsermacWK2BrowserWindowControllerm">trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessmacViewGestureControllercpp">trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacViewGestureControllerh">trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacViewGestureControllermessagesin">trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebCore/ChangeLog        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2013-12-12  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        [wk2] Handle pinch-to-zoom gesture
+        https://bugs.webkit.org/show_bug.cgi?id=125604
+
+        Reviewed by Simon Fraser.
+
+        * WebCore.exp.in:
+        Export some TransformationMatrix functions.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Make some headers private so that RenderLayerCompositor/Backing can be used from WebKit2.
+
+        * rendering/RenderLayerCompositor.h:
+        (WebCore::RenderLayerCompositor::layerForContentShadow):
+        Add a getter for the content shadow layer.
+
</ins><span class="cx"> 2013-12-12  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         DatabaseProcess IndexedDB: Establish a metadata backing store on disk
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebCore/WebCore.exp.in        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -784,6 +784,8 @@
</span><span class="cx"> __ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
</span><span class="cx"> __ZN7WebCore20ResourceResponseBase6setURLERKNS_3URLE
</span><span class="cx"> __ZN7WebCore20ResourceResponseBaseC2Ev
</span><ins>+__ZN7WebCore20TransformationMatrix9translateEdd
+__ZN7WebCore20TransformationMatrix5scaleEd
</ins><span class="cx"> __ZN7WebCore20UserGestureIndicator7s_stateE
</span><span class="cx"> __ZN7WebCore20UserGestureIndicatorC1ENS_26ProcessingUserGestureStateE
</span><span class="cx"> __ZN7WebCore20UserGestureIndicatorD1Ev
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -472,7 +472,7 @@
</span><span class="cx">                 0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F605AEA15F94848004DF0C0 /* ScrollingConstraints.cpp */; };
</span><span class="cx">                 0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */; };
</span><span class="cx">                 0FA24D79162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA24D77162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp */; };
</span><del>-                0FA24D7A162DF91900A3F4C0 /* GraphicsLayerUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */; };
</del><ins>+                0FA24D7A162DF91900A3F4C0 /* GraphicsLayerUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 0FA88EBD16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FA88EBC16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm */; };
</span><span class="cx">                 0FB8890A167D2FA10010CDA5 /* ScrollingTreeStickyNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB88908167D2FA10010CDA5 /* ScrollingTreeStickyNode.h */; };
</span><span class="cx">                 0FB8890B167D2FA10010CDA5 /* ScrollingTreeStickyNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FB88909167D2FA10010CDA5 /* ScrollingTreeStickyNode.mm */; };
</span><span class="lines">@@ -1475,7 +1475,7 @@
</span><span class="cx">                 49AE2D8F134EE50C0072920A /* CSSCalculationValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 49AE2D8D134EE50C0072920A /* CSSCalculationValue.h */; };
</span><span class="cx">                 49AE2D96134EE5F90072920A /* CalculationValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49AE2D94134EE5F90072920A /* CalculationValue.cpp */; };
</span><span class="cx">                 49AE2D97134EE5F90072920A /* CalculationValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 49AE2D95134EE5F90072920A /* CalculationValue.h */; };
</span><del>-                49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49AF2D6814435D050016A784 /* DisplayRefreshMonitor.h */; };
</del><ins>+                49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49AF2D6814435D050016A784 /* DisplayRefreshMonitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 49AF2D6C14435D210016A784 /* DisplayRefreshMonitorMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49AF2D6B14435D210016A784 /* DisplayRefreshMonitorMac.cpp */; };
</span><span class="cx">                 49B3760C15C6C6840059131D /* ArrayValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49B3760A15C6C6840059131D /* ArrayValue.cpp */; };
</span><span class="cx">                 49B3760D15C6C6840059131D /* ArrayValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 49B3760B15C6C6840059131D /* ArrayValue.h */; };
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -263,6 +263,7 @@
</span><span class="cx">     GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }
</span><span class="cx"> #if ENABLE(RUBBER_BANDING)
</span><span class="cx">     GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangAreas.get(); }
</span><ins>+    GraphicsLayer* layerForContentShadow() const { return m_contentShadowLayer.get(); }
</ins><span class="cx"> 
</span><span class="cx">     GraphicsLayer* updateLayerForTopOverhangArea(bool wantsLayer);
</span><span class="cx">     GraphicsLayer* updateLayerForBottomOverhangArea(bool wantsLayer);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/ChangeLog        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -1,3 +1,111 @@
</span><ins>+2013-12-12  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        [wk2] Handle pinch-to-zoom gesture
+        https://bugs.webkit.org/show_bug.cgi?id=125604
+
+        Reviewed by Simon Fraser.
+
+        Add the concept of a &quot;transient&quot; zoom to DrawingArea, which is a zoom
+        that affects the content, but does not cause repaint, as would be used
+        for a live pinch-zoom gesture.
+
+        Add ViewGestureController, which currently only handles magnification 
+        gestures, and keeps track of the current gesture's scale and origin, and
+        forwards relevant events on to the DrawingArea via the transient zoom mechanism.
+
+        * DerivedSources.make:
+        Add ViewGestureController to the list of message receivers.
+
+        * UIProcess/API/Cocoa/WKViewPrivate.h:
+        Add shouldHandleMagnificationGesture property, which controls whether WKView will
+        attempt to handle magnifyWithEvent:.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView waitForAsyncDrawingAreaSizeUpdate]):
+        Fix a typo.
+
+        (-[WKView _ensureGestureController]):
+        Create our ViewGestureController if it doesn't already exist.
+
+        (-[WKView setAllowsMagnification:]):
+        (-[WKView allowsMagnification]):
+        SPI to enable/disable handling the magnification gesture.
+
+        (-[WKView setMagnification:centeredAtPoint:]):
+        (-[WKView setMagnification:]):
+        (-[WKView magnification]):
+        Adjust or retrieve the current page scale.
+        The variant of setMagnification that does not take an origin uses the view's center.
+
+        (-[WKView magnifyWithEvent:]):
+        (-[WKView endGestureWithEvent:]):
+        Forward gesture methods to ViewGestureController.
+
+        * UIProcess/mac/ViewGestureController.cpp: Added.
+        (WebKit::ViewGestureController::create):
+        (WebKit::ViewGestureController::ViewGestureController):
+        (WebKit::ViewGestureController::~ViewGestureController):
+        (WebKit::resistanceForDelta):
+        Compute a resistance factor, which makes it feel &quot;hard&quot; to zoom out past
+        scale=1, and accelerates scaling out before you hit scale=1.
+
+        (WebKit::ViewGestureController::scaledMagnificationOrigin):
+        Compute the origin of the magnification gesture with the transient zoom unapplied.
+
+        (WebKit::ViewGestureController::handleMagnificationGesture):
+        The first magnification gesture will send a message to the WebProcess
+        to retrieve the visible content rect. Subsequent gestures will
+        hand the new magnification and origin to the DrawingArea to apply.
+
+        (WebKit::ViewGestureController::didBeginTransientZoom):
+        Callback from the WebProcess, with the current visible content rect.
+        Subsequent magnification gestures will forward the scale and origin to the DrawingArea.
+        
+        (WebKit::ViewGestureController::endMagnificationGesture):
+        Commit the current transient scale as the actual page scale, which will cause
+        a repaint and bring in all the tiles.
+
+        (WebKit::ViewGestureController::endActiveGesture):
+        If we have an active gesture, call its end function.
+
+        * UIProcess/mac/ViewGestureController.h: Added.
+        * UIProcess/mac/ViewGestureController.messages.in: Added.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add new files.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::beginTransientZoom):
+        Call back to ViewGestureController with the visibleContentRect.
+
+        (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
+        Scale and translate the RenderView's PlatformCALayer.
+        Reaching into the layer tree like this is scary, we should consider
+        teaching RenderLayerCompositor about transient zoom.
+        Hide the content shadow layer for now.
+
+        (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
+        Clear our custom transform on the RenderView's layer, and
+        change the actual page scale, causing a repaint.
+        Un-hide the shadow layer.
+
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::beginTransientZoom):
+        (WebKit::DrawingAreaProxy::adjustTransientZoom):
+        (WebKit::DrawingAreaProxy::commitTransientZoom):
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+        (WebKit::TiledCoreAnimationDrawingAreaProxy::beginTransientZoom):
+        (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
+        (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::beginTransientZoom):
+        (WebKit::DrawingArea::adjustTransientZoom):
+        (WebKit::DrawingArea::commitTransientZoom):
+        * WebProcess/WebPage/DrawingArea.messages.in:
+        Generic plumbing for {begin, adjust, end}TransientZoom.
+
</ins><span class="cx"> 2013-12-12  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         DatabaseProcess IndexedDB: Establish a metadata backing store on disk
</span></span></pre></div>
<a id="trunkSourceWebKit2DerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DerivedSources.make (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DerivedSources.make        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/DerivedSources.make        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -89,6 +89,7 @@
</span><span class="cx">     SecItemShimProxy \
</span><span class="cx">     StorageAreaMap \
</span><span class="cx">     StorageManager \
</span><ins>+    ViewGestureController \
</ins><span class="cx">     WebApplicationCacheManager \
</span><span class="cx">     WebApplicationCacheManagerProxy \
</span><span class="cx">     WebConnection \
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -77,6 +77,8 @@
</span><span class="cx"> @property (readwrite) BOOL shouldClipToVisibleRect;
</span><span class="cx"> @property (readwrite) BOOL shouldExpandToViewHeightForAutoLayout;
</span><span class="cx"> @property (readonly, getter=isUsingUISideCompositing) BOOL usingUISideCompositing;
</span><ins>+@property (readwrite) BOOL allowsMagnification;
+@property (readwrite) double magnification;
</ins><span class="cx"> 
</span><span class="cx"> @property(copy, nonatomic) NSColor *underlayColor;
</span><span class="cx"> 
</span><span class="lines">@@ -94,6 +96,8 @@
</span><span class="cx"> - (void)forceAsyncDrawingAreaSizeUpdate:(NSSize)size;
</span><span class="cx"> - (void)waitForAsyncDrawingAreaSizeUpdate;
</span><span class="cx"> 
</span><ins>+- (void)setMagnification:(double)magnification centeredAtPoint:(NSPoint)point;
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #import &quot;TextChecker.h&quot;
</span><span class="cx"> #import &quot;TextCheckerState.h&quot;
</span><span class="cx"> #import &quot;TiledCoreAnimationDrawingAreaProxy.h&quot;
</span><ins>+#import &quot;ViewGestureController.h&quot;
</ins><span class="cx"> #import &quot;WKAPICast.h&quot;
</span><span class="cx"> #import &quot;WKFullScreenWindowController.h&quot;
</span><span class="cx"> #import &quot;WKPrintingView.h&quot;
</span><span class="lines">@@ -231,6 +232,9 @@
</span><span class="cx">     NSRect _contentPreparationRect;
</span><span class="cx">     BOOL _useContentPreparationRectForVisibleRect;
</span><span class="cx">     BOOL _windowOcclusionDetectionEnabled;
</span><ins>+
+    std::unique_ptr&lt;ViewGestureController&gt; _gestureController;
+    BOOL _allowsMagnification;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="lines">@@ -3234,7 +3238,7 @@
</span><span class="cx"> - (void)waitForAsyncDrawingAreaSizeUpdate
</span><span class="cx"> {
</span><span class="cx">     if (DrawingAreaProxy* drawingArea = _data-&gt;_page-&gt;drawingArea()) {
</span><del>-        // If a geometry update is still pending then the action of recieving the
</del><ins>+        // If a geometry update is still pending then the action of receiving the
</ins><span class="cx">         // first geometry update may result in another update being scheduled -
</span><span class="cx">         // we should wait for this to complete too.
</span><span class="cx">         drawingArea-&gt;waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout * 0.5);
</span><span class="lines">@@ -3250,6 +3254,58 @@
</span><span class="cx">     return NO;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_ensureGestureController
+{
+    if (_data-&gt;_gestureController)
+        return;
+
+    _data-&gt;_gestureController = std::make_unique&lt;ViewGestureController&gt;(*_data-&gt;_page);
+}
+
+- (void)setAllowsMagnification:(BOOL)allowsMagnification
+{
+    _data-&gt;_allowsMagnification = allowsMagnification;
+}
+
+- (BOOL)allowsMagnification
+{
+    return _data-&gt;_allowsMagnification;
+}
+
+- (void)magnifyWithEvent:(NSEvent *)event
+{
+    if (!_data-&gt;_allowsMagnification)
+        return;
+
+    [self _ensureGestureController];
+
+    _data-&gt;_gestureController-&gt;handleMagnificationGesture(event.magnification, [self convertPoint:event.locationInWindow fromView:nil]);
+}
+
+-(void)endGestureWithEvent:(NSEvent *)event
+{
+    if (!_data-&gt;_gestureController)
+        return;
+
+    _data-&gt;_gestureController-&gt;endActiveGesture();
+}
+
+- (void)setMagnification:(double)magnification centeredAtPoint:(NSPoint)point
+{
+    _data-&gt;_page-&gt;scalePage(magnification, roundedIntPoint(point));
+}
+
+- (void)setMagnification:(double)magnification
+{
+    FloatPoint viewCenter(NSMidX([self bounds]), NSMidY([self bounds]));
+    _data-&gt;_page-&gt;scalePage(magnification, roundedIntPoint(viewCenter));
+}
+
+- (double)magnification
+{
+    return _data-&gt;_page-&gt;pageScaleFactor();
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WKResponderChainSink
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDrawingAreaProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -70,6 +70,10 @@
</span><span class="cx">     virtual void colorSpaceDidChange() { }
</span><span class="cx">     virtual void minimumLayoutSizeDidChange() { }
</span><span class="cx"> 
</span><ins>+    virtual void beginTransientZoom() { }
+    virtual void adjustTransientZoom(double scale, WebCore::FloatPoint origin) { }
+    virtual void commitTransientZoom(double scale, WebCore::FloatPoint origin) { }
+
</ins><span class="cx"> protected:
</span><span class="cx">     explicit DrawingAreaProxy(DrawingAreaType, WebPageProxy*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacTiledCoreAnimationDrawingAreaProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -50,6 +50,10 @@
</span><span class="cx">     virtual void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&amp;) OVERRIDE;
</span><span class="cx">     virtual void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&amp;) OVERRIDE;
</span><span class="cx"> 
</span><ins>+    virtual void beginTransientZoom() OVERRIDE;
+    virtual void adjustTransientZoom(double scale, WebCore::FloatPoint origin) OVERRIDE;
+    virtual void commitTransientZoom(double scale, WebCore::FloatPoint origin) OVERRIDE;
+
</ins><span class="cx">     // Message handlers.
</span><span class="cx">     virtual void didUpdateGeometry() OVERRIDE;
</span><span class="cx">     virtual void intrinsicContentSizeDidChange(const WebCore::IntSize&amp; newIntrinsicContentSize) OVERRIDE;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacTiledCoreAnimationDrawingAreaProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -148,6 +148,21 @@
</span><span class="cx">     m_isWaitingForDidUpdateGeometry = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TiledCoreAnimationDrawingAreaProxy::beginTransientZoom()
+{
+    m_webPageProxy-&gt;process().send(Messages::DrawingArea::BeginTransientZoom(), m_webPageProxy-&gt;pageID());
+}
+
+void TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom(double scale, FloatPoint origin)
+{
+    m_webPageProxy-&gt;process().send(Messages::DrawingArea::AdjustTransientZoom(scale, origin), m_webPageProxy-&gt;pageID());
+}
+
+void TiledCoreAnimationDrawingAreaProxy::commitTransientZoom(double scale, FloatPoint origin)
+{
+    m_webPageProxy-&gt;process().send(Messages::DrawingArea::CommitTransientZoom(scale, origin), m_webPageProxy-&gt;pageID());
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacViewGestureControllercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.cpp (0 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.cpp                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.cpp        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -0,0 +1,144 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;ViewGestureController.h&quot;
+
+#import &quot;ViewGestureControllerMessages.h&quot;
+#import &quot;WebPageProxy.h&quot;
+#import &quot;WebProcessProxy.h&quot;
+
+using namespace WebCore;
+
+static const CGFloat minMagnification = 0.75;
+static const CGFloat maxMagnification = 3;
+
+static const CGFloat zoomOutBoost = 1.6;
+static const CGFloat zoomOutResistance = 0.10;
+
+namespace WebKit {
+
+ViewGestureController::ViewGestureController(WebPageProxy&amp; webPageProxy)
+    : m_webPageProxy(webPageProxy)
+    , m_activeGestureType(ViewGestureType::None)
+    , m_visibleContentRectIsValid(false)
+{
+    m_webPageProxy.process().addMessageReceiver(Messages::ViewGestureController::messageReceiverName(), m_webPageProxy.pageID(), *this);
+}
+
+ViewGestureController::~ViewGestureController()
+{
+    m_webPageProxy.process().removeMessageReceiver(Messages::ViewGestureController::messageReceiverName(), m_webPageProxy.pageID());
+}
+
+static double resistanceForDelta(double deltaScale, double currentScale)
+{
+    // Zoom in with no acceleration.
+    // FIXME: Should have resistance when zooming in past the limit.
+    if (deltaScale &gt; 0)
+        return 1;
+
+    // Zoom out with slight acceleration, until we reach unit scale.
+    if (currentScale &gt; 1)
+        return zoomOutBoost;
+
+    // Beyond scale=1, resist zooming out.
+    double scaleDistance = minMagnification - currentScale;
+    double scalePercent = std::min(std::max(scaleDistance / minMagnification, 0.), 1.);
+    double resistance = zoomOutResistance + scalePercent * (0.01 - zoomOutResistance);
+
+    return resistance;
+}
+
+FloatPoint ViewGestureController::scaledMagnificationOrigin(FloatPoint origin, double scale)
+{
+    FloatPoint scaledMagnificationOrigin(origin);
+    scaledMagnificationOrigin.moveBy(m_visibleContentRect.location());
+    float magnificationOriginScale = 1 - (scale / m_webPageProxy.pageScaleFactor());
+    scaledMagnificationOrigin.scale(magnificationOriginScale, magnificationOriginScale);
+    return scaledMagnificationOrigin;
+}
+
+void ViewGestureController::didBeginTransientZoom(FloatRect visibleContentRect)
+{
+    m_activeGestureType = ViewGestureType::Magnification;
+    m_visibleContentRect = visibleContentRect;
+    m_visibleContentRectIsValid = true;
+}
+
+void ViewGestureController::handleMagnificationGesture(double scale, FloatPoint origin)
+{
+    ASSERT(m_activeGestureType == ViewGestureType::None || m_activeGestureType == ViewGestureType::Magnification);
+
+    if (m_activeGestureType == ViewGestureType::None) {
+        // FIXME: We drop the first frame of the gesture on the floor, because we don't have the visible content bounds yet.
+        m_magnification = m_webPageProxy.pageScaleFactor();
+        m_webPageProxy.drawingArea()-&gt;beginTransientZoom();
+        return;
+    }
+
+    // We're still waiting for the DidBeginTransientZoom callback.
+    if (!m_visibleContentRectIsValid)
+        return;
+
+    double scaleWithResistance = resistanceForDelta(scale, m_magnification) * scale;
+
+    m_magnification += m_magnification * scaleWithResistance;
+    m_magnification = std::min(std::max(m_magnification, minMagnification), maxMagnification);
+
+    m_magnificationOrigin = origin;
+
+    m_webPageProxy.drawingArea()-&gt;adjustTransientZoom(m_magnification, scaledMagnificationOrigin(origin, m_magnification));
+
+    m_activeGestureType = ViewGestureType::Magnification;
+}
+
+void ViewGestureController::endMagnificationGesture()
+{
+    ASSERT(m_activeGestureType == ViewGestureType::Magnification);
+
+    // FIXME: Should rubber-band back when zoomed in or out past the limit.
+    double newMagnification = std::max(m_magnification, 1.);
+
+    FloatPoint scaledOrigin = scaledMagnificationOrigin(m_magnificationOrigin, newMagnification);
+    scaledOrigin.moveBy(-m_visibleContentRect.location());
+
+    m_webPageProxy.drawingArea()-&gt;commitTransientZoom(newMagnification, -scaledOrigin);
+}
+
+void ViewGestureController::endActiveGesture()
+{
+    switch (m_activeGestureType) {
+    case ViewGestureType::None:
+        break;
+    case ViewGestureType::Magnification:
+        endMagnificationGesture();
+    }
+
+    m_visibleContentRectIsValid = false;
+    m_activeGestureType = ViewGestureType::None;
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacViewGestureControllerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h (0 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ViewGestureController_h
+#define ViewGestureController_h
+
+#include &quot;MessageReceiver.h&quot;
+#include &lt;WebCore/FloatRect.h&gt;
+
+namespace WebKit {
+
+class WebPageProxy;
+
+class ViewGestureController : private CoreIPC::MessageReceiver {
+    WTF_MAKE_NONCOPYABLE(ViewGestureController);
+public:
+    ViewGestureController(WebPageProxy&amp;);
+    ~ViewGestureController();
+
+    void handleMagnificationGesture(double scale, WebCore::FloatPoint origin);
+
+    void endActiveGesture();
+
+    enum class ViewGestureType {
+        None,
+        Magnification,
+    };
+
+private:
+    // CoreIPC::MessageReceiver.
+    virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&amp;) OVERRIDE;
+
+    // Message handlers.
+    void didBeginTransientZoom(WebCore::FloatRect visibleContentBounds);
+
+    void endMagnificationGesture();
+    WebCore::FloatPoint scaledMagnificationOrigin(WebCore::FloatPoint origin, double scale);
+
+    WebPageProxy&amp; m_webPageProxy;
+
+    double m_magnification;
+    WebCore::FloatPoint m_magnificationOrigin;
+
+    ViewGestureType m_activeGestureType;
+
+    WebCore::FloatRect m_visibleContentRect;
+    bool m_visibleContentRectIsValid;
+};
+
+} // namespace WebKit
+
+#endif // ViewGestureController_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacViewGestureControllermessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.messages.in (0 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.messages.in                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.messages.in        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+# Copyright (C) 2013 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+messages -&gt; ViewGestureController {
+    DidBeginTransientZoom(WebCore::FloatRect visibleContentBounds)
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -352,6 +352,10 @@
</span><span class="cx">                 29CD55AB128E294F00133C85 /* WKAccessibilityWebPageObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CD55A9128E294F00133C85 /* WKAccessibilityWebPageObject.mm */; };
</span><span class="cx">                 29D55DF1161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29D55DEF161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp */; };
</span><span class="cx">                 29D55DF2161BF9F10031A2E3 /* WebPageGroupProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 29D55DF0161BF9F10031A2E3 /* WebPageGroupProxyMessages.h */; };
</span><ins>+                2D125C5E1857EA05003BA3CB /* ViewGestureController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D125C5C1857EA05003BA3CB /* ViewGestureController.h */; };
+                2D125C5F1857EA05003BA3CB /* ViewGestureController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D125C5D1857EA05003BA3CB /* ViewGestureController.cpp */; };
+                2D1B5D5D185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D1B5D5B185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp */; };
+                2D1B5D5E185869C8006C6596 /* ViewGestureControllerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D1B5D5C185869C8006C6596 /* ViewGestureControllerMessages.h */; };
</ins><span class="cx">                 2D2ADF0916362DD500197E47 /* PDFPluginTextAnnotation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D2ADF0616362DC700197E47 /* PDFPluginTextAnnotation.mm */; };
</span><span class="cx">                 2D2ADF0B16362DDB00197E47 /* PDFPluginAnnotation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D2ADF031636243500197E47 /* PDFPluginAnnotation.mm */; };
</span><span class="cx">                 2D2ADF1016364D8200197E47 /* PDFPluginChoiceAnnotation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D2ADF0E16364D8200197E47 /* PDFPluginChoiceAnnotation.mm */; };
</span><span class="lines">@@ -1895,6 +1899,11 @@
</span><span class="cx">                 29D55DEE161BF8780031A2E3 /* WebPageGroupProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebPageGroupProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 29D55DEF161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageGroupProxyMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 29D55DF0161BF9F10031A2E3 /* WebPageGroupProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageGroupProxyMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2D125C5C1857EA05003BA3CB /* ViewGestureController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewGestureController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D125C5D1857EA05003BA3CB /* ViewGestureController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewGestureController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D1B5D5A18586599006C6596 /* ViewGestureController.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = ViewGestureController.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D1B5D5B185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewGestureControllerMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D1B5D5C185869C8006C6596 /* ViewGestureControllerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewGestureControllerMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2D2ADF021636243500197E47 /* PDFPluginAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFPluginAnnotation.h; path = PDF/PDFPluginAnnotation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D2ADF031636243500197E47 /* PDFPluginAnnotation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PDFPluginAnnotation.mm; path = PDF/PDFPluginAnnotation.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D2ADF0516362DC700197E47 /* PDFPluginTextAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFPluginTextAnnotation.h; path = PDF/PDFPluginTextAnnotation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5274,6 +5283,9 @@
</span><span class="cx">                                 1AA417ED12C00D87002BE67B /* TextCheckerMac.mm */,
</span><span class="cx">                                 1AF05D8514688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h */,
</span><span class="cx">                                 1AF05D8414688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.mm */,
</span><ins>+                                2D125C5C1857EA05003BA3CB /* ViewGestureController.h */,
+                                2D125C5D1857EA05003BA3CB /* ViewGestureController.cpp */,
+                                2D1B5D5A18586599006C6596 /* ViewGestureController.messages.in */,
</ins><span class="cx">                                 728E86EF1795188C0087879E /* WebColorPickerMac.h */,
</span><span class="cx">                                 728E86F01795188C0087879E /* WebColorPickerMac.mm */,
</span><span class="cx">                                 1A1C648611F415B700553C19 /* WebContextMac.mm */,
</span><span class="lines">@@ -5452,6 +5464,8 @@
</span><span class="cx">                                 1A334DEC16DE8F88006A8E38 /* StorageAreaMapMessages.h */,
</span><span class="cx">                                 1AB31A9416BC688100F6DBC9 /* StorageManagerMessageReceiver.cpp */,
</span><span class="cx">                                 1AB31A9516BC688100F6DBC9 /* StorageManagerMessages.h */,
</span><ins>+                                2D1B5D5B185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp */,
+                                2D1B5D5C185869C8006C6596 /* ViewGestureControllerMessages.h */,
</ins><span class="cx">                                 512E3568130B57F000ABD19A /* WebApplicationCacheManagerMessageReceiver.cpp */,
</span><span class="cx">                                 512E3569130B57F000ABD19A /* WebApplicationCacheManagerMessages.h */,
</span><span class="cx">                                 512E35F6130B642E00ABD19A /* WebApplicationCacheManagerProxyMessageReceiver.cpp */,
</span><span class="lines">@@ -5746,6 +5760,7 @@
</span><span class="cx">                                 1A24B5F311F531E800C38269 /* MachUtilities.h in Headers */,
</span><span class="cx">                                 1A232903162C867300D82F7A /* MessageDecoder.h in Headers */,
</span><span class="cx">                                 51FCB18617BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h in Headers */,
</span><ins>+                                2D1B5D5E185869C8006C6596 /* ViewGestureControllerMessages.h in Headers */,
</ins><span class="cx">                                 1A2328FF162C866A00D82F7A /* MessageEncoder.h in Headers */,
</span><span class="cx">                                 1AC4C82916B876A90069DCCD /* MessageFlags.h in Headers */,
</span><span class="cx">                                 1AE00D6C18327C1200087DD7 /* StringReference.h in Headers */,
</span><span class="lines">@@ -5992,6 +6007,7 @@
</span><span class="cx">                                 BC9BA5051697C45300E44616 /* WebKit2Initialize.h in Headers */,
</span><span class="cx">                                 BC59534210FC04520098F82D /* WebLoaderClient.h in Headers */,
</span><span class="cx">                                 33D3A3C2133960B000709BE4 /* WebMediaCacheManager.h in Headers */,
</span><ins>+                                2D125C5E1857EA05003BA3CB /* ViewGestureController.h in Headers */,
</ins><span class="cx">                                 33D3A3C91339617900709BE4 /* WebMediaCacheManagerMessages.h in Headers */,
</span><span class="cx">                                 37C4C08D1814AC5C003688B9 /* WKBackForwardList.h in Headers */,
</span><span class="cx">                                 371A19421824D29300F32A5E /* WKNSDictionary.h in Headers */,
</span><span class="lines">@@ -7255,6 +7271,7 @@
</span><span class="cx">                                 BCD3675C148C26C000447E87 /* WebConnectionToUIProcess.cpp in Sources */,
</span><span class="cx">                                 BC4A62A714744EC7006C681A /* WebConnectionToWebProcess.cpp in Sources */,
</span><span class="cx">                                 BC82836516B354F600A278FE /* WebContentProcessMain.mm in Sources */,
</span><ins>+                                2D125C5F1857EA05003BA3CB /* ViewGestureController.cpp in Sources */,
</ins><span class="cx">                                 BC82839916B48DC000A278FE /* WebContentServiceEntryPoint.mm in Sources */,
</span><span class="cx">                                 BCB9E2441120DACA00A137E0 /* WebContext.cpp in Sources */,
</span><span class="cx">                                 31A505F91680025500A930EB /* WebContextClient.cpp in Sources */,
</span><span class="lines">@@ -7517,6 +7534,7 @@
</span><span class="cx">                                 BCBAACEC145225E30053F82F /* WKProcessGroup.mm in Sources */,
</span><span class="cx">                                 512F58FB12A88A5400629530 /* WKProtectionSpace.cpp in Sources */,
</span><span class="cx">                                 37948408150C4B9700E52CE9 /* WKRenderLayer.cpp in Sources */,
</span><ins>+                                2D1B5D5D185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp in Sources */,
</ins><span class="cx">                                 37608822150414F700FC82C7 /* WKRenderObject.cpp in Sources */,
</span><span class="cx">                                 3336763A130C99DC006C9DE2 /* WKResourceCacheManager.cpp in Sources */,
</span><span class="cx">                                 F634445C12A885E9000612D8 /* WKSecurityOrigin.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -126,6 +126,10 @@
</span><span class="cx">     virtual void updateGeometry(const WebCore::IntSize&amp; viewSize, const WebCore::IntSize&amp; layerPosition) { }
</span><span class="cx">     virtual void setDeviceScaleFactor(float) { }
</span><span class="cx">     virtual void setColorSpace(const ColorSpaceData&amp;) { }
</span><ins>+
+    virtual void beginTransientZoom() { }
+    virtual void adjustTransientZoom(double scale, WebCore::FloatPoint origin) { }
+    virtual void commitTransientZoom(double scale, WebCore::FloatPoint origin) { }
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreamessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -30,5 +30,9 @@
</span><span class="cx">     UpdateGeometry(WebCore::IntSize viewSize, WebCore::IntSize layerPosition)
</span><span class="cx">     SetDeviceScaleFactor(float deviceScaleFactor)
</span><span class="cx">     SetColorSpace(WebKit::ColorSpaceData colorSpace)
</span><ins>+    
+    BeginTransientZoom()
+    AdjustTransientZoom(double scale, WebCore::FloatPoint origin)
+    CommitTransientZoom(double scale, WebCore::FloatPoint origin)
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -104,6 +104,10 @@
</span><span class="cx">     virtual void setLayerHostingMode(uint32_t) OVERRIDE;
</span><span class="cx">     virtual void setColorSpace(const ColorSpaceData&amp;) OVERRIDE;
</span><span class="cx"> 
</span><ins>+    virtual void beginTransientZoom() OVERRIDE;
+    virtual void adjustTransientZoom(double scale, WebCore::FloatPoint origin) OVERRIDE;
+    virtual void commitTransientZoom(double scale, WebCore::FloatPoint origin) OVERRIDE;
+
</ins><span class="cx">     void updateLayerHostingContext();
</span><span class="cx"> 
</span><span class="cx">     void setRootCompositingLayer(CALayer *);
</span><span class="lines">@@ -143,6 +147,8 @@
</span><span class="cx">     WebCore::IntSize m_lastSentIntrinsicContentSize;
</span><span class="cx">     WebCore::Timer&lt;TiledCoreAnimationDrawingArea&gt; m_updateIntrinsicContentSizeTimer;
</span><span class="cx">     bool m_inUpdateGeometry;
</span><ins>+
+    double m_transientZoomScale;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #import &quot;DrawingAreaProxyMessages.h&quot;
</span><span class="cx"> #import &quot;LayerHostingContext.h&quot;
</span><span class="cx"> #import &quot;LayerTreeContext.h&quot;
</span><ins>+#import &quot;ViewGestureControllerMessages.h&quot;
</ins><span class="cx"> #import &quot;WebFrame.h&quot;
</span><span class="cx"> #import &quot;WebPage.h&quot;
</span><span class="cx"> #import &quot;WebPageCreationParameters.h&quot;
</span><span class="lines">@@ -43,6 +44,8 @@
</span><span class="cx"> #import &lt;WebCore/GraphicsLayerCA.h&gt;
</span><span class="cx"> #import &lt;WebCore/MainFrame.h&gt;
</span><span class="cx"> #import &lt;WebCore/Page.h&gt;
</span><ins>+#import &lt;WebCore/RenderLayerBacking.h&gt;
+#import &lt;WebCore/RenderLayerCompositor.h&gt;
</ins><span class="cx"> #import &lt;WebCore/RenderView.h&gt;
</span><span class="cx"> #import &lt;WebCore/Settings.h&gt;
</span><span class="cx"> #import &lt;WebCore/TiledBacking.h&gt;
</span><span class="lines">@@ -697,6 +700,54 @@
</span><span class="cx">     return frameView &amp;&amp; frameView-&gt;frame().isMainFrame();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TiledCoreAnimationDrawingArea::beginTransientZoom()
+{
+    FloatRect visibleContentRect = m_webPage-&gt;corePage()-&gt;mainFrame().view()-&gt;visibleContentRect(ScrollableArea::IncludeScrollbars);
+    m_webPage-&gt;send(Messages::ViewGestureController::DidBeginTransientZoom(visibleContentRect));
+}
+
+void TiledCoreAnimationDrawingArea::adjustTransientZoom(double scale, FloatPoint origin)
+{
+    // FIXME: Scrollbars should stay in-place and change height while zooming.
+    // FIXME: Keep around pageScale=1 tiles so we can zoom out without gaps.
+    // FIXME: Bring in unparented-but-painted tiles when zooming out, to fill in any gaps.
+
+    if (!m_rootLayer)
+        return;
+
+    RenderView* renderView = m_webPage-&gt;corePage()-&gt;mainFrame().view()-&gt;renderView();
+
+    TransformationMatrix transform;
+    transform.translate(origin.x(), origin.y());
+    transform.scale(scale);
+
+    PlatformCALayer* renderViewLayer = static_cast&lt;GraphicsLayerCA*&gt;(renderView-&gt;layer()-&gt;backing()-&gt;graphicsLayer())-&gt;platformCALayer();
+    renderViewLayer-&gt;setTransform(transform);
+    renderViewLayer-&gt;setAnchorPoint(FloatPoint3D());
+    renderViewLayer-&gt;setPosition(FloatPoint3D());
+
+    // FIXME: We should transform the shadow layer as well, instead of hiding it.
+    PlatformCALayer* shadowLayer = static_cast&lt;GraphicsLayerCA*&gt;(renderView-&gt;compositor().layerForContentShadow())-&gt;platformCALayer();
+    shadowLayer-&gt;setHidden(true);
+
+    m_transientZoomScale = scale;
+}
+
+void TiledCoreAnimationDrawingArea::commitTransientZoom(double scale, FloatPoint origin)
+{
+    RenderView* renderView = m_webPage-&gt;corePage()-&gt;mainFrame().view()-&gt;renderView();
+
+    // If the page scale is already the target scale, scalePage() will short-circuit
+    // and not apply the transform, so we can't clear it.
+    if (m_transientZoomScale != m_webPage-&gt;pageScaleFactor())
+       static_cast&lt;GraphicsLayerCA*&gt;(renderView-&gt;layer()-&gt;backing()-&gt;graphicsLayer())-&gt;platformCALayer()-&gt;setTransform(TransformationMatrix());
+
+    PlatformCALayer* shadowLayer = static_cast&lt;GraphicsLayerCA*&gt;(renderView-&gt;compositor().layerForContentShadow())-&gt;platformCALayer();
+    shadowLayer-&gt;setHidden(false);
+
+    m_webPage-&gt;scalePage(scale, roundedIntPoint(origin));
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Tools/ChangeLog        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2013-12-12  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        [wk2] Handle pinch-to-zoom gesture
+        https://bugs.webkit.org/show_bug.cgi?id=125604
+
+        Reviewed by Simon Fraser.
+
+        * MiniBrowser/mac/WK2BrowserWindowController.m:
+        (-[WK2BrowserWindowController awakeFromNib]):
+        Enable handling of the magnification gesture in Minibrowser WebKit2 windows.
+
</ins><span class="cx"> 2013-12-12  Eunmi Lee  &lt;eunmi15.lee@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Add myself as a committer.
</span></span></pre></div>
<a id="trunkToolsMiniBrowsermacWK2BrowserWindowControllerm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m (160519 => 160520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m        2013-12-13 01:32:08 UTC (rev 160519)
+++ trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m        2013-12-13 01:36:15 UTC (rev 160520)
</span><span class="lines">@@ -503,6 +503,8 @@
</span><span class="cx"> {
</span><span class="cx">     _webView = [[WKView alloc] initWithFrame:[containerView bounds] processGroup:_processGroup browsingContextGroup:_browsingContextGroup];
</span><span class="cx"> 
</span><ins>+    _webView.allowsMagnification = YES;
+
</ins><span class="cx">     [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
</span><span class="cx">     [containerView addSubview:_webView];
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>