<!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>[191499] trunk/Source/WebKit2</title>
</head>
<body>

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

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

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView renewGState]):
(-[WKView writeSelectionToPasteboard:types:]):
(-[WKView centerSelectionInVisibleArea:]):
(-[WKView scrollWheel:]):
(-[WKView swipeWithEvent:]):
(-[WKView mouseMoved:]):
(-[WKView mouseDown:]):
(-[WKView mouseUp:]):
(-[WKView mouseDragged:]):
(-[WKView pressureChangeWithEvent:]):
(-[WKView acceptsFirstMouse:]):
(-[WKView shouldDelayWindowOrderingForEvent:]):
(-[WKView performKeyEquivalent:]):
(-[WKView keyUp:]):
(-[WKView keyDown:]):
(-[WKView flagsChanged:]):
(-[WKView _superQuickLookWithEvent:]):
(-[WKView _addFontPanelObserver]):
(-[WKView viewWillMoveToWindow:]):
(-[WKView viewDidMoveToWindow]):
(-[WKView viewDidChangeBackingProperties]):
(-[WKView enableAccessibilityIfNecessary]):
(-[WKView quickLookWithEvent:]):
(-[WKView _colorSpace]):
(-[WKView _didRelaunchProcess]):
(-[WKView _setTextIndicator:]):
(-[WKView _setTextIndicator:withLifetime:]):
(-[WKView _clearTextIndicatorWithAnimation:]):
(-[WKView _setTextIndicatorAnimationProgress:]):
(-[WKView initWithFrame:processPool:configuration:webView:]):
(-[WKView _didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
(-[WKView _internalImmediateActionAnimationControllerForHitTestResult:withType:userData:]):
(-[WKView _internalPrepareForImmediateActionAnimation]):
(-[WKView _internalCancelImmediateActionAnimation]):
(-[WKView _internalCompleteImmediateActionAnimation]):
(-[WKView _internalDismissContentRelativeChildWindowsWithAnimation:]):
(-[WKView beginDeferringViewInWindowChanges]):
(-[WKView endDeferringViewInWindowChanges]):
(-[WKView endDeferringViewInWindowChangesSync]):
(-[WKView _prepareForMoveToWindow:withCompletionHandler:]):
(-[WKView isDeferringViewInWindowChanges]):
(-[WKView allowsLinkPreview]):
(-[WKView setAllowsLinkPreview:]):
(-[WKView _setIgnoresAllEvents:]):
(-[WKView _setIgnoresNonWheelMouseEvents:]):
(-[WKView _setIgnoresNonWheelEvents:]):
(-[WKView _ignoresNonWheelEvents]):
(-[WKView _ignoresAllEvents]):
(-[WKView _setOverrideDeviceScaleFactor:]):
(-[WKView _overrideDeviceScaleFactor]):
(-[WKView _setTopContentInset:]):
(-[WKView _topContentInset]):
(-[WKView _dismissContentRelativeChildWindows]):
(-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
(-[WKView _setAutomaticallyAdjustsContentInsets:]):
(-[WKView _automaticallyAdjustsContentInsets]):
(-[WKWindowVisibilityObserver initWithView:]): Deleted.
(-[WKWindowVisibilityObserver startObserving:]): Deleted.
(-[WKWindowVisibilityObserver stopObserving:]): Deleted.
(-[WKWindowVisibilityObserver _windowDidOrderOnScreen:]): Deleted.
(-[WKWindowVisibilityObserver _windowDidOrderOffScreen:]): Deleted.
(-[WKView dealloc]): Deleted.
(-[WKView _updateWindowAndViewFrames]): Deleted.
(-[WKView updateFontPanelIfNeeded]): Deleted.
(-[WKView _selectionChanged]): Deleted.
(-[WKView addWindowObserversForWindow:]): Deleted.
(-[WKView removeWindowObservers]): Deleted.
(-[WKView doWindowDidChangeScreen]): Deleted.
(-[WKView _windowDidBecomeKey:]): Deleted.
(-[WKView _windowDidChangeScreen:]): Deleted.
(-[WKView _windowDidChangeLayerHosting:]): Deleted.
(-[WKView _windowDidResignKey:]): Deleted.
(-[WKView _windowDidMiniaturize:]): Deleted.
(-[WKView _windowDidDeminiaturize:]): Deleted.
(-[WKView _windowDidMove:]): Deleted.
(-[WKView _windowDidResize:]): Deleted.
(-[WKView _windowDidOrderOffScreen:]): Deleted.
(-[WKView _windowDidOrderOnScreen:]): Deleted.
(-[WKView _windowDidChangeBackingProperties:]): Deleted.
(-[WKView _windowDidChangeOcclusionState:]): Deleted.
(-[WKView _prepareForDictionaryLookup]): Deleted.
(-[WKView _dictionaryLookupPopoverWillClose:]): Deleted.
(-[WKView _accessibilityRegisterUIProcessTokens]): Deleted.
(-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]): Deleted.
(-[WKView _intrinsicDeviceScaleFactor]): Deleted.
(-[WKView _preferencesDidChange]): Deleted.
(-[WKView _targetWindowForMovePreparation]): Deleted.
(-[WKView _updateContentInsetsIfAutomatic]): Deleted.
(-[WKView observeValueForKeyPath:ofObject:change:context:]): Deleted.
(-[WKView _dispatchSetTopContentInset]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::automaticallyAdjustsContentInsets):
(WebKit::WebViewImpl::topContentInset):
(WebKit::WebViewImpl::overrideDeviceScaleFactor):
(WebKit::WebViewImpl::isDeferringViewInWindowChanges):
(WebKit::WebViewImpl::targetWindowForMovePreparation):
(WebKit::WebViewImpl::lastPressureEvent):
(WebKit::WebViewImpl::allowsLinkPreview):
(WebKit::WebViewImpl::ignoresNonWheelEvents):
(WebKit::WebViewImpl::ignoresAllEvents):
(WebKit::WebViewImpl::createWeakPtr):
* UIProcess/Cocoa/WebViewImpl.mm:
(SOFT_LINK_CONSTANT_MAY_FAIL):
(-[WKWindowVisibilityObserver initWithView:impl:]):
(-[WKWindowVisibilityObserver dealloc]):
(-[WKWindowVisibilityObserver startObserving:]):
(-[WKWindowVisibilityObserver stopObserving:]):
(-[WKWindowVisibilityObserver startObservingFontPanel]):
(-[WKWindowVisibilityObserver startObservingLookupDismissal]):
(-[WKWindowVisibilityObserver _windowDidOrderOnScreen:]):
(-[WKWindowVisibilityObserver _windowDidOrderOffScreen:]):
(-[WKWindowVisibilityObserver _windowDidBecomeKey:]):
(-[WKWindowVisibilityObserver _windowDidResignKey:]):
(-[WKWindowVisibilityObserver _windowDidMiniaturize:]):
(-[WKWindowVisibilityObserver _windowDidDeminiaturize:]):
(-[WKWindowVisibilityObserver _windowDidMove:]):
(-[WKWindowVisibilityObserver _windowDidResize:]):
(-[WKWindowVisibilityObserver _windowDidChangeBackingProperties:]):
(-[WKWindowVisibilityObserver _windowDidChangeScreen:]):
(-[WKWindowVisibilityObserver _windowDidChangeLayerHosting:]):
(-[WKWindowVisibilityObserver _windowDidChangeOcclusionState:]):
(-[WKWindowVisibilityObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WKWindowVisibilityObserver _dictionaryLookupPopoverWillClose:]):
(-[WKEditCommandObjC initWithWebEditCommandProxy:]):
(-[WKEditCommandObjC command]):
(-[WKEditorUndoTargetObjC undoEditing:]):
(-[WKEditorUndoTargetObjC redoEditing:]):
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::~WebViewImpl):
(WebKit::WebViewImpl::becomeFirstResponder):
(WebKit::WebViewImpl::resignFirstResponder):
(WebKit::WebViewImpl::renewGState):
(WebKit::WebViewImpl::updateWindowAndViewFrames):
(WebKit::WebViewImpl::setAutomaticallyAdjustsContentInsets):
(WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
(WebKit::WebViewImpl::setTopContentInset):
(WebKit::WebViewImpl::dispatchSetTopContentInset):
(WebKit::WebViewImpl::setOverrideDeviceScaleFactor):
(WebKit::WebViewImpl::intrinsicDeviceScaleFactor):
(WebKit::WebViewImpl::windowDidOrderOffScreen):
(WebKit::WebViewImpl::windowDidOrderOnScreen):
(WebKit::WebViewImpl::windowDidBecomeKey):
(WebKit::WebViewImpl::windowDidResignKey):
(WebKit::WebViewImpl::windowDidMiniaturize):
(WebKit::WebViewImpl::windowDidDeminiaturize):
(WebKit::WebViewImpl::windowDidMove):
(WebKit::WebViewImpl::windowDidResize):
(WebKit::WebViewImpl::windowDidChangeBackingProperties):
(WebKit::WebViewImpl::windowDidChangeScreen):
(WebKit::WebViewImpl::windowDidChangeLayerHosting):
(WebKit::WebViewImpl::windowDidChangeOcclusionState):
(WebKit::WebViewImpl::viewWillMoveToWindow):
(WebKit::WebViewImpl::viewDidMoveToWindow):
(WebKit::WebViewImpl::viewDidChangeBackingProperties):
(WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
(WebKit::WebViewImpl::colorSpace):
(WebKit::WebViewImpl::beginDeferringViewInWindowChanges):
(WebKit::WebViewImpl::endDeferringViewInWindowChanges):
(WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
(WebKit::WebViewImpl::prepareForMoveToWindow):
(WebKit::WebViewImpl::pressureChangeWithEvent):
(WebKit::WebViewImpl::isEditable):
(WebKit::WebViewImpl::executeEditCommand):
(WebKit::WebViewImpl::registerEditCommand):
(WebKit::WebViewImpl::clearAllEditCommands):
(WebKit::WebViewImpl::writeSelectionToPasteboard):
(WebKit::WebViewImpl::centerSelectionInVisibleArea):
(WebKit::WebViewImpl::selectionDidChange):
(WebKit::WebViewImpl::startObservingFontPanel):
(WebKit::WebViewImpl::updateFontPanelIfNeeded):
(WebKit::WebViewImpl::preferencesDidChange):
(WebKit::WebViewImpl::setTextIndicator):
(WebKit::WebViewImpl::clearTextIndicatorWithAnimation):
(WebKit::WebViewImpl::setTextIndicatorAnimationProgress):
(WebKit::WebViewImpl::dismissContentRelativeChildWindows):
(WebKit::WebViewImpl::quickLookWithEvent):
(WebKit::WebViewImpl::prepareForDictionaryLookup):
(WebKit::WebViewImpl::setAllowsLinkPreview):
(WebKit::WebViewImpl::immediateActionAnimationControllerForHitTestResult):
(WebKit::WebViewImpl::prepareForImmediateActionAnimation):
(WebKit::WebViewImpl::cancelImmediateActionAnimation):
(WebKit::WebViewImpl::completeImmediateActionAnimation):
(WebKit::WebViewImpl::setIgnoresNonWheelEvents):
(WebKit::WebViewImpl::setIgnoresAllEvents):
(WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::activeWindow):
(WebKit::PageClientImpl::preferencesDidChange):
(WebKit::PageClientImpl::registerEditCommand):
(WebKit::PageClientImpl::clearAllEditCommands):
(WebKit::PageClientImpl::selectionDidChange):
(WebKit::PageClientImpl::didPerformDictionaryLookup):
(-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
(-[WKEditCommandObjC command]): Deleted.
(-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
(-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
(WebKit::PageClientImpl::PageClientImpl): Deleted.
Move more things to WebViewImpl.
This also introduces an unfortunate pattern that is required for things which
clients override on WKView, where we have a flow like this:
        - somebody (PageClient, etc.) calls WebViewImpl::x
        - WebViewImpl::x does nothing except call [WKView _x]
        - [WKView _x] calls WebViewImpl::xFromViewOnly, which does the real work
As long as no clients call the -FromViewOnly variant, this will mean that
all callers are bottlenecked through the overridable WKView method.
How this works with WKWebView, I am not sure yet.

* UIProcess/mac/WKImmediateActionController.h:
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController initWithPage:view:viewImpl:recognizer:]):
(-[WKImmediateActionController willDestroyView:]):
(-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
(-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
(-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
(-[WKImmediateActionController menuItem:viewAtScreenPoint:]):
(-[WKImmediateActionController menuItem:previewItemAtPoint:]):
(-[WKImmediateActionController menuItem:itemFrameForPoint:]):
(-[WKImmediateActionController menuItem:maxSizeForPoint:]):
(-[WKImmediateActionController _animationControllerForDataDetectedText]):
(-[WKImmediateActionController _animationControllerForDataDetectedLink]):
(-[WKImmediateActionController _animationControllerForText]):
(-[WKImmediateActionController initWithPage:view:recognizer:]): Deleted.
Keep a generic NSView, use the WebViewImpl for WK*View related things.</pre>

<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebKit2UIProcessCocoaWebViewImplh">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebViewImplmm">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm</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="#trunkSourceWebKit2UIProcessmacWKImmediateActionControllerh">trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKImmediateActionControllermm">trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191498 => 191499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-23 17:55:09 UTC (rev 191498)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-23 17:57:33 UTC (rev 191499)
</span><span class="lines">@@ -1,3 +1,237 @@
</span><ins>+2015-10-23  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        WKView being inside WKWebView leads to weird API issues
+        https://bugs.webkit.org/show_bug.cgi?id=150174
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView renewGState]):
+        (-[WKView writeSelectionToPasteboard:types:]):
+        (-[WKView centerSelectionInVisibleArea:]):
+        (-[WKView scrollWheel:]):
+        (-[WKView swipeWithEvent:]):
+        (-[WKView mouseMoved:]):
+        (-[WKView mouseDown:]):
+        (-[WKView mouseUp:]):
+        (-[WKView mouseDragged:]):
+        (-[WKView pressureChangeWithEvent:]):
+        (-[WKView acceptsFirstMouse:]):
+        (-[WKView shouldDelayWindowOrderingForEvent:]):
+        (-[WKView performKeyEquivalent:]):
+        (-[WKView keyUp:]):
+        (-[WKView keyDown:]):
+        (-[WKView flagsChanged:]):
+        (-[WKView _superQuickLookWithEvent:]):
+        (-[WKView _addFontPanelObserver]):
+        (-[WKView viewWillMoveToWindow:]):
+        (-[WKView viewDidMoveToWindow]):
+        (-[WKView viewDidChangeBackingProperties]):
+        (-[WKView enableAccessibilityIfNecessary]):
+        (-[WKView quickLookWithEvent:]):
+        (-[WKView _colorSpace]):
+        (-[WKView _didRelaunchProcess]):
+        (-[WKView _setTextIndicator:]):
+        (-[WKView _setTextIndicator:withLifetime:]):
+        (-[WKView _clearTextIndicatorWithAnimation:]):
+        (-[WKView _setTextIndicatorAnimationProgress:]):
+        (-[WKView initWithFrame:processPool:configuration:webView:]):
+        (-[WKView _didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
+        (-[WKView _internalImmediateActionAnimationControllerForHitTestResult:withType:userData:]):
+        (-[WKView _internalPrepareForImmediateActionAnimation]):
+        (-[WKView _internalCancelImmediateActionAnimation]):
+        (-[WKView _internalCompleteImmediateActionAnimation]):
+        (-[WKView _internalDismissContentRelativeChildWindowsWithAnimation:]):
+        (-[WKView beginDeferringViewInWindowChanges]):
+        (-[WKView endDeferringViewInWindowChanges]):
+        (-[WKView endDeferringViewInWindowChangesSync]):
+        (-[WKView _prepareForMoveToWindow:withCompletionHandler:]):
+        (-[WKView isDeferringViewInWindowChanges]):
+        (-[WKView allowsLinkPreview]):
+        (-[WKView setAllowsLinkPreview:]):
+        (-[WKView _setIgnoresAllEvents:]):
+        (-[WKView _setIgnoresNonWheelMouseEvents:]):
+        (-[WKView _setIgnoresNonWheelEvents:]):
+        (-[WKView _ignoresNonWheelEvents]):
+        (-[WKView _ignoresAllEvents]):
+        (-[WKView _setOverrideDeviceScaleFactor:]):
+        (-[WKView _overrideDeviceScaleFactor]):
+        (-[WKView _setTopContentInset:]):
+        (-[WKView _topContentInset]):
+        (-[WKView _dismissContentRelativeChildWindows]):
+        (-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
+        (-[WKView _setAutomaticallyAdjustsContentInsets:]):
+        (-[WKView _automaticallyAdjustsContentInsets]):
+        (-[WKWindowVisibilityObserver initWithView:]): Deleted.
+        (-[WKWindowVisibilityObserver startObserving:]): Deleted.
+        (-[WKWindowVisibilityObserver stopObserving:]): Deleted.
+        (-[WKWindowVisibilityObserver _windowDidOrderOnScreen:]): Deleted.
+        (-[WKWindowVisibilityObserver _windowDidOrderOffScreen:]): Deleted.
+        (-[WKView dealloc]): Deleted.
+        (-[WKView _updateWindowAndViewFrames]): Deleted.
+        (-[WKView updateFontPanelIfNeeded]): Deleted.
+        (-[WKView _selectionChanged]): Deleted.
+        (-[WKView addWindowObserversForWindow:]): Deleted.
+        (-[WKView removeWindowObservers]): Deleted.
+        (-[WKView doWindowDidChangeScreen]): Deleted.
+        (-[WKView _windowDidBecomeKey:]): Deleted.
+        (-[WKView _windowDidChangeScreen:]): Deleted.
+        (-[WKView _windowDidChangeLayerHosting:]): Deleted.
+        (-[WKView _windowDidResignKey:]): Deleted.
+        (-[WKView _windowDidMiniaturize:]): Deleted.
+        (-[WKView _windowDidDeminiaturize:]): Deleted.
+        (-[WKView _windowDidMove:]): Deleted.
+        (-[WKView _windowDidResize:]): Deleted.
+        (-[WKView _windowDidOrderOffScreen:]): Deleted.
+        (-[WKView _windowDidOrderOnScreen:]): Deleted.
+        (-[WKView _windowDidChangeBackingProperties:]): Deleted.
+        (-[WKView _windowDidChangeOcclusionState:]): Deleted.
+        (-[WKView _prepareForDictionaryLookup]): Deleted.
+        (-[WKView _dictionaryLookupPopoverWillClose:]): Deleted.
+        (-[WKView _accessibilityRegisterUIProcessTokens]): Deleted.
+        (-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]): Deleted.
+        (-[WKView _intrinsicDeviceScaleFactor]): Deleted.
+        (-[WKView _preferencesDidChange]): Deleted.
+        (-[WKView _targetWindowForMovePreparation]): Deleted.
+        (-[WKView _updateContentInsetsIfAutomatic]): Deleted.
+        (-[WKView observeValueForKeyPath:ofObject:change:context:]): Deleted.
+        (-[WKView _dispatchSetTopContentInset]): Deleted.
+        * UIProcess/API/mac/WKViewInternal.h:
+        * UIProcess/Cocoa/WebViewImpl.h:
+        (WebKit::WebViewImpl::automaticallyAdjustsContentInsets):
+        (WebKit::WebViewImpl::topContentInset):
+        (WebKit::WebViewImpl::overrideDeviceScaleFactor):
+        (WebKit::WebViewImpl::isDeferringViewInWindowChanges):
+        (WebKit::WebViewImpl::targetWindowForMovePreparation):
+        (WebKit::WebViewImpl::lastPressureEvent):
+        (WebKit::WebViewImpl::allowsLinkPreview):
+        (WebKit::WebViewImpl::ignoresNonWheelEvents):
+        (WebKit::WebViewImpl::ignoresAllEvents):
+        (WebKit::WebViewImpl::createWeakPtr):
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (SOFT_LINK_CONSTANT_MAY_FAIL):
+        (-[WKWindowVisibilityObserver initWithView:impl:]):
+        (-[WKWindowVisibilityObserver dealloc]):
+        (-[WKWindowVisibilityObserver startObserving:]):
+        (-[WKWindowVisibilityObserver stopObserving:]):
+        (-[WKWindowVisibilityObserver startObservingFontPanel]):
+        (-[WKWindowVisibilityObserver startObservingLookupDismissal]):
+        (-[WKWindowVisibilityObserver _windowDidOrderOnScreen:]):
+        (-[WKWindowVisibilityObserver _windowDidOrderOffScreen:]):
+        (-[WKWindowVisibilityObserver _windowDidBecomeKey:]):
+        (-[WKWindowVisibilityObserver _windowDidResignKey:]):
+        (-[WKWindowVisibilityObserver _windowDidMiniaturize:]):
+        (-[WKWindowVisibilityObserver _windowDidDeminiaturize:]):
+        (-[WKWindowVisibilityObserver _windowDidMove:]):
+        (-[WKWindowVisibilityObserver _windowDidResize:]):
+        (-[WKWindowVisibilityObserver _windowDidChangeBackingProperties:]):
+        (-[WKWindowVisibilityObserver _windowDidChangeScreen:]):
+        (-[WKWindowVisibilityObserver _windowDidChangeLayerHosting:]):
+        (-[WKWindowVisibilityObserver _windowDidChangeOcclusionState:]):
+        (-[WKWindowVisibilityObserver observeValueForKeyPath:ofObject:change:context:]):
+        (-[WKWindowVisibilityObserver _dictionaryLookupPopoverWillClose:]):
+        (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
+        (-[WKEditCommandObjC command]):
+        (-[WKEditorUndoTargetObjC undoEditing:]):
+        (-[WKEditorUndoTargetObjC redoEditing:]):
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit::WebViewImpl::~WebViewImpl):
+        (WebKit::WebViewImpl::becomeFirstResponder):
+        (WebKit::WebViewImpl::resignFirstResponder):
+        (WebKit::WebViewImpl::renewGState):
+        (WebKit::WebViewImpl::updateWindowAndViewFrames):
+        (WebKit::WebViewImpl::setAutomaticallyAdjustsContentInsets):
+        (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
+        (WebKit::WebViewImpl::setTopContentInset):
+        (WebKit::WebViewImpl::dispatchSetTopContentInset):
+        (WebKit::WebViewImpl::setOverrideDeviceScaleFactor):
+        (WebKit::WebViewImpl::intrinsicDeviceScaleFactor):
+        (WebKit::WebViewImpl::windowDidOrderOffScreen):
+        (WebKit::WebViewImpl::windowDidOrderOnScreen):
+        (WebKit::WebViewImpl::windowDidBecomeKey):
+        (WebKit::WebViewImpl::windowDidResignKey):
+        (WebKit::WebViewImpl::windowDidMiniaturize):
+        (WebKit::WebViewImpl::windowDidDeminiaturize):
+        (WebKit::WebViewImpl::windowDidMove):
+        (WebKit::WebViewImpl::windowDidResize):
+        (WebKit::WebViewImpl::windowDidChangeBackingProperties):
+        (WebKit::WebViewImpl::windowDidChangeScreen):
+        (WebKit::WebViewImpl::windowDidChangeLayerHosting):
+        (WebKit::WebViewImpl::windowDidChangeOcclusionState):
+        (WebKit::WebViewImpl::viewWillMoveToWindow):
+        (WebKit::WebViewImpl::viewDidMoveToWindow):
+        (WebKit::WebViewImpl::viewDidChangeBackingProperties):
+        (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
+        (WebKit::WebViewImpl::colorSpace):
+        (WebKit::WebViewImpl::beginDeferringViewInWindowChanges):
+        (WebKit::WebViewImpl::endDeferringViewInWindowChanges):
+        (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
+        (WebKit::WebViewImpl::prepareForMoveToWindow):
+        (WebKit::WebViewImpl::pressureChangeWithEvent):
+        (WebKit::WebViewImpl::isEditable):
+        (WebKit::WebViewImpl::executeEditCommand):
+        (WebKit::WebViewImpl::registerEditCommand):
+        (WebKit::WebViewImpl::clearAllEditCommands):
+        (WebKit::WebViewImpl::writeSelectionToPasteboard):
+        (WebKit::WebViewImpl::centerSelectionInVisibleArea):
+        (WebKit::WebViewImpl::selectionDidChange):
+        (WebKit::WebViewImpl::startObservingFontPanel):
+        (WebKit::WebViewImpl::updateFontPanelIfNeeded):
+        (WebKit::WebViewImpl::preferencesDidChange):
+        (WebKit::WebViewImpl::setTextIndicator):
+        (WebKit::WebViewImpl::clearTextIndicatorWithAnimation):
+        (WebKit::WebViewImpl::setTextIndicatorAnimationProgress):
+        (WebKit::WebViewImpl::dismissContentRelativeChildWindows):
+        (WebKit::WebViewImpl::quickLookWithEvent):
+        (WebKit::WebViewImpl::prepareForDictionaryLookup):
+        (WebKit::WebViewImpl::setAllowsLinkPreview):
+        (WebKit::WebViewImpl::immediateActionAnimationControllerForHitTestResult):
+        (WebKit::WebViewImpl::prepareForImmediateActionAnimation):
+        (WebKit::WebViewImpl::cancelImmediateActionAnimation):
+        (WebKit::WebViewImpl::completeImmediateActionAnimation):
+        (WebKit::WebViewImpl::setIgnoresNonWheelEvents):
+        (WebKit::WebViewImpl::setIgnoresAllEvents):
+        (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens):
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::activeWindow):
+        (WebKit::PageClientImpl::preferencesDidChange):
+        (WebKit::PageClientImpl::registerEditCommand):
+        (WebKit::PageClientImpl::clearAllEditCommands):
+        (WebKit::PageClientImpl::selectionDidChange):
+        (WebKit::PageClientImpl::didPerformDictionaryLookup):
+        (-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
+        (-[WKEditCommandObjC command]): Deleted.
+        (-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
+        (-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
+        (WebKit::PageClientImpl::PageClientImpl): Deleted.
+        Move more things to WebViewImpl.
+        This also introduces an unfortunate pattern that is required for things which
+        clients override on WKView, where we have a flow like this:
+                - somebody (PageClient, etc.) calls WebViewImpl::x
+                - WebViewImpl::x does nothing except call [WKView _x]
+                - [WKView _x] calls WebViewImpl::xFromViewOnly, which does the real work
+        As long as no clients call the -FromViewOnly variant, this will mean that
+        all callers are bottlenecked through the overridable WKView method.
+        How this works with WKWebView, I am not sure yet.
+
+        * UIProcess/mac/WKImmediateActionController.h:
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController initWithPage:view:viewImpl:recognizer:]):
+        (-[WKImmediateActionController willDestroyView:]):
+        (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
+        (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
+        (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
+        (-[WKImmediateActionController menuItem:viewAtScreenPoint:]):
+        (-[WKImmediateActionController menuItem:previewItemAtPoint:]):
+        (-[WKImmediateActionController menuItem:itemFrameForPoint:]):
+        (-[WKImmediateActionController menuItem:maxSizeForPoint:]):
+        (-[WKImmediateActionController _animationControllerForDataDetectedText]):
+        (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
+        (-[WKImmediateActionController _animationControllerForText]):
+        (-[WKImmediateActionController initWithPage:view:recognizer:]): Deleted.
+        Keep a generic NSView, use the WebViewImpl for WK*View related things.
+
</ins><span class="cx"> 2015-10-22  Joonghun Park  &lt;jh718.park@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Fix build break since r191471
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (191498 => 191499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-10-23 17:55:09 UTC (rev 191498)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-10-23 17:57:33 UTC (rev 191499)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #import &quot;APILegacyContextHistoryClient.h&quot;
</span><span class="cx"> #import &quot;APIPageConfiguration.h&quot;
</span><span class="cx"> #import &quot;AttributedString.h&quot;
</span><del>-#import &quot;ColorSpaceData.h&quot;
</del><span class="cx"> #import &quot;DataReference.h&quot;
</span><span class="cx"> #import &quot;EditingRange.h&quot;
</span><span class="cx"> #import &quot;EditorState.h&quot;
</span><span class="lines">@@ -59,7 +58,6 @@
</span><span class="cx"> #import &quot;ViewSnapshotStore.h&quot;
</span><span class="cx"> #import &quot;WKAPICast.h&quot;
</span><span class="cx"> #import &quot;WKFullScreenWindowController.h&quot;
</span><del>-#import &quot;WKImmediateActionController.h&quot;
</del><span class="cx"> #import &quot;WKLayoutMode.h&quot;
</span><span class="cx"> #import &quot;WKPrintingView.h&quot;
</span><span class="cx"> #import &quot;WKProcessPoolInternal.h&quot;
</span><span class="lines">@@ -96,15 +94,12 @@
</span><span class="cx"> #import &lt;WebCore/FileSystem.h&gt;
</span><span class="cx"> #import &lt;WebCore/KeyboardEvent.h&gt;
</span><span class="cx"> #import &lt;WebCore/LocalizedStrings.h&gt;
</span><del>-#import &lt;WebCore/LookupSPI.h&gt;
-#import &lt;WebCore/NSImmediateActionGestureRecognizerSPI.h&gt;
</del><span class="cx"> #import &lt;WebCore/NSMenuSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/PlatformEventFactoryMac.h&gt;
</span><span class="cx"> #import &lt;WebCore/PlatformScreen.h&gt;
</span><span class="cx"> #import &lt;WebCore/Region.h&gt;
</span><span class="cx"> #import &lt;WebCore/RuntimeApplicationChecks.h&gt;
</span><span class="cx"> #import &lt;WebCore/SharedBuffer.h&gt;
</span><del>-#import &lt;WebCore/SoftLinking.h&gt;
</del><span class="cx"> #import &lt;WebCore/TextAlternativeWithRange.h&gt;
</span><span class="cx"> #import &lt;WebCore/TextIndicator.h&gt;
</span><span class="cx"> #import &lt;WebCore/TextIndicatorWindow.h&gt;
</span><span class="lines">@@ -149,8 +144,6 @@
</span><span class="cx"> CGError CGSGetScreenRectForWindow(CGSConnectionID cid, CGSWindowID wid, CGRect *rect);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUNotificationPopoverWillClose, NSString *)
-
</del><span class="cx"> using namespace WebKit;
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -171,8 +164,6 @@
</span><span class="cx"> };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-@class WKWindowVisibilityObserver;
-
</del><span class="cx"> @interface WKViewData : NSObject {
</span><span class="cx"> @public
</span><span class="cx">     std::unique_ptr&lt;PageClientImpl&gt; _pageClient;
</span><span class="lines">@@ -200,8 +191,6 @@
</span><span class="cx">     // For asynchronous validation.
</span><span class="cx">     ValidationMap _validationMap;
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;TextIndicatorWindow&gt; _textIndicatorWindow;
-
</del><span class="cx">     // We keep here the event when resending it to
</span><span class="cx">     // the application to distinguish the case of a new event from one 
</span><span class="cx">     // that has been already sent to WebCore.
</span><span class="lines">@@ -223,52 +212,23 @@
</span><span class="cx">     NSEvent *_pressureEvent;
</span><span class="cx">     BOOL _ignoringMouseDraggedEvents;
</span><span class="cx"> 
</span><del>-    id _flagsChangedEventMonitor;
-
</del><span class="cx">     BOOL _hasSpellCheckerDocumentTag;
</span><span class="cx">     NSInteger _spellCheckerDocumentTag;
</span><span class="cx"> 
</span><del>-    BOOL _shouldDeferViewInWindowChanges;
-    NSWindow *_targetWindowForMovePreparation;
-
-    BOOL _viewInWindowChangeWasDeferred;
-
-    BOOL _needsViewFrameInWindowCoordinates;
-    BOOL _didScheduleWindowAndViewFrameUpdate;
-
-    RetainPtr&lt;NSColorSpace&gt; _colorSpace;
-
</del><span class="cx">     RefPtr&lt;WebCore::Image&gt; _promisedImage;
</span><span class="cx">     String _promisedFilename;
</span><span class="cx">     String _promisedURL;
</span><span class="cx"> 
</span><span class="cx">     BOOL _windowOcclusionDetectionEnabled;
</span><span class="cx"> 
</span><del>-    RetainPtr&lt;WKWindowVisibilityObserver&gt; _windowVisibilityObserver;
-
</del><span class="cx">     std::unique_ptr&lt;ViewGestureController&gt; _gestureController;
</span><span class="cx">     BOOL _allowsMagnification;
</span><del>-    BOOL _ignoresNonWheelEvents;
-    BOOL _ignoresAllEvents;
</del><span class="cx">     BOOL _allowsBackForwardNavigationGestures;
</span><del>-    BOOL _allowsLinkPreview;
</del><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;CALayer&gt; _rootLayer;
</span><span class="cx"> 
</span><del>-    BOOL _didScheduleSetTopContentInset;
-    CGFloat _topContentInset;
</del><span class="cx">     CGFloat _totalHeightOfBanners;
</span><span class="cx"> 
</span><del>-    CGFloat _overrideDeviceScaleFactor;
-
-    BOOL _didRegisterForLookupPopoverCloseNotifications;
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    BOOL _automaticallyAdjustsContentInsets;
-    RetainPtr&lt;WKImmediateActionController&gt; _immediateActionController;
-    RetainPtr&lt;NSImmediateActionGestureRecognizer&gt; _immediateActionGestureRecognizer;
-#endif
-
</del><span class="cx"> #if WK_API_ENABLED
</span><span class="cx">     _WKThumbnailView *_thumbnailView;
</span><span class="cx"> #endif
</span><span class="lines">@@ -279,54 +239,6 @@
</span><span class="cx"> @implementation WKViewData
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@interface WKWindowVisibilityObserver : NSObject {
-    WKView *_view;
-}
-
-- (instancetype)initWithView:(WKView *)view;
-- (void)startObserving:(NSWindow *)window;
-- (void)stopObserving:(NSWindow *)window;
-@end
-
-@implementation WKWindowVisibilityObserver
-
-- (instancetype)initWithView:(WKView *)view
-{
-    self = [super init];
-    if (!self)
-        return nil;
-
-    _view = view;
-    return self;
-}
-
-- (void)startObserving:(NSWindow *)window
-{
-    // An NSView derived object such as WKView cannot observe these notifications, because NSView itself observes them.
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidOrderOffScreen:)
-                                                 name:@&quot;NSWindowDidOrderOffScreenNotification&quot; object:window];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidOrderOnScreen:) 
-                                                 name:@&quot;_NSWindowDidBecomeVisible&quot; object:window];
-}
-
-- (void)stopObserving:(NSWindow *)window
-{
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:@&quot;NSWindowDidOrderOffScreenNotification&quot; object:window];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:@&quot;_NSWindowDidBecomeVisible&quot; object:window];
-}
-
-- (void)_windowDidOrderOnScreen:(NSNotification *)notification
-{
-    [_view _windowDidOrderOnScreen:notification];
-}
-
-- (void)_windowDidOrderOffScreen:(NSNotification *)notification
-{
-    [_view _windowDidOrderOffScreen:notification];
-}
-
-@end
-
</del><span class="cx"> @interface WKResponderChainSink : NSResponder {
</span><span class="cx">     NSResponder *_lastResponderInChain;
</span><span class="cx">     bool _didReceiveUnhandledCommand;
</span><span class="lines">@@ -369,10 +281,6 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)dealloc
</span><span class="cx"> {
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    [_data-&gt;_immediateActionController willDestroyView:self];
-#endif
-
</del><span class="cx"> #if WK_API_ENABLED
</span><span class="cx">     if (_data-&gt;_remoteObjectRegistry) {
</span><span class="cx">         _data-&gt;_page-&gt;process().processPool().removeMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _data-&gt;_page-&gt;pageID());
</span><span class="lines">@@ -394,9 +302,6 @@
</span><span class="cx">     NSNotificationCenter* workspaceNotificationCenter = [[NSWorkspace sharedWorkspace] notificationCenter];
</span><span class="cx">     [workspaceNotificationCenter removeObserver:self name:NSWorkspaceActiveSpaceDidChangeNotification object:nil];
</span><span class="cx"> 
</span><del>-    if (canLoadLUNotificationPopoverWillClose())
-        [[NSNotificationCenter defaultCenter] removeObserver:self name:getLUNotificationPopoverWillClose() object:nil];
-
</del><span class="cx">     WebProcessPool::statistics().wkViewCount--;
</span><span class="cx"> 
</span><span class="cx">     [super dealloc];
</span><span class="lines">@@ -481,48 +386,9 @@
</span><span class="cx">     _data-&gt;_impl-&gt;setFrameSize(NSSizeToCGSize(size));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_updateWindowAndViewFrames
-{
-    if (_data-&gt;_impl-&gt;clipsToVisibleRect())
-        _data-&gt;_impl-&gt;updateViewExposedRect();
-
-    if (_data-&gt;_didScheduleWindowAndViewFrameUpdate)
-        return;
-
-    _data-&gt;_didScheduleWindowAndViewFrameUpdate = YES;
-
-    dispatch_async(dispatch_get_main_queue(), ^{
-        _data-&gt;_didScheduleWindowAndViewFrameUpdate = NO;
-
-        NSRect viewFrameInWindowCoordinates = NSZeroRect;
-        NSPoint accessibilityPosition = NSZeroPoint;
-
-        if (_data-&gt;_needsViewFrameInWindowCoordinates)
-            viewFrameInWindowCoordinates = [self convertRect:self.frame toView:nil];
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
-        if (WebCore::AXObjectCache::accessibilityEnabled())
-            accessibilityPosition = [[self accessibilityAttributeValue:NSAccessibilityPositionAttribute] pointValue];
-#pragma clang diagnostic pop
-
-        _data-&gt;_page-&gt;windowAndViewFramesChanged(viewFrameInWindowCoordinates, accessibilityPosition);
-    });
-}
-
</del><span class="cx"> - (void)renewGState
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_textIndicatorWindow)
-        [self _dismissContentRelativeChildWindowsWithAnimation:NO];
-
-    // Update the view frame.
-    if ([self window])
-        [self _updateWindowAndViewFrames];
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    [self _updateContentInsetsIfAutomatic];
-#endif
-
</del><ins>+    _data-&gt;_impl-&gt;renewGState();
</ins><span class="cx">     [super renewGState];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -578,7 +444,7 @@
</span><span class="cx"> 
</span><span class="cx"> // Editing commands
</span><span class="cx"> 
</span><del>-#define WEBCORE_COMMAND(command) - (void)command:(id)sender { _data-&gt;_page-&gt;executeEditCommand(commandNameForSelector(_cmd)); }
</del><ins>+#define WEBCORE_COMMAND(command) - (void)command:(id)sender { _data-&gt;_impl-&gt;executeEditCommand(commandNameForSelector(_cmd)); }
</ins><span class="cx"> 
</span><span class="cx"> WEBCORE_COMMAND(alignCenter)
</span><span class="cx"> WEBCORE_COMMAND(alignJustified)
</span><span class="lines">@@ -687,22 +553,12 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pasteboard types:(NSArray *)types
</span><span class="cx"> {
</span><del>-    size_t numTypes = [types count];
-    [pasteboard declareTypes:types owner:nil];
-    for (size_t i = 0; i &lt; numTypes; ++i) {
-        if ([[types objectAtIndex:i] isEqualTo:NSStringPboardType])
-            [pasteboard setString:_data-&gt;_page-&gt;stringSelectionForPasteboard() forType:NSStringPboardType];
-        else {
-            RefPtr&lt;SharedBuffer&gt; buffer = _data-&gt;_page-&gt;dataSelectionForPasteboard([types objectAtIndex:i]);
-            [pasteboard setData:buffer ? buffer-&gt;createNSData().get() : nil forType:[types objectAtIndex:i]];
-       }
-    }
-    return YES;
</del><ins>+    return _data-&gt;_impl-&gt;writeSelectionToPasteboard(pasteboard, types);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)centerSelectionInVisibleArea:(id)sender 
</span><span class="cx"> { 
</span><del>-    _data-&gt;_page-&gt;centerSelectionInVisibleArea();
</del><ins>+    _data-&gt;_impl-&gt;centerSelectionInVisibleArea();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // This method is needed to support Mac OS X services.
</span><span class="lines">@@ -740,25 +596,6 @@
</span><span class="cx"> 
</span><span class="cx"> // Font panel support.
</span><span class="cx"> 
</span><del>-- (void)updateFontPanelIfNeeded
-{
-    const EditorState&amp; editorState = _data-&gt;_page-&gt;editorState();
-    if (editorState.selectionIsNone || !editorState.isContentEditable)
-        return;
-    if ([NSFontPanel sharedFontPanelExists] &amp;&amp; [[NSFontPanel sharedFontPanel] isVisible]) {
-        _data-&gt;_page-&gt;fontAtSelection([](const String&amp; fontName, double fontSize, bool selectionHasMultipleFonts, WebKit::CallbackBase::Error error) {
-            NSFont *font = [NSFont fontWithName:fontName size:fontSize];
-            if (font)
-                [[NSFontManager sharedFontManager] setSelectedFont:font isMultiple:selectionHasMultipleFonts];
-        });
-    }
-}
-
-- (void)_selectionChanged
-{
-    [self updateFontPanelIfNeeded];
-}
-
</del><span class="cx"> - (void)changeFont:(id)sender
</span><span class="cx"> {
</span><span class="cx">     NSFontManager *fontManager = [NSFontManager sharedFontManager];
</span><span class="lines">@@ -1145,64 +982,64 @@
</span><span class="cx"> #define NATIVE_MOUSE_EVENT_HANDLER(Selector) \
</span><span class="cx">     - (void)Selector:(NSEvent *)theEvent \
</span><span class="cx">     { \
</span><del>-        if (_data-&gt;_ignoresNonWheelEvents) \
</del><ins>+        if (_data-&gt;_impl-&gt;ignoresNonWheelEvents()) \
</ins><span class="cx">             return; \
</span><span class="cx">         if (NSTextInputContext *context = [self inputContext]) { \
</span><span class="cx">             [context handleEvent:theEvent completionHandler:^(BOOL handled) { \
</span><span class="cx">                 if (handled) \
</span><span class="cx">                     LOG(TextInput, &quot;%s was handled by text input context&quot;, String(#Selector).substring(0, String(#Selector).find(&quot;Internal&quot;)).ascii().data()); \
</span><span class="cx">                 else { \
</span><del>-                    NativeWebMouseEvent webEvent(theEvent, _data-&gt;_pressureEvent, self); \
</del><ins>+                    NativeWebMouseEvent webEvent(theEvent, _data-&gt;_impl-&gt;lastPressureEvent(), self); \
</ins><span class="cx">                     _data-&gt;_page-&gt;handleMouseEvent(webEvent); \
</span><span class="cx">                 } \
</span><span class="cx">             }]; \
</span><span class="cx">             return; \
</span><span class="cx">         } \
</span><del>-        NativeWebMouseEvent webEvent(theEvent, _data-&gt;_pressureEvent, self); \
</del><ins>+        NativeWebMouseEvent webEvent(theEvent, _data-&gt;_impl-&gt;lastPressureEvent(), self); \
</ins><span class="cx">         _data-&gt;_page-&gt;handleMouseEvent(webEvent); \
</span><span class="cx">     }
</span><span class="cx"> #define NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(Selector) \
</span><span class="cx">     - (void)Selector:(NSEvent *)theEvent \
</span><span class="cx">     { \
</span><del>-        if (_data-&gt;_ignoresNonWheelEvents) \
</del><ins>+        if (_data-&gt;_impl-&gt;ignoresNonWheelEvents()) \
</ins><span class="cx">             return; \
</span><span class="cx">         if (NSTextInputContext *context = [self inputContext]) { \
</span><span class="cx">             [context handleEvent:theEvent completionHandler:^(BOOL handled) { \
</span><span class="cx">                 if (handled) \
</span><span class="cx">                     LOG(TextInput, &quot;%s was handled by text input context&quot;, String(#Selector).substring(0, String(#Selector).find(&quot;Internal&quot;)).ascii().data()); \
</span><span class="cx">                 else { \
</span><del>-                    NativeWebMouseEvent webEvent(theEvent, _data-&gt;_pressureEvent, self); \
</del><ins>+                    NativeWebMouseEvent webEvent(theEvent, _data-&gt;_impl-&gt;lastPressureEvent(), self); \
</ins><span class="cx">                     _data-&gt;_page-&gt;handleMouseEvent(webEvent); \
</span><span class="cx">                 } \
</span><span class="cx">             }]; \
</span><span class="cx">             return; \
</span><span class="cx">         } \
</span><del>-        NativeWebMouseEvent webEvent(theEvent, _data-&gt;_pressureEvent, self); \
</del><ins>+        NativeWebMouseEvent webEvent(theEvent, _data-&gt;_impl-&gt;lastPressureEvent(), self); \
</ins><span class="cx">         _data-&gt;_page-&gt;handleMouseEvent(webEvent); \
</span><span class="cx">     }
</span><span class="cx"> #else
</span><span class="cx"> #define NATIVE_MOUSE_EVENT_HANDLER(Selector) \
</span><span class="cx">     - (void)Selector:(NSEvent *)theEvent \
</span><span class="cx">     { \
</span><del>-        if (_data-&gt;_ignoresNonWheelEvents) \
</del><ins>+        if (_data-&gt;_impl-&gt;ignoresNonWheelEvents()) \
</ins><span class="cx">             return; \
</span><span class="cx">         if ([[self inputContext] handleEvent:theEvent]) { \
</span><span class="cx">             LOG(TextInput, &quot;%s was handled by text input context&quot;, String(#Selector).substring(0, String(#Selector).find(&quot;Internal&quot;)).ascii().data()); \
</span><span class="cx">             return; \
</span><span class="cx">         } \
</span><del>-        NativeWebMouseEvent webEvent(theEvent, _data-&gt;_pressureEvent, self); \
</del><ins>+        NativeWebMouseEvent webEvent(theEvent, _data-&gt;_impl-&gt;lastPressureEvent(), self); \
</ins><span class="cx">         _data-&gt;_page-&gt;handleMouseEvent(webEvent); \
</span><span class="cx">     }
</span><span class="cx"> #define NATIVE_MOUSE_EVENT_HANDLER_INTERNAL(Selector) \
</span><span class="cx">     - (void)Selector:(NSEvent *)theEvent \
</span><span class="cx">     { \
</span><del>-        if (_data-&gt;_ignoresNonWheelEvents) \
</del><ins>+        if (_data-&gt;_impl-&gt;ignoresNonWheelEvents()) \
</ins><span class="cx">             return; \
</span><span class="cx">         if ([[self inputContext] handleEvent:theEvent]) { \
</span><span class="cx">             LOG(TextInput, &quot;%s was handled by text input context&quot;, String(#Selector).substring(0, String(#Selector).find(&quot;Internal&quot;)).ascii().data()); \
</span><span class="cx">             return; \
</span><span class="cx">         } \
</span><del>-        NativeWebMouseEvent webEvent(theEvent, _data-&gt;_pressureEvent, self); \
</del><ins>+        NativeWebMouseEvent webEvent(theEvent, _data-&gt;_impl-&gt;lastPressureEvent(), self); \
</ins><span class="cx">         _data-&gt;_page-&gt;handleMouseEvent(webEvent); \
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="lines">@@ -1233,7 +1070,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)scrollWheel:(NSEvent *)event
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresAllEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresAllEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (event.phase == NSEventPhaseBegan)
</span><span class="lines">@@ -1251,7 +1088,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)swipeWithEvent:(NSEvent *)event
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (!_data-&gt;_allowsBackForwardNavigationGestures) {
</span><span class="lines">@@ -1269,7 +1106,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)mouseMoved:(NSEvent *)event
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // When a view is first responder, it gets mouse moved events even when the mouse is outside its visible rect.
</span><span class="lines">@@ -1281,7 +1118,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)mouseDown:(NSEvent *)event
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     [self _setMouseDownEvent:event];
</span><span class="lines">@@ -1292,7 +1129,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)mouseUp:(NSEvent *)event
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     [self _setMouseDownEvent:nil];
</span><span class="lines">@@ -1301,7 +1138,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)mouseDragged:(NSEvent *)event
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (_data-&gt;_ignoringMouseDraggedEvents)
</span><span class="lines">@@ -1311,22 +1148,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)pressureChangeWithEvent:(NSEvent *)event
</span><span class="cx"> {
</span><del>-#if defined(__LP64__) &amp;&amp; __MAC_OS_X_VERSION_MAX_ALLOWED &gt;= 101003
-    if (event == _data-&gt;_pressureEvent)
-        return;
-
-    if (_data-&gt;_ignoresNonWheelEvents)
-        return;
-
-    if (event.phase != NSEventPhaseChanged &amp;&amp; event.phase != NSEventPhaseBegan &amp;&amp; event.phase != NSEventPhaseEnded)
-        return;
-
-    NativeWebMouseEvent webEvent(event, _data-&gt;_pressureEvent, self);
-    _data-&gt;_page-&gt;handleMouseEvent(webEvent);
-
-    [_data-&gt;_pressureEvent release];
-    _data-&gt;_pressureEvent = [event retain];
-#endif
</del><ins>+    _data-&gt;_impl-&gt;pressureChangeWithEvent(event);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)acceptsFirstMouse:(NSEvent *)event
</span><span class="lines">@@ -1340,7 +1162,7 @@
</span><span class="cx">         return NO;
</span><span class="cx">     
</span><span class="cx">     [self _setMouseDownEvent:event];
</span><del>-    bool result = _data-&gt;_page-&gt;acceptsFirstMouse([event eventNumber], WebEventFactory::createWebMouseEvent(event, _data-&gt;_pressureEvent, self));
</del><ins>+    bool result = _data-&gt;_page-&gt;acceptsFirstMouse([event eventNumber], WebEventFactory::createWebMouseEvent(event, _data-&gt;_impl-&gt;lastPressureEvent(), self));
</ins><span class="cx">     [self _setMouseDownEvent:nil];
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -1361,7 +1183,7 @@
</span><span class="cx">         return NO;
</span><span class="cx">     
</span><span class="cx">     [self _setMouseDownEvent:event];
</span><del>-    bool result = _data-&gt;_page-&gt;shouldDelayWindowOrderingForEvent(WebEventFactory::createWebMouseEvent(event, _data-&gt;_pressureEvent, self));
</del><ins>+    bool result = _data-&gt;_page-&gt;shouldDelayWindowOrderingForEvent(WebEventFactory::createWebMouseEvent(event, _data-&gt;_impl-&gt;lastPressureEvent(), self));
</ins><span class="cx">     [self _setMouseDownEvent:nil];
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -1793,7 +1615,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)performKeyEquivalent:(NSEvent *)event
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return NO;
</span><span class="cx"> 
</span><span class="cx">     // There's a chance that responding to this event will run a nested event loop, and
</span><span class="lines">@@ -1833,7 +1655,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)keyUp:(NSEvent *)theEvent
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     LOG(TextInput, &quot;keyUp:%p %@&quot;, theEvent, theEvent);
</span><span class="lines">@@ -1846,7 +1668,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)keyDown:(NSEvent *)theEvent
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     LOG(TextInput, &quot;keyDown:%p %@%s&quot;, theEvent, theEvent, (theEvent == _data-&gt;_keyDownEventBeingResent) ? &quot; (re-sent)&quot; : &quot;&quot;);
</span><span class="lines">@@ -1873,7 +1695,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)flagsChanged:(NSEvent *)theEvent
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     LOG(TextInput, &quot;flagsChanged:%p %@&quot;, theEvent, theEvent);
</span><span class="lines">@@ -2236,7 +2058,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)performKeyEquivalent:(NSEvent *)event
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return NO;
</span><span class="cx"> 
</span><span class="cx">     // There's a chance that responding to this event will run a nested event loop, and
</span><span class="lines">@@ -2276,7 +2098,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)keyUp:(NSEvent *)theEvent
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     LOG(TextInput, &quot;keyUp:%p %@&quot;, theEvent, theEvent);
</span><span class="lines">@@ -2286,7 +2108,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)keyDown:(NSEvent *)theEvent
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     LOG(TextInput, &quot;keyDown:%p %@%s&quot;, theEvent, theEvent, (theEvent == _data-&gt;_keyDownEventBeingResent) ? &quot; (re-sent)&quot; : &quot;&quot;);
</span><span class="lines">@@ -2324,7 +2146,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)flagsChanged:(NSEvent *)theEvent
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
</del><ins>+    if (_data-&gt;_impl-&gt;ignoresNonWheelEvents())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     LOG(TextInput, &quot;flagsChanged:%p %@&quot;, theEvent, theEvent);
</span><span class="lines">@@ -2350,6 +2172,11 @@
</span><span class="cx">     return [super inputContext];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_superQuickLookWithEvent:(NSEvent *)event
+{
+    [super quickLookWithEvent:event];
+}
+
</ins><span class="cx"> - (NSArray *)validAttributesForMarkedText
</span><span class="cx"> {
</span><span class="cx">     static NSArray *validAttributes;
</span><span class="lines">@@ -2524,221 +2351,21 @@
</span><span class="cx">     return NSMouseInRect(localPoint, visibleThumbRect, [self isFlipped]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-static void* keyValueObservingContext = &amp;keyValueObservingContext;
-#endif
-
-- (void)addWindowObserversForWindow:(NSWindow *)window
-{
-    if (window) {
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidBecomeKey:)
-                                                     name:NSWindowDidBecomeKeyNotification object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidResignKey:)
-                                                     name:NSWindowDidResignKeyNotification object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidMiniaturize:) 
-                                                     name:NSWindowDidMiniaturizeNotification object:window];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidDeminiaturize:)
-                                                     name:NSWindowDidDeminiaturizeNotification object:window];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidMove:)
-                                                     name:NSWindowDidMoveNotification object:window];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidResize:) 
-                                                     name:NSWindowDidResizeNotification object:window];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeBackingProperties:)
-                                                     name:NSWindowDidChangeBackingPropertiesNotification object:window];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeScreen:)
-                                                     name:NSWindowDidChangeScreenNotification object:window];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeLayerHosting:)
-                                                     name:@&quot;_NSWindowDidChangeContentsHostedInLayerSurfaceNotification&quot; object:window];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeOcclusionState:)
-                                                     name:NSWindowDidChangeOcclusionStateNotification object:window];
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-        [window addObserver:self forKeyPath:@&quot;contentLayoutRect&quot; options:NSKeyValueObservingOptionInitial context:keyValueObservingContext];
-        [window addObserver:self forKeyPath:@&quot;titlebarAppearsTransparent&quot; options:NSKeyValueObservingOptionInitial context:keyValueObservingContext];
-#endif
-        [_data-&gt;_windowVisibilityObserver startObserving:window];
-    }
-}
-
</del><span class="cx"> - (void)_addFontPanelObserver
</span><span class="cx"> {
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    [[NSFontPanel sharedFontPanel] addObserver:self forKeyPath:@&quot;visible&quot; options:0 context:keyValueObservingContext];
-#endif
</del><ins>+    _data-&gt;_impl-&gt;startObservingFontPanel();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)removeWindowObservers
-{
-    NSWindow *window = _data-&gt;_targetWindowForMovePreparation ? _data-&gt;_targetWindowForMovePreparation : [self window];
-    if (!window)
-        return;
-
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidBecomeKeyNotification object:nil];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResignKeyNotification object:nil];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidMiniaturizeNotification object:window];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidMoveNotification object:window];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResizeNotification object:window];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeScreenNotification object:window];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:@&quot;_NSWindowDidChangeContentsHostedInLayerSurfaceNotification&quot; object:window];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeOcclusionStateNotification object:window];
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    if (_data-&gt;_page-&gt;isEditable())
-        [[NSFontPanel sharedFontPanel] removeObserver:self forKeyPath:@&quot;visible&quot; context:keyValueObservingContext];
-    [window removeObserver:self forKeyPath:@&quot;contentLayoutRect&quot; context:keyValueObservingContext];
-    [window removeObserver:self forKeyPath:@&quot;titlebarAppearsTransparent&quot; context:keyValueObservingContext];
-#endif
-    [_data-&gt;_windowVisibilityObserver stopObserving:window];
-}
-
</del><span class="cx"> - (void)viewWillMoveToWindow:(NSWindow *)window
</span><span class="cx"> {
</span><del>-    // If we're in the middle of preparing to move to a window, we should only be moved to that window.
-    ASSERT(!_data-&gt;_targetWindowForMovePreparation || (_data-&gt;_targetWindowForMovePreparation == window));
-
-    NSWindow *currentWindow = [self window];
-    if (window == currentWindow)
-        return;
-
-    _data-&gt;_pageClient-&gt;viewWillMoveToAnotherWindow();
-    
-    [self removeWindowObservers];
-    [self addWindowObserversForWindow:window];
</del><ins>+    _data-&gt;_impl-&gt;viewWillMoveToWindow(window);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)viewDidMoveToWindow
</span><span class="cx"> {
</span><del>-    NSWindow *window = _data-&gt;_targetWindowForMovePreparation ? _data-&gt;_targetWindowForMovePreparation : self.window;
-
-    if (window) {
-        [self doWindowDidChangeScreen];
-
-        ViewState::Flags viewStateChanges = ViewState::WindowIsActive | ViewState::IsVisible;
-        if ([self isDeferringViewInWindowChanges])
-            _data-&gt;_viewInWindowChangeWasDeferred = YES;
-        else
-            viewStateChanges |= ViewState::IsInWindow;
-        _data-&gt;_page-&gt;viewStateDidChange(viewStateChanges);
-
-        [self _updateWindowAndViewFrames];
-
-        // FIXME(135509) This call becomes unnecessary once 135509 is fixed; remove.
-        _data-&gt;_page-&gt;layerHostingModeDidChange();
-
-        if (!_data-&gt;_flagsChangedEventMonitor) {
-            _data-&gt;_flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSFlagsChangedMask handler:^(NSEvent *flagsChangedEvent) {
-                [self _postFakeMouseMovedEventForFlagsChangedEvent:flagsChangedEvent];
-                return flagsChangedEvent;
-            }];
-        }
-
-        [self _accessibilityRegisterUIProcessTokens];
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-        if (_data-&gt;_immediateActionGestureRecognizer &amp;&amp; ![[self gestureRecognizers] containsObject:_data-&gt;_immediateActionGestureRecognizer.get()] &amp;&amp; !_data-&gt;_ignoresNonWheelEvents &amp;&amp; _data-&gt;_allowsLinkPreview)
-            [self addGestureRecognizer:_data-&gt;_immediateActionGestureRecognizer.get()];
-#endif
-    } else {
-        ViewState::Flags viewStateChanges = ViewState::WindowIsActive | ViewState::IsVisible;
-        if ([self isDeferringViewInWindowChanges])
-            _data-&gt;_viewInWindowChangeWasDeferred = YES;
-        else
-            viewStateChanges |= ViewState::IsInWindow;
-        _data-&gt;_page-&gt;viewStateDidChange(viewStateChanges);
-
-        [NSEvent removeMonitor:_data-&gt;_flagsChangedEventMonitor];
-        _data-&gt;_flagsChangedEventMonitor = nil;
-
-        [self _dismissContentRelativeChildWindowsWithAnimation:NO];
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-        if (_data-&gt;_immediateActionGestureRecognizer)
-            [self removeGestureRecognizer:_data-&gt;_immediateActionGestureRecognizer.get()];
-#endif
-    }
-
-    _data-&gt;_page-&gt;setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
</del><ins>+    _data-&gt;_impl-&gt;viewDidMoveToWindow();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)doWindowDidChangeScreen
-{
-    NSWindow *window = _data-&gt;_targetWindowForMovePreparation ? _data-&gt;_targetWindowForMovePreparation : self.window;
-    _data-&gt;_page-&gt;windowScreenDidChange((PlatformDisplayID)[[[[window screen] deviceDescription] objectForKey:@&quot;NSScreenNumber&quot;] intValue]);
-}
-
-- (void)_windowDidBecomeKey:(NSNotification *)notification
-{
-    NSWindow *keyWindow = [notification object];
-    if (keyWindow == [self window] || keyWindow == [[self window] attachedSheet]) {
-        _data-&gt;_impl-&gt;updateSecureInputState();
-        _data-&gt;_page-&gt;viewStateDidChange(ViewState::WindowIsActive);
-    }
-}
-
-- (void)_windowDidChangeScreen:(NSNotification *)notification
-{
-    [self doWindowDidChangeScreen];
-}
-
-- (void)_windowDidChangeLayerHosting:(NSNotification *)notification
-{
-    _data-&gt;_page-&gt;layerHostingModeDidChange();
-}
-
-- (void)_windowDidResignKey:(NSNotification *)notification
-{
-    NSWindow *formerKeyWindow = [notification object];
-    if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet]) {
-        _data-&gt;_impl-&gt;updateSecureInputState();
-        _data-&gt;_page-&gt;viewStateDidChange(ViewState::WindowIsActive);
-    }
-}
-
-- (void)_windowDidMiniaturize:(NSNotification *)notification
-{
-    _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsVisible);
-}
-
-- (void)_windowDidDeminiaturize:(NSNotification *)notification
-{
-    _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsVisible);
-}
-
-- (void)_windowDidMove:(NSNotification *)notification
-{
-    [self _updateWindowAndViewFrames];    
-}
-
-- (void)_windowDidResize:(NSNotification *)notification
-{
-    [self _updateWindowAndViewFrames];
-}
-
-- (void)_windowDidOrderOffScreen:(NSNotification *)notification
-{
-    _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsVisible | ViewState::WindowIsActive);
-}
-
-- (void)_windowDidOrderOnScreen:(NSNotification *)notification
-{
-    _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsVisible | ViewState::WindowIsActive);
-}
-
-- (void)_windowDidChangeBackingProperties:(NSNotification *)notification
-{
-    CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:NSBackingPropertyOldScaleFactorKey] doubleValue];
-    CGFloat newBackingScaleFactor = [self _intrinsicDeviceScaleFactor]; 
-    if (oldBackingScaleFactor == newBackingScaleFactor)
-        return; 
-
-    _data-&gt;_page-&gt;setIntrinsicDeviceScaleFactor(newBackingScaleFactor);
-}
-
-- (void)_windowDidChangeOcclusionState:(NSNotification *)notification
-{
-    _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsVisible);
-}
-
</del><span class="cx"> - (void)drawRect:(NSRect)rect
</span><span class="cx"> {
</span><span class="cx">     LOG(Printing, &quot;drawRect: x:%g, y:%g, width:%g, height:%g&quot;, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
</span><span class="lines">@@ -2769,13 +2396,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)viewDidChangeBackingProperties
</span><span class="cx"> {
</span><del>-    NSColorSpace *colorSpace = [[self window] colorSpace];
-    if ([colorSpace isEqualTo:_data-&gt;_colorSpace.get()])
-        return;
-
-    _data-&gt;_colorSpace = nullptr;
-    if (DrawingAreaProxy *drawingArea = _data-&gt;_page-&gt;drawingArea())
-        drawingArea-&gt;colorSpaceDidChange();
</del><ins>+    _data-&gt;_impl-&gt;viewDidChangeBackingProperties();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_activeSpaceDidChange:(NSNotification *)notification
</span><span class="lines">@@ -2783,32 +2404,6 @@
</span><span class="cx">     _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsVisible);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_prepareForDictionaryLookup
-{
-    if (_data-&gt;_didRegisterForLookupPopoverCloseNotifications)
-        return;
-
-    _data-&gt;_didRegisterForLookupPopoverCloseNotifications = YES;
-
-    if (canLoadLUNotificationPopoverWillClose())
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
-}
-
-- (void)_dictionaryLookupPopoverWillClose:(NSNotification *)notification
-{
-    [self _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::None];
-}
-
-- (void)_accessibilityRegisterUIProcessTokens
-{
-    // Initialize remote accessibility when the window connection has been established.
-    NSData *remoteElementToken = WKAXRemoteTokenForElement(self);
-    NSData *remoteWindowToken = WKAXRemoteTokenForElement([self window]);
-    IPC::DataReference elementToken = IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;([remoteElementToken bytes]), [remoteElementToken length]);
-    IPC::DataReference windowToken = IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;([remoteWindowToken bytes]), [remoteWindowToken length]);
-    _data-&gt;_page-&gt;registerUIProcessAccessibilityTokens(elementToken, windowToken);
-}
-
</del><span class="cx"> - (void)_updateRemoteAccessibilityRegistration:(BOOL)registerProcess
</span><span class="cx"> {
</span><span class="cx">     // When the tree is connected/disconnected, the remote accessibility registration
</span><span class="lines">@@ -2833,7 +2428,7 @@
</span><span class="cx">     // After enabling accessibility update the window frame on the web process so that the
</span><span class="cx">     // correct accessibility position is transmitted (when AX is off, that position is not calculated).
</span><span class="cx">     WebCore::AXObjectCache::enableAccessibility();
</span><del>-    [self _updateWindowAndViewFrames];
</del><ins>+    _data-&gt;_impl-&gt;updateWindowAndViewFrames();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (id)accessibilityFocusedUIElement
</span><span class="lines">@@ -2888,45 +2483,14 @@
</span><span class="cx">     return hitView;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_postFakeMouseMovedEventForFlagsChangedEvent:(NSEvent *)flagsChangedEvent
-{
-    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:[[flagsChangedEvent window] mouseLocationOutsideOfEventStream]
-        modifierFlags:[flagsChangedEvent modifierFlags] timestamp:[flagsChangedEvent timestamp] windowNumber:[flagsChangedEvent windowNumber]
-        context:[flagsChangedEvent context] eventNumber:0 clickCount:0 pressure:0];
-    NativeWebMouseEvent webEvent(fakeEvent, _data-&gt;_pressureEvent, self);
-    _data-&gt;_page-&gt;handleMouseEvent(webEvent);
-}
-
</del><span class="cx"> - (NSInteger)conversationIdentifier
</span><span class="cx"> {
</span><span class="cx">     return (NSInteger)self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (float)_intrinsicDeviceScaleFactor
-{
-    if (_data-&gt;_overrideDeviceScaleFactor)
-        return _data-&gt;_overrideDeviceScaleFactor;
-    if (_data-&gt;_targetWindowForMovePreparation)
-        return [_data-&gt;_targetWindowForMovePreparation backingScaleFactor];
-    if (NSWindow *window = [self window])
-        return [window backingScaleFactor];
-    return [[NSScreen mainScreen] backingScaleFactor];
-}
-
</del><span class="cx"> - (void)quickLookWithEvent:(NSEvent *)event
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents)
-        return;
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    if (_data-&gt;_immediateActionGestureRecognizer) {
-        [super quickLookWithEvent:event];
-        return;
-    }
-#endif
-
-    NSPoint locationInViewCoordinates = [self convertPoint:[event locationInWindow] fromView:nil];
-    _data-&gt;_page-&gt;performDictionaryLookupAtLocation(FloatPoint(locationInViewCoordinates.x, locationInViewCoordinates.y));
</del><ins>+    _data-&gt;_impl-&gt;quickLookWithEvent(event);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (std::unique_ptr&lt;WebKit::DrawingAreaProxy&gt;)_createDrawingAreaProxy
</span><span class="lines">@@ -2939,19 +2503,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (WebKit::ColorSpaceData)_colorSpace
</span><span class="cx"> {
</span><del>-    if (!_data-&gt;_colorSpace) {
-        if (_data-&gt;_targetWindowForMovePreparation)
-            _data-&gt;_colorSpace = [_data-&gt;_targetWindowForMovePreparation colorSpace];
-        else if (NSWindow *window = [self window])
-            _data-&gt;_colorSpace = [window colorSpace];
-        else
-            _data-&gt;_colorSpace = [[NSScreen mainScreen] colorSpace];
-    }
-        
-    ColorSpaceData colorSpaceData;
-    colorSpaceData.cgColorSpace = [_data-&gt;_colorSpace CGColorSpace];
-
-    return colorSpaceData;    
</del><ins>+    return _data-&gt;_impl-&gt;colorSpace();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_processDidExit
</span><span class="lines">@@ -2973,21 +2525,9 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_didRelaunchProcess
</span><span class="cx"> {
</span><del>-    [self _accessibilityRegisterUIProcessTokens];
</del><ins>+    _data-&gt;_impl-&gt;accessibilityRegisterUIProcessTokens();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_preferencesDidChange
-{
-    BOOL needsViewFrameInWindowCoordinates = _data-&gt;_page-&gt;preferences().pluginsEnabled();
-
-    if (!!needsViewFrameInWindowCoordinates == !!_data-&gt;_needsViewFrameInWindowCoordinates)
-        return;
-
-    _data-&gt;_needsViewFrameInWindowCoordinates = needsViewFrameInWindowCoordinates;
-    if ([self window])
-        [self _updateWindowAndViewFrames];
-}
-
</del><span class="cx"> - (void)_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState
</span><span class="cx"> {
</span><span class="cx">     ValidationVector items = _data-&gt;_validationMap.take(commandName);
</span><span class="lines">@@ -3164,33 +2704,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setTextIndicator:(TextIndicator&amp;)textIndicator
-{
-    [self _setTextIndicator:textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
-}
-
-- (void)_setTextIndicator:(TextIndicator&amp;)textIndicator withLifetime:(TextIndicatorWindowLifetime)lifetime
-{
-    if (!_data-&gt;_textIndicatorWindow)
-        _data-&gt;_textIndicatorWindow = std::make_unique&lt;TextIndicatorWindow&gt;(self);
-
-    NSRect textBoundingRectInScreenCoordinates = [self.window convertRectToScreen:[self convertRect:textIndicator.textBoundingRectInRootViewCoordinates() toView:nil]];
-    _data-&gt;_textIndicatorWindow-&gt;setTextIndicator(textIndicator, NSRectToCGRect(textBoundingRectInScreenCoordinates), lifetime);
-}
-
-- (void)_clearTextIndicatorWithAnimation:(TextIndicatorWindowDismissalAnimation)animation
-{
-    if (_data-&gt;_textIndicatorWindow)
-        _data-&gt;_textIndicatorWindow-&gt;clearTextIndicator(animation);
-    _data-&gt;_textIndicatorWindow = nullptr;
-}
-
-- (void)_setTextIndicatorAnimationProgress:(float)progress
-{
-    if (_data-&gt;_textIndicatorWindow)
-        _data-&gt;_textIndicatorWindow-&gt;setAnimationProgress(progress);
-}
-
</del><span class="cx"> - (void)_setAcceleratedCompositingModeRootLayer:(CALayer *)rootLayer
</span><span class="cx"> {
</span><span class="cx">     [rootLayer web_disableAllActions];
</span><span class="lines">@@ -3522,12 +3035,6 @@
</span><span class="cx">     return [NSArray arrayWithObject:[path lastPathComponent]];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
-- (NSWindow *)_targetWindowForMovePreparation
-{
-    return _data-&gt;_targetWindowForMovePreparation;
-}
-
</del><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> - (BOOL)_hasFullScreenWindowController
</span><span class="cx"> {
</span><span class="lines">@@ -3556,11 +3063,6 @@
</span><span class="cx">     return ![sink didReceiveUnhandledCommand];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setIntrinsicContentSize:(NSSize)intrinsicContentSize
-{
-    _data-&gt;_impl-&gt;setIntrinsicContentSize(NSSizeToCGSize(intrinsicContentSize));
-}
-
</del><span class="cx"> - (NSInteger)spellCheckerDocumentTag
</span><span class="cx"> {
</span><span class="cx">     if (!_data-&gt;_hasSpellCheckerDocumentTag) {
</span><span class="lines">@@ -3621,23 +3123,17 @@
</span><span class="cx">     _data-&gt;_pageClient = std::make_unique&lt;PageClientImpl&gt;(self, webView);
</span><span class="cx">     _data-&gt;_page = processPool.createWebPage(*_data-&gt;_pageClient, WTF::move(configuration));
</span><span class="cx"> 
</span><del>-    _data-&gt;_impl = std::make_unique&lt;WebViewImpl&gt;(self, *_data-&gt;_page);
-    static_cast&lt;PageClientImpl*&gt;(_data-&gt;_pageClient.get())-&gt;setImpl(*_data-&gt;_impl);
</del><ins>+    _data-&gt;_impl = std::make_unique&lt;WebViewImpl&gt;(self, *_data-&gt;_page, *_data-&gt;_pageClient);
+    static_cast&lt;PageClientImpl&amp;&gt;(*_data-&gt;_pageClient).setImpl(*_data-&gt;_impl);
</ins><span class="cx"> 
</span><span class="cx">     _data-&gt;_page-&gt;setAddsVisitedLinks(processPool.historyClient().addsVisitedLinks());
</span><span class="cx"> 
</span><del>-    _data-&gt;_page-&gt;setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
</del><span class="cx">     _data-&gt;_page-&gt;initializeWebPage();
</span><span class="cx"> 
</span><span class="cx">     _data-&gt;_mouseDownEvent = nil;
</span><del>-    _data-&gt;_pressureEvent = nil;
</del><span class="cx">     _data-&gt;_ignoringMouseDraggedEvents = NO;
</span><span class="cx">     _data-&gt;_windowOcclusionDetectionEnabled = YES;
</span><span class="cx"> 
</span><del>-    _data-&gt;_windowVisibilityObserver = adoptNS([[WKWindowVisibilityObserver alloc] initWithView:self]);
-
-    _data-&gt;_needsViewFrameInWindowCoordinates = _data-&gt;_page-&gt;preferences().pluginsEnabled();
-
</del><span class="cx">     [self _registerDraggedTypes];
</span><span class="cx"> 
</span><span class="cx">     self.wantsLayer = YES;
</span><span class="lines">@@ -3650,17 +3146,6 @@
</span><span class="cx">     NSNotificationCenter* workspaceNotificationCenter = [[NSWorkspace sharedWorkspace] notificationCenter];
</span><span class="cx">     [workspaceNotificationCenter addObserver:self selector:@selector(_activeSpaceDidChange:) name:NSWorkspaceActiveSpaceDidChangeNotification object:nil];
</span><span class="cx"> 
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    _data-&gt;_allowsLinkPreview = YES;
-
-    if (Class gestureClass = NSClassFromString(@&quot;NSImmediateActionGestureRecognizer&quot;)) {
-        _data-&gt;_immediateActionGestureRecognizer = adoptNS([(NSImmediateActionGestureRecognizer *)[gestureClass alloc] init]);
-        _data-&gt;_immediateActionController = adoptNS([[WKImmediateActionController alloc] initWithPage:*_data-&gt;_page view:self recognizer:_data-&gt;_immediateActionGestureRecognizer.get()]);
-        [_data-&gt;_immediateActionGestureRecognizer setDelegate:_data-&gt;_immediateActionController.get()];
-        [_data-&gt;_immediateActionGestureRecognizer setDelaysPrimaryMouseButtonEvents:NO];
-    }
-#endif
-
</del><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3705,42 +3190,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // WK_API_ENABLED
</span><span class="cx"> 
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-
-- (void)_updateContentInsetsIfAutomatic
-{
-    if (!self._automaticallyAdjustsContentInsets)
-        return;
-
-    if ((self.window.styleMask &amp; NSFullSizeContentViewWindowMask) &amp;&amp; !self.window.titlebarAppearsTransparent &amp;&amp; ![self enclosingScrollView]) {
-        NSRect contentLayoutRect = [self convertRect:self.window.contentLayoutRect fromView:nil];
-        CGFloat newTopContentInset = NSMaxY(contentLayoutRect) - NSHeight(contentLayoutRect);
-        if (self._topContentInset != newTopContentInset)
-            self._topContentInset = newTopContentInset;
-    } else
-        self._topContentInset = 0;
-}
-
-#endif
-
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
-{
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    if (context != keyValueObservingContext) {
-        [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
-        return;
-    }
-
-    if ([keyPath isEqualToString:@&quot;visible&quot;] &amp;&amp; [NSFontPanel sharedFontPanelExists] &amp;&amp; object == [NSFontPanel sharedFontPanel]) {
-        [self updateFontPanelIfNeeded];
-        return;
-    }
-    if ([keyPath isEqualToString:@&quot;contentLayoutRect&quot;] || [keyPath isEqualToString:@&quot;titlebarAppearsTransparent&quot;])
-        [self _updateContentInsetsIfAutomatic];
-#endif
-}
-
-
</del><span class="cx"> - (void)_didFirstVisuallyNonEmptyLayoutForMainFrame
</span><span class="cx"> {
</span><span class="cx">     if (_data-&gt;_gestureController)
</span><span class="lines">@@ -3783,15 +3232,6 @@
</span><span class="cx">         _data-&gt;_gestureController-&gt;removeSwipeSnapshot();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-
-- (void)_didPerformImmediateActionHitTest:(const WebHitTestResultData&amp;)hitTestResult contentPreventsDefault:(BOOL)contentPreventsDefault userData:(API::Object*)userData
-{
-    [_data-&gt;_immediateActionController didPerformImmediateActionHitTest:hitTestResult contentPreventsDefault:contentPreventsDefault userData:userData];
-}
-
-#endif // __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-
</del><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
</span><span class="cx"> - (void)_startWindowDrag
</span><span class="cx"> {
</span><span class="lines">@@ -3993,72 +3433,29 @@
</span><span class="cx">     return _data-&gt;_impl-&gt;createFullScreenWindow();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// FIXME: All of these &quot;DeferringViewInWindowChanges&quot; methods should be able to be removed once clients are weaned off of them.
</del><span class="cx"> - (void)beginDeferringViewInWindowChanges
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_shouldDeferViewInWindowChanges) {
-        NSLog(@&quot;beginDeferringViewInWindowChanges was called while already deferring view-in-window changes!&quot;);
-        return;
-    }
-
-    _data-&gt;_shouldDeferViewInWindowChanges = YES;
</del><ins>+    _data-&gt;_impl-&gt;beginDeferringViewInWindowChanges();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)endDeferringViewInWindowChanges
</span><span class="cx"> {
</span><del>-    if (!_data-&gt;_shouldDeferViewInWindowChanges) {
-        NSLog(@&quot;endDeferringViewInWindowChanges was called without beginDeferringViewInWindowChanges!&quot;);
-        return;
-    }
-
-    _data-&gt;_shouldDeferViewInWindowChanges = NO;
-
-    if (_data-&gt;_viewInWindowChangeWasDeferred) {
-        [self _dispatchSetTopContentInset];
-        _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsInWindow);
-        _data-&gt;_viewInWindowChangeWasDeferred = NO;
-    }
</del><ins>+    _data-&gt;_impl-&gt;endDeferringViewInWindowChanges();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)endDeferringViewInWindowChangesSync
</span><span class="cx"> {
</span><del>-    if (!_data-&gt;_shouldDeferViewInWindowChanges) {
-        NSLog(@&quot;endDeferringViewInWindowChangesSync was called without beginDeferringViewInWindowChanges!&quot;);
-        return;
-    }
-
-    _data-&gt;_shouldDeferViewInWindowChanges = NO;
-
-    if (_data-&gt;_viewInWindowChangeWasDeferred) {
-        [self _dispatchSetTopContentInset];
-        _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsInWindow);
-        _data-&gt;_viewInWindowChangeWasDeferred = NO;
-    }
</del><ins>+    _data-&gt;_impl-&gt;endDeferringViewInWindowChangesSync();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_prepareForMoveToWindow:(NSWindow *)targetWindow withCompletionHandler:(void(^)(void))completionHandler
</span><span class="cx"> {
</span><del>-    _data-&gt;_shouldDeferViewInWindowChanges = YES;
-    [self viewWillMoveToWindow:targetWindow];
-    _data-&gt;_targetWindowForMovePreparation = targetWindow;
-    [self viewDidMoveToWindow];
-
-    _data-&gt;_shouldDeferViewInWindowChanges = NO;
-
-    _data-&gt;_page-&gt;installViewStateChangeCompletionHandler(^() {
-        completionHandler();
-        ASSERT(self.window == _data-&gt;_targetWindowForMovePreparation);
-        _data-&gt;_targetWindowForMovePreparation = nil;
-    });
-
-    [self _dispatchSetTopContentInset];
-    _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsInWindow, false, WebPageProxy::ViewStateChangeDispatchMode::Immediate);
-    _data-&gt;_viewInWindowChangeWasDeferred = NO;
</del><ins>+    _data-&gt;_impl-&gt;prepareForMoveToWindow(targetWindow, completionHandler);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)isDeferringViewInWindowChanges
</span><span class="cx"> {
</span><del>-    return _data-&gt;_shouldDeferViewInWindowChanges;
</del><ins>+    return _data-&gt;_impl-&gt;isDeferringViewInWindowChanges();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)windowOcclusionDetectionEnabled
</span><span class="lines">@@ -4085,73 +3482,48 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)allowsLinkPreview
</span><span class="cx"> {
</span><del>-    return _data-&gt;_allowsLinkPreview;
</del><ins>+    return _data-&gt;_impl-&gt;allowsLinkPreview();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setAllowsLinkPreview:(BOOL)allowsLinkPreview
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_allowsLinkPreview == allowsLinkPreview)
-        return;
-
-    _data-&gt;_allowsLinkPreview = allowsLinkPreview;
-    
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    if (!allowsLinkPreview)
-        [self removeGestureRecognizer:_data-&gt;_immediateActionGestureRecognizer.get()];
-    else if (NSGestureRecognizer *immediateActionRecognizer = _data-&gt;_immediateActionGestureRecognizer.get())
-        [self addGestureRecognizer:immediateActionRecognizer];
-#endif
</del><ins>+    _data-&gt;_impl-&gt;setAllowsLinkPreview(allowsLinkPreview);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setIgnoresAllEvents:(BOOL)ignoresAllEvents
</span><span class="cx"> {
</span><del>-    _data-&gt;_ignoresAllEvents = ignoresAllEvents;
-    [self _setIgnoresNonWheelEvents:ignoresAllEvents];
</del><ins>+    _data-&gt;_impl-&gt;setIgnoresAllEvents(ignoresAllEvents);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Forward _setIgnoresNonWheelMouseEvents to _setIgnoresNonWheelEvents to avoid breaking existing clients.
</span><span class="cx"> - (void)_setIgnoresNonWheelMouseEvents:(BOOL)ignoresNonWheelMouseEvents
</span><span class="cx"> {
</span><del>-    [self _setIgnoresNonWheelEvents:ignoresNonWheelMouseEvents];
</del><ins>+    _data-&gt;_impl-&gt;setIgnoresNonWheelEvents(ignoresNonWheelMouseEvents);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setIgnoresNonWheelEvents:(BOOL)ignoresNonWheelEvents
</span><span class="cx"> {
</span><del>-    if (_data-&gt;_ignoresNonWheelEvents == ignoresNonWheelEvents)
-        return;
-
-    _data-&gt;_ignoresNonWheelEvents = ignoresNonWheelEvents;
-    _data-&gt;_page-&gt;setShouldDispatchFakeMouseMoveEvents(!ignoresNonWheelEvents);
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    if (ignoresNonWheelEvents)
-        [self removeGestureRecognizer:_data-&gt;_immediateActionGestureRecognizer.get()];
-    else if (NSGestureRecognizer *immediateActionRecognizer = _data-&gt;_immediateActionGestureRecognizer.get()) {
-        if (_data-&gt;_allowsLinkPreview)
-            [self addGestureRecognizer:immediateActionRecognizer];
-    }
-#endif
</del><ins>+    _data-&gt;_impl-&gt;setIgnoresNonWheelEvents(ignoresNonWheelEvents);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_ignoresNonWheelEvents
</span><span class="cx"> {
</span><del>-    return _data-&gt;_ignoresNonWheelEvents;
</del><ins>+    return _data-&gt;_impl-&gt;ignoresNonWheelEvents();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_ignoresAllEvents
</span><span class="cx"> {
</span><del>-    return _data-&gt;_ignoresAllEvents;
</del><ins>+    return _data-&gt;_impl-&gt;ignoresAllEvents();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setOverrideDeviceScaleFactor:(CGFloat)deviceScaleFactor
</span><span class="cx"> {
</span><del>-    _data-&gt;_overrideDeviceScaleFactor = deviceScaleFactor;
-    _data-&gt;_page-&gt;setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
</del><ins>+    _data-&gt;_impl-&gt;setOverrideDeviceScaleFactor(deviceScaleFactor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (CGFloat)_overrideDeviceScaleFactor
</span><span class="cx"> {
</span><del>-    return _data-&gt;_overrideDeviceScaleFactor;
</del><ins>+    return _data-&gt;_impl-&gt;overrideDeviceScaleFactor();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (WKLayoutMode)_layoutMode
</span><span class="lines">@@ -4184,32 +3556,14 @@
</span><span class="cx">     _data-&gt;_impl-&gt;setViewScale(viewScale);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_dispatchSetTopContentInset
-{
-    if (!_data-&gt;_didScheduleSetTopContentInset)
-        return;
-
-    _data-&gt;_didScheduleSetTopContentInset = NO;
-    _data-&gt;_page-&gt;setTopContentInset(_data-&gt;_topContentInset);
-}
-
</del><span class="cx"> - (void)_setTopContentInset:(CGFloat)contentInset
</span><span class="cx"> {
</span><del>-    _data-&gt;_topContentInset = contentInset;
-
-    if (_data-&gt;_didScheduleSetTopContentInset)
-        return;
-
-    _data-&gt;_didScheduleSetTopContentInset = YES;
-
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [self _dispatchSetTopContentInset];
-    });
</del><ins>+    return _data-&gt;_impl-&gt;setTopContentInset(contentInset);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (CGFloat)_topContentInset
</span><span class="cx"> {
</span><del>-    return _data-&gt;_topContentInset;
</del><ins>+    return _data-&gt;_impl-&gt;topContentInset();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setTotalHeightOfBanners:(CGFloat)totalHeightOfBanners
</span><span class="lines">@@ -4487,49 +3841,24 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_dismissContentRelativeChildWindows
</span><span class="cx"> {
</span><del>-    // FIXME: We don't know which panel we are dismissing, it may not even be in the current page (see &lt;rdar://problem/13875766&gt;).
-    if ([[self window] isKeyWindow]
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-        || [_data-&gt;_immediateActionController hasActiveImmediateAction]
-#endif
-        ) {
-        DictionaryLookup::hidePopup();
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-        DDActionsManager *actionsManager = [getDDActionsManagerClass() sharedManager];
-        if ([actionsManager respondsToSelector:@selector(requestBubbleClosureUnanchorOnFailure:)])
-            [actionsManager requestBubbleClosureUnanchorOnFailure:YES];
-#endif
-    }
-
-    [self _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::FadeOut];
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-    [_data-&gt;_immediateActionController dismissContentRelativeChildWindows];
-#endif
-
-    static_cast&lt;PageClient&amp;&gt;(*_data-&gt;_pageClient).dismissCorrectionPanel(ReasonForDismissingAlternativeTextIgnored);
</del><ins>+    _data-&gt;_impl-&gt;dismissContentRelativeChildWindowsFromViewOnly();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_dismissContentRelativeChildWindowsWithAnimation:(BOOL)withAnimation
</span><span class="cx"> {
</span><del>-    // Calling _clearTextIndicatorWithAnimation here will win out over the animated clear in _dismissContentRelativeChildWindows.
-    // We can't invert these because clients can override (and have overridden) _dismissContentRelativeChildWindows, so it needs to be called.
-    [self _clearTextIndicatorWithAnimation:withAnimation ? TextIndicatorWindowDismissalAnimation::FadeOut : TextIndicatorWindowDismissalAnimation::None];
-    [self _dismissContentRelativeChildWindows];
</del><ins>+    _data-&gt;_impl-&gt;dismissContentRelativeChildWindowsWithAnimationFromViewOnly(withAnimation);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
</span><span class="cx"> 
</span><span class="cx"> - (void)_setAutomaticallyAdjustsContentInsets:(BOOL)automaticallyAdjustsContentInsets
</span><span class="cx"> {
</span><del>-    _data-&gt;_automaticallyAdjustsContentInsets = automaticallyAdjustsContentInsets;
-    [self _updateContentInsetsIfAutomatic];
</del><ins>+    _data-&gt;_impl-&gt;setAutomaticallyAdjustsContentInsets(automaticallyAdjustsContentInsets);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_automaticallyAdjustsContentInsets
</span><span class="cx"> {
</span><del>-    return _data-&gt;_automaticallyAdjustsContentInsets;
</del><ins>+    return _data-&gt;_impl-&gt;automaticallyAdjustsContentInsets();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (191498 => 191499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2015-10-23 17:55:09 UTC (rev 191498)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2015-10-23 17:57:33 UTC (rev 191499)
</span><span class="lines">@@ -80,19 +80,12 @@
</span><span class="cx"> - (void)_processDidExit;
</span><span class="cx"> - (void)_pageClosed;
</span><span class="cx"> - (void)_didRelaunchProcess;
</span><del>-- (void)_preferencesDidChange;
</del><span class="cx"> - (void)_toolTipChangedFrom:(NSString *)oldToolTip to:(NSString *)newToolTip;
</span><span class="cx"> - (void)_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState;
</span><span class="cx"> - (void)_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled;
</span><span class="cx"> - (bool)_executeSavedCommandBySelector:(SEL)selector;
</span><del>-- (void)_setIntrinsicContentSize:(NSSize)intrinsicContentSize;
</del><span class="cx"> - (NSRect)_convertToDeviceSpace:(NSRect)rect;
</span><span class="cx"> - (NSRect)_convertToUserSpace:(NSRect)rect;
</span><del>-- (void)_setTextIndicator:(WebCore::TextIndicator&amp;)textIndicator;
-- (void)_setTextIndicator:(WebCore::TextIndicator&amp;)textIndicator withLifetime:(WebCore::TextIndicatorWindowLifetime)lifetime;
-- (void)_clearTextIndicatorWithAnimation:(WebCore::TextIndicatorWindowDismissalAnimation)animation;
-- (void)_setTextIndicatorAnimationProgress:(float)progress;
-- (void)_selectionChanged;
</del><span class="cx"> 
</span><span class="cx"> - (void)_setAcceleratedCompositingModeRootLayer:(CALayer *)rootLayer;
</span><span class="cx"> - (CALayer *)_acceleratedCompositingModeRootLayer;
</span><span class="lines">@@ -129,9 +122,6 @@
</span><span class="cx"> - (void)_reparentLayerTreeInThumbnailView;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-- (void)_windowDidOrderOnScreen:(NSNotification *)notification;
-- (void)_windowDidOrderOffScreen:(NSNotification *)notification;
-
</del><span class="cx"> - (void)_addFontPanelObserver;
</span><span class="cx"> // FullScreen
</span><span class="cx"> 
</span><span class="lines">@@ -139,20 +129,12 @@
</span><span class="cx"> @property (readonly) WKFullScreenWindowController *_fullScreenWindowController;
</span><span class="cx"> - (void)_closeFullScreenWindowController;
</span><span class="cx"> 
</span><del>-- (void)_prepareForDictionaryLookup;
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
-- (void)_didPerformImmediateActionHitTest:(const WebKit::WebHitTestResultData&amp;)hitTestResult contentPreventsDefault:(BOOL)contentPreventsDefault userData:(API::Object*)userData;
-#endif
-
</del><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
</span><span class="cx"> - (void)_startWindowDrag;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> @property (nonatomic, retain, setter=_setPrimaryTrackingArea:) NSTrackingArea *_primaryTrackingArea;
</span><span class="cx"> 
</span><del>-@property (readonly) NSWindow *_targetWindowForMovePreparation;
-
</del><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> @property (nonatomic, readonly) _WKRemoteObjectRegistry *_remoteObjectRegistry;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h (191498 => 191499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2015-10-23 17:55:09 UTC (rev 191498)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2015-10-23 17:57:33 UTC (rev 191499)
</span><span class="lines">@@ -28,29 +28,52 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> 
</span><del>-#import &quot;WKLayoutMode.h&quot;
-#import &lt;wtf/RetainPtr.h&gt;
</del><ins>+#include &quot;WKLayoutMode.h&quot;
+#include &quot;WebPageProxy.h&quot;
+#include &lt;WebCore/TextIndicatorWindow.h&gt;
+#include &lt;functional&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/WeakPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
</ins><span class="cx"> 
</span><ins>+OBJC_CLASS NSImmediateActionGestureRecognizer;
</ins><span class="cx"> OBJC_CLASS NSTextInputContext;
</span><span class="cx"> OBJC_CLASS NSView;
</span><ins>+OBJC_CLASS WKEditorUndoTargetObjC;
</ins><span class="cx"> OBJC_CLASS WKFullScreenWindowController;
</span><ins>+OBJC_CLASS WKImmediateActionController;
</ins><span class="cx"> OBJC_CLASS WKViewLayoutStrategy;
</span><ins>+OBJC_CLASS WKWindowVisibilityObserver;
</ins><span class="cx"> 
</span><span class="cx"> @protocol WebViewImplDelegate
</span><span class="cx"> 
</span><span class="cx"> - (NSTextInputContext *)_superInputContext;
</span><ins>+- (void)_superQuickLookWithEvent:(NSEvent *)event;
</ins><span class="cx"> 
</span><ins>+// This is a hack; these things live can live on a category (e.g. WKView (Private)) but WKView itself conforms to this protocol.
+// They're not actually optional.
+@optional
+
+- (id)_immediateActionAnimationControllerForHitTestResult:(WKHitTestResultRef)hitTestResult withType:(uint32_t)type userData:(WKTypeRef)userData;
+- (void)_prepareForImmediateActionAnimation;
+- (void)_cancelImmediateActionAnimation;
+- (void)_completeImmediateActionAnimation;
+- (void)_dismissContentRelativeChildWindows;
+- (void)_dismissContentRelativeChildWindowsWithAnimation:(BOOL)animate;
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+class WebEditCommandProxy;
</ins><span class="cx"> class WebPageProxy;
</span><ins>+struct ColorSpaceData;
</ins><span class="cx"> 
</span><span class="cx"> class WebViewImpl {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(WebViewImpl);
</span><span class="cx"> public:
</span><del>-    WebViewImpl(NSView &lt;WebViewImplDelegate&gt; *, WebPageProxy&amp;);
</del><ins>+    WebViewImpl(NSView &lt;WebViewImplDelegate&gt; *, WebPageProxy&amp;, PageClient&amp;);
</ins><span class="cx"> 
</span><span class="cx">     ~WebViewImpl();
</span><span class="cx"> 
</span><span class="lines">@@ -67,17 +90,25 @@
</span><span class="cx">     void viewWillStartLiveResize();
</span><span class="cx">     void viewDidEndLiveResize();
</span><span class="cx"> 
</span><ins>+    void renewGState();
</ins><span class="cx">     void setFrameSize(CGSize);
</span><span class="cx">     void disableFrameSizeUpdates();
</span><span class="cx">     void enableFrameSizeUpdates();
</span><span class="cx">     bool frameSizeUpdatesDisabled() const;
</span><span class="cx">     void setFrameAndScrollBy(CGRect, CGSize);
</span><ins>+    void updateWindowAndViewFrames();
</ins><span class="cx"> 
</span><span class="cx">     void setFixedLayoutSize(CGSize);
</span><span class="cx">     CGSize fixedLayoutSize() const;
</span><span class="cx"> 
</span><span class="cx">     void setDrawingAreaSize(CGSize);
</span><span class="cx"> 
</span><ins>+    void setAutomaticallyAdjustsContentInsets(bool);
+    bool automaticallyAdjustsContentInsets() const { return m_automaticallyAdjustsContentInsets; }
+    void updateContentInsetsIfAutomatic();
+    void setTopContentInset(CGFloat);
+    CGFloat topContentInset() const { return m_topContentInset; }
+
</ins><span class="cx">     void setContentPreparationRect(CGRect);
</span><span class="cx">     void updateViewExposedRect();
</span><span class="cx">     void setClipsToVisibleRect(bool);
</span><span class="lines">@@ -93,11 +124,45 @@
</span><span class="cx">     void setLayoutMode(WKLayoutMode);
</span><span class="cx">     void updateSupportsArbitraryLayoutModes();
</span><span class="cx"> 
</span><ins>+    void setOverrideDeviceScaleFactor(CGFloat);
+    CGFloat overrideDeviceScaleFactor() const { return m_overrideDeviceScaleFactor; }
+
+    void windowDidOrderOffScreen();
+    void windowDidOrderOnScreen();
+    void windowDidBecomeKey(NSWindow *);
+    void windowDidResignKey(NSWindow *);
+    void windowDidMiniaturize();
+    void windowDidDeminiaturize();
+    void windowDidMove();
+    void windowDidResize();
+    void windowDidChangeBackingProperties(CGFloat oldBackingScaleFactor);
+    void windowDidChangeScreen();
+    void windowDidChangeLayerHosting();
+    void windowDidChangeOcclusionState();
+
+    void viewWillMoveToWindow(NSWindow *);
+    void viewDidMoveToWindow();
+    void viewDidChangeBackingProperties();
+
+    ColorSpaceData colorSpace();
+
+    void beginDeferringViewInWindowChanges();
+    // FIXME: Merge these two?
+    void endDeferringViewInWindowChanges();
+    void endDeferringViewInWindowChangesSync();
+    bool isDeferringViewInWindowChanges() const { return m_shouldDeferViewInWindowChanges; }
+
+    void prepareForMoveToWindow(NSWindow *targetWindow, std::function&lt;void()&gt; completionHandler);
+    NSWindow *targetWindowForMovePreparation() const { return m_targetWindowForMovePreparation; }
+
</ins><span class="cx">     void updateSecureInputState();
</span><span class="cx">     void resetSecureInputState();
</span><span class="cx">     bool inSecureInputState() const { return m_inSecureInputState; }
</span><span class="cx">     void notifyInputContextAboutDiscardedComposition();
</span><span class="cx"> 
</span><ins>+    void pressureChangeWithEvent(NSEvent *);
+    NSEvent *lastPressureEvent() { return m_lastPressureEvent.get(); }
+
</ins><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">     bool hasFullScreenWindowController() const;
</span><span class="cx">     WKFullScreenWindowController *fullScreenWindowController();
</span><span class="lines">@@ -106,33 +171,114 @@
</span><span class="cx">     NSView *fullScreenPlaceholderView();
</span><span class="cx">     NSWindow *createFullScreenWindow();
</span><span class="cx"> 
</span><ins>+    bool isEditable() const;
+    void executeEditCommand(const String&amp; commandName, const String&amp; argument = String());
+    void registerEditCommand(RefPtr&lt;WebEditCommandProxy&gt;, WebPageProxy::UndoOrRedo);
+    void clearAllEditCommands();
+    bool writeSelectionToPasteboard(NSPasteboard *, NSArray *types);
+    void centerSelectionInVisibleArea();
+    void selectionDidChange();
+    void startObservingFontPanel();
+    void updateFontPanelIfNeeded();
+
+    void preferencesDidChange();
+
+    void setTextIndicator(WebCore::TextIndicator&amp;, WebCore::TextIndicatorWindowLifetime = WebCore::TextIndicatorWindowLifetime::Permanent);
+    void clearTextIndicatorWithAnimation(WebCore::TextIndicatorWindowDismissalAnimation);
+    void setTextIndicatorAnimationProgress(float);
+    void dismissContentRelativeChildWindows();
+    void dismissContentRelativeChildWindowsFromViewOnly();
+    void dismissContentRelativeChildWindowsWithAnimation(bool);
+    void dismissContentRelativeChildWindowsWithAnimationFromViewOnly(bool);
+
+    void quickLookWithEvent(NSEvent *);
+    void prepareForDictionaryLookup();
+    void setAllowsLinkPreview(bool);
+    bool allowsLinkPreview() const { return m_allowsLinkPreview; }
+    void* immediateActionAnimationControllerForHitTestResult(WKHitTestResultRef, uint32_t type, WKTypeRef userData);
+    void* immediateActionAnimationControllerForHitTestResultFromViewOnly(WKHitTestResultRef, uint32_t type, WKTypeRef userData);
+    void didPerformImmediateActionHitTest(const WebHitTestResultData&amp;, bool contentPreventsDefault, API::Object* userData);
+    void prepareForImmediateActionAnimation();
+    void cancelImmediateActionAnimation();
+    void completeImmediateActionAnimation();
+
+    void setIgnoresNonWheelEvents(bool);
+    bool ignoresNonWheelEvents() const { return m_ignoresNonWheelEvents; }
+    void setIgnoresAllEvents(bool);
+    bool ignoresAllEvents() const { return m_ignoresAllEvents; }
+
+    void accessibilityRegisterUIProcessTokens();
+
</ins><span class="cx"> private:
</span><ins>+    WeakPtr&lt;WebViewImpl&gt; createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
+
</ins><span class="cx">     bool supportsArbitraryLayoutModes() const;
</span><ins>+    float intrinsicDeviceScaleFactor() const;
+    void dispatchSetTopContentInset();
</ins><span class="cx"> 
</span><ins>+    void postFakeMouseMovedEventForFlagsChangedEvent(NSEvent *);
+
</ins><span class="cx">     NSView &lt;WebViewImplDelegate&gt; *m_view;
</span><span class="cx">     WebPageProxy&amp; m_page;
</span><ins>+    PageClient&amp; m_pageClient;
</ins><span class="cx"> 
</span><ins>+    WeakPtrFactory&lt;WebViewImpl&gt; m_weakPtrFactory;
+
</ins><span class="cx">     bool m_willBecomeFirstResponderAgain { false };
</span><span class="cx">     bool m_inBecomeFirstResponder { false };
</span><span class="cx">     bool m_inResignFirstResponder { false };
</span><span class="cx"> 
</span><del>-    CGRect m_contentPreparationRect;
</del><ins>+    CGRect m_contentPreparationRect { CGRectZero };
</ins><span class="cx">     bool m_useContentPreparationRectForVisibleRect { false };
</span><span class="cx">     bool m_clipsToVisibleRect { false };
</span><ins>+    bool m_needsViewFrameInWindowCoordinates;
+    bool m_didScheduleWindowAndViewFrameUpdate { false };
+    bool m_isDeferringViewInWindowChanges { false };
</ins><span class="cx"> 
</span><del>-    CGSize m_resizeScrollOffset;
</del><ins>+    bool m_automaticallyAdjustsContentInsets { false };
+    CGFloat m_topContentInset { 0 };
+    bool m_didScheduleSetTopContentInset { false };
</ins><span class="cx"> 
</span><del>-    CGSize m_intrinsicContentSize;
</del><ins>+    CGSize m_resizeScrollOffset { CGSizeZero };
</ins><span class="cx"> 
</span><ins>+    CGSize m_intrinsicContentSize { CGSizeZero };
+    CGFloat m_overrideDeviceScaleFactor { 0 };
+
</ins><span class="cx">     RetainPtr&lt;WKViewLayoutStrategy&gt; m_layoutStrategy;
</span><span class="cx">     WKLayoutMode m_lastRequestedLayoutMode { kWKLayoutModeViewSize };
</span><span class="cx">     CGFloat m_lastRequestedViewScale { 1 };
</span><span class="cx"> 
</span><span class="cx">     bool m_inSecureInputState { false };
</span><ins>+    RetainPtr&lt;WKEditorUndoTargetObjC&gt; m_undoTarget;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">     RetainPtr&lt;WKFullScreenWindowController&gt; m_fullScreenWindowController;
</span><span class="cx"> #endif
</span><ins>+
+    RetainPtr&lt;WKWindowVisibilityObserver&gt; m_windowVisibilityObserver;
+
+    bool m_shouldDeferViewInWindowChanges { false };
+    bool m_viewInWindowChangeWasDeferred { false };
+    NSWindow *m_targetWindowForMovePreparation { nullptr };
+
+    id m_flagsChangedEventMonitor { nullptr };
+
+    std::unique_ptr&lt;WebCore::TextIndicatorWindow&gt; m_textIndicatorWindow;
+
+    RetainPtr&lt;NSColorSpace&gt; m_colorSpace;
+
+    RetainPtr&lt;NSEvent&gt; m_lastPressureEvent;
+
+    bool m_ignoresNonWheelEvents { false };
+    bool m_ignoresAllEvents { false };
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    RetainPtr&lt;WKImmediateActionController&gt; m_immediateActionController;
+    RetainPtr&lt;NSImmediateActionGestureRecognizer&gt; m_immediateActionGestureRecognizer;
+#endif
+
+    bool m_allowsLinkPreview { true };
+    bool m_didRegisterForLookupPopoverCloseNotifications { false };
</ins><span class="cx"> };
</span><span class="cx">     
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (191498 => 191499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2015-10-23 17:55:09 UTC (rev 191498)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2015-10-23 17:57:33 UTC (rev 191499)
</span><span class="lines">@@ -28,28 +28,295 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> 
</span><ins>+#import &quot;ColorSpaceData.h&quot;
</ins><span class="cx"> #import &quot;GenericCallback.h&quot;
</span><span class="cx"> #import &quot;Logging.h&quot;
</span><span class="cx"> #import &quot;NativeWebKeyboardEvent.h&quot;
</span><ins>+#import &quot;NativeWebMouseEvent.h&quot;
+#import &quot;PageClient.h&quot;
</ins><span class="cx"> #import &quot;WKFullScreenWindowController.h&quot;
</span><ins>+#import &quot;WKImmediateActionController.h&quot;
</ins><span class="cx"> #import &quot;WKViewLayoutStrategy.h&quot;
</span><span class="cx"> #import &quot;WKWebView.h&quot;
</span><ins>+#import &quot;WebEditCommandProxy.h&quot;
</ins><span class="cx"> #import &quot;WebPageProxy.h&quot;
</span><span class="cx"> #import &lt;HIToolbox/CarbonEventsCore.h&gt;
</span><ins>+#import &lt;WebCore/AXObjectCache.h&gt;
+#import &lt;WebCore/DataDetectorsSPI.h&gt;
+#import &lt;WebCore/DictionaryLookup.h&gt;
</ins><span class="cx"> #import &lt;WebCore/KeypressCommand.h&gt;
</span><ins>+#import &lt;WebCore/LookupSPI.h&gt;
+#import &lt;WebCore/NSImmediateActionGestureRecognizerSPI.h&gt;
</ins><span class="cx"> #import &lt;WebCore/NSWindowSPI.h&gt;
</span><ins>+#import &lt;WebCore/SoftLinking.h&gt;
</ins><span class="cx"> #import &lt;WebCore/ViewState.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebCoreFullScreenPlaceholderView.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebCoreFullScreenWindow.h&gt;
</span><ins>+#import &lt;WebKitSystemInterface.h&gt;
</ins><span class="cx"> 
</span><ins>+SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUNotificationPopoverWillClose, NSString *)
+
+@interface WKWindowVisibilityObserver : NSObject {
+    NSView *_view;
+    WebKit::WebViewImpl *_impl;
+}
+
+- (instancetype)initWithView:(NSView *)view impl:(WebKit::WebViewImpl&amp;)impl;
+- (void)startObserving:(NSWindow *)window;
+- (void)stopObserving:(NSWindow *)window;
+- (void)startObservingFontPanel;
+- (void)startObservingLookupDismissal;
+@end
+
+@implementation WKWindowVisibilityObserver
+
+- (instancetype)initWithView:(NSView *)view impl:(WebKit::WebViewImpl&amp;)impl
+{
+    self = [super init];
+    if (!self)
+        return nil;
+
+    _view = view;
+    _impl = &amp;impl;
+
+    return self;
+}
+
+- (void)dealloc
+{
+    if (canLoadLUNotificationPopoverWillClose())
+        [[NSNotificationCenter defaultCenter] removeObserver:self name:getLUNotificationPopoverWillClose() object:nil];
+
+    [super dealloc];
+}
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+static void* keyValueObservingContext = &amp;keyValueObservingContext;
+#endif
+
+- (void)startObserving:(NSWindow *)window
+{
+    if (!window)
+        return;
+
+    NSNotificationCenter *defaultNotificationCenter = [NSNotificationCenter defaultCenter];
+
+    // An NSView derived object such as WKView cannot observe these notifications, because NSView itself observes them.
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidOrderOffScreen:) name:@&quot;NSWindowDidOrderOffScreenNotification&quot; object:window];
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidOrderOnScreen:) name:@&quot;_NSWindowDidBecomeVisible&quot; object:window];
+
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:nil];
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidResignKey:) name:NSWindowDidResignKeyNotification object:nil];
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidMiniaturize:) name:NSWindowDidMiniaturizeNotification object:window];
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:window];
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidMove:) name:NSWindowDidMoveNotification object:window];
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidResize:) name:NSWindowDidResizeNotification object:window];
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidChangeBackingProperties:) name:NSWindowDidChangeBackingPropertiesNotification object:window];
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidChangeScreen:) name:NSWindowDidChangeScreenNotification object:window];
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidChangeLayerHosting:) name:@&quot;_NSWindowDidChangeContentsHostedInLayerSurfaceNotification&quot; object:window];
+    [defaultNotificationCenter addObserver:self selector:@selector(_windowDidChangeOcclusionState:) name:NSWindowDidChangeOcclusionStateNotification object:window];
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    [window addObserver:self forKeyPath:@&quot;contentLayoutRect&quot; options:NSKeyValueObservingOptionInitial context:keyValueObservingContext];
+    [window addObserver:self forKeyPath:@&quot;titlebarAppearsTransparent&quot; options:NSKeyValueObservingOptionInitial context:keyValueObservingContext];
+#endif
+}
+
+- (void)stopObserving:(NSWindow *)window
+{
+    if (!window)
+        return;
+
+    NSNotificationCenter *defaultNotificationCenter = [NSNotificationCenter defaultCenter];
+
+    [defaultNotificationCenter removeObserver:self name:@&quot;NSWindowDidOrderOffScreenNotification&quot; object:window];
+    [defaultNotificationCenter removeObserver:self name:@&quot;_NSWindowDidBecomeVisible&quot; object:window];
+
+    [defaultNotificationCenter removeObserver:self name:NSWindowDidBecomeKeyNotification object:nil];
+    [defaultNotificationCenter removeObserver:self name:NSWindowDidResignKeyNotification object:nil];
+    [defaultNotificationCenter removeObserver:self name:NSWindowDidMiniaturizeNotification object:window];
+    [defaultNotificationCenter removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window];
+    [defaultNotificationCenter removeObserver:self name:NSWindowDidMoveNotification object:window];
+    [defaultNotificationCenter removeObserver:self name:NSWindowDidResizeNotification object:window];
+    [defaultNotificationCenter removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window];
+    [defaultNotificationCenter removeObserver:self name:NSWindowDidChangeScreenNotification object:window];
+    [defaultNotificationCenter removeObserver:self name:@&quot;_NSWindowDidChangeContentsHostedInLayerSurfaceNotification&quot; object:window];
+    [defaultNotificationCenter removeObserver:self name:NSWindowDidChangeOcclusionStateNotification object:window];
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    if (_impl-&gt;isEditable())
+        [[NSFontPanel sharedFontPanel] removeObserver:self forKeyPath:@&quot;visible&quot; context:keyValueObservingContext];
+    [window removeObserver:self forKeyPath:@&quot;contentLayoutRect&quot; context:keyValueObservingContext];
+    [window removeObserver:self forKeyPath:@&quot;titlebarAppearsTransparent&quot; context:keyValueObservingContext];
+#endif
+}
+
+- (void)startObservingFontPanel
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    [[NSFontPanel sharedFontPanel] addObserver:self forKeyPath:@&quot;visible&quot; options:0 context:keyValueObservingContext];
+#endif
+}
+
+- (void)startObservingLookupDismissal
+{
+    if (canLoadLUNotificationPopoverWillClose())
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
+}
+
+- (void)_windowDidOrderOnScreen:(NSNotification *)notification
+{
+    _impl-&gt;windowDidOrderOnScreen();
+}
+
+- (void)_windowDidOrderOffScreen:(NSNotification *)notification
+{
+    _impl-&gt;windowDidOrderOffScreen();
+}
+
+- (void)_windowDidBecomeKey:(NSNotification *)notification
+{
+    _impl-&gt;windowDidBecomeKey([notification object]);
+}
+
+- (void)_windowDidResignKey:(NSNotification *)notification
+{
+    _impl-&gt;windowDidResignKey([notification object]);
+}
+
+- (void)_windowDidMiniaturize:(NSNotification *)notification
+{
+    _impl-&gt;windowDidMiniaturize();
+}
+
+- (void)_windowDidDeminiaturize:(NSNotification *)notification
+{
+    _impl-&gt;windowDidDeminiaturize();
+}
+
+- (void)_windowDidMove:(NSNotification *)notification
+{
+    _impl-&gt;windowDidMove();
+}
+
+- (void)_windowDidResize:(NSNotification *)notification
+{
+    _impl-&gt;windowDidResize();
+}
+
+- (void)_windowDidChangeBackingProperties:(NSNotification *)notification
+{
+    CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:NSBackingPropertyOldScaleFactorKey] doubleValue];
+    _impl-&gt;windowDidChangeBackingProperties(oldBackingScaleFactor);
+}
+
+- (void)_windowDidChangeScreen:(NSNotification *)notification
+{
+    _impl-&gt;windowDidChangeScreen();
+}
+
+- (void)_windowDidChangeLayerHosting:(NSNotification *)notification
+{
+    _impl-&gt;windowDidChangeLayerHosting();
+}
+
+- (void)_windowDidChangeOcclusionState:(NSNotification *)notification
+{
+    _impl-&gt;windowDidChangeOcclusionState();
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    if (context != keyValueObservingContext) {
+        [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
+        return;
+    }
+
+    if ([keyPath isEqualToString:@&quot;visible&quot;] &amp;&amp; [NSFontPanel sharedFontPanelExists] &amp;&amp; object == [NSFontPanel sharedFontPanel]) {
+        _impl-&gt;updateFontPanelIfNeeded();
+        return;
+    }
+    if ([keyPath isEqualToString:@&quot;contentLayoutRect&quot;] || [keyPath isEqualToString:@&quot;titlebarAppearsTransparent&quot;])
+        _impl-&gt;updateContentInsetsIfAutomatic();
+#endif
+}
+
+- (void)_dictionaryLookupPopoverWillClose:(NSNotification *)notification
+{
+    _impl-&gt;clearTextIndicatorWithAnimation(WebCore::TextIndicatorWindowDismissalAnimation::None);
+}
+
+@end
+
+@interface WKEditCommandObjC : NSObject {
+    RefPtr&lt;WebKit::WebEditCommandProxy&gt; m_command;
+}
+- (id)initWithWebEditCommandProxy:(RefPtr&lt;WebKit::WebEditCommandProxy&gt;)command;
+- (WebKit::WebEditCommandProxy*)command;
+@end
+
+@interface WKEditorUndoTargetObjC : NSObject
+- (void)undoEditing:(id)sender;
+- (void)redoEditing:(id)sender;
+@end
+
+@implementation WKEditCommandObjC
+
+- (id)initWithWebEditCommandProxy:(RefPtr&lt;WebKit::WebEditCommandProxy&gt;)command
+{
+    self = [super init];
+    if (!self)
+        return nil;
+
+    m_command = command;
+    return self;
+}
+
+- (WebKit::WebEditCommandProxy*)command
+{
+    return m_command.get();
+}
+
+@end
+
+@implementation WKEditorUndoTargetObjC
+
+- (void)undoEditing:(id)sender
+{
+    ASSERT([sender isKindOfClass:[WKEditCommandObjC class]]);
+    [sender command]-&gt;unapply();
+}
+
+- (void)redoEditing:(id)sender
+{
+    ASSERT([sender isKindOfClass:[WKEditCommandObjC class]]);
+    [sender command]-&gt;reapply();
+}
+
+@end
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-WebViewImpl::WebViewImpl(NSView &lt;WebViewImplDelegate&gt; *view, WebPageProxy&amp; page)
</del><ins>+WebViewImpl::WebViewImpl(NSView &lt;WebViewImplDelegate&gt; *view, WebPageProxy&amp; page, PageClient&amp; pageClient)
</ins><span class="cx">     : m_view(view)
</span><span class="cx">     , m_page(page)
</span><ins>+    , m_pageClient(pageClient)
+    , m_weakPtrFactory(this)
+    , m_needsViewFrameInWindowCoordinates(m_page.preferences().pluginsEnabled())
</ins><span class="cx">     , m_intrinsicContentSize(CGSizeMake(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric))
</span><span class="cx">     , m_layoutStrategy([WKViewLayoutStrategy layoutStrategyWithPage:m_page view:m_view viewImpl:*this mode:kWKLayoutModeViewSize])
</span><ins>+    , m_undoTarget(adoptNS([[WKEditorUndoTargetObjC alloc] init]))
+    , m_windowVisibilityObserver(adoptNS([[WKWindowVisibilityObserver alloc] initWithView:view impl:*this]))
</ins><span class="cx"> {
</span><ins>+    m_page.setIntrinsicDeviceScaleFactor(intrinsicDeviceScaleFactor());
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    if (Class gestureClass = NSClassFromString(@&quot;NSImmediateActionGestureRecognizer&quot;)) {
+        m_immediateActionGestureRecognizer = adoptNS([(NSImmediateActionGestureRecognizer *)[gestureClass alloc] init]);
+        m_immediateActionController = adoptNS([[WKImmediateActionController alloc] initWithPage:m_page view:m_view viewImpl:*this recognizer:m_immediateActionGestureRecognizer.get()]);
+        [m_immediateActionGestureRecognizer setDelegate:m_immediateActionController.get()];
+        [m_immediateActionGestureRecognizer setDelaysPrimaryMouseButtonEvents:NO];
+    }
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebViewImpl::~WebViewImpl()
</span><span class="lines">@@ -57,6 +324,10 @@
</span><span class="cx">     ASSERT(!m_inSecureInputState);
</span><span class="cx"> 
</span><span class="cx">     [m_layoutStrategy invalidate];
</span><ins>+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    [m_immediateActionController willDestroyView:m_view];
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebViewImpl::setDrawsBackground(bool drawsBackground)
</span><span class="lines">@@ -89,7 +360,7 @@
</span><span class="cx">     // If we just became first responder again, there is no need to do anything,
</span><span class="cx">     // since resignFirstResponder has correctly detected this situation.
</span><span class="cx">     if (m_willBecomeFirstResponderAgain) {
</span><del>-        m_willBecomeFirstResponderAgain = NO;
</del><ins>+        m_willBecomeFirstResponderAgain = false;
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -128,7 +399,7 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    m_willBecomeFirstResponderAgain = NO;
</del><ins>+    m_willBecomeFirstResponderAgain = false;
</ins><span class="cx">     m_inResignFirstResponder = true;
</span><span class="cx"> 
</span><span class="cx"> #if USE(ASYNC_NSTEXTINPUTCLIENT)
</span><span class="lines">@@ -175,6 +446,18 @@
</span><span class="cx">     [m_layoutStrategy didEndLiveResize];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewImpl::renewGState()
+{
+    if (m_textIndicatorWindow)
+        dismissContentRelativeChildWindowsWithAnimation(false);
+
+    // Update the view frame.
+    if (m_view.window)
+        updateWindowAndViewFrames();
+
+    updateContentInsetsIfAutomatic();
+}
+
</ins><span class="cx"> void WebViewImpl::setFrameSize(CGSize)
</span><span class="cx"> {
</span><span class="cx">     [m_layoutStrategy didChangeFrameSize];
</span><span class="lines">@@ -203,6 +486,39 @@
</span><span class="cx">     m_view.frame = NSRectFromCGRect(frame);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewImpl::updateWindowAndViewFrames()
+{
+    if (clipsToVisibleRect())
+        updateViewExposedRect();
+
+    if (m_didScheduleWindowAndViewFrameUpdate)
+        return;
+
+    m_didScheduleWindowAndViewFrameUpdate = true;
+
+    auto weakThis = createWeakPtr();
+    dispatch_async(dispatch_get_main_queue(), [weakThis] {
+        if (!weakThis)
+            return;
+
+        weakThis-&gt;m_didScheduleWindowAndViewFrameUpdate = false;
+
+        NSRect viewFrameInWindowCoordinates = NSZeroRect;
+        NSPoint accessibilityPosition = NSZeroPoint;
+
+        if (weakThis-&gt;m_needsViewFrameInWindowCoordinates)
+            viewFrameInWindowCoordinates = [weakThis-&gt;m_view convertRect:weakThis-&gt;m_view.frame toView:nil];
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+        if (WebCore::AXObjectCache::accessibilityEnabled())
+            accessibilityPosition = [[weakThis-&gt;m_view accessibilityAttributeValue:NSAccessibilityPositionAttribute] pointValue];
+#pragma clang diagnostic pop
+        
+        weakThis-&gt;m_page.windowAndViewFramesChanged(viewFrameInWindowCoordinates, accessibilityPosition);
+    });
+}
+
</ins><span class="cx"> void WebViewImpl::setFixedLayoutSize(CGSize fixedLayoutSize)
</span><span class="cx"> {
</span><span class="cx">     m_page.setFixedLayoutSize(WebCore::expandedIntSize(WebCore::FloatSize(fixedLayoutSize)));
</span><span class="lines">@@ -222,6 +538,55 @@
</span><span class="cx">     m_resizeScrollOffset = CGSizeZero;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewImpl::setAutomaticallyAdjustsContentInsets(bool automaticallyAdjustsContentInsets)
+{
+    m_automaticallyAdjustsContentInsets = automaticallyAdjustsContentInsets;
+    updateContentInsetsIfAutomatic();
+}
+
+void WebViewImpl::updateContentInsetsIfAutomatic()
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    if (!m_automaticallyAdjustsContentInsets)
+        return;
+
+    NSWindow *window = m_view.window;
+    if ((window.styleMask &amp; NSFullSizeContentViewWindowMask) &amp;&amp; !window.titlebarAppearsTransparent &amp;&amp; ![m_view enclosingScrollView]) {
+        NSRect contentLayoutRect = [m_view convertRect:window.contentLayoutRect fromView:nil];
+        CGFloat newTopContentInset = NSMaxY(contentLayoutRect) - NSHeight(contentLayoutRect);
+        if (m_topContentInset != newTopContentInset)
+            setTopContentInset(newTopContentInset);
+    } else
+        setTopContentInset(0);
+#endif
+}
+
+void WebViewImpl::setTopContentInset(CGFloat contentInset)
+{
+    m_topContentInset = contentInset;
+
+    if (m_didScheduleSetTopContentInset)
+        return;
+
+    m_didScheduleSetTopContentInset = true;
+
+    auto weakThis = createWeakPtr();
+    dispatch_async(dispatch_get_main_queue(), [weakThis] {
+        if (!weakThis)
+            return;
+        weakThis-&gt;dispatchSetTopContentInset();
+    });
+}
+
+void WebViewImpl::dispatchSetTopContentInset()
+{
+    if (!m_didScheduleSetTopContentInset)
+        return;
+
+    m_didScheduleSetTopContentInset = false;
+    m_page.setTopContentInset(m_topContentInset);
+}
+
</ins><span class="cx"> void WebViewImpl::setContentPreparationRect(CGRect rect)
</span><span class="cx"> {
</span><span class="cx">     m_contentPreparationRect = rect;
</span><span class="lines">@@ -337,6 +702,270 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewImpl::setOverrideDeviceScaleFactor(CGFloat deviceScaleFactor)
+{
+    m_overrideDeviceScaleFactor = deviceScaleFactor;
+    m_page.setIntrinsicDeviceScaleFactor(intrinsicDeviceScaleFactor());
+}
+
+float WebViewImpl::intrinsicDeviceScaleFactor() const
+{
+    if (m_overrideDeviceScaleFactor)
+        return m_overrideDeviceScaleFactor;
+    if (m_targetWindowForMovePreparation)
+        return m_targetWindowForMovePreparation.backingScaleFactor;
+    if (NSWindow *window = m_view.window)
+        return window.backingScaleFactor;
+    return [NSScreen mainScreen].backingScaleFactor;
+}
+
+void WebViewImpl::windowDidOrderOffScreen()
+{
+    m_page.viewStateDidChange(WebCore::ViewState::IsVisible | WebCore::ViewState::WindowIsActive);
+}
+
+void WebViewImpl::windowDidOrderOnScreen()
+{
+    m_page.viewStateDidChange(WebCore::ViewState::IsVisible | WebCore::ViewState::WindowIsActive);
+}
+
+void WebViewImpl::windowDidBecomeKey(NSWindow *keyWindow)
+{
+    if (keyWindow == m_view.window || keyWindow == m_view.window.attachedSheet) {
+        updateSecureInputState();
+        m_page.viewStateDidChange(WebCore::ViewState::WindowIsActive);
+    }
+}
+
+void WebViewImpl::windowDidResignKey(NSWindow *formerKeyWindow)
+{
+    if (formerKeyWindow == m_view.window || formerKeyWindow == m_view.window.attachedSheet) {
+        updateSecureInputState();
+        m_page.viewStateDidChange(WebCore::ViewState::WindowIsActive);
+    }
+}
+
+void WebViewImpl::windowDidMiniaturize()
+{
+    m_page.viewStateDidChange(WebCore::ViewState::IsVisible);
+}
+
+void WebViewImpl::windowDidDeminiaturize()
+{
+    m_page.viewStateDidChange(WebCore::ViewState::IsVisible);
+}
+
+void WebViewImpl::windowDidMove()
+{
+    updateWindowAndViewFrames();
+}
+
+void WebViewImpl::windowDidResize()
+{
+    updateWindowAndViewFrames();
+}
+
+void WebViewImpl::windowDidChangeBackingProperties(CGFloat oldBackingScaleFactor)
+{
+    CGFloat newBackingScaleFactor = intrinsicDeviceScaleFactor();
+    if (oldBackingScaleFactor == newBackingScaleFactor)
+        return;
+
+    m_page.setIntrinsicDeviceScaleFactor(newBackingScaleFactor);
+}
+
+void WebViewImpl::windowDidChangeScreen()
+{
+    NSWindow *window = m_targetWindowForMovePreparation ? m_targetWindowForMovePreparation : m_view.window;
+    m_page.windowScreenDidChange((PlatformDisplayID)[[[[window screen] deviceDescription] objectForKey:@&quot;NSScreenNumber&quot;] intValue]);
+}
+
+void WebViewImpl::windowDidChangeLayerHosting()
+{
+    m_page.layerHostingModeDidChange();
+}
+
+void WebViewImpl::windowDidChangeOcclusionState()
+{
+    m_page.viewStateDidChange(WebCore::ViewState::IsVisible);
+}
+
+void WebViewImpl::viewWillMoveToWindow(NSWindow *window)
+{
+    // If we're in the middle of preparing to move to a window, we should only be moved to that window.
+    ASSERT(!m_targetWindowForMovePreparation || (m_targetWindowForMovePreparation == window));
+
+    NSWindow *currentWindow = m_view.window;
+    if (window == currentWindow)
+        return;
+
+    clearAllEditCommands();
+
+    NSWindow *stopObservingWindow = m_targetWindowForMovePreparation ? m_targetWindowForMovePreparation : m_view.window;
+    [m_windowVisibilityObserver stopObserving:stopObservingWindow];
+    [m_windowVisibilityObserver startObserving:window];
+}
+
+void WebViewImpl::viewDidMoveToWindow()
+{
+    NSWindow *window = m_targetWindowForMovePreparation ? m_targetWindowForMovePreparation : m_view.window;
+
+    if (window) {
+        windowDidChangeScreen();
+
+        WebCore::ViewState::Flags viewStateChanges = WebCore::ViewState::WindowIsActive | WebCore::ViewState::IsVisible;
+        if (m_isDeferringViewInWindowChanges)
+            m_viewInWindowChangeWasDeferred = true;
+        else
+            viewStateChanges |= WebCore::ViewState::IsInWindow;
+        m_page.viewStateDidChange(viewStateChanges);
+
+        updateWindowAndViewFrames();
+
+        // FIXME(135509) This call becomes unnecessary once 135509 is fixed; remove.
+        m_page.layerHostingModeDidChange();
+
+        if (!m_flagsChangedEventMonitor) {
+            auto weakThis = createWeakPtr();
+            m_flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSFlagsChangedMask handler:[weakThis] (NSEvent *flagsChangedEvent) {
+                if (weakThis)
+                    weakThis-&gt;postFakeMouseMovedEventForFlagsChangedEvent(flagsChangedEvent);
+                return flagsChangedEvent;
+            }];
+        }
+
+        accessibilityRegisterUIProcessTokens();
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+        if (m_immediateActionGestureRecognizer &amp;&amp; ![[m_view gestureRecognizers] containsObject:m_immediateActionGestureRecognizer.get()] &amp;&amp; !m_ignoresNonWheelEvents &amp;&amp; m_allowsLinkPreview)
+            [m_view addGestureRecognizer:m_immediateActionGestureRecognizer.get()];
+#endif
+    } else {
+        WebCore::ViewState::Flags viewStateChanges = WebCore::ViewState::WindowIsActive | WebCore::ViewState::IsVisible;
+        if (m_isDeferringViewInWindowChanges)
+            m_viewInWindowChangeWasDeferred = true;
+        else
+            viewStateChanges |= WebCore::ViewState::IsInWindow;
+        m_page.viewStateDidChange(viewStateChanges);
+
+        [NSEvent removeMonitor:m_flagsChangedEventMonitor];
+        m_flagsChangedEventMonitor = nil;
+
+        dismissContentRelativeChildWindowsWithAnimation(false);
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+        if (m_immediateActionGestureRecognizer)
+            [m_view removeGestureRecognizer:m_immediateActionGestureRecognizer.get()];
+#endif
+    }
+
+    m_page.setIntrinsicDeviceScaleFactor(intrinsicDeviceScaleFactor());
+}
+
+void WebViewImpl::viewDidChangeBackingProperties()
+{
+    NSColorSpace *colorSpace = m_view.window.colorSpace;
+    if ([colorSpace isEqualTo:m_colorSpace.get()])
+        return;
+
+    m_colorSpace = nullptr;
+    if (DrawingAreaProxy *drawingArea = m_page.drawingArea())
+        drawingArea-&gt;colorSpaceDidChange();
+}
+
+void WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent(NSEvent *flagsChangedEvent)
+{
+    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:flagsChangedEvent.window.mouseLocationOutsideOfEventStream
+        modifierFlags:flagsChangedEvent.modifierFlags timestamp:flagsChangedEvent.timestamp windowNumber:flagsChangedEvent.windowNumber
+        context:flagsChangedEvent.context eventNumber:0 clickCount:0 pressure:0];
+    NativeWebMouseEvent webEvent(fakeEvent, m_lastPressureEvent.get(), m_view);
+    m_page.handleMouseEvent(webEvent);
+}
+
+ColorSpaceData WebViewImpl::colorSpace()
+{
+    if (!m_colorSpace) {
+        if (m_targetWindowForMovePreparation)
+            m_colorSpace = m_targetWindowForMovePreparation.colorSpace;
+        else if (NSWindow *window = m_view.window)
+            m_colorSpace = window.colorSpace;
+        else
+            m_colorSpace = [NSScreen mainScreen].colorSpace;
+    }
+
+    ColorSpaceData colorSpaceData;
+    colorSpaceData.cgColorSpace = [m_colorSpace CGColorSpace];
+    
+    return colorSpaceData;
+}
+
+void WebViewImpl::beginDeferringViewInWindowChanges()
+{
+    if (m_shouldDeferViewInWindowChanges) {
+        NSLog(@&quot;beginDeferringViewInWindowChanges was called while already deferring view-in-window changes!&quot;);
+        return;
+    }
+
+    m_shouldDeferViewInWindowChanges = true;
+}
+
+void WebViewImpl::endDeferringViewInWindowChanges()
+{
+    if (!m_shouldDeferViewInWindowChanges) {
+        NSLog(@&quot;endDeferringViewInWindowChanges was called without beginDeferringViewInWindowChanges!&quot;);
+        return;
+    }
+
+    m_shouldDeferViewInWindowChanges = false;
+
+    if (m_viewInWindowChangeWasDeferred) {
+        dispatchSetTopContentInset();
+        m_page.viewStateDidChange(WebCore::ViewState::IsInWindow);
+        m_viewInWindowChangeWasDeferred = false;
+    }
+}
+
+void WebViewImpl::endDeferringViewInWindowChangesSync()
+{
+    if (!m_shouldDeferViewInWindowChanges) {
+        NSLog(@&quot;endDeferringViewInWindowChangesSync was called without beginDeferringViewInWindowChanges!&quot;);
+        return;
+    }
+
+    m_shouldDeferViewInWindowChanges = false;
+
+    if (m_viewInWindowChangeWasDeferred) {
+        dispatchSetTopContentInset();
+        m_page.viewStateDidChange(WebCore::ViewState::IsInWindow);
+        m_viewInWindowChangeWasDeferred = false;
+    }
+}
+
+void WebViewImpl::prepareForMoveToWindow(NSWindow *targetWindow, std::function&lt;void()&gt; completionHandler)
+{
+    m_shouldDeferViewInWindowChanges = true;
+    viewWillMoveToWindow(targetWindow);
+    m_targetWindowForMovePreparation = targetWindow;
+    viewDidMoveToWindow();
+
+    m_shouldDeferViewInWindowChanges = false;
+
+    auto weakThis = createWeakPtr();
+    m_page.installViewStateChangeCompletionHandler([weakThis, completionHandler]() {
+        completionHandler();
+
+        if (!weakThis)
+            return;
+
+        ASSERT(weakThis-&gt;m_view.window == weakThis-&gt;m_targetWindowForMovePreparation);
+        weakThis-&gt;m_targetWindowForMovePreparation = nil;
+    });
+
+    dispatchSetTopContentInset();
+    m_page.viewStateDidChange(WebCore::ViewState::IsInWindow, false, WebPageProxy::ViewStateChangeDispatchMode::Immediate);
+    m_viewInWindowChangeWasDeferred = false;
+}
+
</ins><span class="cx"> void WebViewImpl::updateSecureInputState()
</span><span class="cx"> {
</span><span class="cx">     if (![[m_view window] isKeyWindow] || !isFocused()) {
</span><span class="lines">@@ -386,6 +1015,25 @@
</span><span class="cx">     [[m_view _superInputContext] discardMarkedText]; // Inform the input method that we won't have an inline input area despite having been asked to.
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewImpl::pressureChangeWithEvent(NSEvent *event)
+{
+#if defined(__LP64__) &amp;&amp; __MAC_OS_X_VERSION_MAX_ALLOWED &gt;= 101003
+    if (event == m_lastPressureEvent)
+        return;
+
+    if (m_ignoresNonWheelEvents)
+        return;
+
+    if (event.phase != NSEventPhaseChanged &amp;&amp; event.phase != NSEventPhaseBegan &amp;&amp; event.phase != NSEventPhaseEnded)
+        return;
+
+    NativeWebMouseEvent webEvent(event, m_lastPressureEvent.get(), m_view);
+    m_page.handleMouseEvent(webEvent);
+
+    m_lastPressureEvent = event;
+#endif
+}
+
</ins><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> bool WebViewImpl::hasFullScreenWindowController() const
</span><span class="cx"> {
</span><span class="lines">@@ -428,7 +1076,260 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool WebViewImpl::isEditable() const
+{
+    return m_page.isEditable();
+}
</ins><span class="cx"> 
</span><ins>+void WebViewImpl::executeEditCommand(const String&amp; commandName, const String&amp; argument)
+{
+    m_page.executeEditCommand(commandName, argument);
+}
+
+void WebViewImpl::registerEditCommand(RefPtr&lt;WebEditCommandProxy&gt; prpCommand, WebPageProxy::UndoOrRedo undoOrRedo)
+{
+    RefPtr&lt;WebEditCommandProxy&gt; command = prpCommand;
+
+    RetainPtr&lt;WKEditCommandObjC&gt; commandObjC = adoptNS([[WKEditCommandObjC alloc] initWithWebEditCommandProxy:command]);
+    String actionName = WebEditCommandProxy::nameForEditAction(command-&gt;editAction());
+
+    NSUndoManager *undoManager = [m_view undoManager];
+    [undoManager registerUndoWithTarget:m_undoTarget.get() selector:((undoOrRedo == WebPageProxy::Undo) ? @selector(undoEditing:) : @selector(redoEditing:)) object:commandObjC.get()];
+    if (!actionName.isEmpty())
+        [undoManager setActionName:(NSString *)actionName];
+}
+
+void WebViewImpl::clearAllEditCommands()
+{
+    [[m_view undoManager] removeAllActionsWithTarget:m_undoTarget.get()];
+}
+
+bool WebViewImpl::writeSelectionToPasteboard(NSPasteboard *pasteboard, NSArray *types)
+{
+    size_t numTypes = types.count;
+    [pasteboard declareTypes:types owner:nil];
+    for (size_t i = 0; i &lt; numTypes; ++i) {
+        if ([[types objectAtIndex:i] isEqualTo:NSStringPboardType])
+            [pasteboard setString:m_page.stringSelectionForPasteboard() forType:NSStringPboardType];
+        else {
+            RefPtr&lt;WebCore::SharedBuffer&gt; buffer = m_page.dataSelectionForPasteboard([types objectAtIndex:i]);
+            [pasteboard setData:buffer ? buffer-&gt;createNSData().get() : nil forType:[types objectAtIndex:i]];
+        }
+    }
+    return true;
+}
+
+void WebViewImpl::centerSelectionInVisibleArea()
+{
+    m_page.centerSelectionInVisibleArea();
+}
+
+void WebViewImpl::selectionDidChange()
+{
+    updateFontPanelIfNeeded();
+}
+
+void WebViewImpl::startObservingFontPanel()
+{
+    [m_windowVisibilityObserver startObservingFontPanel];
+}
+
+void WebViewImpl::updateFontPanelIfNeeded()
+{
+    const EditorState&amp; editorState = m_page.editorState();
+    if (editorState.selectionIsNone || !editorState.isContentEditable)
+        return;
+    if ([NSFontPanel sharedFontPanelExists] &amp;&amp; [[NSFontPanel sharedFontPanel] isVisible]) {
+        m_page.fontAtSelection([](const String&amp; fontName, double fontSize, bool selectionHasMultipleFonts, WebKit::CallbackBase::Error error) {
+            NSFont *font = [NSFont fontWithName:fontName size:fontSize];
+            if (font)
+                [[NSFontManager sharedFontManager] setSelectedFont:font isMultiple:selectionHasMultipleFonts];
+        });
+    }
+}
+
+void WebViewImpl::preferencesDidChange()
+{
+    BOOL needsViewFrameInWindowCoordinates = m_page.preferences().pluginsEnabled();
+
+    if (!!needsViewFrameInWindowCoordinates == !!m_needsViewFrameInWindowCoordinates)
+        return;
+
+    m_needsViewFrameInWindowCoordinates = needsViewFrameInWindowCoordinates;
+    if (m_view.window)
+        updateWindowAndViewFrames();
+}
+
+void WebViewImpl::setTextIndicator(WebCore::TextIndicator&amp; textIndicator, WebCore::TextIndicatorWindowLifetime lifetime)
+{
+    if (!m_textIndicatorWindow)
+        m_textIndicatorWindow = std::make_unique&lt;WebCore::TextIndicatorWindow&gt;(m_view);
+
+    NSRect textBoundingRectInScreenCoordinates = [m_view.window convertRectToScreen:[m_view convertRect:textIndicator.textBoundingRectInRootViewCoordinates() toView:nil]];
+    m_textIndicatorWindow-&gt;setTextIndicator(textIndicator, NSRectToCGRect(textBoundingRectInScreenCoordinates), lifetime);
+}
+
+void WebViewImpl::clearTextIndicatorWithAnimation(WebCore::TextIndicatorWindowDismissalAnimation animation)
+{
+    if (m_textIndicatorWindow)
+        m_textIndicatorWindow-&gt;clearTextIndicator(animation);
+    m_textIndicatorWindow = nullptr;
+}
+
+void WebViewImpl::setTextIndicatorAnimationProgress(float progress)
+{
+    if (m_textIndicatorWindow)
+        m_textIndicatorWindow-&gt;setAnimationProgress(progress);
+}
+
+void WebViewImpl::dismissContentRelativeChildWindowsWithAnimation(bool animate)
+{
+    [m_view _dismissContentRelativeChildWindowsWithAnimation:animate];
+}
+
+void WebViewImpl::dismissContentRelativeChildWindowsWithAnimationFromViewOnly(bool animate)
+{
+    // Calling _clearTextIndicatorWithAnimation here will win out over the animated clear in dismissContentRelativeChildWindowsFromViewOnly.
+    // We can't invert these because clients can override (and have overridden) _dismissContentRelativeChildWindows, so it needs to be called.
+    // For this same reason, this can't be moved to WebViewImpl without care.
+    clearTextIndicatorWithAnimation(animate ? WebCore::TextIndicatorWindowDismissalAnimation::FadeOut : WebCore::TextIndicatorWindowDismissalAnimation::None);
+    [m_view _dismissContentRelativeChildWindows];
+}
+
+void WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly()
+{
+    bool hasActiveImmediateAction = false;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    hasActiveImmediateAction = [m_immediateActionController hasActiveImmediateAction];
+#endif
+
+    // FIXME: We don't know which panel we are dismissing, it may not even be in the current page (see &lt;rdar://problem/13875766&gt;).
+    if (m_view.window.isKeyWindow || hasActiveImmediateAction) {
+        WebCore::DictionaryLookup::hidePopup();
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+        DDActionsManager *actionsManager = [getDDActionsManagerClass() sharedManager];
+        if ([actionsManager respondsToSelector:@selector(requestBubbleClosureUnanchorOnFailure:)])
+            [actionsManager requestBubbleClosureUnanchorOnFailure:YES];
+#endif
+    }
+
+    clearTextIndicatorWithAnimation(WebCore::TextIndicatorWindowDismissalAnimation::FadeOut);
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    [m_immediateActionController dismissContentRelativeChildWindows];
+#endif
+    
+    m_pageClient.dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeTextIgnored);
+}
+
+void WebViewImpl::quickLookWithEvent(NSEvent *event)
+{
+    if (ignoresNonWheelEvents())
+        return;
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    if (m_immediateActionGestureRecognizer) {
+        [m_view _superQuickLookWithEvent:event];
+        return;
+    }
+#endif
+
+    NSPoint locationInViewCoordinates = [m_view convertPoint:[event locationInWindow] fromView:nil];
+    m_page.performDictionaryLookupAtLocation(WebCore::FloatPoint(locationInViewCoordinates));
+}
+
+void WebViewImpl::prepareForDictionaryLookup()
+{
+    if (m_didRegisterForLookupPopoverCloseNotifications)
+        return;
+
+    m_didRegisterForLookupPopoverCloseNotifications = true;
+
+    [m_windowVisibilityObserver startObservingLookupDismissal];
+}
+
+void WebViewImpl::setAllowsLinkPreview(bool allowsLinkPreview)
+{
+    if (m_allowsLinkPreview == allowsLinkPreview)
+        return;
+
+    m_allowsLinkPreview = allowsLinkPreview;
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    if (!allowsLinkPreview)
+        [m_view removeGestureRecognizer:m_immediateActionGestureRecognizer.get()];
+    else if (NSGestureRecognizer *immediateActionRecognizer = m_immediateActionGestureRecognizer.get())
+        [m_view addGestureRecognizer:immediateActionRecognizer];
+#endif
+}
+
+void* WebViewImpl::immediateActionAnimationControllerForHitTestResult(WKHitTestResultRef hitTestResult, uint32_t type, WKTypeRef userData)
+{
+    return [m_view _immediateActionAnimationControllerForHitTestResult:hitTestResult withType:type userData:userData];
+}
+
+void* WebViewImpl::immediateActionAnimationControllerForHitTestResultFromViewOnly(WKHitTestResultRef hitTestResult, uint32_t type, WKTypeRef userData)
+{
+    return nil;
+}
+
+void WebViewImpl::didPerformImmediateActionHitTest(const WebHitTestResultData&amp; result, bool contentPreventsDefault, API::Object* userData)
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    [m_immediateActionController didPerformImmediateActionHitTest:result contentPreventsDefault:contentPreventsDefault userData:userData];
+#endif
+}
+
+void WebViewImpl::prepareForImmediateActionAnimation()
+{
+    [m_view _prepareForImmediateActionAnimation];
+}
+
+void WebViewImpl::cancelImmediateActionAnimation()
+{
+    [m_view _cancelImmediateActionAnimation];
+}
+
+void WebViewImpl::completeImmediateActionAnimation()
+{
+    [m_view _completeImmediateActionAnimation];
+}
+
+void WebViewImpl::setIgnoresNonWheelEvents(bool ignoresNonWheelEvents)
+{
+    if (m_ignoresNonWheelEvents == ignoresNonWheelEvents)
+        return;
+
+    m_ignoresNonWheelEvents = ignoresNonWheelEvents;
+    m_page.setShouldDispatchFakeMouseMoveEvents(!ignoresNonWheelEvents);
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    if (ignoresNonWheelEvents)
+        [m_view removeGestureRecognizer:m_immediateActionGestureRecognizer.get()];
+    else if (NSGestureRecognizer *immediateActionRecognizer = m_immediateActionGestureRecognizer.get()) {
+        if (m_allowsLinkPreview)
+            [m_view addGestureRecognizer:immediateActionRecognizer];
+    }
+#endif
+}
+
+void WebViewImpl::setIgnoresAllEvents(bool ignoresAllEvents)
+{
+    m_ignoresAllEvents = ignoresAllEvents;
+    setIgnoresNonWheelEvents(ignoresAllEvents);
+}
+
+void WebViewImpl::accessibilityRegisterUIProcessTokens()
+{
+    // Initialize remote accessibility when the window connection has been established.
+    NSData *remoteElementToken = WKAXRemoteTokenForElement(m_view);
+    NSData *remoteWindowToken = WKAXRemoteTokenForElement(m_view.window);
+    IPC::DataReference elementToken = IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;([remoteElementToken bytes]), [remoteElementToken length]);
+    IPC::DataReference windowToken = IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;([remoteWindowToken bytes]), [remoteWindowToken length]);
+    m_page.registerUIProcessAccessibilityTokens(elementToken, windowToken);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (191498 => 191499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-10-23 17:55:09 UTC (rev 191498)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-10-23 17:57:33 UTC (rev 191499)
</span><span class="lines">@@ -220,7 +220,6 @@
</span><span class="cx">     WKView *m_wkView;
</span><span class="cx">     WKWebView *m_webView;
</span><span class="cx">     WebViewImpl* m_impl { nullptr };
</span><del>-    RetainPtr&lt;WKEditorUndoTargetObjC&gt; m_undoTarget;
</del><span class="cx"> #if USE(AUTOCORRECTION_PANEL)
</span><span class="cx">     CorrectionPanel m_correctionPanel;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (191498 => 191499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-10-23 17:55:09 UTC (rev 191498)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-10-23 17:57:33 UTC (rev 191499)
</span><span class="lines">@@ -90,60 +90,11 @@
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace WebKit;
</span><span class="cx"> 
</span><del>-@interface WKEditCommandObjC : NSObject
-{
-    RefPtr&lt;WebEditCommandProxy&gt; m_command;
-}
-- (id)initWithWebEditCommandProxy:(PassRefPtr&lt;WebEditCommandProxy&gt;)command;
-- (WebEditCommandProxy*)command;
-@end
-
-@interface WKEditorUndoTargetObjC : NSObject
-- (void)undoEditing:(id)sender;
-- (void)redoEditing:(id)sender;
-@end
-
-@implementation WKEditCommandObjC
-
-- (id)initWithWebEditCommandProxy:(PassRefPtr&lt;WebEditCommandProxy&gt;)command
-{
-    self = [super init];
-    if (!self)
-        return nil;
-
-    m_command = command;
-    return self;
-}
-
-- (WebEditCommandProxy*)command
-{
-    return m_command.get();
-}
-
-@end
-
-@implementation WKEditorUndoTargetObjC
-
-- (void)undoEditing:(id)sender
-{
-    ASSERT([sender isKindOfClass:[WKEditCommandObjC class]]);
-    [sender command]-&gt;unapply();
-}
-
-- (void)redoEditing:(id)sender
-{
-    ASSERT([sender isKindOfClass:[WKEditCommandObjC class]]);
-    [sender command]-&gt;reapply();
-}
-
-@end
-
</del><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> PageClientImpl::PageClientImpl(WKView* wkView, WKWebView *webView)
</span><span class="cx">     : m_wkView(wkView)
</span><span class="cx">     , m_webView(webView)
</span><del>-    , m_undoTarget(adoptNS([[WKEditorUndoTargetObjC alloc] init]))
</del><span class="cx"> #if USE(DICTATION_ALTERNATIVES)
</span><span class="cx">     , m_alternativeTextUIController(std::make_unique&lt;AlternativeTextUIController&gt;())
</span><span class="cx"> #endif
</span><span class="lines">@@ -207,8 +158,8 @@
</span><span class="cx">     if (m_wkView._thumbnailView)
</span><span class="cx">         return m_wkView._thumbnailView.window;
</span><span class="cx"> #endif
</span><del>-    if (m_wkView._targetWindowForMovePreparation)
-        return m_wkView._targetWindowForMovePreparation;
</del><ins>+    if (m_impl &amp;&amp; m_impl-&gt;targetWindowForMovePreparation())
+        return m_impl-&gt;targetWindowForMovePreparation();
</ins><span class="cx">     return m_wkView.window;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -307,7 +258,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::preferencesDidChange()
</span><span class="cx"> {
</span><del>-    [m_wkView _preferencesDidChange];
</del><ins>+    m_impl-&gt;preferencesDidChange();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::toolTipChanged(const String&amp; oldToolTip, const String&amp; newToolTip)
</span><span class="lines">@@ -373,15 +324,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::registerEditCommand(PassRefPtr&lt;WebEditCommandProxy&gt; prpCommand, WebPageProxy::UndoOrRedo undoOrRedo)
</span><span class="cx"> {
</span><del>-    RefPtr&lt;WebEditCommandProxy&gt; command = prpCommand;
-
-    RetainPtr&lt;WKEditCommandObjC&gt; commandObjC = adoptNS([[WKEditCommandObjC alloc] initWithWebEditCommandProxy:command]);
-    String actionName = WebEditCommandProxy::nameForEditAction(command-&gt;editAction());
-
-    NSUndoManager *undoManager = [m_wkView undoManager];
-    [undoManager registerUndoWithTarget:m_undoTarget.get() selector:((undoOrRedo == WebPageProxy::Undo) ? @selector(undoEditing:) : @selector(redoEditing:)) object:commandObjC.get()];
-    if (!actionName.isEmpty())
-        [undoManager setActionName:(NSString *)actionName];
</del><ins>+    m_impl-&gt;registerEditCommand(prpCommand, undoOrRedo);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(INSERTION_UNDO_GROUPING)
</span><span class="lines">@@ -393,7 +336,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::clearAllEditCommands()
</span><span class="cx"> {
</span><del>-    [[m_wkView undoManager] removeAllActionsWithTarget:m_undoTarget.get()];
</del><ins>+    m_impl-&gt;clearAllEditCommands();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PageClientImpl::canUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
</span><span class="lines">@@ -515,17 +458,17 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::setTextIndicator(Ref&lt;TextIndicator&gt; textIndicator, WebCore::TextIndicatorWindowLifetime lifetime)
</span><span class="cx"> {
</span><del>-    [m_wkView _setTextIndicator:textIndicator.get() withLifetime:lifetime];
</del><ins>+    m_impl-&gt;setTextIndicator(textIndicator.get(), lifetime);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::clearTextIndicator(WebCore::TextIndicatorWindowDismissalAnimation dismissalAnimation)
</span><span class="cx"> {
</span><del>-    [m_wkView _clearTextIndicatorWithAnimation:dismissalAnimation];
</del><ins>+    m_impl-&gt;clearTextIndicatorWithAnimation(dismissalAnimation);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::setTextIndicatorAnimationProgress(float progress)
</span><span class="cx"> {
</span><del>-    [m_wkView _setTextIndicatorAnimationProgress:progress];
</del><ins>+    m_impl-&gt;setTextIndicatorAnimationProgress(progress);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::accessibilityWebProcessTokenReceived(const IPC::DataReference&amp; data)
</span><span class="lines">@@ -576,7 +519,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::selectionDidChange()
</span><span class="cx"> {
</span><del>-    [m_wkView _selectionChanged];
</del><ins>+    m_impl-&gt;selectionDidChange();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&amp; event)
</span><span class="lines">@@ -603,10 +546,10 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::didPerformDictionaryLookup(const DictionaryPopupInfo&amp; dictionaryPopupInfo)
</span><span class="cx"> {
</span><del>-    [m_wkView _prepareForDictionaryLookup];
</del><ins>+    m_impl-&gt;prepareForDictionaryLookup();
</ins><span class="cx"> 
</span><span class="cx">     DictionaryLookup::showPopup(dictionaryPopupInfo, m_wkView, [this](TextIndicator&amp; textIndicator) {
</span><del>-        [m_wkView _setTextIndicator:textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</del><ins>+        m_impl-&gt;setTextIndicator(textIndicator, TextIndicatorWindowLifetime::Permanent);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -661,10 +604,14 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::intrinsicContentSizeDidChange(const IntSize&amp; intrinsicContentSize)
</span><span class="cx"> {
</span><del>-    if (m_webView)
</del><ins>+#if WK_API_ENABLED
+    if (m_webView) {
</ins><span class="cx">         [m_webView _setIntrinsicContentSize:intrinsicContentSize];
</span><del>-    else
-        [m_wkView _setIntrinsicContentSize:intrinsicContentSize];
</del><ins>+        return;
+    }
+#endif
+
+    m_impl-&gt;setIntrinsicContentSize(intrinsicContentSize);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PageClientImpl::executeSavedCommandBySelector(const String&amp; selectorString)
</span><span class="lines">@@ -839,7 +786,7 @@
</span><span class="cx"> void PageClientImpl::didPerformImmediateActionHitTest(const WebHitTestResultData&amp; result, bool contentPreventsDefault, API::Object* userData)
</span><span class="cx"> {
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
</span><del>-    [m_wkView _didPerformImmediateActionHitTest:result contentPreventsDefault:contentPreventsDefault userData:userData];
</del><ins>+    m_impl-&gt;didPerformImmediateActionHitTest(result, contentPreventsDefault, userData);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -849,7 +796,7 @@
</span><span class="cx">     if (m_webView)
</span><span class="cx">         return [m_webView _immediateActionAnimationControllerForHitTestResult:wrapper(*hitTestResult) withType:(_WKImmediateActionType)type userData:(id)(userData.get())];
</span><span class="cx"> #endif
</span><del>-    return [m_wkView _immediateActionAnimationControllerForHitTestResult:toAPI(hitTestResult.get()) withType:type userData:toAPI(userData.get())];
</del><ins>+    return m_impl-&gt;immediateActionAnimationControllerForHitTestResult(toAPI(hitTestResult.get()), type, toAPI(userData.get()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::showPlatformContextMenu(NSMenu *menu, IntPoint location)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKImmediateActionControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.h (191498 => 191499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.h        2015-10-23 17:55:09 UTC (rev 191498)
+++ trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.h        2015-10-23 17:57:33 UTC (rev 191499)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> class WebPageProxy;
</span><ins>+class WebViewImpl;
</ins><span class="cx"> 
</span><span class="cx"> enum class ImmediateActionState {
</span><span class="cx">     None = 0,
</span><span class="lines">@@ -46,12 +47,12 @@
</span><span class="cx"> 
</span><span class="cx"> @class DDActionContext;
</span><span class="cx"> @class QLPreviewMenuItem;
</span><del>-@class WKView;
</del><span class="cx"> 
</span><span class="cx"> @interface WKImmediateActionController : NSObject &lt;NSImmediateActionGestureRecognizerDelegate&gt; {
</span><span class="cx"> @private
</span><del>-    WebKit::WebPageProxy *_page;
-    WKView *_wkView;
</del><ins>+    WebKit::WebPageProxy* _page;
+    NSView *_view;
+    WebKit::WebViewImpl* _viewImpl;
</ins><span class="cx"> 
</span><span class="cx">     WebKit::ImmediateActionState _state;
</span><span class="cx">     WebKit::WebHitTestResultData _hitTestResultData;
</span><span class="lines">@@ -67,8 +68,8 @@
</span><span class="cx">     BOOL _hasActiveImmediateAction;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (instancetype)initWithPage:(WebKit::WebPageProxy&amp;)page view:(WKView *)wkView recognizer:(NSImmediateActionGestureRecognizer *)immediateActionRecognizer;
-- (void)willDestroyView:(WKView *)view;
</del><ins>+- (instancetype)initWithPage:(WebKit::WebPageProxy&amp;)page view:(NSView *)view viewImpl:(WebKit::WebViewImpl&amp;)viewImpl recognizer:(NSImmediateActionGestureRecognizer *)immediateActionRecognizer;
+- (void)willDestroyView:(NSView *)view;
</ins><span class="cx"> - (void)didPerformImmediateActionHitTest:(const WebKit::WebHitTestResultData&amp;)hitTestResult contentPreventsDefault:(BOOL)contentPreventsDefault userData:(API::Object*)userData;
</span><span class="cx"> - (void)dismissContentRelativeChildWindows;
</span><span class="cx"> - (BOOL)hasActiveImmediateAction;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKImmediateActionControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm (191498 => 191499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm        2015-10-23 17:55:09 UTC (rev 191498)
+++ trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm        2015-10-23 17:57:33 UTC (rev 191499)
</span><span class="lines">@@ -30,11 +30,11 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;APIHitTestResult.h&quot;
</span><span class="cx"> #import &quot;WKNSURLExtras.h&quot;
</span><del>-#import &quot;WKViewInternal.h&quot;
</del><span class="cx"> #import &quot;WebPageMessages.h&quot;
</span><span class="cx"> #import &quot;WebPageProxy.h&quot;
</span><span class="cx"> #import &quot;WebPageProxyMessages.h&quot;
</span><span class="cx"> #import &quot;WebProcessProxy.h&quot;
</span><ins>+#import &quot;WebViewImpl.h&quot;
</ins><span class="cx"> #import &lt;WebCore/DataDetectorsSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/DictionaryLookup.h&gt;
</span><span class="cx"> #import &lt;WebCore/GeometryUtilities.h&gt;
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WKImmediateActionController
</span><span class="cx"> 
</span><del>-- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(WKView *)wkView recognizer:(NSImmediateActionGestureRecognizer *)immediateActionRecognizer
</del><ins>+- (instancetype)initWithPage:(WebPageProxy&amp;)page view:(NSView *)view viewImpl:(WebViewImpl&amp;)viewImpl recognizer:(NSImmediateActionGestureRecognizer *)immediateActionRecognizer
</ins><span class="cx"> {
</span><span class="cx">     self = [super init];
</span><span class="cx"> 
</span><span class="lines">@@ -72,7 +72,8 @@
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><span class="cx">     _page = &amp;page;
</span><del>-    _wkView = wkView;
</del><ins>+    _view = view;
+    _viewImpl = &amp;viewImpl;
</ins><span class="cx">     _type = kWKImmediateActionNone;
</span><span class="cx">     _immediateActionRecognizer = immediateActionRecognizer;
</span><span class="cx">     _hasActiveImmediateAction = NO;
</span><span class="lines">@@ -80,10 +81,11 @@
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)willDestroyView:(WKView *)view
</del><ins>+- (void)willDestroyView:(NSView *)view
</ins><span class="cx"> {
</span><span class="cx">     _page = nullptr;
</span><del>-    _wkView = nil;
</del><ins>+    _view = nil;
+    _viewImpl = nullptr;
</ins><span class="cx">     _hitTestResultData = WebHitTestResultData();
</span><span class="cx">     _contentPreventsDefault = NO;
</span><span class="cx">     
</span><span class="lines">@@ -168,9 +170,9 @@
</span><span class="cx">     if (immediateActionRecognizer != _immediateActionRecognizer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    [_wkView _prepareForImmediateActionAnimation];
</del><ins>+    _viewImpl-&gt;prepareForImmediateActionAnimation();
</ins><span class="cx"> 
</span><del>-    [_wkView _dismissContentRelativeChildWindows];
</del><ins>+    _viewImpl-&gt;dismissContentRelativeChildWindowsWithAnimation(true);
</ins><span class="cx"> 
</span><span class="cx">     _page-&gt;setMaintainsInactiveSelection(true);
</span><span class="cx"> 
</span><span class="lines">@@ -231,7 +233,7 @@
</span><span class="cx"> 
</span><span class="cx">     _page-&gt;immediateActionDidCancel();
</span><span class="cx"> 
</span><del>-    [_wkView _cancelImmediateActionAnimation];
</del><ins>+    _viewImpl-&gt;cancelImmediateActionAnimation();
</ins><span class="cx"> 
</span><span class="cx">     _page-&gt;setTextIndicatorAnimationProgress(0);
</span><span class="cx">     [self _clearImmediateActionState];
</span><span class="lines">@@ -245,7 +247,7 @@
</span><span class="cx"> 
</span><span class="cx">     _page-&gt;immediateActionDidComplete();
</span><span class="cx"> 
</span><del>-    [_wkView _completeImmediateActionAnimation];
</del><ins>+    _viewImpl-&gt;completeImmediateActionAnimation();
</ins><span class="cx"> 
</span><span class="cx">     _page-&gt;setTextIndicatorAnimationProgress(1);
</span><span class="cx"> }
</span><span class="lines">@@ -345,12 +347,12 @@
</span><span class="cx"> 
</span><span class="cx"> - (NSView *)menuItem:(NSMenuItem *)menuItem viewAtScreenPoint:(NSPoint)screenPoint
</span><span class="cx"> {
</span><del>-    return _wkView;
</del><ins>+    return _view;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (id&lt;QLPreviewItem&gt;)menuItem:(NSMenuItem *)menuItem previewItemAtPoint:(NSPoint)point
</span><span class="cx"> {
</span><del>-    if (!_wkView)
</del><ins>+    if (!_view)
</ins><span class="cx">         return nil;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;API::HitTestResult&gt; hitTestResult = [self _webHitTestResult];
</span><span class="lines">@@ -369,20 +371,20 @@
</span><span class="cx"> 
</span><span class="cx"> - (NSRect)menuItem:(NSMenuItem *)menuItem itemFrameForPoint:(NSPoint)point
</span><span class="cx"> {
</span><del>-    if (!_wkView)
</del><ins>+    if (!_view)
</ins><span class="cx">         return NSZeroRect;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;API::HitTestResult&gt; hitTestResult = [self _webHitTestResult];
</span><del>-    return [_wkView convertRect:hitTestResult-&gt;elementBoundingBox() toView:nil];
</del><ins>+    return [_view convertRect:hitTestResult-&gt;elementBoundingBox() toView:nil];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSSize)menuItem:(NSMenuItem *)menuItem maxSizeForPoint:(NSPoint)point
</span><span class="cx"> {
</span><del>-    if (!_wkView)
</del><ins>+    if (!_view)
</ins><span class="cx">         return NSZeroSize;
</span><span class="cx"> 
</span><del>-    NSSize screenSize = _wkView.window.screen.frame.size;
-    FloatRect largestRect = largestRectWithAspectRatioInsideRect(screenSize.width / screenSize.height, _wkView.bounds);
</del><ins>+    NSSize screenSize = _view.window.screen.frame.size;
+    FloatRect largestRect = largestRectWithAspectRatioInsideRect(screenSize.width / screenSize.height, _view.bounds);
</ins><span class="cx">     return NSMakeSize(largestRect.width() * 0.75, largestRect.height() * 0.75);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -403,7 +405,7 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;WebPageProxy&gt; page = _page;
</span><span class="cx">     PageOverlay::PageOverlayID overlayID = _hitTestResultData.detectedDataOriginatingPageOverlay;
</span><del>-    _currentActionContext = [actionContext contextForView:_wkView altMode:YES interactionStartedHandler:^() {
</del><ins>+    _currentActionContext = [actionContext contextForView:_view altMode:YES interactionStartedHandler:^() {
</ins><span class="cx">         page-&gt;send(Messages::WebPage::DataDetectorsDidPresentUI(overlayID));
</span><span class="cx">     } interactionChangedHandler:^() {
</span><span class="cx">         if (_hitTestResultData.detectedDataTextIndicator)
</span><span class="lines">@@ -414,7 +416,7 @@
</span><span class="cx">         [self _clearImmediateActionState];
</span><span class="cx">     }];
</span><span class="cx"> 
</span><del>-    [_currentActionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResultData.detectedDataBoundingBox toView:nil]]];
</del><ins>+    [_currentActionContext setHighlightFrame:[_view.window convertRectToScreen:[_view convertRect:_hitTestResultData.detectedDataBoundingBox toView:nil]]];
</ins><span class="cx"> 
</span><span class="cx">     NSArray *menuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForResult:[_currentActionContext mainResult] actionContext:_currentActionContext.get()];
</span><span class="cx"> 
</span><span class="lines">@@ -435,7 +437,7 @@
</span><span class="cx">     [actionContext setImmediate:YES];
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;WebPageProxy&gt; page = _page;
</span><del>-    _currentActionContext = [actionContext contextForView:_wkView altMode:YES interactionStartedHandler:^() {
</del><ins>+    _currentActionContext = [actionContext contextForView:_view altMode:YES interactionStartedHandler:^() {
</ins><span class="cx">     } interactionChangedHandler:^() {
</span><span class="cx">         if (_hitTestResultData.linkTextIndicator)
</span><span class="cx">             page-&gt;setTextIndicator(_hitTestResultData.linkTextIndicator-&gt;data());
</span><span class="lines">@@ -443,7 +445,7 @@
</span><span class="cx">         [self _clearImmediateActionState];
</span><span class="cx">     }];
</span><span class="cx"> 
</span><del>-    [_currentActionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResultData.elementBoundingBox toView:nil]]];
</del><ins>+    [_currentActionContext setHighlightFrame:[_view.window convertRectToScreen:[_view convertRect:_hitTestResultData.elementBoundingBox toView:nil]]];
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;API::HitTestResult&gt; hitTestResult = [self _webHitTestResult];
</span><span class="cx">     NSArray *menuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForTargetURL:hitTestResult-&gt;absoluteLinkURL() actionContext:_currentActionContext.get()];
</span><span class="lines">@@ -465,10 +467,10 @@
</span><span class="cx">     if (!dictionaryPopupInfo.attributedString)
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><del>-    [_wkView _prepareForDictionaryLookup];
</del><ins>+    _viewImpl-&gt;prepareForDictionaryLookup();
</ins><span class="cx"> 
</span><del>-    return DictionaryLookup::animationControllerForPopup(dictionaryPopupInfo, _wkView, [self](TextIndicator&amp; textIndicator) {
-        [_wkView _setTextIndicator:textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</del><ins>+    return DictionaryLookup::animationControllerForPopup(dictionaryPopupInfo, _view, [self](TextIndicator&amp; textIndicator) {
+        _viewImpl-&gt;setTextIndicator(textIndicator, TextIndicatorWindowLifetime::Permanent);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>