<!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>[191320] trunk/Source</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/191320">191320</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-10-19 15:32:59 -0700 (Mon, 19 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>WKView being inside WKWebView leads to weird API issues
https://bugs.webkit.org/show_bug.cgi?id=150174

Reviewed by Darin Adler.

No new tests, just moving code around.

* WebCore.xcodeproj/project.pbxproj:
* platform/spi/mac/NSWindowSPI.h: Added.

* UIProcess/API/mac/WKView.mm:
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/Cocoa/WebViewImpl.h: Added.
* UIProcess/Cocoa/WebViewImpl.mm: Added.
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::~WebViewImpl):
(WebKit::WebViewImpl::setDrawsBackground):
(WebKit::WebViewImpl::drawsBackground):
(WebKit::WebViewImpl::setDrawsTransparentBackground):
(WebKit::WebViewImpl::drawsTransparentBackground):
(WebKit::WebViewImpl::acceptsFirstResponder):
(WebKit::WebViewImpl::becomeFirstResponder):
(WebKit::WebViewImpl::resignFirstResponder):
(WebKit::WebViewImpl::isFocused):
(WebKit::WebViewImpl::viewWillStartLiveResize):
(WebKit::WebViewImpl::viewDidEndLiveResize):
(WebKit::WebViewImpl::setFrameSize):
(WebKit::WebViewImpl::disableFrameSizeUpdates):
(WebKit::WebViewImpl::enableFrameSizeUpdates):
(WebKit::WebViewImpl::frameSizeUpdatesDisabled):
(WebKit::WebViewImpl::setFrameAndScrollBy):
(WebKit::WebViewImpl::setFixedLayoutSize):
(WebKit::WebViewImpl::fixedLayoutSize):
(WebKit::WebViewImpl::setDrawingAreaSize):
(WebKit::WebViewImpl::setContentPreparationRect):
(WebKit::WebViewImpl::updateViewExposedRect):
(WebKit::WebViewImpl::setClipsToVisibleRect):
(WebKit::WebViewImpl::setIntrinsicContentSize):
(WebKit::WebViewImpl::intrinsicContentSize):
(WebKit::WebViewImpl::setViewScale):
(WebKit::WebViewImpl::viewScale):
(WebKit::WebViewImpl::layoutMode):
(WebKit::WebViewImpl::setLayoutMode):
(WebKit::WebViewImpl::supportsArbitraryLayoutModes):
(WebKit::WebViewImpl::updateSupportsArbitraryLayoutModes):
(WebKit::WebViewImpl::updateSecureInputState):
(WebKit::WebViewImpl::resetSecureInputState):
(WebKit::WebViewImpl::notifyInputContextAboutDiscardedComposition):
(WebKit::WebViewImpl::hasFullScreenWindowController):
(WebKit::WebViewImpl::fullScreenWindowController):
(WebKit::WebViewImpl::closeFullScreenWindowController):
(WebKit::WebViewImpl::fullScreenPlaceholderView):
(WebKit::WebViewImpl::createFullScreenWindow):
Move the actual implementation of a number of WKView methods into a
C++ class, WebViewImpl, which WKView calls directly into.
Eventually, we will move all of the logic of WKView into WebViewImpl,
and then duplicate the necessary forwarding in WKWebView and remove
WKWebView's inner WKView.

* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::isViewFocused):
(WebKit::PageClientImpl::didCommitLoadForMainFrame):
(WebKit::PageClientImpl::updateSecureInputState):
(WebKit::PageClientImpl::resetSecureInputState):
(WebKit::PageClientImpl::notifyInputContextAboutDiscardedComposition):
(WebKit::PageClientImpl::beganEnterFullScreen):
(WebKit::PageClientImpl::beganExitFullScreen):
For now, forward PageClient requests that can be answered by WebViewImpl
to WebViewImpl. Eventually, we'll probably fold PageClientImpl and WebViewImpl
together into one class, and these things will collapse down.

* UIProcess/mac/WKFullScreenWindowController.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController initWithWindow:webView:page:]):
(-[WKFullScreenWindowController enterFullScreen:]):
(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
(-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
(-[WKFullScreenWindowController _manager]):
(-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
(-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
(-[WKFullScreenWindowController initWithWindow:webView:]): Deleted.
(-[WKFullScreenWindowController _page]): Deleted.
* UIProcess/mac/WKViewLayoutStrategy.h:
* UIProcess/mac/WKViewLayoutStrategy.mm:
(+[WKViewLayoutStrategy layoutStrategyWithPage:view:viewImpl:mode:]):
(-[WKViewLayoutStrategy initWithPage:view:viewImpl:mode:]):
(-[WKViewLayoutStrategy invalidate]):
(-[WKViewLayoutStrategy didChangeFrameSize]):
(-[WKViewViewSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
(-[WKViewFixedSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
(-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:viewImpl:mode:]):
(-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy updateLayout]):
(-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeFrameSize]):
(-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
(+[WKViewLayoutStrategy layoutStrategyWithPage:view:mode:]): Deleted.
(-[WKViewLayoutStrategy initWithPage:view:mode:]): Deleted.
(-[WKViewLayoutStrategy willDestroyView:]): Deleted.
(-[WKViewViewSizeLayoutStrategy initWithPage:view:mode:]): Deleted.
(-[WKViewFixedSizeLayoutStrategy initWithPage:view:mode:]): Deleted.
(-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:mode:]): Deleted.
(-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:mode:]): Deleted.
Make WKViewLayoutStrategy and WKFullScreenWindowController operate in terms of generic
NSViews instead of WKView, so that eventually they will be able to work for either
WKView or WKWebView, and so that they can sit underneath WebViewImpl.

* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewInternalh">trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplh">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplmm">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKFullScreenWindowControllerh">trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKFullScreenWindowControllermm">trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKViewLayoutStrategyh">trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKViewLayoutStrategymm">trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformspimacNSWindowSPIh">trunk/Source/WebCore/platform/spi/mac/NSWindowSPI.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebViewImplh">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebViewImplmm">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebCore/ChangeLog        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-10-19  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        WKView being inside WKWebView leads to weird API issues
+        https://bugs.webkit.org/show_bug.cgi?id=150174
+
+        Reviewed by Darin Adler.
+
+        No new tests, just moving code around.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/spi/mac/NSWindowSPI.h: Added.
+
</ins><span class="cx"> 2015-10-19  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Restore an assertion to the way it was before r191310, which was correct.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -1121,6 +1121,7 @@
</span><span class="cx">                 2BE8E2C912A58A0100FAD550 /* HTMLMetaCharsetParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BE8E2C812A58A0100FAD550 /* HTMLMetaCharsetParser.cpp */; };
</span><span class="cx">                 2D0B4AAB18DA1CCD00434DE1 /* IOSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D0B4AAC18DA1CCD00434DE1 /* IOSurface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */; };
</span><ins>+                2D0CF8171BCF5DE1007A4937 /* NSWindowSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 2D232C001A326F02006BF2DB /* TUCallSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D232BFF1A326EF9006BF2DB /* TUCallSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D25396218CE7F6200270222 /* ImageControlsButtonElementMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D25396018CE7F6200270222 /* ImageControlsButtonElementMac.cpp */; };
</span><span class="cx">                 2D25396318CE7F6200270222 /* ImageControlsButtonElementMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D25396118CE7F6200270222 /* ImageControlsButtonElementMac.h */; };
</span><span class="lines">@@ -8439,6 +8440,7 @@
</span><span class="cx">                 2BE8E2C812A58A0100FAD550 /* HTMLMetaCharsetParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLMetaCharsetParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSurface.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IOSurface.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSWindowSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2D232BFF1A326EF9006BF2DB /* TUCallSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TUCallSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D25396018CE7F6200270222 /* ImageControlsButtonElementMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageControlsButtonElementMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D25396118CE7F6200270222 /* ImageControlsButtonElementMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageControlsButtonElementMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -18540,6 +18542,7 @@
</span><span class="cx">                                 F40EA8AA1B867D6500CE5581 /* NSScrollingInputFilterSPI.h */,
</span><span class="cx">                                 2DCB837719F99BBA00A7FBE4 /* NSSharingServicePickerSPI.h */,
</span><span class="cx">                                 2DCB837819F99BBA00A7FBE4 /* NSSharingServiceSPI.h */,
</span><ins>+                                2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */,
</ins><span class="cx">                                 937F4CCB1A2D48C100BB39F5 /* QuickLookMacSPI.h */,
</span><span class="cx">                                 2D232BFF1A326EF9006BF2DB /* TUCallSPI.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -27840,6 +27843,7 @@
</span><span class="cx">                                 44A20DB90F84166C00B3E1FE /* WebCoreURLResponseIOS.h in Headers */,
</span><span class="cx">                                 93F199F008245E59001E9ABC /* WebCoreView.h in Headers */,
</span><span class="cx">                                 A5E616741894581F009ADF50 /* WebDebuggerAgent.h in Headers */,
</span><ins>+                                2D0CF8171BCF5DE1007A4937 /* NSWindowSPI.h in Headers */,
</ins><span class="cx">                                 FE0D84E910484348001A179E /* WebEvent.h in Headers */,
</span><span class="cx">                                 225A16B50D5C11E900090295 /* WebEventRegion.h in Headers */,
</span><span class="cx">                                 A19D93471A9FEC7200B46C24 /* WebFilterEvaluatorSPI.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspimacNSWindowSPIh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/spi/mac/NSWindowSPI.h (0 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/NSWindowSPI.h                                (rev 0)
+++ trunk/Source/WebCore/platform/spi/mac/NSWindowSPI.h        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &lt;wtf/Platform.h&gt;
+
+#if PLATFORM(MAC)
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import &lt;AppKit/NSWindow_Private.h&gt;
+
+#else
+
+#import &lt;AppKit/NSWindow.h&gt;
+
+@interface NSWindow ()
+
+- (id)_newFirstResponderAfterResigning;
+
+@end
+
+#endif
+
+#endif // PLATFORM(MAC)
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -1,3 +1,110 @@
</span><ins>+2015-10-19  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        WKView being inside WKWebView leads to weird API issues
+        https://bugs.webkit.org/show_bug.cgi?id=150174
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/API/mac/WKView.mm:
+        * UIProcess/API/mac/WKViewInternal.h:
+        * UIProcess/Cocoa/WebViewImpl.h: Added.
+        * UIProcess/Cocoa/WebViewImpl.mm: Added.
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit::WebViewImpl::~WebViewImpl):
+        (WebKit::WebViewImpl::setDrawsBackground):
+        (WebKit::WebViewImpl::drawsBackground):
+        (WebKit::WebViewImpl::setDrawsTransparentBackground):
+        (WebKit::WebViewImpl::drawsTransparentBackground):
+        (WebKit::WebViewImpl::acceptsFirstResponder):
+        (WebKit::WebViewImpl::becomeFirstResponder):
+        (WebKit::WebViewImpl::resignFirstResponder):
+        (WebKit::WebViewImpl::isFocused):
+        (WebKit::WebViewImpl::viewWillStartLiveResize):
+        (WebKit::WebViewImpl::viewDidEndLiveResize):
+        (WebKit::WebViewImpl::setFrameSize):
+        (WebKit::WebViewImpl::disableFrameSizeUpdates):
+        (WebKit::WebViewImpl::enableFrameSizeUpdates):
+        (WebKit::WebViewImpl::frameSizeUpdatesDisabled):
+        (WebKit::WebViewImpl::setFrameAndScrollBy):
+        (WebKit::WebViewImpl::setFixedLayoutSize):
+        (WebKit::WebViewImpl::fixedLayoutSize):
+        (WebKit::WebViewImpl::setDrawingAreaSize):
+        (WebKit::WebViewImpl::setContentPreparationRect):
+        (WebKit::WebViewImpl::updateViewExposedRect):
+        (WebKit::WebViewImpl::setClipsToVisibleRect):
+        (WebKit::WebViewImpl::setIntrinsicContentSize):
+        (WebKit::WebViewImpl::intrinsicContentSize):
+        (WebKit::WebViewImpl::setViewScale):
+        (WebKit::WebViewImpl::viewScale):
+        (WebKit::WebViewImpl::layoutMode):
+        (WebKit::WebViewImpl::setLayoutMode):
+        (WebKit::WebViewImpl::supportsArbitraryLayoutModes):
+        (WebKit::WebViewImpl::updateSupportsArbitraryLayoutModes):
+        (WebKit::WebViewImpl::updateSecureInputState):
+        (WebKit::WebViewImpl::resetSecureInputState):
+        (WebKit::WebViewImpl::notifyInputContextAboutDiscardedComposition):
+        (WebKit::WebViewImpl::hasFullScreenWindowController):
+        (WebKit::WebViewImpl::fullScreenWindowController):
+        (WebKit::WebViewImpl::closeFullScreenWindowController):
+        (WebKit::WebViewImpl::fullScreenPlaceholderView):
+        (WebKit::WebViewImpl::createFullScreenWindow):
+        Move the actual implementation of a number of WKView methods into a
+        C++ class, WebViewImpl, which WKView calls directly into.
+        Eventually, we will move all of the logic of WKView into WebViewImpl,
+        and then duplicate the necessary forwarding in WKWebView and remove
+        WKWebView's inner WKView.
+
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::isViewFocused):
+        (WebKit::PageClientImpl::didCommitLoadForMainFrame):
+        (WebKit::PageClientImpl::updateSecureInputState):
+        (WebKit::PageClientImpl::resetSecureInputState):
+        (WebKit::PageClientImpl::notifyInputContextAboutDiscardedComposition):
+        (WebKit::PageClientImpl::beganEnterFullScreen):
+        (WebKit::PageClientImpl::beganExitFullScreen):
+        For now, forward PageClient requests that can be answered by WebViewImpl
+        to WebViewImpl. Eventually, we'll probably fold PageClientImpl and WebViewImpl
+        together into one class, and these things will collapse down.
+
+        * UIProcess/mac/WKFullScreenWindowController.h:
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (-[WKFullScreenWindowController initWithWindow:webView:page:]):
+        (-[WKFullScreenWindowController enterFullScreen:]):
+        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
+        (-[WKFullScreenWindowController exitFullScreen]):
+        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
+        (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
+        (-[WKFullScreenWindowController _manager]):
+        (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
+        (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
+        (-[WKFullScreenWindowController initWithWindow:webView:]): Deleted.
+        (-[WKFullScreenWindowController _page]): Deleted.
+        * UIProcess/mac/WKViewLayoutStrategy.h:
+        * UIProcess/mac/WKViewLayoutStrategy.mm:
+        (+[WKViewLayoutStrategy layoutStrategyWithPage:view:viewImpl:mode:]):
+        (-[WKViewLayoutStrategy initWithPage:view:viewImpl:mode:]):
+        (-[WKViewLayoutStrategy invalidate]):
+        (-[WKViewLayoutStrategy didChangeFrameSize]):
+        (-[WKViewViewSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
+        (-[WKViewFixedSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
+        (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:viewImpl:mode:]):
+        (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy updateLayout]):
+        (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeFrameSize]):
+        (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
+        (+[WKViewLayoutStrategy layoutStrategyWithPage:view:mode:]): Deleted.
+        (-[WKViewLayoutStrategy initWithPage:view:mode:]): Deleted.
+        (-[WKViewLayoutStrategy willDestroyView:]): Deleted.
+        (-[WKViewViewSizeLayoutStrategy initWithPage:view:mode:]): Deleted.
+        (-[WKViewFixedSizeLayoutStrategy initWithPage:view:mode:]): Deleted.
+        (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:mode:]): Deleted.
+        (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:mode:]): Deleted.
+        Make WKViewLayoutStrategy and WKFullScreenWindowController operate in terms of generic
+        NSViews instead of WKView, so that eventually they will be able to work for either
+        WKView or WKWebView, and so that they can sit underneath WebViewImpl.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2015-10-19  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r191307.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -66,7 +66,6 @@
</span><span class="cx"> #import &quot;WKStringCF.h&quot;
</span><span class="cx"> #import &quot;WKTextInputWindowController.h&quot;
</span><span class="cx"> #import &quot;WKViewInternal.h&quot;
</span><del>-#import &quot;WKViewLayoutStrategy.h&quot;
</del><span class="cx"> #import &quot;WKViewPrivate.h&quot;
</span><span class="cx"> #import &quot;WKWebView.h&quot;
</span><span class="cx"> #import &quot;WebBackForwardList.h&quot;
</span><span class="lines">@@ -81,6 +80,7 @@
</span><span class="cx"> #import &quot;WebProcessPool.h&quot;
</span><span class="cx"> #import &quot;WebProcessProxy.h&quot;
</span><span class="cx"> #import &quot;WebSystemInterface.h&quot;
</span><ins>+#import &quot;WebViewImpl.h&quot;
</ins><span class="cx"> #import &quot;_WKRemoteObjectRegistryInternal.h&quot;
</span><span class="cx"> #import &quot;_WKThumbnailViewInternal.h&quot;
</span><span class="cx"> #import &lt;QuartzCore/QuartzCore.h&gt;
</span><span class="lines">@@ -130,10 +130,6 @@
</span><span class="cx"> - (void)_setCurrentEvent:(NSEvent *)event;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@interface NSWindow (WKNSWindowDetails)
-- (id)_newFirstResponderAfterResigning;
-@end
-
</del><span class="cx"> #if USE(ASYNC_NSTEXTINPUTCLIENT)
</span><span class="cx"> @interface NSTextInputContext (WKNSTextInputContextDetails)
</span><span class="cx"> - (void)handleEvent:(NSEvent *)theEvent completionHandler:(void(^)(BOOL handled))completionHandler;
</span><span class="lines">@@ -181,6 +177,7 @@
</span><span class="cx"> @public
</span><span class="cx">     std::unique_ptr&lt;PageClientImpl&gt; _pageClient;
</span><span class="cx">     RefPtr&lt;WebPageProxy&gt; _page;
</span><ins>+    std::unique_ptr&lt;WebViewImpl&gt; _impl;
</ins><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx">     RetainPtr&lt;WKBrowsingContextController&gt; _browsingContextController;
</span><span class="lines">@@ -215,16 +212,12 @@
</span><span class="cx">     WKViewInterpretKeyEventsParameters* _interpretKeyEventsParameters;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    NSSize _resizeScrollOffset;
-
</del><span class="cx">     // The identifier of the plug-in we want to send complex text input to, or 0 if there is none.
</span><span class="cx">     uint64_t _pluginComplexTextInputIdentifier;
</span><span class="cx"> 
</span><span class="cx">     // The state of complex text input for the plug-in.
</span><span class="cx">     PluginComplexTextInputState _pluginComplexTextInputState;
</span><span class="cx"> 
</span><del>-    bool _inBecomeFirstResponder;
-    bool _inResignFirstResponder;
</del><span class="cx">     BOOL _willBecomeFirstResponderAgain;
</span><span class="cx">     NSEvent *_mouseDownEvent;
</span><span class="cx">     NSEvent *_pressureEvent;
</span><span class="lines">@@ -232,15 +225,9 @@
</span><span class="cx"> 
</span><span class="cx">     id _flagsChangedEventMonitor;
</span><span class="cx"> 
</span><del>-#if ENABLE(FULLSCREEN_API)
-    RetainPtr&lt;WKFullScreenWindowController&gt; _fullScreenWindowController;
-#endif
-
</del><span class="cx">     BOOL _hasSpellCheckerDocumentTag;
</span><span class="cx">     NSInteger _spellCheckerDocumentTag;
</span><span class="cx"> 
</span><del>-    BOOL _inSecureInputState;
-
</del><span class="cx">     BOOL _shouldDeferViewInWindowChanges;
</span><span class="cx">     NSWindow *_targetWindowForMovePreparation;
</span><span class="cx"> 
</span><span class="lines">@@ -254,11 +241,7 @@
</span><span class="cx">     RefPtr&lt;WebCore::Image&gt; _promisedImage;
</span><span class="cx">     String _promisedFilename;
</span><span class="cx">     String _promisedURL;
</span><del>-    
-    NSSize _intrinsicContentSize;
-    BOOL _clipsToVisibleRect;
-    NSRect _contentPreparationRect;
-    BOOL _useContentPreparationRectForVisibleRect;
</del><ins>+
</ins><span class="cx">     BOOL _windowOcclusionDetectionEnabled;
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;WKWindowVisibilityObserver&gt; _windowVisibilityObserver;
</span><span class="lines">@@ -270,10 +253,6 @@
</span><span class="cx">     BOOL _allowsBackForwardNavigationGestures;
</span><span class="cx">     BOOL _allowsLinkPreview;
</span><span class="cx"> 
</span><del>-    RetainPtr&lt;WKViewLayoutStrategy&gt; _layoutStrategy;
-    WKLayoutMode _lastRequestedLayoutMode;
-    float _lastRequestedViewScale;
-
</del><span class="cx">     RetainPtr&lt;CALayer&gt; _rootLayer;
</span><span class="cx"> 
</span><span class="cx">     BOOL _didScheduleSetTopContentInset;
</span><span class="lines">@@ -369,6 +348,9 @@
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+@interface WKView () &lt;WebViewImplDelegate&gt;
+@end
+
</ins><span class="cx"> @implementation WKView
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="lines">@@ -390,7 +372,6 @@
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
</span><span class="cx">     [_data-&gt;_immediateActionController willDestroyView:self];
</span><span class="cx"> #endif
</span><del>-    [_data-&gt;_layoutStrategy willDestroyView:self];
</del><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx">     if (_data-&gt;_remoteObjectRegistry) {
</span><span class="lines">@@ -401,10 +382,11 @@
</span><span class="cx"> 
</span><span class="cx">     _data-&gt;_page-&gt;close();
</span><span class="cx"> 
</span><ins>+    _data-&gt;_impl = nullptr;
+
</ins><span class="cx"> #if WK_API_ENABLED
</span><span class="cx">     ASSERT(!_data-&gt;_thumbnailView);
</span><span class="cx"> #endif
</span><del>-    ASSERT(!_data-&gt;_inSecureInputState);
</del><span class="cx"> 
</span><span class="cx">     [_data release];
</span><span class="cx">     _data = nil;
</span><span class="lines">@@ -434,107 +416,47 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)setDrawsBackground:(BOOL)drawsBackground
</span><span class="cx"> {
</span><del>-    _data-&gt;_page-&gt;setDrawsBackground(drawsBackground);
</del><ins>+    _data-&gt;_impl-&gt;setDrawsBackground(drawsBackground);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)drawsBackground
</span><span class="cx"> {
</span><del>-    return _data-&gt;_page-&gt;drawsBackground();
</del><ins>+    return _data-&gt;_impl-&gt;drawsBackground();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setDrawsTransparentBackground:(BOOL)drawsTransparentBackground
</span><span class="cx"> {
</span><del>-    _data-&gt;_page-&gt;setDrawsTransparentBackground(drawsTransparentBackground);
</del><ins>+    _data-&gt;_impl-&gt;setDrawsTransparentBackground(drawsTransparentBackground);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)drawsTransparentBackground
</span><span class="cx"> {
</span><del>-    return _data-&gt;_page-&gt;drawsTransparentBackground();
</del><ins>+    return _data-&gt;_impl-&gt;drawsTransparentBackground();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)acceptsFirstResponder
</span><span class="cx"> {
</span><del>-    return YES;
</del><ins>+    return _data-&gt;_impl-&gt;acceptsFirstResponder();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)becomeFirstResponder
</span><span class="cx"> {
</span><del>-    // If we just became first responder again, there is no need to do anything,
-    // since resignFirstResponder has correctly detected this situation.
-    if (_data-&gt;_willBecomeFirstResponderAgain) {
-        _data-&gt;_willBecomeFirstResponderAgain = NO;
-        return YES;
-    }
-
-    NSSelectionDirection direction = [[self window] keyViewSelectionDirection];
-
-    _data-&gt;_inBecomeFirstResponder = true;
-    
-    [self _updateSecureInputState];
-    _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsFocused);
-    // Restore the selection in the editable region if resigning first responder cleared selection.
-    _data-&gt;_page-&gt;restoreSelectionInFocusedEditableElement();
-
-    _data-&gt;_inBecomeFirstResponder = false;
-    
-    if (direction != NSDirectSelection) {
-        NSEvent *event = [NSApp currentEvent];
-        NSEvent *keyboardEvent = nil;
-        if ([event type] == NSKeyDown || [event type] == NSKeyUp)
-            keyboardEvent = event;
-        _data-&gt;_page-&gt;setInitialFocus(direction == NSSelectingNext, keyboardEvent != nil, NativeWebKeyboardEvent(keyboardEvent, false, Vector&lt;KeypressCommand&gt;()), [](WebKit::CallbackBase::Error) { });
-    }
-    return YES;
</del><ins>+    return _data-&gt;_impl-&gt;becomeFirstResponder();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)resignFirstResponder
</span><span class="cx"> {
</span><del>-#if WK_API_ENABLED
-    // Predict the case where we are losing first responder status only to
-    // gain it back again. We want resignFirstResponder to do nothing in that case.
-    id nextResponder = [[self window] _newFirstResponderAfterResigning];
-    if ([nextResponder isKindOfClass:[WKWebView class]] &amp;&amp; self.superview == nextResponder) {
-        _data-&gt;_willBecomeFirstResponderAgain = YES;
-        return YES;
-    }
-#endif
-
-    _data-&gt;_willBecomeFirstResponderAgain = NO;
-    _data-&gt;_inResignFirstResponder = true;
-
-#if USE(ASYNC_NSTEXTINPUTCLIENT)
-    _data-&gt;_page-&gt;confirmCompositionAsync();
-#else
-    if (_data-&gt;_page-&gt;editorState().hasComposition &amp;&amp; !_data-&gt;_page-&gt;editorState().shouldIgnoreCompositionSelectionChange)
-        _data-&gt;_page-&gt;cancelComposition();
-#endif
-
-    [self _notifyInputContextAboutDiscardedComposition];
-
-    [self _resetSecureInputState];
-
-    if (!_data-&gt;_page-&gt;maintainsInactiveSelection())
-        _data-&gt;_page-&gt;clearSelection();
-    
-    _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsFocused);
-
-    _data-&gt;_inResignFirstResponder = false;
-
-    return YES;
</del><ins>+    return _data-&gt;_impl-&gt;resignFirstResponder();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)viewWillStartLiveResize
</span><span class="cx"> {
</span><del>-    _data-&gt;_page-&gt;viewWillStartLiveResize();
-
-    [_data-&gt;_layoutStrategy willStartLiveResize];
</del><ins>+    _data-&gt;_impl-&gt;viewWillStartLiveResize();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)viewDidEndLiveResize
</span><span class="cx"> {
</span><del>-    _data-&gt;_page-&gt;viewWillEndLiveResize();
-
-    [_data-&gt;_layoutStrategy didEndLiveResize];
</del><ins>+    _data-&gt;_impl-&gt;viewDidEndLiveResize();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)isFlipped
</span><span class="lines">@@ -544,39 +466,25 @@
</span><span class="cx"> 
</span><span class="cx"> - (NSSize)intrinsicContentSize
</span><span class="cx"> {
</span><del>-    return _data-&gt;_intrinsicContentSize;
</del><ins>+    return NSSizeFromCGSize(_data-&gt;_impl-&gt;intrinsicContentSize());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)prepareContentInRect:(NSRect)rect
</span><span class="cx"> {
</span><del>-    _data-&gt;_contentPreparationRect = rect;
-    _data-&gt;_useContentPreparationRectForVisibleRect = YES;
-
-    [self _updateViewExposedRect];
</del><ins>+    _data-&gt;_impl-&gt;setContentPreparationRect(NSRectToCGRect(rect));
+    _data-&gt;_impl-&gt;updateViewExposedRect();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_updateViewExposedRect
-{
-    NSRect exposedRect = [self visibleRect];
-
-    if (_data-&gt;_useContentPreparationRectForVisibleRect)
-        exposedRect = NSUnionRect(_data-&gt;_contentPreparationRect, exposedRect);
-
-    if (auto drawingArea = _data-&gt;_page-&gt;drawingArea())
-        drawingArea-&gt;setExposedRect(_data-&gt;_clipsToVisibleRect ? FloatRect(exposedRect) : FloatRect::infiniteRect());
-}
-
</del><span class="cx"> - (void)setFrameSize:(NSSize)size
</span><span class="cx"> {
</span><span class="cx">     [super setFrameSize:size];
</span><del>-
-    [_data-&gt;_layoutStrategy didChangeFrameSize];
</del><ins>+    _data-&gt;_impl-&gt;setFrameSize(NSSizeToCGSize(size));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_updateWindowAndViewFrames
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_clipsToVisibleRect)
-        [self _updateViewExposedRect];
</del><ins>+    if (_data-&gt;_impl-&gt;clipsToVisibleRect())
+        _data-&gt;_impl-&gt;updateViewExposedRect();
</ins><span class="cx"> 
</span><span class="cx">     if (_data-&gt;_didScheduleWindowAndViewFrameUpdate)
</span><span class="cx">         return;
</span><span class="lines">@@ -1829,11 +1737,11 @@
</span><span class="cx">     } else
</span><span class="cx">         text = string;
</span><span class="cx"> 
</span><del>-    if (_data-&gt;_inSecureInputState) {
</del><ins>+    if (_data-&gt;_impl-&gt;inSecureInputState()) {
</ins><span class="cx">         // In password fields, we only allow ASCII dead keys, and don't allow inline input, matching NSSecureTextInputField.
</span><span class="cx">         // Allowing ASCII dead keys is necessary to enable full Roman input when using a Vietnamese keyboard.
</span><span class="cx">         ASSERT(!_data-&gt;_page-&gt;editorState().hasComposition);
</span><del>-        [self _notifyInputContextAboutDiscardedComposition];
</del><ins>+        _data-&gt;_impl-&gt;notifyInputContextAboutDiscardedComposition();
</ins><span class="cx">         // FIXME: We should store the command to handle it after DOM event processing, as it's regular keyboard input now, not a composition.
</span><span class="cx">         if ([text length] == 1 &amp;&amp; isASCII([text characterAtIndex:0]))
</span><span class="cx">             _data-&gt;_page-&gt;insertTextAsync(text, replacementRange);
</span><span class="lines">@@ -2225,7 +2133,7 @@
</span><span class="cx">         // In password fields, we only allow ASCII dead keys, and don't allow inline input, matching NSSecureTextInputField.
</span><span class="cx">         // Allowing ASCII dead keys is necessary to enable full Roman input when using a Vietnamese keyboard.
</span><span class="cx">         ASSERT(!_data-&gt;_page-&gt;editorState().hasComposition);
</span><del>-        [self _notifyInputContextAboutDiscardedComposition];
</del><ins>+        _data-&gt;_impl-&gt;notifyInputContextAboutDiscardedComposition();
</ins><span class="cx">         if ([text length] == 1 &amp;&amp; [[text decomposedStringWithCanonicalMapping] characterAtIndex:0] &lt; 0x80) {
</span><span class="cx">             _data-&gt;_page-&gt;insertText(text, replacementRange);
</span><span class="cx">         } else
</span><span class="lines">@@ -2437,6 +2345,11 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // USE(ASYNC_NSTEXTINPUTCLIENT)
</span><span class="cx"> 
</span><ins>+- (NSTextInputContext *)_superInputContext
+{
+    return [super inputContext];
+}
+
</ins><span class="cx"> - (NSArray *)validAttributesForMarkedText
</span><span class="cx"> {
</span><span class="cx">     static NSArray *validAttributes;
</span><span class="lines">@@ -2757,7 +2670,7 @@
</span><span class="cx"> {
</span><span class="cx">     NSWindow *keyWindow = [notification object];
</span><span class="cx">     if (keyWindow == [self window] || keyWindow == [[self window] attachedSheet]) {
</span><del>-        [self _updateSecureInputState];
</del><ins>+        _data-&gt;_impl-&gt;updateSecureInputState();
</ins><span class="cx">         _data-&gt;_page-&gt;viewStateDidChange(ViewState::WindowIsActive);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -2776,7 +2689,7 @@
</span><span class="cx"> {
</span><span class="cx">     NSWindow *formerKeyWindow = [notification object];
</span><span class="cx">     if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet]) {
</span><del>-        [self _updateSecureInputState];
</del><ins>+        _data-&gt;_impl-&gt;updateSecureInputState();
</ins><span class="cx">         _data-&gt;_page-&gt;viewStateDidChange(ViewState::WindowIsActive);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -3000,15 +2913,6 @@
</span><span class="cx">     return [[NSScreen mainScreen] backingScaleFactor];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setDrawingAreaSize:(NSSize)size
-{
-    if (!_data-&gt;_page-&gt;drawingArea())
-        return;
-    
-    _data-&gt;_page-&gt;drawingArea()-&gt;setSize(IntSize(size), IntSize(0, 0), IntSize(_data-&gt;_resizeScrollOffset));
-    _data-&gt;_resizeScrollOffset = NSZeroSize;
-}
-
</del><span class="cx"> - (void)quickLookWithEvent:(NSEvent *)event
</span><span class="cx"> {
</span><span class="cx">     if (_data-&gt;_ignoresNonWheelEvents)
</span><span class="lines">@@ -3033,15 +2937,6 @@
</span><span class="cx">     return std::make_unique&lt;TiledCoreAnimationDrawingAreaProxy&gt;(*_data-&gt;_page);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (BOOL)_isFocused
-{
-    if (_data-&gt;_inBecomeFirstResponder)
-        return YES;
-    if (_data-&gt;_inResignFirstResponder)
-        return NO;
-    return [[self window] firstResponder] == self;
-}
-
</del><span class="cx"> - (WebKit::ColorSpaceData)_colorSpace
</span><span class="cx"> {
</span><span class="cx">     if (!_data-&gt;_colorSpace) {
</span><span class="lines">@@ -3061,7 +2956,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_processDidExit
</span><span class="cx"> {
</span><del>-    [self _notifyInputContextAboutDiscardedComposition];
</del><ins>+    _data-&gt;_impl-&gt;notifyInputContextAboutDiscardedComposition();
</ins><span class="cx"> 
</span><span class="cx">     if (_data-&gt;_layerHostingView)
</span><span class="cx">         [self _setAcceleratedCompositingModeRootLayer:nil];
</span><span class="lines">@@ -3296,11 +3191,6 @@
</span><span class="cx">         _data-&gt;_textIndicatorWindow-&gt;setAnimationProgress(progress);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (CALayer *)_rootLayer
-{
-    return [_data-&gt;_layerHostingView layer];
-}
-
</del><span class="cx"> - (void)_setAcceleratedCompositingModeRootLayer:(CALayer *)rootLayer
</span><span class="cx"> {
</span><span class="cx">     [rootLayer web_disableAllActions];
</span><span class="lines">@@ -3632,54 +3522,7 @@
</span><span class="cx">     return [NSArray arrayWithObject:[path lastPathComponent]];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_updateSecureInputState
-{
-    if (![[self window] isKeyWindow] || ![self _isFocused]) {
-        if (_data-&gt;_inSecureInputState) {
-            DisableSecureEventInput();
-            _data-&gt;_inSecureInputState = NO;
-        }
-        return;
-    }
-    // WKView has a single input context for all editable areas (except for plug-ins).
-    NSTextInputContext *context = [super inputContext];
-    bool isInPasswordField = _data-&gt;_page-&gt;editorState().isInPasswordField;
</del><span class="cx"> 
</span><del>-    if (isInPasswordField) {
-        if (!_data-&gt;_inSecureInputState)
-            EnableSecureEventInput();
-        static NSArray *romanInputSources = [[NSArray alloc] initWithObjects:&amp;NSAllRomanInputSourcesLocaleIdentifier count:1];
-        LOG(TextInput, &quot;-&gt; setAllowedInputSourceLocales:romanInputSources&quot;);
-        [context setAllowedInputSourceLocales:romanInputSources];
-    } else {
-        if (_data-&gt;_inSecureInputState)
-            DisableSecureEventInput();
-        LOG(TextInput, &quot;-&gt; setAllowedInputSourceLocales:nil&quot;);
-        [context setAllowedInputSourceLocales:nil];
-    }
-    _data-&gt;_inSecureInputState = isInPasswordField;
-}
-
-- (void)_resetSecureInputState
-{
-    if (_data-&gt;_inSecureInputState) {
-        DisableSecureEventInput();
-        _data-&gt;_inSecureInputState = NO;
-    }
-}
-
-- (void)_notifyInputContextAboutDiscardedComposition
-{
-    // &lt;rdar://problem/9359055&gt;: -discardMarkedText can only be called for active contexts.
-    // FIXME: We fail to ever notify the input context if something (e.g. a navigation) happens while the window is not key.
-    // This is not a problem when the window is key, because we discard marked text on resigning first responder.
-    if (![[self window] isKeyWindow] || self != [[self window] firstResponder])
-        return;
-
-    LOG(TextInput, &quot;-&gt; discardMarkedText&quot;);
-    [[super inputContext] discardMarkedText]; // Inform the input method that we won't have an inline input area despite having been asked to.
-}
-
</del><span class="cx"> - (NSWindow *)_targetWindowForMovePreparation
</span><span class="cx"> {
</span><span class="cx">     return _data-&gt;_targetWindowForMovePreparation;
</span><span class="lines">@@ -3688,24 +3531,17 @@
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> - (BOOL)_hasFullScreenWindowController
</span><span class="cx"> {
</span><del>-    return (bool)_data-&gt;_fullScreenWindowController;
</del><ins>+    return _data-&gt;_impl-&gt;hasFullScreenWindowController();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (WKFullScreenWindowController *)_fullScreenWindowController
</span><span class="cx"> {
</span><del>-    if (!_data-&gt;_fullScreenWindowController)
-        _data-&gt;_fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWindow:[self createFullScreenWindow] webView:self]);
-
-    return _data-&gt;_fullScreenWindowController.get();
</del><ins>+    return _data-&gt;_impl-&gt;fullScreenWindowController();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_closeFullScreenWindowController
</span><span class="cx"> {
</span><del>-    if (!_data-&gt;_fullScreenWindowController)
-        return;
-
-    [_data-&gt;_fullScreenWindowController close];
-    _data-&gt;_fullScreenWindowController = nullptr;
</del><ins>+    _data-&gt;_impl-&gt;closeFullScreenWindowController();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -3722,16 +3558,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_setIntrinsicContentSize:(NSSize)intrinsicContentSize
</span><span class="cx"> {
</span><del>-    // If the intrinsic content size is less than the minimum layout width, the content flowed to fit,
-    // so we can report that that dimension is flexible. If not, we need to report our intrinsic width
-    // so that autolayout will know to provide space for us.
-
-    NSSize intrinsicContentSizeAcknowledgingFlexibleWidth = intrinsicContentSize;
-    if (intrinsicContentSize.width &lt; _data-&gt;_page-&gt;minimumLayoutSize().width())
-        intrinsicContentSizeAcknowledgingFlexibleWidth.width = NSViewNoInstrinsicMetric;
-
-    _data-&gt;_intrinsicContentSize = intrinsicContentSizeAcknowledgingFlexibleWidth;
-    [self invalidateIntrinsicContentSize];
</del><ins>+    _data-&gt;_impl-&gt;setIntrinsicContentSize(NSSizeToCGSize(intrinsicContentSize));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSInteger)spellCheckerDocumentTag
</span><span class="lines">@@ -3793,6 +3620,10 @@
</span><span class="cx"> 
</span><span class="cx">     _data-&gt;_pageClient = std::make_unique&lt;PageClientImpl&gt;(self, webView);
</span><span class="cx">     _data-&gt;_page = processPool.createWebPage(*_data-&gt;_pageClient, WTF::move(configuration));
</span><ins>+
+    _data-&gt;_impl = std::make_unique&lt;WebViewImpl&gt;(self, *_data-&gt;_page);
+    static_cast&lt;PageClientImpl*&gt;(_data-&gt;_pageClient.get())-&gt;setImpl(*_data-&gt;_impl);
+
</ins><span class="cx">     _data-&gt;_page-&gt;setAddsVisitedLinks(processPool.historyClient().addsVisitedLinks());
</span><span class="cx"> 
</span><span class="cx">     _data-&gt;_page-&gt;setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
</span><span class="lines">@@ -3801,20 +3632,12 @@
</span><span class="cx">     _data-&gt;_mouseDownEvent = nil;
</span><span class="cx">     _data-&gt;_pressureEvent = nil;
</span><span class="cx">     _data-&gt;_ignoringMouseDraggedEvents = NO;
</span><del>-    _data-&gt;_clipsToVisibleRect = NO;
-    _data-&gt;_useContentPreparationRectForVisibleRect = NO;
</del><span class="cx">     _data-&gt;_windowOcclusionDetectionEnabled = YES;
</span><del>-    _data-&gt;_lastRequestedLayoutMode = kWKLayoutModeViewSize;
-    _data-&gt;_lastRequestedViewScale = 1;
</del><span class="cx"> 
</span><span class="cx">     _data-&gt;_windowVisibilityObserver = adoptNS([[WKWindowVisibilityObserver alloc] initWithView:self]);
</span><span class="cx"> 
</span><del>-    _data-&gt;_intrinsicContentSize = NSMakeSize(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric);
-
</del><span class="cx">     _data-&gt;_needsViewFrameInWindowCoordinates = _data-&gt;_page-&gt;preferences().pluginsEnabled();
</span><span class="cx"> 
</span><del>-    _data-&gt;_layoutStrategy = [WKViewLayoutStrategy layoutStrategyWithPage:*_data-&gt;_page view:self mode:kWKLayoutModeViewSize];
-
</del><span class="cx">     [self _registerDraggedTypes];
</span><span class="cx"> 
</span><span class="cx">     self.wantsLayer = YES;
</span><span class="lines">@@ -3924,44 +3747,6 @@
</span><span class="cx">         _data-&gt;_gestureController-&gt;didFirstVisuallyNonEmptyLayoutForMainFrame();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (BOOL)_supportsArbitraryLayoutModes
-{
-    if ([_data-&gt;_fullScreenWindowController isFullScreen])
-        return NO;
-
-    WebPageProxy* page = _data-&gt;_page.get();
-    if (!page)
-        return YES;
-    WebFrameProxy* frame = page-&gt;mainFrame();
-    if (!frame)
-        return YES;
-
-    // If we have a plugin document in the main frame, avoid using custom WKLayoutModes
-    // and fall back to the defaults, because there's a good chance that it won't work (e.g. with PDFPlugin).
-    if (frame-&gt;containsPluginDocument())
-        return NO;
-
-    return YES;
-}
-
-- (void)_updateSupportsArbitraryLayoutModes
-{
-    if (![self _supportsArbitraryLayoutModes]) {
-        WKLayoutMode oldRequestedLayoutMode = _data-&gt;_lastRequestedLayoutMode;
-        float oldRequestedViewScale = _data-&gt;_lastRequestedViewScale;
-        [self _setViewScale:1];
-        [self _setLayoutMode:kWKLayoutModeViewSize];
-
-        // The 'last requested' parameters will have been overwritten by setting them above, but we don't
-        // want this to count as a request (only changes from the client count), so reset them.
-        _data-&gt;_lastRequestedLayoutMode = oldRequestedLayoutMode;
-        _data-&gt;_lastRequestedViewScale = oldRequestedViewScale;
-    } else if (_data-&gt;_lastRequestedLayoutMode != [_data-&gt;_layoutStrategy layoutMode]) {
-        [self _setViewScale:_data-&gt;_lastRequestedViewScale];
-        [self _setLayoutMode:_data-&gt;_lastRequestedLayoutMode];
-    }
-}
-
</del><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> - (_WKRemoteObjectRegistry *)_remoteObjectRegistry
</span><span class="cx"> {
</span><span class="lines">@@ -3972,15 +3757,8 @@
</span><span class="cx"> 
</span><span class="cx">     return _data-&gt;_remoteObjectRegistry.get();
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-
-- (void)_didCommitLoadForMainFrame
-{
-    [self _updateSupportsArbitraryLayoutModes];
-}
-
</del><span class="cx"> - (void)_didFinishLoadForMainFrame
</span><span class="cx"> {
</span><span class="cx">     if (_data-&gt;_gestureController)
</span><span class="lines">@@ -4021,6 +3799,12 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+// FIXME: Get rid of this when we have better plumbing to WKViewLayoutStrategy.
+- (void)_updateViewExposedRect
+{
+    _data-&gt;_impl-&gt;updateViewExposedRect();
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WKView (Private)
</span><span class="lines">@@ -4108,25 +3892,22 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)setFrame:(NSRect)rect andScrollBy:(NSSize)offset
</span><span class="cx"> {
</span><del>-    ASSERT(NSEqualSizes(_data-&gt;_resizeScrollOffset, NSZeroSize));
-
-    _data-&gt;_resizeScrollOffset = offset;
-    [self setFrame:rect];
</del><ins>+    _data-&gt;_impl-&gt;setFrameAndScrollBy(NSRectToCGRect(rect), NSSizeToCGSize(offset));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)disableFrameSizeUpdates
</span><span class="cx"> {
</span><del>-    [_data-&gt;_layoutStrategy disableFrameSizeUpdates];
</del><ins>+    _data-&gt;_impl-&gt;disableFrameSizeUpdates();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)enableFrameSizeUpdates
</span><span class="cx"> {
</span><del>-    [_data-&gt;_layoutStrategy enableFrameSizeUpdates];
</del><ins>+    _data-&gt;_impl-&gt;enableFrameSizeUpdates();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)frameSizeUpdatesDisabled
</span><span class="cx"> {
</span><del>-    return [_data-&gt;_layoutStrategy frameSizeUpdatesDisabled];
</del><ins>+    return _data-&gt;_impl-&gt;frameSizeUpdatesDisabled();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> + (void)hideWordDefinitionWindow
</span><span class="lines">@@ -4161,13 +3942,12 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)shouldClipToVisibleRect
</span><span class="cx"> {
</span><del>-    return _data-&gt;_clipsToVisibleRect;
</del><ins>+    return _data-&gt;_impl-&gt;clipsToVisibleRect();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setShouldClipToVisibleRect:(BOOL)clipsToVisibleRect
</span><span class="cx"> {
</span><del>-    _data-&gt;_clipsToVisibleRect = clipsToVisibleRect;
-    [self _updateViewExposedRect];
</del><ins>+    _data-&gt;_impl-&gt;setClipsToVisibleRect(clipsToVisibleRect);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSColor *)underlayColor
</span><span class="lines">@@ -4204,20 +3984,13 @@
</span><span class="cx"> 
</span><span class="cx"> - (NSView *)fullScreenPlaceholderView
</span><span class="cx"> {
</span><del>-#if ENABLE(FULLSCREEN_API)
-    if (_data-&gt;_fullScreenWindowController &amp;&amp; [_data-&gt;_fullScreenWindowController isFullScreen])
-        return [_data-&gt;_fullScreenWindowController webViewPlaceholder];
-#endif
-    return nil;
</del><ins>+    return _data-&gt;_impl-&gt;fullScreenPlaceholderView();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: This returns an autoreleased object. Should it really be prefixed 'create'?
</ins><span class="cx"> - (NSWindow *)createFullScreenWindow
</span><span class="cx"> {
</span><del>-#if ENABLE(FULLSCREEN_API)
-    return [[[WebCoreFullScreenWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame] styleMask:(NSBorderlessWindowMask | NSResizableWindowMask) backing:NSBackingStoreBuffered defer:NO] autorelease];
-#else
-    return nil;
-#endif
</del><ins>+    return _data-&gt;_impl-&gt;createFullScreenWindow();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: All of these &quot;DeferringViewInWindowChanges&quot; methods should be able to be removed once clients are weaned off of them.
</span><span class="lines">@@ -4383,50 +4156,32 @@
</span><span class="cx"> 
</span><span class="cx"> - (WKLayoutMode)_layoutMode
</span><span class="cx"> {
</span><del>-    return [_data-&gt;_layoutStrategy layoutMode];
</del><ins>+    return _data-&gt;_impl-&gt;layoutMode();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setLayoutMode:(WKLayoutMode)layoutMode
</span><span class="cx"> {
</span><del>-    _data-&gt;_lastRequestedLayoutMode = layoutMode;
-
-    if (![self _supportsArbitraryLayoutModes] &amp;&amp; layoutMode != kWKLayoutModeViewSize)
-        return;
-
-    if (layoutMode == [_data-&gt;_layoutStrategy layoutMode])
-        return;
-
-    [_data-&gt;_layoutStrategy willChangeLayoutStrategy];
-    _data-&gt;_layoutStrategy = [WKViewLayoutStrategy layoutStrategyWithPage:*_data-&gt;_page view:self mode:layoutMode];
</del><ins>+    _data-&gt;_impl-&gt;setLayoutMode(layoutMode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (CGSize)_fixedLayoutSize
</span><span class="cx"> {
</span><del>-    return _data-&gt;_page-&gt;fixedLayoutSize();
</del><ins>+    return _data-&gt;_impl-&gt;fixedLayoutSize();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setFixedLayoutSize:(CGSize)fixedLayoutSize
</span><span class="cx"> {
</span><del>-    _data-&gt;_page-&gt;setFixedLayoutSize(expandedIntSize(FloatSize(fixedLayoutSize)));
</del><ins>+    _data-&gt;_impl-&gt;setFixedLayoutSize(fixedLayoutSize);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (CGFloat)_viewScale
</span><span class="cx"> {
</span><del>-    return _data-&gt;_page-&gt;viewScaleFactor();
</del><ins>+    return _data-&gt;_impl-&gt;viewScale();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setViewScale:(CGFloat)viewScale
</span><span class="cx"> {
</span><del>-    _data-&gt;_lastRequestedViewScale = viewScale;
-
-    if (![self _supportsArbitraryLayoutModes] &amp;&amp; viewScale != 1)
-        return;
-
-    if (viewScale &lt;= 0 || isnan(viewScale) || isinf(viewScale))
-        [NSException raise:NSInvalidArgumentException format:@&quot;View scale should be a positive number&quot;];
-
-    _data-&gt;_page-&gt;scaleView(viewScale);
-    [_data-&gt;_layoutStrategy didChangeViewScale];
</del><ins>+    _data-&gt;_impl-&gt;setViewScale(viewScale);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_dispatchSetTopContentInset
</span><span class="lines">@@ -4527,9 +4282,9 @@
</span><span class="cx"> {
</span><span class="cx">     // This SPI is only used on 10.9 and below, and is incompatible with the fence-based drawing area size synchronization in 10.10+.
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1090
</span><del>-    if (_data-&gt;_clipsToVisibleRect)
-        [self _updateViewExposedRect];
-    [self _setDrawingAreaSize:size];
</del><ins>+    if (_data-&gt;_impl-&gt;clipsToVisibleRect())
+        _data-&gt;_impl-&gt;updateViewExposedRect();
+    _data-&gt;_impl-&gt;setDrawingAreaSize(NSSizeToCGSize(size));
</ins><span class="cx"> 
</span><span class="cx">     // If a geometry update is pending the new update won't be sent. Poll without waiting for any
</span><span class="cx">     // pending did-update message now, such that the new update can be sent. We do so after setting
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -77,7 +77,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> - (std::unique_ptr&lt;WebKit::DrawingAreaProxy&gt;)_createDrawingAreaProxy;
</span><del>-- (BOOL)_isFocused;
</del><span class="cx"> - (void)_processDidExit;
</span><span class="cx"> - (void)_pageClosed;
</span><span class="cx"> - (void)_didRelaunchProcess;
</span><span class="lines">@@ -110,9 +109,6 @@
</span><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="cx"> - (void)_setPromisedDataForAttachment:(NSString *)filename withExtension:(NSString *)extension withTitle:(NSString *)title withURL:(NSString *)url withVisibleURL:(NSString *)visibleUrl forPasteboard:(NSString *)pasteboardName;
</span><span class="cx"> #endif
</span><del>-- (void)_updateSecureInputState;
-- (void)_resetSecureInputState;
-- (void)_notifyInputContextAboutDiscardedComposition;
</del><span class="cx"> 
</span><span class="cx"> - (WebKit::ColorSpaceData)_colorSpace;
</span><span class="cx"> 
</span><span class="lines">@@ -123,7 +119,6 @@
</span><span class="cx"> - (BOOL)_suppressVisibilityUpdates;
</span><span class="cx"> 
</span><span class="cx"> - (void)_didFirstVisuallyNonEmptyLayoutForMainFrame;
</span><del>-- (void)_didCommitLoadForMainFrame;
</del><span class="cx"> - (void)_didFinishLoadForMainFrame;
</span><span class="cx"> - (void)_didFailLoadForMainFrame;
</span><span class="cx"> - (void)_didSameDocumentNavigationForMainFrame:(WebKit::SameDocumentNavigationType)type;
</span><span class="lines">@@ -158,13 +153,6 @@
</span><span class="cx"> 
</span><span class="cx"> @property (readonly) NSWindow *_targetWindowForMovePreparation;
</span><span class="cx"> 
</span><del>-// For WKViewLayoutStrategy and subclasses:
-- (void)_setDrawingAreaSize:(NSSize)size;
-- (void)_updateViewExposedRect;
-- (CALayer *)_rootLayer;
-
-- (void)_updateSupportsArbitraryLayoutModes;
-
</del><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> @property (nonatomic, readonly) _WKRemoteObjectRegistry *_remoteObjectRegistry;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h (0 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -0,0 +1,142 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 WebViewImpl_h
+#define WebViewImpl_h
+
+#if PLATFORM(MAC)
+
+#import &quot;WKLayoutMode.h&quot;
+#import &lt;wtf/RetainPtr.h&gt;
+
+OBJC_CLASS NSTextInputContext;
+OBJC_CLASS NSView;
+OBJC_CLASS WKFullScreenWindowController;
+OBJC_CLASS WKViewLayoutStrategy;
+
+@protocol WebViewImplDelegate
+
+- (NSTextInputContext *)_superInputContext;
+
+@end
+
+namespace WebKit {
+
+class WebPageProxy;
+
+class WebViewImpl {
+    WTF_MAKE_FAST_ALLOCATED;
+    WTF_MAKE_NONCOPYABLE(WebViewImpl);
+public:
+    WebViewImpl(NSView &lt;WebViewImplDelegate&gt; *, WebPageProxy&amp;);
+
+    ~WebViewImpl();
+
+    void setDrawsBackground(bool);
+    bool drawsBackground() const;
+    void setDrawsTransparentBackground(bool);
+    bool drawsTransparentBackground() const;
+
+    bool acceptsFirstResponder();
+    bool becomeFirstResponder();
+    bool resignFirstResponder();
+    bool isFocused() const;
+
+    void viewWillStartLiveResize();
+    void viewDidEndLiveResize();
+
+    void setFrameSize(CGSize);
+    void disableFrameSizeUpdates();
+    void enableFrameSizeUpdates();
+    bool frameSizeUpdatesDisabled() const;
+    void setFrameAndScrollBy(CGRect, CGSize);
+
+    void setFixedLayoutSize(CGSize);
+    CGSize fixedLayoutSize() const;
+
+    void setDrawingAreaSize(CGSize);
+
+    void setContentPreparationRect(CGRect);
+    void updateViewExposedRect();
+    void setClipsToVisibleRect(bool);
+    bool clipsToVisibleRect() const { return m_clipsToVisibleRect; }
+
+    void setIntrinsicContentSize(CGSize);
+    CGSize intrinsicContentSize() const;
+
+    void setViewScale(CGFloat);
+    CGFloat viewScale() const;
+
+    WKLayoutMode layoutMode() const;
+    void setLayoutMode(WKLayoutMode);
+    void updateSupportsArbitraryLayoutModes();
+
+    void updateSecureInputState();
+    void resetSecureInputState();
+    bool inSecureInputState() const { return m_inSecureInputState; }
+    void notifyInputContextAboutDiscardedComposition();
+
+#if ENABLE(FULLSCREEN_API)
+    bool hasFullScreenWindowController() const;
+    WKFullScreenWindowController *fullScreenWindowController();
+    void closeFullScreenWindowController();
+#endif
+    NSView *fullScreenPlaceholderView();
+    NSWindow *createFullScreenWindow();
+
+private:
+    bool supportsArbitraryLayoutModes() const;
+
+    NSView &lt;WebViewImplDelegate&gt; *m_view;
+    WebPageProxy&amp; m_page;
+
+    bool m_willBecomeFirstResponderAgain { false };
+    bool m_inBecomeFirstResponder { false };
+    bool m_inResignFirstResponder { false };
+
+    CGRect m_contentPreparationRect;
+    bool m_useContentPreparationRectForVisibleRect { false };
+    bool m_clipsToVisibleRect { false };
+
+    CGSize m_resizeScrollOffset;
+
+    CGSize m_intrinsicContentSize;
+
+    RetainPtr&lt;WKViewLayoutStrategy&gt; m_layoutStrategy;
+    WKLayoutMode m_lastRequestedLayoutMode { kWKLayoutModeViewSize };
+    CGFloat m_lastRequestedViewScale { 1 };
+
+    bool m_inSecureInputState { false };
+
+#if ENABLE(FULLSCREEN_API)
+    RetainPtr&lt;WKFullScreenWindowController&gt; m_fullScreenWindowController;
+#endif
+};
+    
+} // namespace WebKit
+
+#endif // PLATFORM(MAC)
+
+#endif // WebViewImpl_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (0 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -0,0 +1,434 @@
</span><ins>+/*
+ * Copyright (C) 2015 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;WebViewImpl.h&quot;
+
+#if PLATFORM(MAC)
+
+#import &quot;GenericCallback.h&quot;
+#import &quot;Logging.h&quot;
+#import &quot;NativeWebKeyboardEvent.h&quot;
+#import &quot;WKFullScreenWindowController.h&quot;
+#import &quot;WKViewLayoutStrategy.h&quot;
+#import &quot;WKWebView.h&quot;
+#import &quot;WebPageProxy.h&quot;
+#import &lt;HIToolbox/CarbonEventsCore.h&gt;
+#import &lt;WebCore/KeypressCommand.h&gt;
+#import &lt;WebCore/NSWindowSPI.h&gt;
+#import &lt;WebCore/ViewState.h&gt;
+#import &lt;WebCore/WebCoreFullScreenPlaceholderView.h&gt;
+#import &lt;WebCore/WebCoreFullScreenWindow.h&gt;
+
+namespace WebKit {
+
+WebViewImpl::WebViewImpl(NSView &lt;WebViewImplDelegate&gt; *view, WebPageProxy&amp; page)
+    : m_view(view)
+    , m_page(page)
+    , m_intrinsicContentSize(CGSizeMake(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric))
+    , m_layoutStrategy([WKViewLayoutStrategy layoutStrategyWithPage:m_page view:m_view viewImpl:*this mode:kWKLayoutModeViewSize])
+{
+}
+
+WebViewImpl::~WebViewImpl()
+{
+    ASSERT(!m_inSecureInputState);
+
+    [m_layoutStrategy invalidate];
+}
+
+void WebViewImpl::setDrawsBackground(bool drawsBackground)
+{
+    m_page.setDrawsBackground(drawsBackground);
+}
+
+bool WebViewImpl::drawsBackground() const
+{
+    return m_page.drawsBackground();
+}
+
+void WebViewImpl::setDrawsTransparentBackground(bool drawsTransparentBackground)
+{
+    m_page.setDrawsTransparentBackground(drawsTransparentBackground);
+}
+
+bool WebViewImpl::drawsTransparentBackground() const
+{
+    return m_page.drawsTransparentBackground();
+}
+
+bool WebViewImpl::acceptsFirstResponder()
+{
+    return true;
+}
+
+bool WebViewImpl::becomeFirstResponder()
+{
+    // If we just became first responder again, there is no need to do anything,
+    // since resignFirstResponder has correctly detected this situation.
+    if (m_willBecomeFirstResponderAgain) {
+        m_willBecomeFirstResponderAgain = NO;
+        return true;
+    }
+
+    NSSelectionDirection direction = [[m_view window] keyViewSelectionDirection];
+
+    m_inBecomeFirstResponder = true;
+
+    updateSecureInputState();
+    m_page.viewStateDidChange(WebCore::ViewState::IsFocused);
+    // Restore the selection in the editable region if resigning first responder cleared selection.
+    m_page.restoreSelectionInFocusedEditableElement();
+
+    m_inBecomeFirstResponder = false;
+
+    if (direction != NSDirectSelection) {
+        NSEvent *event = [NSApp currentEvent];
+        NSEvent *keyboardEvent = nil;
+        if ([event type] == NSKeyDown || [event type] == NSKeyUp)
+            keyboardEvent = event;
+        m_page.setInitialFocus(direction == NSSelectingNext, keyboardEvent != nil, NativeWebKeyboardEvent(keyboardEvent, false, Vector&lt;WebCore::KeypressCommand&gt;()), [](WebKit::CallbackBase::Error) { });
+    }
+    return true;
+}
+
+bool WebViewImpl::resignFirstResponder()
+{
+#if WK_API_ENABLED
+    // Predict the case where we are losing first responder status only to
+    // gain it back again. We want resignFirstResponder to do nothing in that case.
+    id nextResponder = [[m_view window] _newFirstResponderAfterResigning];
+
+    // FIXME: This will probably need to change once WKWebView doesn't contain a WKView.
+    if ([nextResponder isKindOfClass:[WKWebView class]] &amp;&amp; m_view.superview == nextResponder) {
+        m_willBecomeFirstResponderAgain = true;
+        return true;
+    }
+#endif
+
+    m_willBecomeFirstResponderAgain = NO;
+    m_inResignFirstResponder = true;
+
+#if USE(ASYNC_NSTEXTINPUTCLIENT)
+    m_page.confirmCompositionAsync();
+#else
+    if (m_page.editorState().hasComposition &amp;&amp; !m_page.editorState().shouldIgnoreCompositionSelectionChange)
+        m_page.cancelComposition();
+#endif
+
+    notifyInputContextAboutDiscardedComposition();
+
+    resetSecureInputState();
+
+    if (!m_page.maintainsInactiveSelection())
+        m_page.clearSelection();
+
+    m_page.viewStateDidChange(WebCore::ViewState::IsFocused);
+    
+    m_inResignFirstResponder = false;
+    
+    return true;
+}
+
+bool WebViewImpl::isFocused() const
+{
+    if (m_inBecomeFirstResponder)
+        return true;
+    if (m_inResignFirstResponder)
+        return false;
+    return m_view.window.firstResponder == m_view;
+}
+
+void WebViewImpl::viewWillStartLiveResize()
+{
+    m_page.viewWillStartLiveResize();
+
+    [m_layoutStrategy willStartLiveResize];
+}
+
+void WebViewImpl::viewDidEndLiveResize()
+{
+    m_page.viewWillEndLiveResize();
+
+    [m_layoutStrategy didEndLiveResize];
+}
+
+void WebViewImpl::setFrameSize(CGSize)
+{
+    [m_layoutStrategy didChangeFrameSize];
+}
+
+void WebViewImpl::disableFrameSizeUpdates()
+{
+    [m_layoutStrategy disableFrameSizeUpdates];
+}
+
+void WebViewImpl::enableFrameSizeUpdates()
+{
+    [m_layoutStrategy enableFrameSizeUpdates];
+}
+
+bool WebViewImpl::frameSizeUpdatesDisabled() const
+{
+    return [m_layoutStrategy frameSizeUpdatesDisabled];
+}
+
+void WebViewImpl::setFrameAndScrollBy(CGRect frame, CGSize offset)
+{
+    ASSERT(CGSizeEqualToSize(m_resizeScrollOffset, CGSizeZero));
+
+    m_resizeScrollOffset = offset;
+    m_view.frame = NSRectFromCGRect(frame);
+}
+
+void WebViewImpl::setFixedLayoutSize(CGSize fixedLayoutSize)
+{
+    m_page.setFixedLayoutSize(WebCore::expandedIntSize(WebCore::FloatSize(fixedLayoutSize)));
+}
+
+CGSize WebViewImpl::fixedLayoutSize() const
+{
+    return m_page.fixedLayoutSize();
+}
+
+void WebViewImpl::setDrawingAreaSize(CGSize size)
+{
+    if (!m_page.drawingArea())
+        return;
+
+    m_page.drawingArea()-&gt;setSize(WebCore::IntSize(size), WebCore::IntSize(), WebCore::IntSize(m_resizeScrollOffset));
+    m_resizeScrollOffset = CGSizeZero;
+}
+
+void WebViewImpl::setContentPreparationRect(CGRect rect)
+{
+    m_contentPreparationRect = rect;
+    m_useContentPreparationRectForVisibleRect = true;
+}
+
+void WebViewImpl::updateViewExposedRect()
+{
+    CGRect exposedRect = NSRectToCGRect([m_view visibleRect]);
+
+    if (m_useContentPreparationRectForVisibleRect)
+        exposedRect = CGRectUnion(m_contentPreparationRect, exposedRect);
+
+    if (auto drawingArea = m_page.drawingArea())
+        drawingArea-&gt;setExposedRect(m_clipsToVisibleRect ? WebCore::FloatRect(exposedRect) : WebCore::FloatRect::infiniteRect());
+}
+
+void WebViewImpl::setClipsToVisibleRect(bool clipsToVisibleRect)
+{
+    m_clipsToVisibleRect = clipsToVisibleRect;
+    updateViewExposedRect();
+}
+
+void WebViewImpl::setIntrinsicContentSize(CGSize intrinsicContentSize)
+{
+    // If the intrinsic content size is less than the minimum layout width, the content flowed to fit,
+    // so we can report that that dimension is flexible. If not, we need to report our intrinsic width
+    // so that autolayout will know to provide space for us.
+
+    CGSize intrinsicContentSizeAcknowledgingFlexibleWidth = intrinsicContentSize;
+    if (intrinsicContentSize.width &lt; m_page.minimumLayoutSize().width())
+        intrinsicContentSizeAcknowledgingFlexibleWidth.width = NSViewNoInstrinsicMetric;
+
+    m_intrinsicContentSize = intrinsicContentSizeAcknowledgingFlexibleWidth;
+    [m_view invalidateIntrinsicContentSize];
+}
+
+CGSize WebViewImpl::intrinsicContentSize() const
+{
+    return m_intrinsicContentSize;
+}
+
+void WebViewImpl::setViewScale(CGFloat viewScale)
+{
+    m_lastRequestedViewScale = viewScale;
+
+    if (!supportsArbitraryLayoutModes() &amp;&amp; viewScale != 1)
+        return;
+
+    if (viewScale &lt;= 0 || isnan(viewScale) || isinf(viewScale))
+        [NSException raise:NSInvalidArgumentException format:@&quot;View scale should be a positive number&quot;];
+
+    m_page.scaleView(viewScale);
+    [m_layoutStrategy didChangeViewScale];
+}
+
+CGFloat WebViewImpl::viewScale() const
+{
+    return m_page.viewScaleFactor();
+}
+
+WKLayoutMode WebViewImpl::layoutMode() const
+{
+    return [m_layoutStrategy layoutMode];
+}
+
+void WebViewImpl::setLayoutMode(WKLayoutMode layoutMode)
+{
+    m_lastRequestedLayoutMode = layoutMode;
+
+    if (!supportsArbitraryLayoutModes() &amp;&amp; layoutMode != kWKLayoutModeViewSize)
+        return;
+
+    if (layoutMode == [m_layoutStrategy layoutMode])
+        return;
+
+    [m_layoutStrategy willChangeLayoutStrategy];
+    m_layoutStrategy = [WKViewLayoutStrategy layoutStrategyWithPage:m_page view:m_view viewImpl:*this mode:layoutMode];
+}
+
+bool WebViewImpl::supportsArbitraryLayoutModes() const
+{
+    if ([m_fullScreenWindowController isFullScreen])
+        return false;
+
+    WebFrameProxy* frame = m_page.mainFrame();
+    if (!frame)
+        return true;
+
+    // If we have a plugin document in the main frame, avoid using custom WKLayoutModes
+    // and fall back to the defaults, because there's a good chance that it won't work (e.g. with PDFPlugin).
+    if (frame-&gt;containsPluginDocument())
+        return false;
+
+    return true;
+}
+
+void WebViewImpl::updateSupportsArbitraryLayoutModes()
+{
+    if (!supportsArbitraryLayoutModes()) {
+        WKLayoutMode oldRequestedLayoutMode = m_lastRequestedLayoutMode;
+        CGFloat oldRequestedViewScale = m_lastRequestedViewScale;
+        setViewScale(1);
+        setLayoutMode(kWKLayoutModeViewSize);
+
+        // The 'last requested' parameters will have been overwritten by setting them above, but we don't
+        // want this to count as a request (only changes from the client count), so reset them.
+        m_lastRequestedLayoutMode = oldRequestedLayoutMode;
+        m_lastRequestedViewScale = oldRequestedViewScale;
+    } else if (m_lastRequestedLayoutMode != [m_layoutStrategy layoutMode]) {
+        setViewScale(m_lastRequestedViewScale);
+        setLayoutMode(m_lastRequestedLayoutMode);
+    }
+}
+
+void WebViewImpl::updateSecureInputState()
+{
+    if (![[m_view window] isKeyWindow] || !isFocused()) {
+        if (m_inSecureInputState) {
+            DisableSecureEventInput();
+            m_inSecureInputState = false;
+        }
+        return;
+    }
+    // WKView has a single input context for all editable areas (except for plug-ins).
+    NSTextInputContext *context = [m_view _superInputContext];
+    bool isInPasswordField = m_page.editorState().isInPasswordField;
+
+    if (isInPasswordField) {
+        if (!m_inSecureInputState)
+            EnableSecureEventInput();
+        static NSArray *romanInputSources = [[NSArray alloc] initWithObjects:&amp;NSAllRomanInputSourcesLocaleIdentifier count:1];
+        LOG(TextInput, &quot;-&gt; setAllowedInputSourceLocales:romanInputSources&quot;);
+        [context setAllowedInputSourceLocales:romanInputSources];
+    } else {
+        if (m_inSecureInputState)
+            DisableSecureEventInput();
+        LOG(TextInput, &quot;-&gt; setAllowedInputSourceLocales:nil&quot;);
+        [context setAllowedInputSourceLocales:nil];
+    }
+    m_inSecureInputState = isInPasswordField;
+}
+
+void WebViewImpl::resetSecureInputState()
+{
+    if (m_inSecureInputState) {
+        DisableSecureEventInput();
+        m_inSecureInputState = false;
+    }
+}
+
+void WebViewImpl::notifyInputContextAboutDiscardedComposition()
+{
+    // &lt;rdar://problem/9359055&gt;: -discardMarkedText can only be called for active contexts.
+    // FIXME: We fail to ever notify the input context if something (e.g. a navigation) happens while the window is not key.
+    // This is not a problem when the window is key, because we discard marked text on resigning first responder.
+    if (![[m_view window] isKeyWindow] || m_view != [[m_view window] firstResponder])
+        return;
+
+    LOG(TextInput, &quot;-&gt; discardMarkedText&quot;);
+
+    [[m_view _superInputContext] discardMarkedText]; // Inform the input method that we won't have an inline input area despite having been asked to.
+}
+
+#if ENABLE(FULLSCREEN_API)
+bool WebViewImpl::hasFullScreenWindowController() const
+{
+    return !!m_fullScreenWindowController;
+}
+
+WKFullScreenWindowController *WebViewImpl::fullScreenWindowController()
+{
+    if (!m_fullScreenWindowController)
+        m_fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWindow:createFullScreenWindow() webView:m_view page:m_page]);
+
+    return m_fullScreenWindowController.get();
+}
+
+void WebViewImpl::closeFullScreenWindowController()
+{
+    if (!m_fullScreenWindowController)
+        return;
+
+    [m_fullScreenWindowController close];
+    m_fullScreenWindowController = nullptr;
+}
+#endif
+
+NSView *WebViewImpl::fullScreenPlaceholderView()
+{
+#if ENABLE(FULLSCREEN_API)
+    if (m_fullScreenWindowController &amp;&amp; [m_fullScreenWindowController isFullScreen])
+        return [m_fullScreenWindowController webViewPlaceholder];
+#endif
+    return nil;
+}
+
+NSWindow *WebViewImpl::createFullScreenWindow()
+{
+#if ENABLE(FULLSCREEN_API)
+    return [[[WebCoreFullScreenWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame] styleMask:(NSBorderlessWindowMask | NSResizableWindowMask) backing:NSBackingStoreBuffered defer:NO] autorelease];
+#else
+    return nil;
+#endif
+}
+
+
+} // namespace WebKit
+
+#endif // PLATFORM(MAC)
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -43,6 +43,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+class WebViewImpl;
+
</ins><span class="cx"> class PageClientImpl final : public PageClient
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">     , public WebFullScreenManagerProxyClient
</span><span class="lines">@@ -51,7 +53,10 @@
</span><span class="cx"> public:
</span><span class="cx">     PageClientImpl(WKView *, WKWebView *);
</span><span class="cx">     virtual ~PageClientImpl();
</span><del>-    
</del><ins>+
+    // FIXME: Eventually WebViewImpl should become the PageClient.
+    void setImpl(WebViewImpl&amp; impl) { m_impl = &amp;impl; }
+
</ins><span class="cx">     void viewWillMoveToAnotherWindow();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -213,6 +218,7 @@
</span><span class="cx"> 
</span><span class="cx">     WKView *m_wkView;
</span><span class="cx">     WKWebView *m_webView;
</span><ins>+    WebViewImpl* m_impl { nullptr };
</ins><span class="cx">     RetainPtr&lt;WKEditorUndoTargetObjC&gt; m_undoTarget;
</span><span class="cx"> #if USE(AUTOCORRECTION_PANEL)
</span><span class="cx">     CorrectionPanel m_correctionPanel;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #import &quot;WebContextMenuProxyMac.h&quot;
</span><span class="cx"> #import &quot;WebEditCommandProxy.h&quot;
</span><span class="cx"> #import &quot;WebPopupMenuProxyMac.h&quot;
</span><ins>+#import &quot;WebViewImpl.h&quot;
</ins><span class="cx"> #import &quot;WindowServerConnection.h&quot;
</span><span class="cx"> #import &quot;_WKDownloadInternal.h&quot;
</span><span class="cx"> #import &quot;_WKHitTestResultInternal.h&quot;
</span><span class="lines">@@ -219,7 +220,12 @@
</span><span class="cx"> 
</span><span class="cx"> bool PageClientImpl::isViewFocused()
</span><span class="cx"> {
</span><del>-    return [m_wkView _isFocused];
</del><ins>+    // FIXME: This is called from the WebPageProxy constructor before we have a WebViewImpl.
+    // Once WebViewImpl and PageClient merge, this won't be a problem.
+    if (!m_impl)
+        return NO;
+
+    return m_impl-&gt;isFocused();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::makeFirstResponder()
</span><span class="lines">@@ -311,7 +317,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::didCommitLoadForMainFrame(const String&amp; mimeType, bool useCustomContentProvider)
</span><span class="cx"> {
</span><del>-    [m_wkView _didCommitLoadForMainFrame];
</del><ins>+    m_impl-&gt;updateSupportsArbitraryLayoutModes();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::didFinishLoadingDataForCustomContentProvider(const String&amp; suggestedFilename, const IPC::DataReference&amp; dataReference)
</span><span class="lines">@@ -433,17 +439,17 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::updateSecureInputState()
</span><span class="cx"> {
</span><del>-    [m_wkView _updateSecureInputState];
</del><ins>+    m_impl-&gt;updateSecureInputState();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::resetSecureInputState()
</span><span class="cx"> {
</span><del>-    [m_wkView _resetSecureInputState];
</del><ins>+    m_impl-&gt;resetSecureInputState();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::notifyInputContextAboutDiscardedComposition()
</span><span class="cx"> {
</span><del>-    [m_wkView _notifyInputContextAboutDiscardedComposition];
</del><ins>+    m_impl-&gt;notifyInputContextAboutDiscardedComposition();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; !USE(ASYNC_NSTEXTINPUTCLIENT)
</span><span class="lines">@@ -723,13 +729,13 @@
</span><span class="cx"> void PageClientImpl::beganEnterFullScreen(const IntRect&amp; initialFrame, const IntRect&amp; finalFrame)
</span><span class="cx"> {
</span><span class="cx">     [m_wkView._fullScreenWindowController beganEnterFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
</span><del>-    [m_wkView _updateSupportsArbitraryLayoutModes];
</del><ins>+    m_impl-&gt;updateSupportsArbitraryLayoutModes();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::beganExitFullScreen(const IntRect&amp; initialFrame, const IntRect&amp; finalFrame)
</span><span class="cx"> {
</span><span class="cx">     [m_wkView._fullScreenWindowController beganExitFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
</span><del>-    [m_wkView _updateSupportsArbitraryLayoutModes];
</del><ins>+    m_impl-&gt;updateSupportsArbitraryLayoutModes();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(FULLSCREEN_API)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKFullScreenWindowControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit { 
</span><span class="cx"> class LayerTreeContext;
</span><ins>+class WebPageProxy;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -44,7 +45,8 @@
</span><span class="cx"> 
</span><span class="cx"> @interface WKFullScreenWindowController : NSWindowController&lt;NSWindowDelegate&gt; {
</span><span class="cx"> @private
</span><del>-    WKView *_webView; // Cannot be retained, see &lt;rdar://problem/14884666&gt;.
</del><ins>+    NSView *_webView; // Cannot be retained, see &lt;rdar://problem/14884666&gt;.
+    WebKit::WebPageProxy* _page;
</ins><span class="cx">     RetainPtr&lt;WebCoreFullScreenPlaceholderView&gt; _webViewPlaceholder;
</span><span class="cx">     RetainPtr&lt;NSView&gt; _clipView;
</span><span class="cx">     NSRect _initialFrame;
</span><span class="lines">@@ -60,7 +62,7 @@
</span><span class="cx"> @property (readonly) NSRect initialFrame;
</span><span class="cx"> @property (readonly) NSRect finalFrame;
</span><span class="cx"> 
</span><del>-- (id)initWithWindow:(NSWindow *)window webView:(WKView *)webView;
</del><ins>+- (id)initWithWindow:(NSWindow *)window webView:(NSView *)webView page:(WebKit::WebPageProxy&amp;)page;
</ins><span class="cx"> 
</span><span class="cx"> - (WebCoreFullScreenPlaceholderView*)webViewPlaceholder;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKFullScreenWindowControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -63,9 +63,8 @@
</span><span class="cx"> - (void)enterFullScreenMode:(id)sender;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@interface WKFullScreenWindowController(Private)&lt;NSAnimationDelegate&gt;
</del><ins>+@interface WKFullScreenWindowController (Private) &lt;NSAnimationDelegate&gt;
</ins><span class="cx"> - (void)_replaceView:(NSView*)view with:(NSView*)otherView;
</span><del>-- (WebPageProxy*)_page;
</del><span class="cx"> - (WebFullScreenManagerProxy*)_manager;
</span><span class="cx"> - (void)_startEnterFullScreenAnimationWithDuration:(NSTimeInterval)duration;
</span><span class="cx"> - (void)_startExitFullScreenAnimationWithDuration:(NSTimeInterval)duration;
</span><span class="lines">@@ -86,7 +85,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma mark -
</span><span class="cx"> #pragma mark Initialization
</span><del>-- (id)initWithWindow:(NSWindow *)window webView:(WKView *)webView
</del><ins>+- (id)initWithWindow:(NSWindow *)window webView:(NSView *)webView page:(WebPageProxy&amp;)page
</ins><span class="cx"> {
</span><span class="cx">     self = [super initWithWindow:window];
</span><span class="cx">     if (!self)
</span><span class="lines">@@ -106,6 +105,7 @@
</span><span class="cx"> 
</span><span class="cx">     [self windowDidLoad];
</span><span class="cx">     _webView = webView;
</span><ins>+    _page = &amp;page;
</ins><span class="cx">     
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="lines">@@ -241,7 +241,7 @@
</span><span class="cx">     // unnecessary in the full-screen animation case, and can cause bugs; see
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=88940 and https://bugs.webkit.org/show_bug.cgi?id=88374
</span><span class="cx">     // We will resume the normal behavior in _startEnterFullScreenAnimationWithDuration:
</span><del>-    [_webView _setSuppressVisibilityUpdates:YES];
</del><ins>+    _page-&gt;setSuppressVisibilityUpdates(true);
</ins><span class="cx"> 
</span><span class="cx">     // Swap the webView placeholder into place.
</span><span class="cx">     if (!_webViewPlaceholder) {
</span><span class="lines">@@ -253,14 +253,14 @@
</span><span class="cx">     [self _replaceView:_webView with:_webViewPlaceholder.get()];
</span><span class="cx">     
</span><span class="cx">     // Then insert the WebView into the full screen window
</span><del>-    NSView* contentView = [[self window] contentView];
</del><ins>+    NSView *contentView = [[self window] contentView];
</ins><span class="cx">     [_clipView addSubview:_webView positioned:NSWindowBelow relativeTo:nil];
</span><span class="cx">     [_webView setFrame:[contentView bounds]];
</span><span class="cx"> 
</span><span class="cx">     makeResponderFirstResponderIfDescendantOfView(self.window, webWindowFirstResponder, _webView);
</span><span class="cx"> 
</span><del>-    _savedScale = [self _page]-&gt;pageScaleFactor();
-    [self _page]-&gt;scalePage(1, IntPoint());
</del><ins>+    _savedScale = _page-&gt;pageScaleFactor();
+    _page-&gt;scalePage(1, IntPoint());
</ins><span class="cx">     [self _manager]-&gt;setAnimatingFullScreen(true);
</span><span class="cx">     [self _manager]-&gt;willEnterFullScreen();
</span><span class="cx"> }
</span><span class="lines">@@ -309,14 +309,14 @@
</span><span class="cx">         _fullScreenState = NotInFullScreen;
</span><span class="cx"> 
</span><span class="cx">         [[self window] setAutodisplay:YES];
</span><del>-        [_webView _setSuppressVisibilityUpdates:NO];
</del><ins>+        _page-&gt;setSuppressVisibilityUpdates(false);
</ins><span class="cx"> 
</span><span class="cx">         NSResponder *firstResponder = [[self window] firstResponder];
</span><span class="cx">         [self _replaceView:_webViewPlaceholder.get() with:_webView];
</span><span class="cx">         makeResponderFirstResponderIfDescendantOfView(_webView.window, firstResponder, _webView);
</span><span class="cx">         [[_webView window] makeKeyAndOrderFront:self];
</span><span class="cx"> 
</span><del>-        [self _page]-&gt;scalePage(_savedScale, IntPoint());
</del><ins>+        _page-&gt;scalePage(_savedScale, IntPoint());
</ins><span class="cx">         [self _manager]-&gt;restoreScrollPosition();
</span><span class="cx">         [self _manager]-&gt;didExitFullScreen();
</span><span class="cx">         [self _manager]-&gt;setAnimatingFullScreen(false);
</span><span class="lines">@@ -344,7 +344,7 @@
</span><span class="cx"> 
</span><span class="cx">     // See the related comment in enterFullScreen:
</span><span class="cx">     // We will resume the normal behavior in _startExitFullScreenAnimationWithDuration:
</span><del>-    [_webView _setSuppressVisibilityUpdates:YES];
</del><ins>+    _page-&gt;setSuppressVisibilityUpdates(true);
</ins><span class="cx">     [_webViewPlaceholder setTarget:nil];
</span><span class="cx"> 
</span><span class="cx">     [self _manager]-&gt;setAnimatingFullScreen(true);
</span><span class="lines">@@ -379,7 +379,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Screen updates to be re-enabled in completeFinishExitFullScreenAnimationAfterRepaint.
</span><span class="cx">     NSDisableScreenUpdates();
</span><del>-    [_webView _setSuppressVisibilityUpdates:YES];
</del><ins>+    _page-&gt;setSuppressVisibilityUpdates(true);
</ins><span class="cx">     [[self window] orderOut:self];
</span><span class="cx">     NSView *contentView = [[self window] contentView];
</span><span class="cx">     contentView.layer.hidden = YES;
</span><span class="lines">@@ -394,7 +394,7 @@
</span><span class="cx">     // These messages must be sent after the swap or flashing will occur during forceRepaint:
</span><span class="cx">     [self _manager]-&gt;didExitFullScreen();
</span><span class="cx">     [self _manager]-&gt;setAnimatingFullScreen(false);
</span><del>-    [self _page]-&gt;scalePage(_savedScale, IntPoint());
</del><ins>+    _page-&gt;scalePage(_savedScale, IntPoint());
</ins><span class="cx">     [self _manager]-&gt;restoreScrollPosition();
</span><span class="cx"> 
</span><span class="cx">     if (_repaintCallback) {
</span><span class="lines">@@ -406,7 +406,7 @@
</span><span class="cx">     _repaintCallback = VoidCallback::create([self](WebKit::CallbackBase::Error) {
</span><span class="cx">         [self completeFinishExitFullScreenAnimationAfterRepaint];
</span><span class="cx">     });
</span><del>-    [self _page]-&gt;forceRepaint(_repaintCallback);
</del><ins>+    _page-&gt;forceRepaint(_repaintCallback);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)completeFinishExitFullScreenAnimationAfterRepaint
</span><span class="lines">@@ -414,7 +414,7 @@
</span><span class="cx">     _repaintCallback = nullptr;
</span><span class="cx">     [[_webView window] setAutodisplay:YES];
</span><span class="cx">     [[_webView window] displayIfNeeded];
</span><del>-    [_webView _setSuppressVisibilityUpdates:NO];
</del><ins>+    _page-&gt;setSuppressVisibilityUpdates(false);
</ins><span class="cx">     NSEnableScreenUpdates();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -487,17 +487,11 @@
</span><span class="cx"> #pragma mark -
</span><span class="cx"> #pragma mark Internal Interface
</span><span class="cx"> 
</span><del>-- (WebPageProxy*)_page
-{
-    return toImpl([_webView pageRef]);
-}
-
</del><span class="cx"> - (WebFullScreenManagerProxy*)_manager
</span><span class="cx"> {
</span><del>-    WebPageProxy* webPage = [self _page];
-    if (!webPage)
-        return 0;
-    return webPage-&gt;fullScreenManager();
</del><ins>+    if (!_page)
+        return nullptr;
+    return _page-&gt;fullScreenManager();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_replaceView:(NSView*)view with:(NSView*)otherView
</span><span class="lines">@@ -604,7 +598,7 @@
</span><span class="cx">     [window makeKeyAndOrderFront:self];
</span><span class="cx">     [window setCollectionBehavior:behavior];
</span><span class="cx"> 
</span><del>-    [_webView _setSuppressVisibilityUpdates:NO];
</del><ins>+    _page-&gt;setSuppressVisibilityUpdates(false);
</ins><span class="cx">     [[self window] setAutodisplay:YES];
</span><span class="cx">     [[self window] displayIfNeeded];
</span><span class="cx">     NSEnableScreenUpdates();
</span><span class="lines">@@ -627,7 +621,7 @@
</span><span class="cx">     contentView.layer.hidden = NO;
</span><span class="cx">     [contentView.layer addAnimation:fadeAnimation(duration, AnimateOut) forKey:@&quot;fullscreen&quot;];
</span><span class="cx"> 
</span><del>-    [_webView _setSuppressVisibilityUpdates:NO];
</del><ins>+    _page-&gt;setSuppressVisibilityUpdates(false);
</ins><span class="cx">     [[self window] setAutodisplay:YES];
</span><span class="cx">     [[self window] displayIfNeeded];
</span><span class="cx">     NSEnableScreenUpdates();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKViewLayoutStrategyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.h (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.h        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.h        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -32,22 +32,24 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> class WebPageProxy;
</span><ins>+class WebViewImpl;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-@class WKView;
</del><ins>+@class NSView;
</ins><span class="cx"> 
</span><span class="cx"> @interface WKViewLayoutStrategy : NSObject {
</span><span class="cx"> @package
</span><del>-    WebKit::WebPageProxy *_page;
-    WKView *_wkView;
</del><ins>+    WebKit::WebPageProxy* _page;
+    WebKit::WebViewImpl* _webViewImpl;
+    NSView *_view;
</ins><span class="cx"> 
</span><span class="cx">     WKLayoutMode _layoutMode;
</span><span class="cx">     unsigned _frameSizeUpdatesDisabledCount;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-+ (instancetype)layoutStrategyWithPage:(WebKit::WebPageProxy&amp;)page view:(WKView *)wkView mode:(WKLayoutMode)mode;
</del><ins>++ (instancetype)layoutStrategyWithPage:(WebKit::WebPageProxy&amp;)page view:(NSView *)view viewImpl:(WebKit::WebViewImpl&amp;)webViewImpl mode:(WKLayoutMode)mode;
</ins><span class="cx"> 
</span><del>-- (void)willDestroyView:(WKView *)view;
</del><ins>+- (void)invalidate;
</ins><span class="cx"> 
</span><span class="cx"> - (void)enableFrameSizeUpdates;
</span><span class="cx"> - (void)disableFrameSizeUpdates;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKViewLayoutStrategymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.mm (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.mm        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.mm        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -28,8 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> 
</span><del>-#import &quot;WKViewInternal.h&quot;
</del><span class="cx"> #import &quot;WebPageProxy.h&quot;
</span><ins>+#import &quot;WebViewImpl.h&quot;
</ins><span class="cx"> #import &lt;WebCore/MachSendRight.h&gt;
</span><span class="cx"> #import &lt;WebCore/QuartzCoreSPI.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -50,23 +50,23 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WKViewLayoutStrategy
</span><span class="cx"> 
</span><del>-+ (instancetype)layoutStrategyWithPage:(WebPageProxy&amp;)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</del><ins>++ (instancetype)layoutStrategyWithPage:(WebPageProxy&amp;)page view:(NSView *)view viewImpl:(WebViewImpl&amp;)webViewImpl mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><span class="cx">     WKViewLayoutStrategy *strategy;
</span><span class="cx"> 
</span><span class="cx">     switch (mode) {
</span><span class="cx">     case kWKLayoutModeFixedSize:
</span><del>-        strategy = [[WKViewFixedSizeLayoutStrategy alloc] initWithPage:page view:wkView mode:mode];
</del><ins>+        strategy = [[WKViewFixedSizeLayoutStrategy alloc] initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</ins><span class="cx">         break;
</span><span class="cx">     case kWKLayoutModeDynamicSizeComputedFromViewScale:
</span><del>-        strategy = [[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy alloc] initWithPage:page view:wkView mode:mode];
</del><ins>+        strategy = [[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy alloc] initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</ins><span class="cx">         break;
</span><span class="cx">     case kWKLayoutModeDynamicSizeComputedFromMinimumDocumentSize:
</span><del>-        strategy = [[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy alloc] initWithPage:page view:wkView mode:mode];
</del><ins>+        strategy = [[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy alloc] initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</ins><span class="cx">         break;
</span><span class="cx">     case kWKLayoutModeViewSize:
</span><span class="cx">     default:
</span><del>-        strategy = [[WKViewViewSizeLayoutStrategy alloc] initWithPage:page view:wkView mode:mode];
</del><ins>+        strategy = [[WKViewViewSizeLayoutStrategy alloc] initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     return [strategy autorelease];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(NSView *)view viewImpl:(WebViewImpl&amp;)webViewImpl mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><span class="cx">     self = [super init];
</span><span class="cx"> 
</span><span class="lines">@@ -83,16 +83,18 @@
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><span class="cx">     _page = &amp;page;
</span><del>-    _wkView = wkView;
</del><ins>+    _webViewImpl = &amp;webViewImpl;
+    _view = view;
</ins><span class="cx">     _layoutMode = mode;
</span><span class="cx"> 
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)willDestroyView:(WKView *)view
</del><ins>+- (void)invalidate
</ins><span class="cx"> {
</span><span class="cx">     _page = nullptr;
</span><del>-    _wkView = nil;
</del><ins>+    _webViewImpl = nullptr;
+    _view = nil;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (WKLayoutMode)layoutMode
</span><span class="lines">@@ -140,9 +142,9 @@
</span><span class="cx">     if ([self frameSizeUpdatesDisabled])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (_wkView.shouldClipToVisibleRect)
-        [_wkView _updateViewExposedRect];
-    [_wkView _setDrawingAreaSize:_wkView.frame.size];
</del><ins>+    if (_webViewImpl-&gt;clipsToVisibleRect())
+        _webViewImpl-&gt;updateViewExposedRect();
+    _webViewImpl-&gt;setDrawingAreaSize(NSSizeToCGSize(_view.frame.size));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)willChangeLayoutStrategy
</span><span class="lines">@@ -153,9 +155,9 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WKViewViewSizeLayoutStrategy
</span><span class="cx"> 
</span><del>-- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(NSView *)view viewImpl:(WebViewImpl&amp;)webViewImpl mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><del>-    self = [super initWithPage:page view:wkView mode:mode];
</del><ins>+    self = [super initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</ins><span class="cx"> 
</span><span class="cx">     if (!self)
</span><span class="cx">         return nil;
</span><span class="lines">@@ -173,9 +175,9 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WKViewFixedSizeLayoutStrategy
</span><span class="cx"> 
</span><del>-- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(NSView *)view viewImpl:(WebViewImpl&amp;)webViewImpl mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><del>-    self = [super initWithPage:page view:wkView mode:mode];
</del><ins>+    self = [super initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</ins><span class="cx"> 
</span><span class="cx">     if (!self)
</span><span class="cx">         return nil;
</span><span class="lines">@@ -193,9 +195,9 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WKViewDynamicSizeComputedFromViewScaleLayoutStrategy
</span><span class="cx"> 
</span><del>-- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(NSView *)view viewImpl:(WebViewImpl&amp;)webViewImpl mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><del>-    self = [super initWithPage:page view:wkView mode:mode];
</del><ins>+    self = [super initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</ins><span class="cx"> 
</span><span class="cx">     if (!self)
</span><span class="cx">         return nil;
</span><span class="lines">@@ -208,7 +210,7 @@
</span><span class="cx"> - (void)updateLayout
</span><span class="cx"> {
</span><span class="cx">     CGFloat inverseScale = 1 / _page-&gt;viewScaleFactor();
</span><del>-    [_wkView _setFixedLayoutSize:CGSizeMake(_wkView.frame.size.width * inverseScale, _wkView.frame.size.height * inverseScale)];
</del><ins>+    _webViewImpl-&gt;setFixedLayoutSize(CGSizeMake(_view.frame.size.width * inverseScale, _view.frame.size.height * inverseScale));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)didChangeViewScale
</span><span class="lines">@@ -222,7 +224,7 @@
</span><span class="cx"> {
</span><span class="cx">     [super didChangeFrameSize];
</span><span class="cx"> 
</span><del>-    if ([_wkView frameSizeUpdatesDisabled])
</del><ins>+    if (self.frameSizeUpdatesDisabled)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     [self updateLayout];
</span><span class="lines">@@ -232,9 +234,9 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy
</span><span class="cx"> 
</span><del>-- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(NSView *)view viewImpl:(WebViewImpl&amp;)webViewImpl mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><del>-    self = [super initWithPage:page view:wkView mode:mode];
</del><ins>+    self = [super initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</ins><span class="cx"> 
</span><span class="cx">     if (!self)
</span><span class="cx">         return nil;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (191319 => 191320)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-10-19 22:20:45 UTC (rev 191319)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-10-19 22:32:59 UTC (rev 191320)
</span><span class="lines">@@ -696,6 +696,8 @@
</span><span class="cx">                 2DF9EEEE1A786EAD00B6CFBE /* APINavigationResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DF9EEED1A786EAD00B6CFBE /* APINavigationResponse.h */; };
</span><span class="cx">                 2E0B8A7A1BC59A590044B32D /* _WKFormDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E0B8A791BC59A590044B32D /* _WKFormDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2E7A944A1BBD97C300945547 /* _WKFocusedElementInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                2DFC7DBB1BCCC19500C1548C /* WebViewImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DFC7DB91BCCC19500C1548C /* WebViewImpl.h */; settings = {ASSET_TAGS = (); }; };
+                2DFC7DBC1BCCC19500C1548C /* WebViewImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DFC7DBA1BCCC19500C1548C /* WebViewImpl.mm */; settings = {ASSET_TAGS = (); }; };
</ins><span class="cx">                 31099973146C75A20029DEB9 /* WebNotificationClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31099971146C759B0029DEB9 /* WebNotificationClient.cpp */; };
</span><span class="cx">                 310999C7146C9E3D0029DEB9 /* WebNotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31099968146C71F50029DEB9 /* WebNotificationClient.h */; };
</span><span class="cx">                 312C0C4A146DDC8A0016C911 /* WKNotificationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 312C0C49146DDC8A0016C911 /* WKNotificationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2860,6 +2862,8 @@
</span><span class="cx">                 2DF9EEED1A786EAD00B6CFBE /* APINavigationResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APINavigationResponse.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2E0B8A791BC59A590044B32D /* _WKFormDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKFormDelegate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKFocusedElementInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2DFC7DB91BCCC19500C1548C /* WebViewImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewImpl.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2DFC7DBA1BCCC19500C1548C /* WebViewImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewImpl.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 31099968146C71F50029DEB9 /* WebNotificationClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31099971146C759B0029DEB9 /* WebNotificationClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationClient.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 312C0C49146DDC8A0016C911 /* WKNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNotificationProvider.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4941,6 +4945,8 @@
</span><span class="cx">                                 7C4694CB1A4B510A00AD5845 /* WebPasteboardProxyCocoa.mm */,
</span><span class="cx">                                 7CE4D2151A49148400C7F152 /* WebProcessPoolCocoa.mm */,
</span><span class="cx">                                 1A04F6171A4A3A7A00A21B6E /* WebProcessProxyCocoa.mm */,
</span><ins>+                                2DFC7DB91BCCC19500C1548C /* WebViewImpl.h */,
+                                2DFC7DBA1BCCC19500C1548C /* WebViewImpl.mm */,
</ins><span class="cx">                                 1AD01BCB1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h */,
</span><span class="cx">                                 1AD01BCA1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.mm */,
</span><span class="cx">                                 2D7AAFD218C8640600A7ACD4 /* WKWebViewContentProvider.h */,
</span><span class="lines">@@ -7665,6 +7671,7 @@
</span><span class="cx">                                 1A2D956F12848564001EB962 /* ChildProcess.h in Headers */,
</span><span class="cx">                                 BC82837A16B36A4F00A278FE /* ChildProcessEntryPoint.h in Headers */,
</span><span class="cx">                                 51FAEC3A1B0657630009C4E7 /* ChildProcessMessages.h in Headers */,
</span><ins>+                                2DFC7DBB1BCCC19500C1548C /* WebViewImpl.h in Headers */,
</ins><span class="cx">                                 E1513C67166EABB200149FCB /* ChildProcessProxy.h in Headers */,
</span><span class="cx">                                 290F4272172A0C7400939FF0 /* ChildProcessSupplement.h in Headers */,
</span><span class="cx">                                 1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */,
</span><span class="lines">@@ -9805,6 +9812,7 @@
</span><span class="cx">                                 1A8B66B31BC45B010082DF77 /* WKBundleMac.mm in Sources */,
</span><span class="cx">                                 BC111A5B112F4FBB00337BAB /* WebContextMenuClient.cpp in Sources */,
</span><span class="cx">                                 51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */,
</span><ins>+                                2DFC7DBC1BCCC19500C1548C /* WebViewImpl.mm in Sources */,
</ins><span class="cx">                                 512935D71288D19400A4B695 /* WebContextMenuItem.cpp in Sources */,
</span><span class="cx">                                 510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */,
</span><span class="cx">                                 51A84CE3127F386B00CA6EA4 /* WebContextMenuProxy.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>