<!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>[191315] 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/191315">191315</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-19 13:39:47 -0700 (Mon, 19 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/191307">r191307</a>.
https://bugs.webkit.org/show_bug.cgi?id=150338
broke lots of API tests, need time to figure out whats up
(Requested by thorton on #webkit).
Reverted changeset:
"WKView being inside WKWebView leads to weird API issues"
https://bugs.webkit.org/show_bug.cgi?id=150174
http://trac.webkit.org/changeset/191307</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>Removed 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 (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebCore/ChangeLog        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2015-10-19 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><ins>+ Unreviewed, rolling out r191307.
+ https://bugs.webkit.org/show_bug.cgi?id=150338
+
+ broke lots of API tests, need time to figure out whats up
+ (Requested by thorton on #webkit).
+
+ Reverted changeset:
+
+ "WKView being inside WKWebView leads to weird API issues"
+ https://bugs.webkit.org/show_bug.cgi?id=150174
+ http://trac.webkit.org/changeset/191307
+
+2015-10-19 Commit Queue <commit-queue@webkit.org>
+
</ins><span class="cx"> Unreviewed, rolling out r191295, r191297, and r191301.
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=150337
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -1121,7 +1121,6 @@
</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><del>-                2D0CF8171BCF5DE1007A4937 /* NSWindowSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><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">@@ -8440,7 +8439,6 @@
</span><span class="cx">                 2BE8E2C812A58A0100FAD550 /* HTMLMetaCharsetParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLMetaCharsetParser.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSurface.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IOSurface.mm; sourceTree = "<group>"; };
</span><del>-                2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSWindowSPI.h; sourceTree = "<group>"; };
</del><span class="cx">                 2D232BFF1A326EF9006BF2DB /* TUCallSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TUCallSPI.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D25396018CE7F6200270222 /* ImageControlsButtonElementMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageControlsButtonElementMac.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2D25396118CE7F6200270222 /* ImageControlsButtonElementMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageControlsButtonElementMac.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -18542,7 +18540,6 @@
</span><span class="cx">                                 F40EA8AA1B867D6500CE5581 /* NSScrollingInputFilterSPI.h */,
</span><span class="cx">                                 2DCB837719F99BBA00A7FBE4 /* NSSharingServicePickerSPI.h */,
</span><span class="cx">                                 2DCB837819F99BBA00A7FBE4 /* NSSharingServiceSPI.h */,
</span><del>-                                2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */,
</del><span class="cx">                                 937F4CCB1A2D48C100BB39F5 /* QuickLookMacSPI.h */,
</span><span class="cx">                                 2D232BFF1A326EF9006BF2DB /* TUCallSPI.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -27843,7 +27840,6 @@
</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><del>-                                2D0CF8171BCF5DE1007A4937 /* NSWindowSPI.h in Headers */,
</del><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="delfile"><h4>Deleted: trunk/Source/WebCore/platform/spi/mac/NSWindowSPI.h (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/NSWindowSPI.h        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebCore/platform/spi/mac/NSWindowSPI.h        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-/*
- * 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 <wtf/Platform.h>
-
-#if PLATFORM(MAC)
-
-#if USE(APPLE_INTERNAL_SDK)
-
-#import <AppKit/NSWindow_Private.h>
-
-#else
-
-#import <AppKit/NSWindow.h>
-
-@interface NSWindow ()
-
-- (id)_newFirstResponderAfterResigning;
-
-@end
-
-#endif
-
-#endif // PLATFORM(MAC)
</del></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-10-19 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r191307.
+ https://bugs.webkit.org/show_bug.cgi?id=150338
+
+ broke lots of API tests, need time to figure out whats up
+ (Requested by thorton on #webkit).
+
+ Reverted changeset:
+
+ "WKView being inside WKWebView leads to weird API issues"
+ https://bugs.webkit.org/show_bug.cgi?id=150174
+ http://trac.webkit.org/changeset/191307
+
</ins><span class="cx"> 2015-10-19 Tim Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> Try again to fix the 32-bit build.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> #import "WKStringCF.h"
</span><span class="cx"> #import "WKTextInputWindowController.h"
</span><span class="cx"> #import "WKViewInternal.h"
</span><ins>+#import "WKViewLayoutStrategy.h"
</ins><span class="cx"> #import "WKViewPrivate.h"
</span><span class="cx"> #import "WKWebView.h"
</span><span class="cx"> #import "WebBackForwardList.h"
</span><span class="lines">@@ -80,7 +81,6 @@
</span><span class="cx"> #import "WebProcessPool.h"
</span><span class="cx"> #import "WebProcessProxy.h"
</span><span class="cx"> #import "WebSystemInterface.h"
</span><del>-#import "WebViewImpl.h"
</del><span class="cx"> #import "_WKRemoteObjectRegistryInternal.h"
</span><span class="cx"> #import "_WKThumbnailViewInternal.h"
</span><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><span class="lines">@@ -130,6 +130,10 @@
</span><span class="cx"> - (void)_setCurrentEvent:(NSEvent *)event;
</span><span class="cx"> @end
</span><span class="cx">
</span><ins>+@interface NSWindow (WKNSWindowDetails)
+- (id)_newFirstResponderAfterResigning;
+@end
+
</ins><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">@@ -177,7 +181,6 @@
</span><span class="cx"> @public
</span><span class="cx"> std::unique_ptr<PageClientImpl> _pageClient;
</span><span class="cx"> RefPtr<WebPageProxy> _page;
</span><del>- std::unique_ptr<WebViewImpl> _impl;
</del><span class="cx">
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> RetainPtr<WKBrowsingContextController> _browsingContextController;
</span><span class="lines">@@ -212,12 +215,16 @@
</span><span class="cx"> WKViewInterpretKeyEventsParameters* _interpretKeyEventsParameters;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ NSSize _resizeScrollOffset;
+
</ins><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><ins>+ bool _inBecomeFirstResponder;
+ bool _inResignFirstResponder;
</ins><span class="cx"> BOOL _willBecomeFirstResponderAgain;
</span><span class="cx"> NSEvent *_mouseDownEvent;
</span><span class="cx"> NSEvent *_pressureEvent;
</span><span class="lines">@@ -225,9 +232,15 @@
</span><span class="cx">
</span><span class="cx"> id _flagsChangedEventMonitor;
</span><span class="cx">
</span><ins>+#if ENABLE(FULLSCREEN_API)
+ RetainPtr<WKFullScreenWindowController> _fullScreenWindowController;
+#endif
+
</ins><span class="cx"> BOOL _hasSpellCheckerDocumentTag;
</span><span class="cx"> NSInteger _spellCheckerDocumentTag;
</span><span class="cx">
</span><ins>+ BOOL _inSecureInputState;
+
</ins><span class="cx"> BOOL _shouldDeferViewInWindowChanges;
</span><span class="cx"> NSWindow *_targetWindowForMovePreparation;
</span><span class="cx">
</span><span class="lines">@@ -241,7 +254,11 @@
</span><span class="cx"> RefPtr<WebCore::Image> _promisedImage;
</span><span class="cx"> String _promisedFilename;
</span><span class="cx"> String _promisedURL;
</span><del>-
</del><ins>+
+ NSSize _intrinsicContentSize;
+ BOOL _clipsToVisibleRect;
+ NSRect _contentPreparationRect;
+ BOOL _useContentPreparationRectForVisibleRect;
</ins><span class="cx"> BOOL _windowOcclusionDetectionEnabled;
</span><span class="cx">
</span><span class="cx"> RetainPtr<WKWindowVisibilityObserver> _windowVisibilityObserver;
</span><span class="lines">@@ -253,6 +270,10 @@
</span><span class="cx"> BOOL _allowsBackForwardNavigationGestures;
</span><span class="cx"> BOOL _allowsLinkPreview;
</span><span class="cx">
</span><ins>+ RetainPtr<WKViewLayoutStrategy> _layoutStrategy;
+ WKLayoutMode _lastRequestedLayoutMode;
+ float _lastRequestedViewScale;
+
</ins><span class="cx"> RetainPtr<CALayer> _rootLayer;
</span><span class="cx">
</span><span class="cx"> BOOL _didScheduleSetTopContentInset;
</span><span class="lines">@@ -348,9 +369,6 @@
</span><span class="cx">
</span><span class="cx"> @end
</span><span class="cx">
</span><del>-@interface WKView () <WebViewImplDelegate>
-@end
-
</del><span class="cx"> @implementation WKView
</span><span class="cx">
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="lines">@@ -372,9 +390,8 @@
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</span><span class="cx"> [_data->_immediateActionController willDestroyView:self];
</span><span class="cx"> #endif
</span><ins>+ [_data->_layoutStrategy willDestroyView:self];
</ins><span class="cx">
</span><del>- _data->_impl = nullptr;
-
</del><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> if (_data->_remoteObjectRegistry) {
</span><span class="cx"> _data->_page->process().processPool().removeMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _data->_page->pageID());
</span><span class="lines">@@ -387,6 +404,7 @@
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> ASSERT(!_data->_thumbnailView);
</span><span class="cx"> #endif
</span><ins>+ ASSERT(!_data->_inSecureInputState);
</ins><span class="cx">
</span><span class="cx"> [_data release];
</span><span class="cx"> _data = nil;
</span><span class="lines">@@ -416,47 +434,107 @@
</span><span class="cx">
</span><span class="cx"> - (void)setDrawsBackground:(BOOL)drawsBackground
</span><span class="cx"> {
</span><del>- _data->_impl->setDrawsBackground(drawsBackground);
</del><ins>+ _data->_page->setDrawsBackground(drawsBackground);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (BOOL)drawsBackground
</span><span class="cx"> {
</span><del>- return _data->_impl->drawsBackground();
</del><ins>+ return _data->_page->drawsBackground();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)setDrawsTransparentBackground:(BOOL)drawsTransparentBackground
</span><span class="cx"> {
</span><del>- _data->_impl->setDrawsTransparentBackground(drawsTransparentBackground);
</del><ins>+ _data->_page->setDrawsTransparentBackground(drawsTransparentBackground);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (BOOL)drawsTransparentBackground
</span><span class="cx"> {
</span><del>- return _data->_impl->drawsTransparentBackground();
</del><ins>+ return _data->_page->drawsTransparentBackground();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (BOOL)acceptsFirstResponder
</span><span class="cx"> {
</span><del>- return _data->_impl->acceptsFirstResponder();
</del><ins>+ return YES;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (BOOL)becomeFirstResponder
</span><span class="cx"> {
</span><del>- return _data->_impl->becomeFirstResponder();
</del><ins>+ // If we just became first responder again, there is no need to do anything,
+ // since resignFirstResponder has correctly detected this situation.
+ if (_data->_willBecomeFirstResponderAgain) {
+ _data->_willBecomeFirstResponderAgain = NO;
+ return YES;
+ }
+
+ NSSelectionDirection direction = [[self window] keyViewSelectionDirection];
+
+ _data->_inBecomeFirstResponder = true;
+
+ [self _updateSecureInputState];
+ _data->_page->viewStateDidChange(ViewState::IsFocused);
+ // Restore the selection in the editable region if resigning first responder cleared selection.
+ _data->_page->restoreSelectionInFocusedEditableElement();
+
+ _data->_inBecomeFirstResponder = false;
+
+ if (direction != NSDirectSelection) {
+ NSEvent *event = [NSApp currentEvent];
+ NSEvent *keyboardEvent = nil;
+ if ([event type] == NSKeyDown || [event type] == NSKeyUp)
+ keyboardEvent = event;
+ _data->_page->setInitialFocus(direction == NSSelectingNext, keyboardEvent != nil, NativeWebKeyboardEvent(keyboardEvent, false, Vector<KeypressCommand>()), [](WebKit::CallbackBase::Error) { });
+ }
+ return YES;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (BOOL)resignFirstResponder
</span><span class="cx"> {
</span><del>- return _data->_impl->resignFirstResponder();
</del><ins>+#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]] && self.superview == nextResponder) {
+ _data->_willBecomeFirstResponderAgain = YES;
+ return YES;
+ }
+#endif
+
+ _data->_willBecomeFirstResponderAgain = NO;
+ _data->_inResignFirstResponder = true;
+
+#if USE(ASYNC_NSTEXTINPUTCLIENT)
+ _data->_page->confirmCompositionAsync();
+#else
+ if (_data->_page->editorState().hasComposition && !_data->_page->editorState().shouldIgnoreCompositionSelectionChange)
+ _data->_page->cancelComposition();
+#endif
+
+ [self _notifyInputContextAboutDiscardedComposition];
+
+ [self _resetSecureInputState];
+
+ if (!_data->_page->maintainsInactiveSelection())
+ _data->_page->clearSelection();
+
+ _data->_page->viewStateDidChange(ViewState::IsFocused);
+
+ _data->_inResignFirstResponder = false;
+
+ return YES;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)viewWillStartLiveResize
</span><span class="cx"> {
</span><del>- _data->_impl->viewWillStartLiveResize();
</del><ins>+ _data->_page->viewWillStartLiveResize();
+
+ [_data->_layoutStrategy willStartLiveResize];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)viewDidEndLiveResize
</span><span class="cx"> {
</span><del>- _data->_impl->viewDidEndLiveResize();
</del><ins>+ _data->_page->viewWillEndLiveResize();
+
+ [_data->_layoutStrategy didEndLiveResize];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (BOOL)isFlipped
</span><span class="lines">@@ -466,25 +544,39 @@
</span><span class="cx">
</span><span class="cx"> - (NSSize)intrinsicContentSize
</span><span class="cx"> {
</span><del>- return NSSizeFromCGSize(_data->_impl->intrinsicContentSize());
</del><ins>+ return _data->_intrinsicContentSize;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)prepareContentInRect:(NSRect)rect
</span><span class="cx"> {
</span><del>- _data->_impl->setContentPreparationRect(NSRectToCGRect(rect));
- _data->_impl->updateViewExposedRect();
</del><ins>+ _data->_contentPreparationRect = rect;
+ _data->_useContentPreparationRectForVisibleRect = YES;
+
+ [self _updateViewExposedRect];
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)_updateViewExposedRect
+{
+ NSRect exposedRect = [self visibleRect];
+
+ if (_data->_useContentPreparationRectForVisibleRect)
+ exposedRect = NSUnionRect(_data->_contentPreparationRect, exposedRect);
+
+ if (auto drawingArea = _data->_page->drawingArea())
+ drawingArea->setExposedRect(_data->_clipsToVisibleRect ? FloatRect(exposedRect) : FloatRect::infiniteRect());
+}
+
</ins><span class="cx"> - (void)setFrameSize:(NSSize)size
</span><span class="cx"> {
</span><span class="cx"> [super setFrameSize:size];
</span><del>- _data->_impl->setFrameSize(NSSizeToCGSize(size));
</del><ins>+
+ [_data->_layoutStrategy didChangeFrameSize];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_updateWindowAndViewFrames
</span><span class="cx"> {
</span><del>- if (_data->_impl->clipsToVisibleRect())
- _data->_impl->updateViewExposedRect();
</del><ins>+ if (_data->_clipsToVisibleRect)
+ [self _updateViewExposedRect];
</ins><span class="cx">
</span><span class="cx"> if (_data->_didScheduleWindowAndViewFrameUpdate)
</span><span class="cx"> return;
</span><span class="lines">@@ -1737,11 +1829,11 @@
</span><span class="cx"> } else
</span><span class="cx"> text = string;
</span><span class="cx">
</span><del>- if (_data->_impl->inSecureInputState()) {
</del><ins>+ if (_data->_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->_page->editorState().hasComposition);
</span><del>- _data->_impl->notifyInputContextAboutDiscardedComposition();
</del><ins>+ [self _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 && isASCII([text characterAtIndex:0]))
</span><span class="cx"> _data->_page->insertTextAsync(text, replacementRange);
</span><span class="lines">@@ -2133,7 +2225,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->_page->editorState().hasComposition);
</span><del>- _data->_impl->notifyInputContextAboutDiscardedComposition();
</del><ins>+ [self _notifyInputContextAboutDiscardedComposition];
</ins><span class="cx"> if ([text length] == 1 && [[text decomposedStringWithCanonicalMapping] characterAtIndex:0] < 0x80) {
</span><span class="cx"> _data->_page->insertText(text, replacementRange);
</span><span class="cx"> } else
</span><span class="lines">@@ -2345,11 +2437,6 @@
</span><span class="cx">
</span><span class="cx"> #endif // USE(ASYNC_NSTEXTINPUTCLIENT)
</span><span class="cx">
</span><del>-- (NSTextInputContext *)_superInputContext
-{
- return [super inputContext];
-}
-
</del><span class="cx"> - (NSArray *)validAttributesForMarkedText
</span><span class="cx"> {
</span><span class="cx"> static NSArray *validAttributes;
</span><span class="lines">@@ -2670,7 +2757,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>- _data->_impl->updateSecureInputState();
</del><ins>+ [self _updateSecureInputState];
</ins><span class="cx"> _data->_page->viewStateDidChange(ViewState::WindowIsActive);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -2689,7 +2776,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>- _data->_impl->updateSecureInputState();
</del><ins>+ [self _updateSecureInputState];
</ins><span class="cx"> _data->_page->viewStateDidChange(ViewState::WindowIsActive);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -2913,6 +3000,15 @@
</span><span class="cx"> return [[NSScreen mainScreen] backingScaleFactor];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)_setDrawingAreaSize:(NSSize)size
+{
+ if (!_data->_page->drawingArea())
+ return;
+
+ _data->_page->drawingArea()->setSize(IntSize(size), IntSize(0, 0), IntSize(_data->_resizeScrollOffset));
+ _data->_resizeScrollOffset = NSZeroSize;
+}
+
</ins><span class="cx"> - (void)quickLookWithEvent:(NSEvent *)event
</span><span class="cx"> {
</span><span class="cx"> if (_data->_ignoresNonWheelEvents)
</span><span class="lines">@@ -2937,6 +3033,15 @@
</span><span class="cx"> return std::make_unique<TiledCoreAnimationDrawingAreaProxy>(*_data->_page);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (BOOL)_isFocused
+{
+ if (_data->_inBecomeFirstResponder)
+ return YES;
+ if (_data->_inResignFirstResponder)
+ return NO;
+ return [[self window] firstResponder] == self;
+}
+
</ins><span class="cx"> - (WebKit::ColorSpaceData)_colorSpace
</span><span class="cx"> {
</span><span class="cx"> if (!_data->_colorSpace) {
</span><span class="lines">@@ -2956,7 +3061,7 @@
</span><span class="cx">
</span><span class="cx"> - (void)_processDidExit
</span><span class="cx"> {
</span><del>- _data->_impl->notifyInputContextAboutDiscardedComposition();
</del><ins>+ [self _notifyInputContextAboutDiscardedComposition];
</ins><span class="cx">
</span><span class="cx"> if (_data->_layerHostingView)
</span><span class="cx"> [self _setAcceleratedCompositingModeRootLayer:nil];
</span><span class="lines">@@ -3191,6 +3296,11 @@
</span><span class="cx"> _data->_textIndicatorWindow->setAnimationProgress(progress);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (CALayer *)_rootLayer
+{
+ return [_data->_layerHostingView layer];
+}
+
</ins><span class="cx"> - (void)_setAcceleratedCompositingModeRootLayer:(CALayer *)rootLayer
</span><span class="cx"> {
</span><span class="cx"> [rootLayer web_disableAllActions];
</span><span class="lines">@@ -3522,7 +3632,54 @@
</span><span class="cx"> return [NSArray arrayWithObject:[path lastPathComponent]];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)_updateSecureInputState
+{
+ if (![[self window] isKeyWindow] || ![self _isFocused]) {
+ if (_data->_inSecureInputState) {
+ DisableSecureEventInput();
+ _data->_inSecureInputState = NO;
+ }
+ return;
+ }
+ // WKView has a single input context for all editable areas (except for plug-ins).
+ NSTextInputContext *context = [super inputContext];
+ bool isInPasswordField = _data->_page->editorState().isInPasswordField;
</ins><span class="cx">
</span><ins>+ if (isInPasswordField) {
+ if (!_data->_inSecureInputState)
+ EnableSecureEventInput();
+ static NSArray *romanInputSources = [[NSArray alloc] initWithObjects:&NSAllRomanInputSourcesLocaleIdentifier count:1];
+ LOG(TextInput, "-> setAllowedInputSourceLocales:romanInputSources");
+ [context setAllowedInputSourceLocales:romanInputSources];
+ } else {
+ if (_data->_inSecureInputState)
+ DisableSecureEventInput();
+ LOG(TextInput, "-> setAllowedInputSourceLocales:nil");
+ [context setAllowedInputSourceLocales:nil];
+ }
+ _data->_inSecureInputState = isInPasswordField;
+}
+
+- (void)_resetSecureInputState
+{
+ if (_data->_inSecureInputState) {
+ DisableSecureEventInput();
+ _data->_inSecureInputState = NO;
+ }
+}
+
+- (void)_notifyInputContextAboutDiscardedComposition
+{
+ // <rdar://problem/9359055>: -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, "-> discardMarkedText");
+ [[super inputContext] discardMarkedText]; // Inform the input method that we won't have an inline input area despite having been asked to.
+}
+
</ins><span class="cx"> - (NSWindow *)_targetWindowForMovePreparation
</span><span class="cx"> {
</span><span class="cx"> return _data->_targetWindowForMovePreparation;
</span><span class="lines">@@ -3531,17 +3688,24 @@
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> - (BOOL)_hasFullScreenWindowController
</span><span class="cx"> {
</span><del>- return _data->_impl->hasFullScreenWindowController();
</del><ins>+ return (bool)_data->_fullScreenWindowController;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (WKFullScreenWindowController *)_fullScreenWindowController
</span><span class="cx"> {
</span><del>- return _data->_impl->fullScreenWindowController();
</del><ins>+ if (!_data->_fullScreenWindowController)
+ _data->_fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWindow:[self createFullScreenWindow] webView:self]);
+
+ return _data->_fullScreenWindowController.get();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_closeFullScreenWindowController
</span><span class="cx"> {
</span><del>- _data->_impl->closeFullScreenWindowController();
</del><ins>+ if (!_data->_fullScreenWindowController)
+ return;
+
+ [_data->_fullScreenWindowController close];
+ _data->_fullScreenWindowController = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -3558,7 +3722,16 @@
</span><span class="cx">
</span><span class="cx"> - (void)_setIntrinsicContentSize:(NSSize)intrinsicContentSize
</span><span class="cx"> {
</span><del>- _data->_impl->setIntrinsicContentSize(NSSizeToCGSize(intrinsicContentSize));
</del><ins>+ // 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 < _data->_page->minimumLayoutSize().width())
+ intrinsicContentSizeAcknowledgingFlexibleWidth.width = NSViewNoInstrinsicMetric;
+
+ _data->_intrinsicContentSize = intrinsicContentSizeAcknowledgingFlexibleWidth;
+ [self invalidateIntrinsicContentSize];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSInteger)spellCheckerDocumentTag
</span><span class="lines">@@ -3620,10 +3793,6 @@
</span><span class="cx">
</span><span class="cx"> _data->_pageClient = std::make_unique<PageClientImpl>(self, webView);
</span><span class="cx"> _data->_page = processPool.createWebPage(*_data->_pageClient, WTF::move(configuration));
</span><del>-
- _data->_impl = std::make_unique<WebViewImpl>(self, *_data->_page);
- static_cast<PageClientImpl*>(_data->_pageClient.get())->setImpl(*_data->_impl);
-
</del><span class="cx"> _data->_page->setAddsVisitedLinks(processPool.historyClient().addsVisitedLinks());
</span><span class="cx">
</span><span class="cx"> _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
</span><span class="lines">@@ -3632,12 +3801,20 @@
</span><span class="cx"> _data->_mouseDownEvent = nil;
</span><span class="cx"> _data->_pressureEvent = nil;
</span><span class="cx"> _data->_ignoringMouseDraggedEvents = NO;
</span><ins>+ _data->_clipsToVisibleRect = NO;
+ _data->_useContentPreparationRectForVisibleRect = NO;
</ins><span class="cx"> _data->_windowOcclusionDetectionEnabled = YES;
</span><ins>+ _data->_lastRequestedLayoutMode = kWKLayoutModeViewSize;
+ _data->_lastRequestedViewScale = 1;
</ins><span class="cx">
</span><span class="cx"> _data->_windowVisibilityObserver = adoptNS([[WKWindowVisibilityObserver alloc] initWithView:self]);
</span><span class="cx">
</span><ins>+ _data->_intrinsicContentSize = NSMakeSize(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric);
+
</ins><span class="cx"> _data->_needsViewFrameInWindowCoordinates = _data->_page->preferences().pluginsEnabled();
</span><span class="cx">
</span><ins>+ _data->_layoutStrategy = [WKViewLayoutStrategy layoutStrategyWithPage:*_data->_page view:self mode:kWKLayoutModeViewSize];
+
</ins><span class="cx"> [self _registerDraggedTypes];
</span><span class="cx">
</span><span class="cx"> self.wantsLayer = YES;
</span><span class="lines">@@ -3747,6 +3924,44 @@
</span><span class="cx"> _data->_gestureController->didFirstVisuallyNonEmptyLayoutForMainFrame();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (BOOL)_supportsArbitraryLayoutModes
+{
+ if ([_data->_fullScreenWindowController isFullScreen])
+ return NO;
+
+ WebPageProxy* page = _data->_page.get();
+ if (!page)
+ return YES;
+ WebFrameProxy* frame = page->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->containsPluginDocument())
+ return NO;
+
+ return YES;
+}
+
+- (void)_updateSupportsArbitraryLayoutModes
+{
+ if (![self _supportsArbitraryLayoutModes]) {
+ WKLayoutMode oldRequestedLayoutMode = _data->_lastRequestedLayoutMode;
+ float oldRequestedViewScale = _data->_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->_lastRequestedLayoutMode = oldRequestedLayoutMode;
+ _data->_lastRequestedViewScale = oldRequestedViewScale;
+ } else if (_data->_lastRequestedLayoutMode != [_data->_layoutStrategy layoutMode]) {
+ [self _setViewScale:_data->_lastRequestedViewScale];
+ [self _setLayoutMode:_data->_lastRequestedLayoutMode];
+ }
+}
+
</ins><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> - (_WKRemoteObjectRegistry *)_remoteObjectRegistry
</span><span class="cx"> {
</span><span class="lines">@@ -3757,8 +3972,15 @@
</span><span class="cx">
</span><span class="cx"> return _data->_remoteObjectRegistry.get();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><ins>+
+- (void)_didCommitLoadForMainFrame
+{
+ [self _updateSupportsArbitraryLayoutModes];
+}
+
</ins><span class="cx"> - (void)_didFinishLoadForMainFrame
</span><span class="cx"> {
</span><span class="cx"> if (_data->_gestureController)
</span><span class="lines">@@ -3799,12 +4021,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-// FIXME: Get rid of this when we have better plumbing to WKViewLayoutStrategy.
-- (void)_updateViewExposedRect
-{
- _data->_impl->updateViewExposedRect();
-}
-
</del><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @implementation WKView (Private)
</span><span class="lines">@@ -3892,22 +4108,25 @@
</span><span class="cx">
</span><span class="cx"> - (void)setFrame:(NSRect)rect andScrollBy:(NSSize)offset
</span><span class="cx"> {
</span><del>- _data->_impl->setFrameAndScrollBy(NSRectToCGRect(rect), NSSizeToCGSize(offset));
</del><ins>+ ASSERT(NSEqualSizes(_data->_resizeScrollOffset, NSZeroSize));
+
+ _data->_resizeScrollOffset = offset;
+ [self setFrame:rect];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)disableFrameSizeUpdates
</span><span class="cx"> {
</span><del>- _data->_impl->disableFrameSizeUpdates();
</del><ins>+ [_data->_layoutStrategy disableFrameSizeUpdates];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)enableFrameSizeUpdates
</span><span class="cx"> {
</span><del>- _data->_impl->enableFrameSizeUpdates();
</del><ins>+ [_data->_layoutStrategy enableFrameSizeUpdates];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (BOOL)frameSizeUpdatesDisabled
</span><span class="cx"> {
</span><del>- return _data->_impl->frameSizeUpdatesDisabled();
</del><ins>+ return [_data->_layoutStrategy frameSizeUpdatesDisabled];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> + (void)hideWordDefinitionWindow
</span><span class="lines">@@ -3942,12 +4161,13 @@
</span><span class="cx">
</span><span class="cx"> - (BOOL)shouldClipToVisibleRect
</span><span class="cx"> {
</span><del>- return _data->_impl->clipsToVisibleRect();
</del><ins>+ return _data->_clipsToVisibleRect;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)setShouldClipToVisibleRect:(BOOL)clipsToVisibleRect
</span><span class="cx"> {
</span><del>- _data->_impl->setClipsToVisibleRect(clipsToVisibleRect);
</del><ins>+ _data->_clipsToVisibleRect = clipsToVisibleRect;
+ [self _updateViewExposedRect];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSColor *)underlayColor
</span><span class="lines">@@ -3984,13 +4204,20 @@
</span><span class="cx">
</span><span class="cx"> - (NSView *)fullScreenPlaceholderView
</span><span class="cx"> {
</span><del>- return _data->_impl->fullScreenPlaceholderView();
</del><ins>+#if ENABLE(FULLSCREEN_API)
+ if (_data->_fullScreenWindowController && [_data->_fullScreenWindowController isFullScreen])
+ return [_data->_fullScreenWindowController webViewPlaceholder];
+#endif
+ return nil;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-// FIXME: This returns an autoreleased object. Should it really be prefixed 'create'?
</del><span class="cx"> - (NSWindow *)createFullScreenWindow
</span><span class="cx"> {
</span><del>- return _data->_impl->createFullScreenWindow();
</del><ins>+#if ENABLE(FULLSCREEN_API)
+ return [[[WebCoreFullScreenWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame] styleMask:(NSBorderlessWindowMask | NSResizableWindowMask) backing:NSBackingStoreBuffered defer:NO] autorelease];
+#else
+ return nil;
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // FIXME: All of these "DeferringViewInWindowChanges" methods should be able to be removed once clients are weaned off of them.
</span><span class="lines">@@ -4156,32 +4383,50 @@
</span><span class="cx">
</span><span class="cx"> - (WKLayoutMode)_layoutMode
</span><span class="cx"> {
</span><del>- return _data->_impl->layoutMode();
</del><ins>+ return [_data->_layoutStrategy layoutMode];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_setLayoutMode:(WKLayoutMode)layoutMode
</span><span class="cx"> {
</span><del>- _data->_impl->setLayoutMode(layoutMode);
</del><ins>+ _data->_lastRequestedLayoutMode = layoutMode;
+
+ if (![self _supportsArbitraryLayoutModes] && layoutMode != kWKLayoutModeViewSize)
+ return;
+
+ if (layoutMode == [_data->_layoutStrategy layoutMode])
+ return;
+
+ [_data->_layoutStrategy willChangeLayoutStrategy];
+ _data->_layoutStrategy = [WKViewLayoutStrategy layoutStrategyWithPage:*_data->_page view:self mode:layoutMode];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (CGSize)_fixedLayoutSize
</span><span class="cx"> {
</span><del>- return _data->_impl->fixedLayoutSize();
</del><ins>+ return _data->_page->fixedLayoutSize();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_setFixedLayoutSize:(CGSize)fixedLayoutSize
</span><span class="cx"> {
</span><del>- _data->_impl->setFixedLayoutSize(fixedLayoutSize);
</del><ins>+ _data->_page->setFixedLayoutSize(expandedIntSize(FloatSize(fixedLayoutSize)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (CGFloat)_viewScale
</span><span class="cx"> {
</span><del>- return _data->_impl->viewScale();
</del><ins>+ return _data->_page->viewScaleFactor();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_setViewScale:(CGFloat)viewScale
</span><span class="cx"> {
</span><del>- _data->_impl->setViewScale(viewScale);
</del><ins>+ _data->_lastRequestedViewScale = viewScale;
+
+ if (![self _supportsArbitraryLayoutModes] && viewScale != 1)
+ return;
+
+ if (viewScale <= 0 || isnan(viewScale) || isinf(viewScale))
+ [NSException raise:NSInvalidArgumentException format:@"View scale should be a positive number"];
+
+ _data->_page->scaleView(viewScale);
+ [_data->_layoutStrategy didChangeViewScale];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_dispatchSetTopContentInset
</span><span class="lines">@@ -4282,9 +4527,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 <= 1090
</span><del>- if (_data->_impl->clipsToVisibleRect())
- _data->_impl->updateViewExposedRect();
- _data->_impl->setDrawingAreaSize(NSSizeToCGSize(size));
</del><ins>+ if (_data->_clipsToVisibleRect)
+ [self _updateViewExposedRect];
+ [self _setDrawingAreaSize: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 (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> - (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
</span><ins>+- (BOOL)_isFocused;
</ins><span class="cx"> - (void)_processDidExit;
</span><span class="cx"> - (void)_pageClosed;
</span><span class="cx"> - (void)_didRelaunchProcess;
</span><span class="lines">@@ -109,6 +110,9 @@
</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><ins>+- (void)_updateSecureInputState;
+- (void)_resetSecureInputState;
+- (void)_notifyInputContextAboutDiscardedComposition;
</ins><span class="cx">
</span><span class="cx"> - (WebKit::ColorSpaceData)_colorSpace;
</span><span class="cx">
</span><span class="lines">@@ -119,6 +123,7 @@
</span><span class="cx"> - (BOOL)_suppressVisibilityUpdates;
</span><span class="cx">
</span><span class="cx"> - (void)_didFirstVisuallyNonEmptyLayoutForMainFrame;
</span><ins>+- (void)_didCommitLoadForMainFrame;
</ins><span class="cx"> - (void)_didFinishLoadForMainFrame;
</span><span class="cx"> - (void)_didFailLoadForMainFrame;
</span><span class="cx"> - (void)_didSameDocumentNavigationForMainFrame:(WebKit::SameDocumentNavigationType)type;
</span><span class="lines">@@ -153,6 +158,13 @@
</span><span class="cx">
</span><span class="cx"> @property (readonly) NSWindow *_targetWindowForMovePreparation;
</span><span class="cx">
</span><ins>+// For WKViewLayoutStrategy and subclasses:
+- (void)_setDrawingAreaSize:(NSSize)size;
+- (void)_updateViewExposedRect;
+- (CALayer *)_rootLayer;
+
+- (void)_updateSupportsArbitraryLayoutModes;
+
</ins><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="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -1,142 +0,0 @@
</span><del>-/*
- * 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 "WKLayoutMode.h"
-#import <wtf/RetainPtr.h>
-
-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 <WebViewImplDelegate> *, WebPageProxy&);
-
- ~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 <WebViewImplDelegate> *m_view;
- WebPageProxy& 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<WKViewLayoutStrategy> m_layoutStrategy;
- WKLayoutMode m_lastRequestedLayoutMode { kWKLayoutModeViewSize };
- CGFloat m_lastRequestedViewScale { 1 };
-
- bool m_inSecureInputState { false };
-
-#if ENABLE(FULLSCREEN_API)
- RetainPtr<WKFullScreenWindowController> m_fullScreenWindowController;
-#endif
-};
-
-} // namespace WebKit
-
-#endif // PLATFORM(MAC)
-
-#endif // WebViewImpl_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -1,434 +0,0 @@
</span><del>-/*
- * 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 "config.h"
-#import "WebViewImpl.h"
-
-#if PLATFORM(MAC)
-
-#import "GenericCallback.h"
-#import "Logging.h"
-#import "NativeWebKeyboardEvent.h"
-#import "WKFullScreenWindowController.h"
-#import "WKViewLayoutStrategy.h"
-#import "WKWebView.h"
-#import "WebPageProxy.h"
-#import <HIToolbox/CarbonEventsCore.h>
-#import <WebCore/KeypressCommand.h>
-#import <WebCore/NSWindowSPI.h>
-#import <WebCore/ViewState.h>
-#import <WebCore/WebCoreFullScreenPlaceholderView.h>
-#import <WebCore/WebCoreFullScreenWindow.h>
-
-namespace WebKit {
-
-WebViewImpl::WebViewImpl(NSView <WebViewImplDelegate> *view, WebPageProxy& 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<WebCore::KeypressCommand>()), [](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]] && 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 && !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()->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->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 < 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() && viewScale != 1)
- return;
-
- if (viewScale <= 0 || isnan(viewScale) || isinf(viewScale))
- [NSException raise:NSInvalidArgumentException format:@"View scale should be a positive number"];
-
- 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() && 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->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:&NSAllRomanInputSourcesLocaleIdentifier count:1];
- LOG(TextInput, "-> setAllowedInputSourceLocales:romanInputSources");
- [context setAllowedInputSourceLocales:romanInputSources];
- } else {
- if (m_inSecureInputState)
- DisableSecureEventInput();
- LOG(TextInput, "-> setAllowedInputSourceLocales:nil");
- [context setAllowedInputSourceLocales:nil];
- }
- m_inSecureInputState = isInPasswordField;
-}
-
-void WebViewImpl::resetSecureInputState()
-{
- if (m_inSecureInputState) {
- DisableSecureEventInput();
- m_inSecureInputState = false;
- }
-}
-
-void WebViewImpl::notifyInputContextAboutDiscardedComposition()
-{
- // <rdar://problem/9359055>: -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, "-> discardMarkedText");
-
- [[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 && [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)
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -43,8 +43,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><del>-class WebViewImpl;
-
</del><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">@@ -53,10 +51,7 @@
</span><span class="cx"> public:
</span><span class="cx"> PageClientImpl(WKView *, WKWebView *);
</span><span class="cx"> virtual ~PageClientImpl();
</span><del>-
- // FIXME: Eventually WebViewImpl should become the PageClient.
- void setImpl(WebViewImpl& impl) { m_impl = &impl; }
-
</del><ins>+
</ins><span class="cx"> void viewWillMoveToAnotherWindow();
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -218,7 +213,6 @@
</span><span class="cx">
</span><span class="cx"> WKView *m_wkView;
</span><span class="cx"> WKWebView *m_webView;
</span><del>- WebViewImpl* m_impl { nullptr };
</del><span class="cx"> RetainPtr<WKEditorUndoTargetObjC> 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 (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx"> #import "WebContextMenuProxyMac.h"
</span><span class="cx"> #import "WebEditCommandProxy.h"
</span><span class="cx"> #import "WebPopupMenuProxyMac.h"
</span><del>-#import "WebViewImpl.h"
</del><span class="cx"> #import "WindowServerConnection.h"
</span><span class="cx"> #import "_WKDownloadInternal.h"
</span><span class="cx"> #import "_WKHitTestResultInternal.h"
</span><span class="lines">@@ -220,12 +219,7 @@
</span><span class="cx">
</span><span class="cx"> bool PageClientImpl::isViewFocused()
</span><span class="cx"> {
</span><del>- // 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->isFocused();
</del><ins>+ return [m_wkView _isFocused];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::makeFirstResponder()
</span><span class="lines">@@ -317,7 +311,7 @@
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::didCommitLoadForMainFrame(const String& mimeType, bool useCustomContentProvider)
</span><span class="cx"> {
</span><del>- m_impl->updateSupportsArbitraryLayoutModes();
</del><ins>+ [m_wkView _didCommitLoadForMainFrame];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference& dataReference)
</span><span class="lines">@@ -439,17 +433,17 @@
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::updateSecureInputState()
</span><span class="cx"> {
</span><del>- m_impl->updateSecureInputState();
</del><ins>+ [m_wkView _updateSecureInputState];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::resetSecureInputState()
</span><span class="cx"> {
</span><del>- m_impl->resetSecureInputState();
</del><ins>+ [m_wkView _resetSecureInputState];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::notifyInputContextAboutDiscardedComposition()
</span><span class="cx"> {
</span><del>- m_impl->notifyInputContextAboutDiscardedComposition();
</del><ins>+ [m_wkView _notifyInputContextAboutDiscardedComposition];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC) && !USE(ASYNC_NSTEXTINPUTCLIENT)
</span><span class="lines">@@ -729,13 +723,13 @@
</span><span class="cx"> void PageClientImpl::beganEnterFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
</span><span class="cx"> {
</span><span class="cx"> [m_wkView._fullScreenWindowController beganEnterFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
</span><del>- m_impl->updateSupportsArbitraryLayoutModes();
</del><ins>+ [m_wkView _updateSupportsArbitraryLayoutModes];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
</span><span class="cx"> {
</span><span class="cx"> [m_wkView._fullScreenWindowController beganExitFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
</span><del>- m_impl->updateSupportsArbitraryLayoutModes();
</del><ins>+ [m_wkView _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 (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> class LayerTreeContext;
</span><del>-class WebPageProxy;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -45,8 +44,7 @@
</span><span class="cx">
</span><span class="cx"> @interface WKFullScreenWindowController : NSWindowController<NSWindowDelegate> {
</span><span class="cx"> @private
</span><del>- NSView *_webView; // Cannot be retained, see <rdar://problem/14884666>.
- WebKit::WebPageProxy* _page;
</del><ins>+ WKView *_webView; // Cannot be retained, see <rdar://problem/14884666>.
</ins><span class="cx"> RetainPtr<WebCoreFullScreenPlaceholderView> _webViewPlaceholder;
</span><span class="cx"> RetainPtr<NSView> _clipView;
</span><span class="cx"> NSRect _initialFrame;
</span><span class="lines">@@ -62,7 +60,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:(NSView *)webView page:(WebKit::WebPageProxy&)page;
</del><ins>+- (id)initWithWindow:(NSWindow *)window webView:(WKView *)webView;
</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 (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -63,8 +63,9 @@
</span><span class="cx"> - (void)enterFullScreenMode:(id)sender;
</span><span class="cx"> @end
</span><span class="cx">
</span><del>-@interface WKFullScreenWindowController (Private) <NSAnimationDelegate>
</del><ins>+@interface WKFullScreenWindowController(Private)<NSAnimationDelegate>
</ins><span class="cx"> - (void)_replaceView:(NSView*)view with:(NSView*)otherView;
</span><ins>+- (WebPageProxy*)_page;
</ins><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">@@ -85,7 +86,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:(NSView *)webView page:(WebPageProxy&)page
</del><ins>+- (id)initWithWindow:(NSWindow *)window webView:(WKView *)webView
</ins><span class="cx"> {
</span><span class="cx"> self = [super initWithWindow:window];
</span><span class="cx"> if (!self)
</span><span class="lines">@@ -105,7 +106,6 @@
</span><span class="cx">
</span><span class="cx"> [self windowDidLoad];
</span><span class="cx"> _webView = webView;
</span><del>- _page = &page;
</del><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>- _page->setSuppressVisibilityUpdates(true);
</del><ins>+ [_webView _setSuppressVisibilityUpdates:YES];
</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 = _page->pageScaleFactor();
- _page->scalePage(1, IntPoint());
</del><ins>+ _savedScale = [self _page]->pageScaleFactor();
+ [self _page]->scalePage(1, IntPoint());
</ins><span class="cx"> [self _manager]->setAnimatingFullScreen(true);
</span><span class="cx"> [self _manager]->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>- _page->setSuppressVisibilityUpdates(false);
</del><ins>+ [_webView _setSuppressVisibilityUpdates:NO];
</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>- _page->scalePage(_savedScale, IntPoint());
</del><ins>+ [self _page]->scalePage(_savedScale, IntPoint());
</ins><span class="cx"> [self _manager]->restoreScrollPosition();
</span><span class="cx"> [self _manager]->didExitFullScreen();
</span><span class="cx"> [self _manager]->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>- _page->setSuppressVisibilityUpdates(true);
</del><ins>+ [_webView _setSuppressVisibilityUpdates:YES];
</ins><span class="cx"> [_webViewPlaceholder setTarget:nil];
</span><span class="cx">
</span><span class="cx"> [self _manager]->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>- _page->setSuppressVisibilityUpdates(true);
</del><ins>+ [_webView _setSuppressVisibilityUpdates:YES];
</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]->didExitFullScreen();
</span><span class="cx"> [self _manager]->setAnimatingFullScreen(false);
</span><del>- _page->scalePage(_savedScale, IntPoint());
</del><ins>+ [self _page]->scalePage(_savedScale, IntPoint());
</ins><span class="cx"> [self _manager]->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>- _page->forceRepaint(_repaintCallback);
</del><ins>+ [self _page]->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>- _page->setSuppressVisibilityUpdates(false);
</del><ins>+ [_webView _setSuppressVisibilityUpdates:NO];
</ins><span class="cx"> NSEnableScreenUpdates();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -487,11 +487,17 @@
</span><span class="cx"> #pragma mark -
</span><span class="cx"> #pragma mark Internal Interface
</span><span class="cx">
</span><ins>+- (WebPageProxy*)_page
+{
+ return toImpl([_webView pageRef]);
+}
+
</ins><span class="cx"> - (WebFullScreenManagerProxy*)_manager
</span><span class="cx"> {
</span><del>- if (!_page)
- return nullptr;
- return _page->fullScreenManager();
</del><ins>+ WebPageProxy* webPage = [self _page];
+ if (!webPage)
+ return 0;
+ return webPage->fullScreenManager();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_replaceView:(NSView*)view with:(NSView*)otherView
</span><span class="lines">@@ -598,7 +604,7 @@
</span><span class="cx"> [window makeKeyAndOrderFront:self];
</span><span class="cx"> [window setCollectionBehavior:behavior];
</span><span class="cx">
</span><del>- _page->setSuppressVisibilityUpdates(false);
</del><ins>+ [_webView _setSuppressVisibilityUpdates:NO];
</ins><span class="cx"> [[self window] setAutodisplay:YES];
</span><span class="cx"> [[self window] displayIfNeeded];
</span><span class="cx"> NSEnableScreenUpdates();
</span><span class="lines">@@ -621,7 +627,7 @@
</span><span class="cx"> contentView.layer.hidden = NO;
</span><span class="cx"> [contentView.layer addAnimation:fadeAnimation(duration, AnimateOut) forKey:@"fullscreen"];
</span><span class="cx">
</span><del>- _page->setSuppressVisibilityUpdates(false);
</del><ins>+ [_webView _setSuppressVisibilityUpdates:NO];
</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 (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.h        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.h        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -32,24 +32,22 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> class WebPageProxy;
</span><del>-class WebViewImpl;
</del><span class="cx"> }
</span><span class="cx">
</span><del>-@class NSView;
</del><ins>+@class WKView;
</ins><span class="cx">
</span><span class="cx"> @interface WKViewLayoutStrategy : NSObject {
</span><span class="cx"> @package
</span><del>- WebKit::WebPageProxy* _page;
- WebKit::WebViewImpl* _webViewImpl;
- NSView *_view;
</del><ins>+ WebKit::WebPageProxy *_page;
+ WKView *_wkView;
</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&)page view:(NSView *)view viewImpl:(WebKit::WebViewImpl&)webViewImpl mode:(WKLayoutMode)mode;
</del><ins>++ (instancetype)layoutStrategyWithPage:(WebKit::WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode;
</ins><span class="cx">
</span><del>-- (void)invalidate;
</del><ins>+- (void)willDestroyView:(WKView *)view;
</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 (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.mm        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.mm        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -28,8 +28,8 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">
</span><ins>+#import "WKViewInternal.h"
</ins><span class="cx"> #import "WebPageProxy.h"
</span><del>-#import "WebViewImpl.h"
</del><span class="cx"> #import <WebCore/MachSendRight.h>
</span><span class="cx"> #import <WebCore/QuartzCoreSPI.h>
</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&)page view:(NSView *)view viewImpl:(WebViewImpl&)webViewImpl mode:(WKLayoutMode)mode
</del><ins>++ (instancetype)layoutStrategyWithPage:(WebPageProxy&)page view:(WKView *)wkView 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:view viewImpl:webViewImpl mode:mode];
</del><ins>+ strategy = [[WKViewFixedSizeLayoutStrategy alloc] initWithPage:page view:wkView mode:mode];
</ins><span class="cx"> break;
</span><span class="cx"> case kWKLayoutModeDynamicSizeComputedFromViewScale:
</span><del>- strategy = [[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy alloc] initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</del><ins>+ strategy = [[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy alloc] initWithPage:page view:wkView mode:mode];
</ins><span class="cx"> break;
</span><span class="cx"> case kWKLayoutModeDynamicSizeComputedFromMinimumDocumentSize:
</span><del>- strategy = [[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy alloc] initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</del><ins>+ strategy = [[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy alloc] initWithPage:page view:wkView 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:view viewImpl:webViewImpl mode:mode];
</del><ins>+ strategy = [[WKViewViewSizeLayoutStrategy alloc] initWithPage:page view:wkView 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&)page view:(NSView *)view viewImpl:(WebViewImpl&)webViewImpl mode:(WKLayoutMode)mode
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><span class="cx"> self = [super init];
</span><span class="cx">
</span><span class="lines">@@ -83,18 +83,16 @@
</span><span class="cx"> return nil;
</span><span class="cx">
</span><span class="cx"> _page = &page;
</span><del>- _webViewImpl = &webViewImpl;
- _view = view;
</del><ins>+ _wkView = wkView;
</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)invalidate
</del><ins>+- (void)willDestroyView:(WKView *)view
</ins><span class="cx"> {
</span><span class="cx"> _page = nullptr;
</span><del>- _webViewImpl = nullptr;
- _view = nil;
</del><ins>+ _wkView = nil;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (WKLayoutMode)layoutMode
</span><span class="lines">@@ -142,9 +140,9 @@
</span><span class="cx"> if ([self frameSizeUpdatesDisabled])
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (_webViewImpl->clipsToVisibleRect())
- _webViewImpl->updateViewExposedRect();
- _webViewImpl->setDrawingAreaSize(NSSizeToCGSize(_view.frame.size));
</del><ins>+ if (_wkView.shouldClipToVisibleRect)
+ [_wkView _updateViewExposedRect];
+ [_wkView _setDrawingAreaSize:_wkView.frame.size];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)willChangeLayoutStrategy
</span><span class="lines">@@ -155,9 +153,9 @@
</span><span class="cx">
</span><span class="cx"> @implementation WKViewViewSizeLayoutStrategy
</span><span class="cx">
</span><del>-- (instancetype)initWithPage:(WebPageProxy&)page view:(NSView *)view viewImpl:(WebViewImpl&)webViewImpl mode:(WKLayoutMode)mode
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><del>- self = [super initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</del><ins>+ self = [super initWithPage:page view:wkView mode:mode];
</ins><span class="cx">
</span><span class="cx"> if (!self)
</span><span class="cx"> return nil;
</span><span class="lines">@@ -175,9 +173,9 @@
</span><span class="cx">
</span><span class="cx"> @implementation WKViewFixedSizeLayoutStrategy
</span><span class="cx">
</span><del>-- (instancetype)initWithPage:(WebPageProxy&)page view:(NSView *)view viewImpl:(WebViewImpl&)webViewImpl mode:(WKLayoutMode)mode
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><del>- self = [super initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</del><ins>+ self = [super initWithPage:page view:wkView mode:mode];
</ins><span class="cx">
</span><span class="cx"> if (!self)
</span><span class="cx"> return nil;
</span><span class="lines">@@ -195,9 +193,9 @@
</span><span class="cx">
</span><span class="cx"> @implementation WKViewDynamicSizeComputedFromViewScaleLayoutStrategy
</span><span class="cx">
</span><del>-- (instancetype)initWithPage:(WebPageProxy&)page view:(NSView *)view viewImpl:(WebViewImpl&)webViewImpl mode:(WKLayoutMode)mode
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><del>- self = [super initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</del><ins>+ self = [super initWithPage:page view:wkView mode:mode];
</ins><span class="cx">
</span><span class="cx"> if (!self)
</span><span class="cx"> return nil;
</span><span class="lines">@@ -210,7 +208,7 @@
</span><span class="cx"> - (void)updateLayout
</span><span class="cx"> {
</span><span class="cx"> CGFloat inverseScale = 1 / _page->viewScaleFactor();
</span><del>- _webViewImpl->setFixedLayoutSize(CGSizeMake(_view.frame.size.width * inverseScale, _view.frame.size.height * inverseScale));
</del><ins>+ [_wkView _setFixedLayoutSize:CGSizeMake(_wkView.frame.size.width * inverseScale, _wkView.frame.size.height * inverseScale)];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)didChangeViewScale
</span><span class="lines">@@ -224,7 +222,7 @@
</span><span class="cx"> {
</span><span class="cx"> [super didChangeFrameSize];
</span><span class="cx">
</span><del>- if (self.frameSizeUpdatesDisabled)
</del><ins>+ if ([_wkView frameSizeUpdatesDisabled])
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> [self updateLayout];
</span><span class="lines">@@ -234,9 +232,9 @@
</span><span class="cx">
</span><span class="cx"> @implementation WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy
</span><span class="cx">
</span><del>-- (instancetype)initWithPage:(WebPageProxy&)page view:(NSView *)view viewImpl:(WebViewImpl&)webViewImpl mode:(WKLayoutMode)mode
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&)page view:(WKView *)wkView mode:(WKLayoutMode)mode
</ins><span class="cx"> {
</span><del>- self = [super initWithPage:page view:view viewImpl:webViewImpl mode:mode];
</del><ins>+ self = [super initWithPage:page view:wkView 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 (191314 => 191315)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-10-19 20:32:30 UTC (rev 191314)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-10-19 20:39:47 UTC (rev 191315)
</span><span class="lines">@@ -696,8 +696,6 @@
</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><del>-                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 = (); }; };
</del><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">@@ -2862,8 +2860,6 @@
</span><span class="cx">                 2DF9EEED1A786EAD00B6CFBE /* APINavigationResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APINavigationResponse.h; sourceTree = "<group>"; };
</span><span class="cx">                 2E0B8A791BC59A590044B32D /* _WKFormDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKFormDelegate.h; sourceTree = "<group>"; };
</span><span class="cx">                 2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKFocusedElementInfo.h; sourceTree = "<group>"; };
</span><del>-                2DFC7DB91BCCC19500C1548C /* WebViewImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewImpl.h; sourceTree = "<group>"; };
-                2DFC7DBA1BCCC19500C1548C /* WebViewImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewImpl.mm; sourceTree = "<group>"; };
</del><span class="cx">                 31099968146C71F50029DEB9 /* WebNotificationClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 31099971146C759B0029DEB9 /* WebNotificationClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationClient.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 312C0C49146DDC8A0016C911 /* WKNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNotificationProvider.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -4945,8 +4941,6 @@
</span><span class="cx">                                 7C4694CB1A4B510A00AD5845 /* WebPasteboardProxyCocoa.mm */,
</span><span class="cx">                                 7CE4D2151A49148400C7F152 /* WebProcessPoolCocoa.mm */,
</span><span class="cx">                                 1A04F6171A4A3A7A00A21B6E /* WebProcessProxyCocoa.mm */,
</span><del>-                                2DFC7DB91BCCC19500C1548C /* WebViewImpl.h */,
-                                2DFC7DBA1BCCC19500C1548C /* WebViewImpl.mm */,
</del><span class="cx">                                 1AD01BCB1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h */,
</span><span class="cx">                                 1AD01BCA1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.mm */,
</span><span class="cx">                                 2D7AAFD218C8640600A7ACD4 /* WKWebViewContentProvider.h */,
</span><span class="lines">@@ -7671,7 +7665,6 @@
</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><del>-                                2DFC7DBB1BCCC19500C1548C /* WebViewImpl.h in Headers */,
</del><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">@@ -9812,7 +9805,6 @@
</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><del>-                                2DFC7DBC1BCCC19500C1548C /* WebViewImpl.mm in Sources */,
</del><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>