<!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>[164736] trunk/Source/WebKit2</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/164736">164736</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-26 12:18:30 -0800 (Wed, 26 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/164725">r164725</a> and <a href="http://trac.webkit.org/projects/webkit/changeset/164731">r164731</a>.
http://trac.webkit.org/changeset/164725
http://trac.webkit.org/changeset/164731
https://bugs.webkit.org/show_bug.cgi?id=129382

WebKitTestRunner build is broken on IOS (Requested by smfr on
#webkit).

* UIProcess/API/Cocoa/WKView.h:
* UIProcess/API/ios/WKViewIOS.mm: Added.
(-[WKView initWithCoder:]):
(-[WKView initWithFrame:processGroup:browsingContextGroup:]):
(-[WKView initWithFrame:processGroup:browsingContextGroup:relatedToView:]):
(-[WKView dealloc]):
(-[WKView setFrame:]):
(-[WKView setBounds:]):
(-[WKView scrollView]):
(-[WKView browsingContextController]):
(-[WKView setAllowsBackForwardNavigationGestures:]):
(-[WKView allowsBackForwardNavigationGestures]):
(-[WKView viewForZoomingInScrollView:]):
(-[WKView scrollViewWillBeginZooming:withView:]):
(-[WKView scrollViewWillBeginDragging:]):
(-[WKView _didFinishScrolling]):
(-[WKView scrollViewDidEndDragging:willDecelerate:]):
(-[WKView scrollViewDidEndDecelerating:]):
(-[WKView scrollViewDidScrollToTop:]):
(-[WKView scrollViewDidScroll:]):
(-[WKView scrollViewDidZoom:]):
(-[WKView scrollViewDidEndZooming:withView:atScale:]):
(-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
(-[WKView _frameOrBoundsChanged]):
(-[WKView _updateVisibleContentRects]):
(-[WKView _keyboardChangedWithInfo:adjustScrollView:]):
(-[WKView _keyboardWillChangeFrame:]):
(-[WKView _keyboardDidChangeFrame:]):
(-[WKView _keyboardWillShow:]):
(-[WKView _keyboardWillHide:]):
(-[WKView pageRef]):
(-[WKView initWithFrame:contextRef:pageGroupRef:]):
(-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
(-[WKView minimumLayoutSizeOverride]):
(-[WKView setMinimumLayoutSizeOverride:]):
(-[WKView _obscuredInsets]):
(-[WKView _setObscuredInsets:]):
(-[WKView _beginInteractiveObscuredInsetsChange]):
(-[WKView _endInteractiveObscuredInsetsChange]):
(-[WKView _pageExtendedBackgroundColor]):
(-[WKView _setBackgroundExtendsBeyondPage:]):
(-[WKView _backgroundExtendsBeyondPage]):
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKViewh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKView.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebKit2/UIProcess/API/ios/</li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosWKViewIOSmm">trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (164735 => 164736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-26 20:15:44 UTC (rev 164735)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-26 20:18:30 UTC (rev 164736)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2014-02-26  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r164725 and r164731.
+        http://trac.webkit.org/changeset/164725
+        http://trac.webkit.org/changeset/164731
+        https://bugs.webkit.org/show_bug.cgi?id=129382
+
+        WebKitTestRunner build is broken on IOS (Requested by smfr on
+        #webkit).
+
+        * UIProcess/API/Cocoa/WKView.h:
+        * UIProcess/API/ios/WKViewIOS.mm: Added.
+        (-[WKView initWithCoder:]):
+        (-[WKView initWithFrame:processGroup:browsingContextGroup:]):
+        (-[WKView initWithFrame:processGroup:browsingContextGroup:relatedToView:]):
+        (-[WKView dealloc]):
+        (-[WKView setFrame:]):
+        (-[WKView setBounds:]):
+        (-[WKView scrollView]):
+        (-[WKView browsingContextController]):
+        (-[WKView setAllowsBackForwardNavigationGestures:]):
+        (-[WKView allowsBackForwardNavigationGestures]):
+        (-[WKView viewForZoomingInScrollView:]):
+        (-[WKView scrollViewWillBeginZooming:withView:]):
+        (-[WKView scrollViewWillBeginDragging:]):
+        (-[WKView _didFinishScrolling]):
+        (-[WKView scrollViewDidEndDragging:willDecelerate:]):
+        (-[WKView scrollViewDidEndDecelerating:]):
+        (-[WKView scrollViewDidScrollToTop:]):
+        (-[WKView scrollViewDidScroll:]):
+        (-[WKView scrollViewDidZoom:]):
+        (-[WKView scrollViewDidEndZooming:withView:atScale:]):
+        (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
+        (-[WKView _frameOrBoundsChanged]):
+        (-[WKView _updateVisibleContentRects]):
+        (-[WKView _keyboardChangedWithInfo:adjustScrollView:]):
+        (-[WKView _keyboardWillChangeFrame:]):
+        (-[WKView _keyboardDidChangeFrame:]):
+        (-[WKView _keyboardWillShow:]):
+        (-[WKView _keyboardWillHide:]):
+        (-[WKView pageRef]):
+        (-[WKView initWithFrame:contextRef:pageGroupRef:]):
+        (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
+        (-[WKView minimumLayoutSizeOverride]):
+        (-[WKView setMinimumLayoutSizeOverride:]):
+        (-[WKView _obscuredInsets]):
+        (-[WKView _setObscuredInsets:]):
+        (-[WKView _beginInteractiveObscuredInsetsChange]):
+        (-[WKView _endInteractiveObscuredInsetsChange]):
+        (-[WKView _pageExtendedBackgroundColor]):
+        (-[WKView _setBackgroundExtendsBeyondPage:]):
+        (-[WKView _backgroundExtendsBeyondPage]):
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-02-26  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Build fix: ContextMenuContextData.* should not be in the Copy Files
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKView.h (164735 => 164736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKView.h        2014-02-26 20:15:44 UTC (rev 164735)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKView.h        2014-02-26 20:18:30 UTC (rev 164736)
</span><span class="lines">@@ -25,7 +25,11 @@
</span><span class="cx"> 
</span><span class="cx"> #import &lt;WebKit2/WKFoundation.h&gt;
</span><span class="cx"> 
</span><ins>+#if TARGET_OS_IPHONE
+#import &lt;UIKit/UIKit.h&gt;
+#else
</ins><span class="cx"> #import &lt;Cocoa/Cocoa.h&gt;
</span><ins>+#endif
</ins><span class="cx"> #import &lt;WebKit2/WKDeclarationSpecifiers.h&gt;
</span><span class="cx"> 
</span><span class="cx"> @class WKBrowsingContextController;
</span><span class="lines">@@ -33,8 +37,13 @@
</span><span class="cx"> @class WKProcessGroup;
</span><span class="cx"> @class WKViewData;
</span><span class="cx"> 
</span><ins>+#if TARGET_OS_IPHONE
</ins><span class="cx"> WK_EXPORT
</span><ins>+@interface WKView : UIView {
+#else
+WK_EXPORT
</ins><span class="cx"> @interface WKView : NSView &lt;NSTextInputClient&gt; {
</span><ins>+#endif
</ins><span class="cx"> @private
</span><span class="cx">     WKViewData *_data;
</span><span class="cx">     unsigned _unused;
</span><span class="lines">@@ -42,8 +51,13 @@
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span><ins>+#if TARGET_OS_IPHONE
+- (id)initWithFrame:(CGRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup;
+- (id)initWithFrame:(CGRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup relatedToView:(WKView *)relatedView;
+#else
</ins><span class="cx"> - (id)initWithFrame:(NSRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup;
</span><span class="cx"> - (id)initWithFrame:(NSRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup relatedToView:(WKView *)relatedView;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> @property(readonly) WKBrowsingContextController *browsingContextController;
</span><span class="cx"> 
</span><span class="lines">@@ -52,4 +66,8 @@
</span><span class="cx"> @property BOOL drawsBackground;
</span><span class="cx"> @property BOOL drawsTransparentBackground;
</span><span class="cx"> 
</span><ins>+#if TARGET_OS_IPHONE
+@property (nonatomic, readonly) UIScrollView *scrollView;
+#endif
+
</ins><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosWKViewIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm (0 => 164736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm        2014-02-26 20:18:30 UTC (rev 164736)
</span><span class="lines">@@ -0,0 +1,386 @@
</span><ins>+/*
+ * Copyright (C) 2013, 2014 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;WKViewPrivate.h&quot;
+
+#import &quot;RemoteLayerTreeTransaction.h&quot;
+#import &quot;ViewGestureController.h&quot;
+#import &quot;WebPageProxy.h&quot;
+#import &quot;WKBrowsingContextGroupPrivate.h&quot;
+#import &quot;WKContentView.h&quot;
+#import &quot;WKProcessGroupPrivate.h&quot;
+#import &quot;WKScrollView.h&quot;
+#import &quot;WKAPICast.h&quot;
+#import &lt;UIKit/UIImage_Private.h&gt;
+#import &lt;UIKit/UIPeripheralHost_Private.h&gt;
+#import &lt;UIKit/UIScreen.h&gt;
+#import &lt;UIKit/UIScrollView_Private.h&gt;
+#import &lt;UIKit/UIWindow_Private.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+using namespace WebKit;
+
+@interface WKView () &lt;UIScrollViewDelegate&gt;
+@end
+
+@interface UIScrollView (UIScrollViewInternal)
+- (void)_adjustForAutomaticKeyboardInfo:(NSDictionary*)info animated:(BOOL)animated lastAdjustment:(CGFloat*)lastAdjustment;
+@end
+
+@implementation WKView {
+    RetainPtr&lt;WKScrollView&gt; _scrollView;
+    RetainPtr&lt;WKContentView&gt; _contentView;
+
+    BOOL _isWaitingForNewLayerTreeAfterDidCommitLoad;
+    std::unique_ptr&lt;ViewGestureController&gt; _gestureController;
+    
+    BOOL _allowsBackForwardNavigationGestures;
+
+    BOOL _hasStaticMinimumLayoutSize;
+    CGSize _minimumLayoutSizeOverride;
+
+    UIEdgeInsets _obscuredInsets;
+    bool _isChangingObscuredInsetsInteractively;
+    CGFloat _lastAdjustmentForScroller;
+}
+
+- (id)initWithCoder:(NSCoder *)coder
+{
+    // FIXME: Implement.
+    [self release];
+    return nil;
+}
+
+- (id)initWithFrame:(CGRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup
+{
+    return [self initWithFrame:frame processGroup:processGroup browsingContextGroup:browsingContextGroup relatedToView:nil];
+}
+
+- (id)initWithFrame:(CGRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup relatedToView:(WKView *)relatedView
+{
+    if (!(self = [super initWithFrame:frame]))
+        return nil;
+
+    [self _commonInitializationWithContextRef:processGroup._contextRef pageGroupRef:browsingContextGroup._pageGroupRef relatedToPage:relatedView ? [relatedView pageRef] : nullptr];
+    return self;
+}
+
+- (void)dealloc
+{
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+    [super dealloc];
+}
+
+- (void)setFrame:(CGRect)frame
+{
+    CGRect oldFrame = [self frame];
+    [super setFrame:frame];
+
+    if (!CGSizeEqualToSize(oldFrame.size, frame.size))
+        [self _frameOrBoundsChanged];
+}
+
+- (void)setBounds:(CGRect)bounds
+{
+    CGRect oldBounds = [self bounds];
+    [super setBounds:bounds];
+    
+    if (!CGSizeEqualToSize(oldBounds.size, bounds.size))
+        [self _frameOrBoundsChanged];
+}
+
+- (UIScrollView *)scrollView
+{
+    return _scrollView.get();
+}
+
+- (WKBrowsingContextController *)browsingContextController
+{
+    return [_contentView browsingContextController];
+}
+
+- (void)setAllowsBackForwardNavigationGestures:(BOOL)allowsBackForwardNavigationGestures
+{
+    if (_allowsBackForwardNavigationGestures == allowsBackForwardNavigationGestures)
+        return;
+
+    _allowsBackForwardNavigationGestures = allowsBackForwardNavigationGestures;
+    
+    WebPageProxy *webPageProxy = [_contentView page];
+    
+    if (allowsBackForwardNavigationGestures) {
+        if (!_gestureController) {
+            _gestureController = std::make_unique&lt;ViewGestureController&gt;(*webPageProxy);
+            _gestureController-&gt;installSwipeHandler(self, [self scrollView]);
+        }
+    } else
+        _gestureController = nullptr;
+    
+    webPageProxy-&gt;setShouldRecordNavigationSnapshots(allowsBackForwardNavigationGestures);
+}
+
+- (BOOL)allowsBackForwardNavigationGestures
+{
+    return _allowsBackForwardNavigationGestures;
+}
+
+#pragma mark - UIScrollViewDelegate
+
+- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
+{
+    ASSERT(_scrollView == scrollView);
+    return _contentView.get();
+}
+
+- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view
+{
+    if (scrollView.pinchGestureRecognizer.state == UIGestureRecognizerStateBegan)
+        [_contentView willStartUserTriggeredZoom];
+    [_contentView willStartZoomOrScroll];
+}
+
+- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
+{
+    if (scrollView.panGestureRecognizer.state == UIGestureRecognizerStateBegan)
+        [_contentView willStartUserTriggeredScroll];
+    [_contentView willStartZoomOrScroll];
+}
+
+- (void)_didFinishScrolling
+{
+    [self _updateVisibleContentRects];
+    [_contentView didFinishScrolling];
+}
+
+- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
+{
+    // If we're decelerating, scroll offset will be updated when scrollViewDidFinishDecelerating: is called.
+    if (!decelerate)
+        [self _didFinishScrolling];
+}
+
+- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
+{
+    [self _didFinishScrolling];
+}
+
+- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
+{
+    [self _didFinishScrolling];
+}
+
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView
+{
+    [self _updateVisibleContentRects];
+}
+
+- (void)scrollViewDidZoom:(UIScrollView *)scrollView
+{
+    [self _updateVisibleContentRects];
+}
+
+- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
+{
+    ASSERT(scrollView == _scrollView);
+    [self _updateVisibleContentRects];
+    [_contentView didZoomToScale:scale];
+}
+
+#pragma mark Internal
+
+- (void)_commonInitializationWithContextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage
+{
+    ASSERT(!_scrollView);
+    ASSERT(!_contentView);
+
+    CGRect bounds = self.bounds;
+
+    _scrollView = adoptNS([[WKScrollView alloc] initWithFrame:bounds]);
+    [_scrollView setInternalDelegate:self];
+    [_scrollView setBouncesZoom:YES];
+
+    [self addSubview:_scrollView.get()];
+
+    WebKit::WebPageConfiguration webPageConfiguration;
+    webPageConfiguration.pageGroup = toImpl(pageGroupRef);
+    webPageConfiguration.relatedPage = toImpl(relatedPage);
+
+    _contentView = adoptNS([[WKContentView alloc] initWithFrame:bounds context:*toImpl(contextRef) configuration:std::move(webPageConfiguration)]);
+
+    [[_contentView layer] setAnchorPoint:CGPointZero];
+    [_contentView setFrame:bounds];
+    [_scrollView addSubview:_contentView.get()];
+
+    [self _frameOrBoundsChanged];
+
+    NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
+    [center addObserver:self selector:@selector(_keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
+    [center addObserver:self selector:@selector(_keyboardDidChangeFrame:) name:UIKeyboardDidChangeFrameNotification object:nil];
+    [center addObserver:self selector:@selector(_keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
+    [center addObserver:self selector:@selector(_keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
+}
+
+- (void)_frameOrBoundsChanged
+{
+    CGRect bounds = [self bounds];
+    if (!_hasStaticMinimumLayoutSize)
+        [_contentView setMinimumLayoutSize:bounds.size];
+    [_scrollView setFrame:bounds];
+    [_contentView setMinimumSize:bounds.size];
+    [self _updateVisibleContentRects];
+}
+
+- (void)_updateVisibleContentRects
+{
+    CGRect fullViewRect = self.bounds;
+    CGRect visibleRectInContentCoordinates = [self convertRect:fullViewRect toView:_contentView.get()];
+
+    CGRect unobscuredRect = UIEdgeInsetsInsetRect(fullViewRect, _obscuredInsets);
+    CGRect unobscuredRectInContentCoordinates = [self convertRect:unobscuredRect toView:_contentView.get()];
+
+    CGFloat scaleFactor = [_scrollView zoomScale];
+
+    [_contentView didUpdateVisibleRect:visibleRectInContentCoordinates unobscuredRect:unobscuredRectInContentCoordinates scale:scaleFactor inStableState:YES];
+}
+
+- (void)_keyboardChangedWithInfo:(NSDictionary *)keyboardInfo adjustScrollView:(BOOL)adjustScrollView
+{
+    // FIXME: We will also need to adjust the unobscured rect by taking into account the keyboard rect and the obscured insets.
+    if (adjustScrollView)
+        [_scrollView _adjustForAutomaticKeyboardInfo:keyboardInfo animated:YES lastAdjustment:&amp;_lastAdjustmentForScroller];
+}
+
+- (void)_keyboardWillChangeFrame:(NSNotification *)notification
+{
+    if ([_contentView isAssistingNode])
+        [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:YES];
+}
+
+- (void)_keyboardDidChangeFrame:(NSNotification *)notification
+{
+    [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:NO];
+}
+
+- (void)_keyboardWillShow:(NSNotification *)notification
+{
+    if ([_contentView isAssistingNode])
+        [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:YES];
+}
+
+- (void)_keyboardWillHide:(NSNotification *)notification
+{
+    // Ignore keyboard will hide notifications sent during rotation. They're just there for
+    // backwards compatibility reasons and processing the will hide notification would
+    // temporarily screw up the the unobscured view area.
+    if ([[UIPeripheralHost sharedInstance] rotationState])
+        return;
+
+    [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:YES];
+}
+
+@end
+
+@implementation WKView (Private)
+
+- (WKPageRef)pageRef
+{
+    return toAPI([_contentView page]);
+}
+
+- (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef
+{
+    return [self initWithFrame:frame contextRef:contextRef pageGroupRef:pageGroupRef relatedToPage:nil];
+}
+
+- (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage
+{
+    if (!(self = [super initWithFrame:frame]))
+        return nil;
+
+    [self _commonInitializationWithContextRef:contextRef pageGroupRef:pageGroupRef relatedToPage:relatedPage];
+    return self;
+}
+
+- (CGSize)minimumLayoutSizeOverride
+{
+    ASSERT(_hasStaticMinimumLayoutSize);
+    return _minimumLayoutSizeOverride;
+}
+
+- (void)setMinimumLayoutSizeOverride:(CGSize)minimumLayoutSizeOverride
+{
+    _hasStaticMinimumLayoutSize = YES;
+    _minimumLayoutSizeOverride = minimumLayoutSizeOverride;
+    [_contentView setMinimumLayoutSize:minimumLayoutSizeOverride];
+}
+
+- (UIEdgeInsets)_obscuredInsets
+{
+    return _obscuredInsets;
+}
+
+- (void)_setObscuredInsets:(UIEdgeInsets)obscuredInsets
+{
+    ASSERT(obscuredInsets.top &gt;= 0);
+    ASSERT(obscuredInsets.left &gt;= 0);
+    ASSERT(obscuredInsets.bottom &gt;= 0);
+    ASSERT(obscuredInsets.right &gt;= 0);
+    _obscuredInsets = obscuredInsets;
+    [self _updateVisibleContentRects];
+}
+
+- (void)_beginInteractiveObscuredInsetsChange
+{
+    ASSERT(!_isChangingObscuredInsetsInteractively);
+    _isChangingObscuredInsetsInteractively = YES;
+}
+
+- (void)_endInteractiveObscuredInsetsChange
+{
+    ASSERT(_isChangingObscuredInsetsInteractively);
+    _isChangingObscuredInsetsInteractively = NO;
+}
+
+- (UIColor *)_pageExtendedBackgroundColor
+{
+    WebCore::Color color = [_contentView page]-&gt;pageExtendedBackgroundColor();
+    if (!color.isValid())
+        return nil;
+
+    return [UIColor colorWithRed:(color.red() / 255.0) green:(color.green() / 255.0) blue:(color.blue() / 255.0) alpha:(color.alpha() / 255.0)];
+}
+
+- (void)_setBackgroundExtendsBeyondPage:(BOOL)backgroundExtends
+{
+    [_contentView page]-&gt;setBackgroundExtendsBeyondPage(backgroundExtends);
+}
+
+- (BOOL)_backgroundExtendsBeyondPage
+{
+    return [_contentView page]-&gt;backgroundExtendsBeyondPage();
+}
+
+@end
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (164735 => 164736)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-02-26 20:15:44 UTC (rev 164735)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-02-26 20:18:30 UTC (rev 164736)
</span><span class="lines">@@ -503,6 +503,7 @@
</span><span class="cx">                 2DA049B4180CCCD300AAFA9E /* PlatformCALayerRemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA049B2180CCCD300AAFA9E /* PlatformCALayerRemote.h */; };
</span><span class="cx">                 2DA049B7180CCD0A00AAFA9E /* GraphicsLayerCARemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DA049B5180CCD0A00AAFA9E /* GraphicsLayerCARemote.cpp */; };
</span><span class="cx">                 2DA049B8180CCD0A00AAFA9E /* GraphicsLayerCARemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA049B6180CCD0A00AAFA9E /* GraphicsLayerCARemote.h */; };
</span><ins>+                2DA944951884E3B500ED86DB /* WKViewIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA944861884E3B500ED86DB /* WKViewIOS.mm */; };
</ins><span class="cx">                 2DA9449E1884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA944971884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm */; };
</span><span class="cx">                 2DA9449F1884E4F000ED86DB /* NativeWebTouchEventIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA944981884E4F000ED86DB /* NativeWebTouchEventIOS.mm */; };
</span><span class="cx">                 2DA944A01884E4F000ED86DB /* WebIOSEventFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA944991884E4F000ED86DB /* WebIOSEventFactory.h */; };
</span><span class="lines">@@ -2176,8 +2177,8 @@
</span><span class="cx">                 2684054618B85E7E0022C38B /* ViewUpdateDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewUpdateDispatcher.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2684054818B85FF70022C38B /* ViewUpdateDispatcher.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ViewUpdateDispatcher.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2684054A18B866FF0022C38B /* VisibleContentRectUpdateInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleContentRectUpdateInfo.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                2684055018B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewUpdateDispatcherMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                2684055118B86ED60022C38B /* ViewUpdateDispatcherMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewUpdateDispatcherMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                2684055018B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ViewUpdateDispatcherMessageReceiver.cpp; path = &quot;ViewUpdateDispatcherMessageReceiver.cpp&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2684055118B86ED60022C38B /* ViewUpdateDispatcherMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ViewUpdateDispatcherMessages.h; path = &quot;ViewUpdateDispatcherMessages.h&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKWebViewPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildProcessSupplement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 293EBEA91627D9C9005F89F1 /* WKDOMText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDOMText.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -2241,6 +2242,7 @@
</span><span class="cx">                 2DA049B2180CCCD300AAFA9E /* PlatformCALayerRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCALayerRemote.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DA049B5180CCD0A00AAFA9E /* GraphicsLayerCARemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsLayerCARemote.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DA049B6180CCD0A00AAFA9E /* GraphicsLayerCARemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsLayerCARemote.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2DA944861884E3B500ED86DB /* WKViewIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKViewIOS.mm; path = ios/WKViewIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2DA944971884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NativeWebKeyboardEventIOS.mm; path = ios/NativeWebKeyboardEventIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DA944981884E4F000ED86DB /* NativeWebTouchEventIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NativeWebTouchEventIOS.mm; path = ios/NativeWebTouchEventIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DA944991884E4F000ED86DB /* WebIOSEventFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebIOSEventFactory.h; path = ios/WebIOSEventFactory.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4261,6 +4263,14 @@
</span><span class="cx">                         name = ios;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                2DA944771884E3AB00ED86DB /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                2DA944861884E3B500ED86DB /* WKViewIOS.mm */,
+                        );
+                        name = ios;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 2DA944961884E4DA00ED86DB /* ios */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -5274,6 +5284,7 @@
</span><span class="cx">                                 BC0C376610F807660076D7CB /* C */,
</span><span class="cx">                                 37C4C08318149C2A003688B9 /* Cocoa */,
</span><span class="cx">                                 BC8A501311765F4500757573 /* cpp */,
</span><ins>+                                2DA944771884E3AB00ED86DB /* ios */,
</ins><span class="cx">                                 BC111B47112F616900337BAB /* mac */,
</span><span class="cx">                                 1A6637D618B2831F00C0BCF3 /* APIHistoryClient.h */,
</span><span class="cx">                                 1A2464F21891E45100234C5B /* APILoaderClient.h */,
</span><span class="lines">@@ -7886,6 +7897,7 @@
</span><span class="cx">                                 BCA8C6AF11E3C08700812FB7 /* InjectedBundlePageUIClient.cpp in Sources */,
</span><span class="cx">                                 0F5947A3187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.cpp in Sources */,
</span><span class="cx">                                 BC33E0D212408E8600360F3F /* InjectedBundleRangeHandle.cpp in Sources */,
</span><ins>+                                2DA944951884E3B500ED86DB /* WKViewIOS.mm in Sources */,
</ins><span class="cx">                                 BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */,
</span><span class="cx">                                 1AE49A4A11FFA8CE0048B464 /* JSNPMethod.cpp in Sources */,
</span><span class="cx">                                 1AE4987911FF7FAA0048B464 /* JSNPObject.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>