<!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>[191637] 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/191637">191637</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-10-27 13:55:36 -0700 (Tue, 27 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 _superAccessibilityAttributeValue:]):
(-[WKView accessibilityFocusedUIElement]):
(-[WKView accessibilityIsIgnored]):
(-[WKView accessibilityHitTest:]):
(-[WKView accessibilityAttributeValue:]):
(-[WKView _processDidExit]):
(-[WKView _pageClosed]):
(-[WKView _updateRemoteAccessibilityRegistration:]): Deleted.
(-[WKView enableAccessibilityIfNecessary]): Deleted.
(-[WKView _toolTipChangedFrom:to:]): Deleted.
(-[WKView _setAccessibilityWebProcessToken:]): Deleted.
(-[WKView _hasFullScreenWindowController]): Deleted.
(-[WKView _fullScreenWindowController]): Deleted.
(-[WKView _closeFullScreenWindowController]): Deleted.
(-[WKView _setSuppressVisibilityUpdates:]): Deleted.
(-[WKView _suppressVisibilityUpdates]): Deleted.
(-[WKView _primaryTrackingArea]): Deleted.
(-[WKView _setPrimaryTrackingArea:]): Deleted.
(-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::accessibilityIsIgnored):
(WebKit::WebViewImpl::primaryTrackingArea):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::trackingAreaOptions):
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::setAccessibilityWebProcessToken):
(WebKit::WebViewImpl::updateRemoteAccessibilityRegistration):
(WebKit::WebViewImpl::accessibilityFocusedUIElement):
(WebKit::WebViewImpl::accessibilityHitTest):
(WebKit::WebViewImpl::enableAccessibilityIfNecessary):
(WebKit::WebViewImpl::accessibilityAttributeValue):
(WebKit::WebViewImpl::setPrimaryTrackingArea):
(WebKit::WebViewImpl::toolTipChanged):
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::toolTipChanged):
(WebKit::PageClientImpl::accessibilityWebProcessTokenReceived):
(WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
(WebKit::PageClientImpl::closeFullScreenManager):
(WebKit::PageClientImpl::isFullScreen):
(WebKit::PageClientImpl::enterFullScreen):
(WebKit::PageClientImpl::exitFullScreen):
(WebKit::PageClientImpl::beganEnterFullScreen):
(WebKit::PageClientImpl::beganExitFullScreen):
Move accessibility code, and fold in some internal-only methods.</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="#trunkSourceWebKit2UIProcessmacPageClientImplmm">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191636 => 191637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-27 20:41:34 UTC (rev 191636)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-27 20:55:36 UTC (rev 191637)
</span><span class="lines">@@ -6,6 +6,60 @@
</span><span class="cx">         Reviewed by Anders Carlsson.
</span><span class="cx"> 
</span><span class="cx">         * UIProcess/API/mac/WKView.mm:
</span><ins>+        (-[WKView _superAccessibilityAttributeValue:]):
+        (-[WKView accessibilityFocusedUIElement]):
+        (-[WKView accessibilityIsIgnored]):
+        (-[WKView accessibilityHitTest:]):
+        (-[WKView accessibilityAttributeValue:]):
+        (-[WKView _processDidExit]):
+        (-[WKView _pageClosed]):
+        (-[WKView _updateRemoteAccessibilityRegistration:]): Deleted.
+        (-[WKView enableAccessibilityIfNecessary]): Deleted.
+        (-[WKView _toolTipChangedFrom:to:]): Deleted.
+        (-[WKView _setAccessibilityWebProcessToken:]): Deleted.
+        (-[WKView _hasFullScreenWindowController]): Deleted.
+        (-[WKView _fullScreenWindowController]): Deleted.
+        (-[WKView _closeFullScreenWindowController]): Deleted.
+        (-[WKView _setSuppressVisibilityUpdates:]): Deleted.
+        (-[WKView _suppressVisibilityUpdates]): Deleted.
+        (-[WKView _primaryTrackingArea]): Deleted.
+        (-[WKView _setPrimaryTrackingArea:]): Deleted.
+        (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
+        * UIProcess/API/mac/WKViewInternal.h:
+        * UIProcess/Cocoa/WebViewImpl.h:
+        (WebKit::WebViewImpl::accessibilityIsIgnored):
+        (WebKit::WebViewImpl::primaryTrackingArea):
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::trackingAreaOptions):
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit::WebViewImpl::setAccessibilityWebProcessToken):
+        (WebKit::WebViewImpl::updateRemoteAccessibilityRegistration):
+        (WebKit::WebViewImpl::accessibilityFocusedUIElement):
+        (WebKit::WebViewImpl::accessibilityHitTest):
+        (WebKit::WebViewImpl::enableAccessibilityIfNecessary):
+        (WebKit::WebViewImpl::accessibilityAttributeValue):
+        (WebKit::WebViewImpl::setPrimaryTrackingArea):
+        (WebKit::WebViewImpl::toolTipChanged):
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::toolTipChanged):
+        (WebKit::PageClientImpl::accessibilityWebProcessTokenReceived):
+        (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
+        (WebKit::PageClientImpl::closeFullScreenManager):
+        (WebKit::PageClientImpl::isFullScreen):
+        (WebKit::PageClientImpl::enterFullScreen):
+        (WebKit::PageClientImpl::exitFullScreen):
+        (WebKit::PageClientImpl::beganEnterFullScreen):
+        (WebKit::PageClientImpl::beganExitFullScreen):
+        Move accessibility code, and fold in some internal-only methods.
+
+2015-10-27  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:
</ins><span class="cx">         (-[WKView scrollWheel:]):
</span><span class="cx">         (-[WKView swipeWithEvent:]):
</span><span class="cx">         (-[WKView _superSwipeWithEvent:]):
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (191636 => 191637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-10-27 20:41:34 UTC (rev 191636)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-10-27 20:55:36 UTC (rev 191637)
</span><span class="lines">@@ -162,10 +162,6 @@
</span><span class="cx">     RetainPtr&lt;_WKRemoteObjectRegistry&gt; _remoteObjectRegistry;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    RetainPtr&lt;NSTrackingArea&gt; _primaryTrackingArea;
-
-    RetainPtr&lt;id&gt; _remoteAccessibilityChild;
-
</del><span class="cx">     // For asynchronous validation.
</span><span class="cx">     ValidationMap _validationMap;
</span><span class="cx"> 
</span><span class="lines">@@ -2047,6 +2043,14 @@
</span><span class="cx">     [super removeTrackingRect:tag];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (id)_superAccessibilityAttributeValue:(NSString *)attribute
+{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+    return [super accessibilityAttributeValue:attribute];
+#pragma clang diagnostic pop
+}
+
</ins><span class="cx"> - (NSArray *)validAttributesForMarkedText
</span><span class="cx"> {
</span><span class="cx">     static NSArray *validAttributes;
</span><span class="lines">@@ -2169,74 +2173,24 @@
</span><span class="cx">     _data-&gt;_page-&gt;viewStateDidChange(ViewState::IsVisible);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_updateRemoteAccessibilityRegistration:(BOOL)registerProcess
-{
-    // When the tree is connected/disconnected, the remote accessibility registration
-    // needs to be updated with the pid of the remote process. If the process is going
-    // away, that information is not present in WebProcess
-    pid_t pid = 0;
-    if (registerProcess)
-        pid = _data-&gt;_page-&gt;process().processIdentifier();
-    else if (!registerProcess) {
-        pid = WKAXRemoteProcessIdentifier(_data-&gt;_remoteAccessibilityChild.get());
-        _data-&gt;_remoteAccessibilityChild = nil;
-    }
-    if (pid)
-        WKAXRegisterRemoteProcess(registerProcess, pid); 
-}
-
-- (void)enableAccessibilityIfNecessary
-{
-    if (WebCore::AXObjectCache::accessibilityEnabled())
-        return;
-
-    // After enabling accessibility update the window frame on the web process so that the
-    // correct accessibility position is transmitted (when AX is off, that position is not calculated).
-    WebCore::AXObjectCache::enableAccessibility();
-    _data-&gt;_impl-&gt;updateWindowAndViewFrames();
-}
-
</del><span class="cx"> - (id)accessibilityFocusedUIElement
</span><span class="cx"> {
</span><del>-    [self enableAccessibilityIfNecessary];
-    return _data-&gt;_remoteAccessibilityChild.get();
</del><ins>+    return _data-&gt;_impl-&gt;accessibilityFocusedUIElement();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)accessibilityIsIgnored
</span><span class="cx"> {
</span><del>-    return NO;
</del><ins>+    return _data-&gt;_impl-&gt;accessibilityIsIgnored();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (id)accessibilityHitTest:(NSPoint)point
</span><span class="cx"> {
</span><del>-    [self enableAccessibilityIfNecessary];
-    return _data-&gt;_remoteAccessibilityChild.get();
</del><ins>+    return _data-&gt;_impl-&gt;accessibilityHitTest(NSPointToCGPoint(point));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (id)accessibilityAttributeValue:(NSString*)attribute
</del><ins>+- (id)accessibilityAttributeValue:(NSString *)attribute
</ins><span class="cx"> {
</span><del>-    [self enableAccessibilityIfNecessary];
-
-    if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
-
-        id child = nil;
-        if (_data-&gt;_remoteAccessibilityChild)
-            child = _data-&gt;_remoteAccessibilityChild.get();
-        
-        if (!child)
-            return nil;
-        return [NSArray arrayWithObject:child];
-    }
-    if ([attribute isEqualToString:NSAccessibilityRoleAttribute])
-        return NSAccessibilityGroupRole;
-    if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute])
-        return NSAccessibilityRoleDescription(NSAccessibilityGroupRole, nil);
-    if ([attribute isEqualToString:NSAccessibilityParentAttribute])
-        return NSAccessibilityUnignoredAncestor([self superview]);
-    if ([attribute isEqualToString:NSAccessibilityEnabledAttribute])
-        return [NSNumber numberWithBool:YES];
-    
-    return [super accessibilityAttributeValue:attribute];
</del><ins>+    return _data-&gt;_impl-&gt;accessibilityAttributeValue(attribute);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSView *)hitTest:(NSPoint)point
</span><span class="lines">@@ -2278,14 +2232,14 @@
</span><span class="cx">     if (_data-&gt;_impl-&gt;layerHostingView())
</span><span class="cx">         _data-&gt;_impl-&gt;setAcceleratedCompositingRootLayer(nil);
</span><span class="cx"> 
</span><del>-    [self _updateRemoteAccessibilityRegistration:NO];
</del><ins>+    _data-&gt;_impl-&gt;updateRemoteAccessibilityRegistration(false);
</ins><span class="cx"> 
</span><span class="cx">     _data-&gt;_impl-&gt;resetGestureController();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_pageClosed
</span><span class="cx"> {
</span><del>-    [self _updateRemoteAccessibilityRegistration:NO];
</del><ins>+    _data-&gt;_impl-&gt;updateRemoteAccessibilityRegistration(false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_didRelaunchProcess
</span><span class="lines">@@ -2378,17 +2332,6 @@
</span><span class="cx">     return _data-&gt;_impl-&gt;stringForToolTip(tag);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_toolTipChangedFrom:(NSString *)oldToolTip to:(NSString *)newToolTip
-{
-    _data-&gt;_impl-&gt;toolTipChanged(oldToolTip, newToolTip);
-}
-
-- (void)_setAccessibilityWebProcessToken:(NSData *)data
-{
-    _data-&gt;_remoteAccessibilityChild = WKAXRemoteElementForToken(data);
-    [self _updateRemoteAccessibilityRegistration:YES];
-}
-
</del><span class="cx"> - (void)_dragImageForView:(NSView *)view withImage:(NSImage *)image at:(NSPoint)clientPoint linkDrag:(BOOL)linkDrag
</span><span class="cx"> {
</span><span class="cx">     // The call below could release this WKView.
</span><span class="lines">@@ -2546,23 +2489,6 @@
</span><span class="cx">     return [NSArray arrayWithObject:[path lastPathComponent]];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(FULLSCREEN_API)
-- (BOOL)_hasFullScreenWindowController
-{
-    return _data-&gt;_impl-&gt;hasFullScreenWindowController();
-}
-
-- (WKFullScreenWindowController *)_fullScreenWindowController
-{
-    return _data-&gt;_impl-&gt;fullScreenWindowController();
-}
-
-- (void)_closeFullScreenWindowController
-{
-    _data-&gt;_impl-&gt;closeFullScreenWindowController();
-}
-#endif
-
</del><span class="cx"> - (bool)_executeSavedCommandBySelector:(SEL)selector
</span><span class="cx"> {
</span><span class="cx">     LOG(TextInput, &quot;Executing previously saved command %s&quot;, sel_getName(selector));
</span><span class="lines">@@ -2588,28 +2514,6 @@
</span><span class="cx">     _data-&gt;_page-&gt;handleAlternativeTextUIResult(text);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setSuppressVisibilityUpdates:(BOOL)suppressVisibilityUpdates
-{
-    _data-&gt;_page-&gt;setSuppressVisibilityUpdates(suppressVisibilityUpdates);
-}
-
-- (BOOL)_suppressVisibilityUpdates
-{
-    return _data-&gt;_page-&gt;suppressVisibilityUpdates();
-}
-
-- (NSTrackingArea *)_primaryTrackingArea
-{
-    return _data-&gt;_primaryTrackingArea.get();
-}
-
-- (void)_setPrimaryTrackingArea:(NSTrackingArea *)trackingArea
-{
-    [self removeTrackingArea:_data-&gt;_primaryTrackingArea.get()];
-    _data-&gt;_primaryTrackingArea = trackingArea;
-    [self addTrackingArea:trackingArea];
-}
-
</del><span class="cx"> - (instancetype)initWithFrame:(NSRect)frame processPool:(WebProcessPool&amp;)processPool configuration:(Ref&lt;API::PageConfiguration&gt;&amp;&amp;)configuration webView:(WKWebView *)webView
</span><span class="cx"> {
</span><span class="cx">     self = [super initWithFrame:frame];
</span><span class="lines">@@ -2620,16 +2524,7 @@
</span><span class="cx"> 
</span><span class="cx">     InitializeWebKit2();
</span><span class="cx"> 
</span><del>-    // Legacy style scrollbars have design details that rely on tracking the mouse all the time.
-    NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingCursorUpdate;
-    if (WKRecommendedScrollerStyle() == NSScrollerStyleLegacy)
-        options |= NSTrackingActiveAlways;
-    else
-        options |= NSTrackingActiveInKeyWindow;
-
</del><span class="cx">     _data = [[WKViewData alloc] init];
</span><del>-    _data-&gt;_primaryTrackingArea = adoptNS([[NSTrackingArea alloc] initWithRect:frame options:options owner:self userInfo:nil]);
-    [self addTrackingArea:_data-&gt;_primaryTrackingArea.get()];
</del><span class="cx"> 
</span><span class="cx">     _data-&gt;_pageClient = std::make_unique&lt;PageClientImpl&gt;(self, webView);
</span><span class="cx">     _data-&gt;_page = processPool.createWebPage(*_data-&gt;_pageClient, WTF::move(configuration));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (191636 => 191637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2015-10-27 20:41:34 UTC (rev 191636)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2015-10-27 20:55:36 UTC (rev 191637)
</span><span class="lines">@@ -27,11 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;WKViewPrivate.h&quot;
</span><span class="cx"> 
</span><del>-#import &quot;APIObject.h&quot;
-#import &quot;PluginComplexTextInputState.h&quot;
-#import &quot;SameDocumentNavigationType.h&quot;
-#import &quot;WebFindOptions.h&quot;
-#import &quot;WebHitTestResultData.h&quot;
</del><span class="cx"> #import &lt;wtf/Forward.h&gt;
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/Vector.h&gt;
</span><span class="lines">@@ -39,7 +34,6 @@
</span><span class="cx"> @class _WKRemoteObjectRegistry;
</span><span class="cx"> 
</span><span class="cx"> namespace API {
</span><del>-class Object;
</del><span class="cx"> class PageConfiguration;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -50,22 +44,14 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class Image;
</span><span class="cx"> class SharedBuffer;
</span><del>-class TextIndicator;
-enum class TextIndicatorWindowLifetime : uint8_t;
-enum class TextIndicatorWindowDismissalAnimation : uint8_t;
-struct KeypressCommand;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> class DrawingAreaProxy;
</span><del>-class LayerTreeContext;
-class ViewSnapshot;
</del><span class="cx"> class WebProcessPool;
</span><span class="cx"> struct ColorSpaceData;
</span><del>-struct EditorState;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-@class WKFullScreenWindowController;
</del><span class="cx"> @class WKWebView;
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> @class _WKThumbnailView;
</span><span class="lines">@@ -80,15 +66,12 @@
</span><span class="cx"> - (void)_processDidExit;
</span><span class="cx"> - (void)_pageClosed;
</span><span class="cx"> - (void)_didRelaunchProcess;
</span><del>-- (void)_toolTipChangedFrom:(NSString *)oldToolTip to:(NSString *)newToolTip;
</del><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><span class="cx"> - (NSRect)_convertToDeviceSpace:(NSRect)rect;
</span><span class="cx"> - (NSRect)_convertToUserSpace:(NSRect)rect;
</span><span class="cx"> 
</span><del>-- (void)_setAccessibilityWebProcessToken:(NSData *)data;
-
</del><span class="cx"> - (void)_dragImageForView:(NSView *)view withImage:(NSImage *)image at:(NSPoint)clientPoint linkDrag:(BOOL)linkDrag;
</span><span class="cx"> - (void)_setPromisedDataForImage:(WebCore::Image *)image withFileName:(NSString *)filename withExtension:(NSString *)extension withTitle:(NSString *)title withURL:(NSString *)url withVisibleURL:(NSString *)visibleUrl withArchive:(WebCore::SharedBuffer*) archiveBuffer forPasteboard:(NSString *)pasteboardName;
</span><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="lines">@@ -100,26 +83,16 @@
</span><span class="cx"> - (NSInteger)spellCheckerDocumentTag;
</span><span class="cx"> - (void)handleAcceptedAlternativeText:(NSString*)text;
</span><span class="cx"> 
</span><del>-- (void)_setSuppressVisibilityUpdates:(BOOL)suppressVisibilityUpdates;
-- (BOOL)_suppressVisibilityUpdates;
-
</del><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> @property (nonatomic, setter=_setThumbnailView:) _WKThumbnailView *_thumbnailView;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> - (void)_addFontPanelObserver;
</span><del>-// FullScreen
</del><span class="cx"> 
</span><del>-@property (readonly) BOOL _hasFullScreenWindowController;
-@property (readonly) WKFullScreenWindowController *_fullScreenWindowController;
-- (void)_closeFullScreenWindowController;
-
</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><del>-@property (nonatomic, retain, setter=_setPrimaryTrackingArea:) NSTrackingArea *_primaryTrackingArea;
-
</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 (191636 => 191637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2015-10-27 20:41:34 UTC (rev 191636)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2015-10-27 20:55:36 UTC (rev 191637)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx"> - (void)_superSwipeWithEvent:(NSEvent *)event;
</span><span class="cx"> - (void)_superMagnifyWithEvent:(NSEvent *)event;
</span><span class="cx"> - (void)_superSmartMagnifyWithEvent:(NSEvent *)event;
</span><ins>+- (id)_superAccessibilityAttributeValue:(NSString *)attribute;
</ins><span class="cx"> 
</span><span class="cx"> // This is a hack; these things live can live on a category (e.g. WKView (Private)) but WKView itself conforms to this protocol.
</span><span class="cx"> // They're not actually optional.
</span><span class="lines">@@ -225,15 +226,25 @@
</span><span class="cx">     void setIgnoresMouseDraggedEvents(bool);
</span><span class="cx">     bool ignoresMouseDraggedEvents() const { return m_ignoresMouseDraggedEvents; }
</span><span class="cx"> 
</span><ins>+    void setAccessibilityWebProcessToken(NSData *);
</ins><span class="cx">     void accessibilityRegisterUIProcessTokens();
</span><ins>+    void updateRemoteAccessibilityRegistration(bool registerProcess);
+    id accessibilityFocusedUIElement();
+    bool accessibilityIsIgnored() const { return false; }
+    id accessibilityHitTest(CGPoint);
+    void enableAccessibilityIfNecessary();
+    id accessibilityAttributeValue(NSString *);
</ins><span class="cx"> 
</span><ins>+    NSTrackingArea *primaryTrackingArea() const { return m_primaryTrackingArea.get(); }
+    void setPrimaryTrackingArea(NSTrackingArea *);
+
</ins><span class="cx">     NSTrackingRectTag addTrackingRect(CGRect, id owner, void* userData, bool assumeInside);
</span><span class="cx">     NSTrackingRectTag addTrackingRectWithTrackingNum(CGRect, id owner, void* userData, bool assumeInside, int tag);
</span><span class="cx">     void addTrackingRectsWithTrackingNums(CGRect*, id owner, void** userDataList, bool assumeInside, NSTrackingRectTag *trackingNums, int count);
</span><span class="cx">     void removeTrackingRect(NSTrackingRectTag);
</span><span class="cx">     void removeTrackingRects(NSTrackingRectTag *, int count);
</span><span class="cx">     NSString *stringForToolTip(NSToolTipTag tag);
</span><del>-    void toolTipChanged(NSString *oldToolTip, NSString *newToolTip);
</del><ins>+    void toolTipChanged(const String&amp; oldToolTip, const String&amp; newToolTip);
</ins><span class="cx"> 
</span><span class="cx">     void setAcceleratedCompositingRootLayer(CALayer *);
</span><span class="cx">     CALayer *acceleratedCompositingRootLayer() const { return m_rootLayer.get(); }
</span><span class="lines">@@ -368,6 +379,8 @@
</span><span class="cx">     bool m_allowsLinkPreview { true };
</span><span class="cx">     bool m_didRegisterForLookupPopoverCloseNotifications { false };
</span><span class="cx"> 
</span><ins>+    RetainPtr&lt;NSTrackingArea&gt; m_primaryTrackingArea;
+
</ins><span class="cx">     NSToolTipTag m_lastToolTipTag { 0 };
</span><span class="cx">     id m_trackingRectOwner { nil };
</span><span class="cx">     void* m_trackingRectUserData { nullptr };
</span><span class="lines">@@ -382,6 +395,8 @@
</span><span class="cx">     std::unique_ptr&lt;ViewGestureController&gt; m_gestureController;
</span><span class="cx">     bool m_allowsBackForwardNavigationGestures { false };
</span><span class="cx">     bool m_allowsMagnification { false };
</span><ins>+
+    RetainPtr&lt;id&gt; m_remoteAccessibilityChild;
</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 (191636 => 191637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2015-10-27 20:41:34 UTC (rev 191636)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2015-10-27 20:55:36 UTC (rev 191637)
</span><span class="lines">@@ -321,6 +321,17 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+static NSTrackingAreaOptions trackingAreaOptions()
+{
+    // Legacy style scrollbars have design details that rely on tracking the mouse all the time.
+    NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingCursorUpdate;
+    if (WKRecommendedScrollerStyle() == NSScrollerStyleLegacy)
+        options |= NSTrackingActiveAlways;
+    else
+        options |= NSTrackingActiveInKeyWindow;
+    return options;
+}
+
</ins><span class="cx"> WebViewImpl::WebViewImpl(NSView &lt;WebViewImplDelegate&gt; *view, WebPageProxy&amp; page, PageClient&amp; pageClient)
</span><span class="cx">     : m_view(view)
</span><span class="cx">     , m_page(page)
</span><span class="lines">@@ -331,7 +342,10 @@
</span><span class="cx">     , m_layoutStrategy([WKViewLayoutStrategy layoutStrategyWithPage:m_page view:m_view viewImpl:*this mode:kWKLayoutModeViewSize])
</span><span class="cx">     , m_undoTarget(adoptNS([[WKEditorUndoTargetObjC alloc] init]))
</span><span class="cx">     , m_windowVisibilityObserver(adoptNS([[WKWindowVisibilityObserver alloc] initWithView:view impl:*this]))
</span><ins>+    , m_primaryTrackingArea(adoptNS([[NSTrackingArea alloc] initWithRect:m_view.frame options:trackingAreaOptions() owner:m_view userInfo:nil]))
</ins><span class="cx"> {
</span><ins>+    [m_view addTrackingArea:m_primaryTrackingArea.get()];
+
</ins><span class="cx">     m_page.setIntrinsicDeviceScaleFactor(intrinsicDeviceScaleFactor());
</span><span class="cx"> 
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
</span><span class="lines">@@ -1464,6 +1478,28 @@
</span><span class="cx">     m_ignoresMouseDraggedEvents = ignoresMouseDraggedEvents;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewImpl::setAccessibilityWebProcessToken(NSData *data)
+{
+    m_remoteAccessibilityChild = WKAXRemoteElementForToken(data);
+    updateRemoteAccessibilityRegistration(true);
+}
+
+void WebViewImpl::updateRemoteAccessibilityRegistration(bool registerProcess)
+{
+    // When the tree is connected/disconnected, the remote accessibility registration
+    // needs to be updated with the pid of the remote process. If the process is going
+    // away, that information is not present in WebProcess
+    pid_t pid = 0;
+    if (registerProcess)
+        pid = m_page.process().processIdentifier();
+    else if (!registerProcess) {
+        pid = WKAXRemoteProcessIdentifier(m_remoteAccessibilityChild.get());
+        m_remoteAccessibilityChild = nil;
+    }
+    if (pid)
+        WKAXRegisterRemoteProcess(registerProcess, pid);
+}
+
</ins><span class="cx"> void WebViewImpl::accessibilityRegisterUIProcessTokens()
</span><span class="cx"> {
</span><span class="cx">     // Initialize remote accessibility when the window connection has been established.
</span><span class="lines">@@ -1474,6 +1510,61 @@
</span><span class="cx">     m_page.registerUIProcessAccessibilityTokens(elementToken, windowToken);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+id WebViewImpl::accessibilityFocusedUIElement()
+{
+    enableAccessibilityIfNecessary();
+    return m_remoteAccessibilityChild.get();
+}
+
+id WebViewImpl::accessibilityHitTest(CGPoint)
+{
+    return accessibilityFocusedUIElement();
+}
+
+void WebViewImpl::enableAccessibilityIfNecessary()
+{
+    if (WebCore::AXObjectCache::accessibilityEnabled())
+        return;
+
+    // After enabling accessibility update the window frame on the web process so that the
+    // correct accessibility position is transmitted (when AX is off, that position is not calculated).
+    WebCore::AXObjectCache::enableAccessibility();
+    updateWindowAndViewFrames();
+}
+
+id WebViewImpl::accessibilityAttributeValue(NSString *attribute)
+{
+    enableAccessibilityIfNecessary();
+
+    if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
+
+        id child = nil;
+        if (m_remoteAccessibilityChild)
+            child = m_remoteAccessibilityChild.get();
+
+            if (!child)
+                return nil;
+        return [NSArray arrayWithObject:child];
+    }
+    if ([attribute isEqualToString:NSAccessibilityRoleAttribute])
+        return NSAccessibilityGroupRole;
+    if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute])
+        return NSAccessibilityRoleDescription(NSAccessibilityGroupRole, nil);
+        if ([attribute isEqualToString:NSAccessibilityParentAttribute])
+            return NSAccessibilityUnignoredAncestor([m_view superview]);
+            if ([attribute isEqualToString:NSAccessibilityEnabledAttribute])
+                return @YES;
+    
+    return [m_view _superAccessibilityAttributeValue:attribute];
+}
+
+void WebViewImpl::setPrimaryTrackingArea(NSTrackingArea *trackingArea)
+{
+    [m_view removeTrackingArea:m_primaryTrackingArea.get()];
+    m_primaryTrackingArea = trackingArea;
+    [m_view addTrackingArea:trackingArea];
+}
+
</ins><span class="cx"> // Any non-zero value will do, but using something recognizable might help us debug some day.
</span><span class="cx"> #define TRACKING_RECT_TAG 0xBADFACE
</span><span class="cx"> 
</span><span class="lines">@@ -1571,12 +1662,12 @@
</span><span class="cx">     return nsStringFromWebCoreString(m_page.toolTip());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebViewImpl::toolTipChanged(NSString *oldToolTip, NSString *newToolTip)
</del><ins>+void WebViewImpl::toolTipChanged(const String&amp; oldToolTip, const String&amp; newToolTip)
</ins><span class="cx"> {
</span><del>-    if (oldToolTip)
</del><ins>+    if (!oldToolTip.isNull())
</ins><span class="cx">         sendToolTipMouseExited();
</span><span class="cx">     
</span><del>-    if (newToolTip &amp;&amp; [newToolTip length] &gt; 0) {
</del><ins>+    if (!newToolTip.isEmpty()) {
</ins><span class="cx">         // See radar 3500217 for why we remove all tooltips rather than just the single one we created.
</span><span class="cx">         [m_view removeAllToolTips];
</span><span class="cx">         NSRect wideOpenRect = NSMakeRect(-100000, -100000, 200000, 200000);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (191636 => 191637)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-10-27 20:41:34 UTC (rev 191636)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-10-27 20:55:36 UTC (rev 191637)
</span><span class="lines">@@ -264,7 +264,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::toolTipChanged(const String&amp; oldToolTip, const String&amp; newToolTip)
</span><span class="cx"> {
</span><del>-    [m_wkView _toolTipChangedFrom:nsStringFromWebCoreString(oldToolTip) to:nsStringFromWebCoreString(newToolTip)];
</del><ins>+    m_impl-&gt;toolTipChanged(oldToolTip, newToolTip);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::didCommitLoadForMainFrame(const String&amp; mimeType, bool useCustomContentProvider)
</span><span class="lines">@@ -474,8 +474,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::accessibilityWebProcessTokenReceived(const IPC::DataReference&amp; data)
</span><span class="cx"> {
</span><del>-    NSData* remoteToken = [NSData dataWithBytes:data.data() length:data.size()];
-    [m_wkView _setAccessibilityWebProcessToken:remoteToken];
</del><ins>+    m_impl-&gt;setAccessibilityWebProcessToken([NSData dataWithBytes:data.data() length:data.size()]);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void PageClientImpl::enterAcceleratedCompositingMode(const LayerTreeContext&amp; layerTreeContext)
</span><span class="lines">@@ -601,7 +600,7 @@
</span><span class="cx">         options |= NSTrackingActiveInKeyWindow;
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;NSTrackingArea&gt; trackingArea = adoptNS([[NSTrackingArea alloc] initWithRect:[m_wkView frame] options:options owner:m_wkView userInfo:nil]);
</span><del>-    [m_wkView _setPrimaryTrackingArea:trackingArea.get()];
</del><ins>+    m_impl-&gt;setPrimaryTrackingArea(trackingArea.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::intrinsicContentSizeDidChange(const IntSize&amp; intrinsicContentSize)
</span><span class="lines">@@ -658,36 +657,36 @@
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::closeFullScreenManager()
</span><span class="cx"> {
</span><del>-    [m_wkView _closeFullScreenWindowController];
</del><ins>+    m_impl-&gt;closeFullScreenWindowController();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PageClientImpl::isFullScreen()
</span><span class="cx"> {
</span><del>-    if (!m_wkView._hasFullScreenWindowController)
</del><ins>+    if (!m_impl-&gt;hasFullScreenWindowController())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return m_wkView._fullScreenWindowController.isFullScreen;
</del><ins>+    return m_impl-&gt;fullScreenWindowController().isFullScreen;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::enterFullScreen()
</span><span class="cx"> {
</span><del>-    [m_wkView._fullScreenWindowController enterFullScreen:nil];
</del><ins>+    [m_impl-&gt;fullScreenWindowController() enterFullScreen:nil];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::exitFullScreen()
</span><span class="cx"> {
</span><del>-    [m_wkView._fullScreenWindowController exitFullScreen];
</del><ins>+    [m_impl-&gt;fullScreenWindowController() exitFullScreen];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::beganEnterFullScreen(const IntRect&amp; initialFrame, const IntRect&amp; finalFrame)
</span><span class="cx"> {
</span><del>-    [m_wkView._fullScreenWindowController beganEnterFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
</del><ins>+    [m_impl-&gt;fullScreenWindowController() beganEnterFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
</ins><span class="cx">     m_impl-&gt;updateSupportsArbitraryLayoutModes();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::beganExitFullScreen(const IntRect&amp; initialFrame, const IntRect&amp; finalFrame)
</span><span class="cx"> {
</span><del>-    [m_wkView._fullScreenWindowController beganExitFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
</del><ins>+    [m_impl-&gt;fullScreenWindowController() beganExitFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
</ins><span class="cx">     m_impl-&gt;updateSupportsArbitraryLayoutModes();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>