WKView being inside WKWebView leads to weird API issues
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Oct 2015 21:14:43 +0000 (21:14 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Oct 2015 21:14:43 +0000 (21:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150174

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView _superDoCommandBySelector:]):
(-[WKView _createDrawingAreaProxy]): Deleted.
(-[WKView _processDidExit]): Deleted.
(-[WKView _pageClosed]): Deleted.
(-[WKView _didRelaunchProcess]): Deleted.
(-[WKView _convertToDeviceSpace:]): Deleted.
(-[WKView _convertToUserSpace:]): Deleted.
(-[WKView _executeSavedCommandBySelector:]): Deleted.
(-[WKResponderChainSink initWithResponderChain:]): Deleted.
(-[WKResponderChainSink detach]): Deleted.
(-[WKResponderChainSink didReceiveUnhandledCommand]): Deleted.
(-[WKResponderChainSink noResponderFor:]): Deleted.
(-[WKResponderChainSink doCommandBySelector:]): Deleted.
(-[WKResponderChainSink tryToPerform:with:]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKResponderChainSink initWithResponderChain:]):
(-[WKResponderChainSink detach]):
(-[WKResponderChainSink didReceiveUnhandledCommand]):
(-[WKResponderChainSink noResponderFor:]):
(-[WKResponderChainSink doCommandBySelector:]):
(-[WKResponderChainSink tryToPerform:with:]):
(WebKit::WebViewImpl::createDrawingAreaProxy):
(WebKit::WebViewImpl::processDidExit):
(WebKit::WebViewImpl::pageClosed):
(WebKit::WebViewImpl::didRelaunchProcess):
(WebKit::WebViewImpl::executeSavedCommandBySelector):
(WebKit::WebViewImpl::resetGestureController): Deleted.
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createDrawingAreaProxy):
(WebKit::PageClientImpl::processDidExit):
(WebKit::PageClientImpl::pageClosed):
(WebKit::PageClientImpl::didRelaunchProcess):
(WebKit::PageClientImpl::convertToDeviceSpace):
(WebKit::PageClientImpl::convertToUserSpace):
(WebKit::PageClientImpl::executeSavedCommandBySelector):
Move most of the rest of WKViewInternal.h's methods to WebViewImpl.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191690 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h
Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit2/UIProcess/mac/PageClientImpl.mm

index 28177d42979c2074aed476fcf3dac52603b57012..75dd003887ddc42c20247dedf4b3c5466026b6b8 100644 (file)
@@ -1,3 +1,50 @@
+2015-10-28  Tim Horton  <timothy_horton@apple.com>
+
+        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 _superDoCommandBySelector:]):
+        (-[WKView _createDrawingAreaProxy]): Deleted.
+        (-[WKView _processDidExit]): Deleted.
+        (-[WKView _pageClosed]): Deleted.
+        (-[WKView _didRelaunchProcess]): Deleted.
+        (-[WKView _convertToDeviceSpace:]): Deleted.
+        (-[WKView _convertToUserSpace:]): Deleted.
+        (-[WKView _executeSavedCommandBySelector:]): Deleted.
+        (-[WKResponderChainSink initWithResponderChain:]): Deleted.
+        (-[WKResponderChainSink detach]): Deleted.
+        (-[WKResponderChainSink didReceiveUnhandledCommand]): Deleted.
+        (-[WKResponderChainSink noResponderFor:]): Deleted.
+        (-[WKResponderChainSink doCommandBySelector:]): Deleted.
+        (-[WKResponderChainSink tryToPerform:with:]): Deleted.
+        * UIProcess/API/mac/WKViewInternal.h:
+        * UIProcess/Cocoa/WebViewImpl.h:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (-[WKResponderChainSink initWithResponderChain:]):
+        (-[WKResponderChainSink detach]):
+        (-[WKResponderChainSink didReceiveUnhandledCommand]):
+        (-[WKResponderChainSink noResponderFor:]):
+        (-[WKResponderChainSink doCommandBySelector:]):
+        (-[WKResponderChainSink tryToPerform:with:]):
+        (WebKit::WebViewImpl::createDrawingAreaProxy):
+        (WebKit::WebViewImpl::processDidExit):
+        (WebKit::WebViewImpl::pageClosed):
+        (WebKit::WebViewImpl::didRelaunchProcess):
+        (WebKit::WebViewImpl::executeSavedCommandBySelector):
+        (WebKit::WebViewImpl::resetGestureController): Deleted.
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::createDrawingAreaProxy):
+        (WebKit::PageClientImpl::processDidExit):
+        (WebKit::PageClientImpl::pageClosed):
+        (WebKit::PageClientImpl::didRelaunchProcess):
+        (WebKit::PageClientImpl::convertToDeviceSpace):
+        (WebKit::PageClientImpl::convertToUserSpace):
+        (WebKit::PageClientImpl::executeSavedCommandBySelector):
+        Move most of the rest of WKViewInternal.h's methods to WebViewImpl.
+
 2015-10-28  Alex Christensen  <achristensen@webkit.org>
 
         Compile and link with CMake on Mac
index 56805863111a9ac536d2dd50524b5cdb8596b2b9..f69a1466bef09137f3ee2648f4419b4361694062 100644 (file)
 #import "NativeWebWheelEvent.h"
 #import "PageClientImpl.h"
 #import "PasteboardTypes.h"
-#import "RemoteLayerTreeDrawingAreaProxy.h"
 #import "RemoteObjectRegistry.h"
 #import "RemoteObjectRegistryMessages.h"
 #import "StringUtilities.h"
 #import "TextChecker.h"
 #import "TextCheckerState.h"
-#import "TiledCoreAnimationDrawingAreaProxy.h"
 #import "WKAPICast.h"
 #import "WKFullScreenWindowController.h"
 #import "WKLayoutMode.h"
@@ -187,15 +185,6 @@ struct WKViewInterpretKeyEventsParameters {
 @implementation WKViewData
 @end
 
-@interface WKResponderChainSink : NSResponder {
-    NSResponder *_lastResponderInChain;
-    bool _didReceiveUnhandledCommand;
-}
-- (id)initWithResponderChain:(NSResponder *)chain;
-- (void)detach;
-- (bool)didReceiveUnhandledCommand;
-@end
-
 @interface WKView () <WebViewImplDelegate>
 @end
 
@@ -2032,6 +2021,11 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
 #pragma clang diagnostic pop
 }
 
+- (void)_superDoCommandBySelector:(SEL)selector
+{
+    [super doCommandBySelector:selector];
+}
+
 - (NSArray *)validAttributesForMarkedText
 {
     static NSArray *validAttributes;
@@ -2193,36 +2187,6 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
     _data->_impl->quickLookWithEvent(event);
 }
 
-- (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy
-{
-    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"WebKit2UseRemoteLayerTreeDrawingArea"] boolValue])
-        return std::make_unique<RemoteLayerTreeDrawingAreaProxy>(*_data->_page);
-
-    return std::make_unique<TiledCoreAnimationDrawingAreaProxy>(*_data->_page);
-}
-
-- (void)_processDidExit
-{
-    _data->_impl->notifyInputContextAboutDiscardedComposition();
-
-    if (_data->_impl->layerHostingView())
-        _data->_impl->setAcceleratedCompositingRootLayer(nil);
-
-    _data->_impl->updateRemoteAccessibilityRegistration(false);
-
-    _data->_impl->resetGestureController();
-}
-
-- (void)_pageClosed
-{
-    _data->_impl->updateRemoteAccessibilityRegistration(false);
-}
-
-- (void)_didRelaunchProcess
-{
-    _data->_impl->accessibilityRegisterUIProcessTokens();
-}
-
 - (void)_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState
 {
     ValidationVector items = _data->_validationMap.take(commandName);
@@ -2260,16 +2224,6 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
     _data->_keyDownEventBeingResent = nullptr;
 }
 
-- (NSRect)_convertToDeviceSpace:(NSRect)rect
-{
-    return toDeviceSpace(rect, [self window]);
-}
-
-- (NSRect)_convertToUserSpace:(NSRect)rect
-{
-    return toUserSpace(rect, [self window]);
-}
-
 - (NSTrackingRectTag)addTrackingRect:(NSRect)rect owner:(id)owner userData:(void *)data assumeInside:(BOOL)assumeInside
 {
     return _data->_impl->addTrackingRect(NSRectToCGRect(rect), owner, data, assumeInside);
@@ -2323,17 +2277,6 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
     return _data->_impl->namesOfPromisedFilesDroppedAtDestination(dropDestination);
 }
 
-- (bool)_executeSavedCommandBySelector:(SEL)selector
-{
-    LOG(TextInput, "Executing previously saved command %s", sel_getName(selector));
-    // The sink does two things: 1) Tells us if the responder went unhandled, and
-    // 2) prevents any NSBeep; we don't ever want to beep here.
-    RetainPtr<WKResponderChainSink> sink = adoptNS([[WKResponderChainSink alloc] initWithResponderChain:self]);
-    [super doCommandBySelector:selector];
-    [sink detach];
-    return ![sink didReceiveUnhandledCommand];
-}
-
 - (instancetype)initWithFrame:(NSRect)frame processPool:(WebProcessPool&)processPool configuration:(Ref<API::PageConfiguration>&&)configuration webView:(WKWebView *)webView
 {
     self = [super initWithFrame:frame];
@@ -2954,60 +2897,4 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
 
 @end
 
-@implementation WKResponderChainSink
-
-- (id)initWithResponderChain:(NSResponder *)chain
-{
-    self = [super init];
-    if (!self)
-        return nil;
-    _lastResponderInChain = chain;
-    while (NSResponder *next = [_lastResponderInChain nextResponder])
-        _lastResponderInChain = next;
-    [_lastResponderInChain setNextResponder:self];
-    return self;
-}
-
-- (void)detach
-{
-    // This assumes that the responder chain was either unmodified since
-    // -initWithResponderChain: was called, or was modified in such a way
-    // that _lastResponderInChain is still in the chain, and self was not
-    // moved earlier in the chain than _lastResponderInChain.
-    NSResponder *responderBeforeSelf = _lastResponderInChain;    
-    NSResponder *next = [responderBeforeSelf nextResponder];
-    for (; next && next != self; next = [next nextResponder])
-        responderBeforeSelf = next;
-    
-    // Nothing to be done if we are no longer in the responder chain.
-    if (next != self)
-        return;
-    
-    [responderBeforeSelf setNextResponder:[self nextResponder]];
-    _lastResponderInChain = nil;
-}
-
-- (bool)didReceiveUnhandledCommand
-{
-    return _didReceiveUnhandledCommand;
-}
-
-- (void)noResponderFor:(SEL)selector
-{
-    _didReceiveUnhandledCommand = true;
-}
-
-- (void)doCommandBySelector:(SEL)selector
-{
-    _didReceiveUnhandledCommand = true;
-}
-
-- (BOOL)tryToPerform:(SEL)action with:(id)object
-{
-    _didReceiveUnhandledCommand = true;
-    return YES;
-}
-
-@end
-
 #endif // PLATFORM(MAC)
index 08fc7d062f4370ef096164400e07482baa14615d..4fd7f901bff28c971b0644fe03cc217cabef92ec 100644 (file)
 #import <wtf/RetainPtr.h>
 #import <wtf/Vector.h>
 
-@class _WKRemoteObjectRegistry;
-
 namespace API {
 class PageConfiguration;
 }
 
 namespace WebKit {
-class DrawingAreaProxy;
 class WebProcessPool;
 }
 
 @class WKWebView;
 #if WK_API_ENABLED
+@class _WKRemoteObjectRegistry;
 @class _WKThumbnailView;
 #endif
 
 @interface WKView ()
 #if WK_API_ENABLED
 - (instancetype)initWithFrame:(NSRect)frame processPool:(WebKit::WebProcessPool&)processPool configuration:(Ref<API::PageConfiguration>&&)configuration webView:(WKWebView *)webView;
-#endif
-
-- (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
-- (void)_processDidExit;
-- (void)_pageClosed;
-- (void)_didRelaunchProcess;
-- (void)_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState;
-- (void)_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled;
-- (bool)_executeSavedCommandBySelector:(SEL)selector;
-- (NSRect)_convertToDeviceSpace:(NSRect)rect;
-- (NSRect)_convertToUserSpace:(NSRect)rect;
-
-#if WK_API_ENABLED
 @property (nonatomic, setter=_setThumbnailView:) _WKThumbnailView *_thumbnailView;
+@property (nonatomic, readonly) _WKRemoteObjectRegistry *_remoteObjectRegistry;
 #endif
 
+- (void)_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled;
 - (void)_addFontPanelObserver;
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
 - (void)_startWindowDrag;
 #endif
 
-#if WK_API_ENABLED
-@property (nonatomic, readonly) _WKRemoteObjectRegistry *_remoteObjectRegistry;
-#endif
-
 @end
 
 #endif
index 33daf7a4cf53e0633ad7026c563c141c8a945acc..c0c39d859aece31e7e977ed72c5241b07f290877 100644 (file)
@@ -56,6 +56,7 @@ OBJC_CLASS _WKThumbnailView;
 - (void)_superMagnifyWithEvent:(NSEvent *)event;
 - (void)_superSmartMagnifyWithEvent:(NSEvent *)event;
 - (id)_superAccessibilityAttributeValue:(NSString *)attribute;
+- (void)_superDoCommandBySelector:(SEL)selector;
 
 // 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.
@@ -73,6 +74,7 @@ OBJC_CLASS _WKThumbnailView;
 
 namespace WebKit {
 
+class DrawingAreaProxy;
 class ViewGestureController;
 class WebEditCommandProxy;
 class WebPageProxy;
@@ -86,6 +88,10 @@ public:
 
     ~WebViewImpl();
 
+    void processDidExit();
+    void pageClosed();
+    void didRelaunchProcess();
+
     void setDrawsBackground(bool);
     bool drawsBackground() const;
     void setDrawsTransparentBackground(bool);
@@ -110,6 +116,7 @@ public:
     void setFixedLayoutSize(CGSize);
     CGSize fixedLayoutSize() const;
 
+    std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy();
     void setDrawingAreaSize(CGSize);
 
     void setAutomaticallyAdjustsContentInsets(bool);
@@ -287,7 +294,6 @@ public:
 
     ViewGestureController* gestureController() { return m_gestureController.get(); }
     ViewGestureController& ensureGestureController();
-    void resetGestureController();
     void setAllowsBackForwardNavigationGestures(bool);
     bool allowsBackForwardNavigationGestures() const { return m_allowsBackForwardNavigationGestures; }
     void setAllowsMagnification(bool);
@@ -312,6 +318,8 @@ public:
     void gestureEventWasNotHandledByWebCore(NSEvent *);
     void gestureEventWasNotHandledByWebCoreFromViewOnly(NSEvent *);
 
+    bool executeSavedCommandBySelector(SEL);
+
 private:
     WeakPtr<WebViewImpl> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
 
index 107a744ee6a51dcb8355d32036ebbb67611248d3..dc7f2381f52713a2477a4fc984cf68fc93864580 100644 (file)
@@ -37,7 +37,9 @@
 #import "NativeWebWheelEvent.h"
 #import "PageClient.h"
 #import "PasteboardTypes.h"
+#import "RemoteLayerTreeDrawingAreaProxy.h"
 #import "StringUtilities.h"
+#import "TiledCoreAnimationDrawingAreaProxy.h"
 #import "ViewGestureController.h"
 #import "WKFullScreenWindowController.h"
 #import "WKImmediateActionController.h"
@@ -321,6 +323,72 @@ static void* keyValueObservingContext = &keyValueObservingContext;
 
 @end
 
+@interface WKResponderChainSink : NSResponder {
+    NSResponder *_lastResponderInChain;
+    bool _didReceiveUnhandledCommand;
+}
+
+- (id)initWithResponderChain:(NSResponder *)chain;
+- (void)detach;
+- (bool)didReceiveUnhandledCommand;
+@end
+
+@implementation WKResponderChainSink
+
+- (id)initWithResponderChain:(NSResponder *)chain
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    _lastResponderInChain = chain;
+    while (NSResponder *next = [_lastResponderInChain nextResponder])
+        _lastResponderInChain = next;
+    [_lastResponderInChain setNextResponder:self];
+    return self;
+}
+
+- (void)detach
+{
+    // This assumes that the responder chain was either unmodified since
+    // -initWithResponderChain: was called, or was modified in such a way
+    // that _lastResponderInChain is still in the chain, and self was not
+    // moved earlier in the chain than _lastResponderInChain.
+    NSResponder *responderBeforeSelf = _lastResponderInChain;
+    NSResponder *next = [responderBeforeSelf nextResponder];
+    for (; next && next != self; next = [next nextResponder])
+        responderBeforeSelf = next;
+
+    // Nothing to be done if we are no longer in the responder chain.
+    if (next != self)
+        return;
+
+    [responderBeforeSelf setNextResponder:[self nextResponder]];
+    _lastResponderInChain = nil;
+}
+
+- (bool)didReceiveUnhandledCommand
+{
+    return _didReceiveUnhandledCommand;
+}
+
+- (void)noResponderFor:(SEL)selector
+{
+    _didReceiveUnhandledCommand = true;
+}
+
+- (void)doCommandBySelector:(SEL)selector
+{
+    _didReceiveUnhandledCommand = true;
+}
+
+- (BOOL)tryToPerform:(SEL)action with:(id)object
+{
+    _didReceiveUnhandledCommand = true;
+    return YES;
+}
+
+@end
+
 namespace WebKit {
 
 static NSTrackingAreaOptions trackingAreaOptions()
@@ -375,6 +443,36 @@ WebViewImpl::~WebViewImpl()
 #endif
 }
 
+std::unique_ptr<WebKit::DrawingAreaProxy> WebViewImpl::createDrawingAreaProxy()
+{
+    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"WebKit2UseRemoteLayerTreeDrawingArea"] boolValue])
+        return std::make_unique<RemoteLayerTreeDrawingAreaProxy>(m_page);
+
+    return std::make_unique<TiledCoreAnimationDrawingAreaProxy>(m_page);
+}
+
+void WebViewImpl::processDidExit()
+{
+    notifyInputContextAboutDiscardedComposition();
+
+    if (m_layerHostingView)
+        setAcceleratedCompositingRootLayer(nil);
+
+    updateRemoteAccessibilityRegistration(false);
+
+    m_gestureController = nullptr;
+}
+
+void WebViewImpl::pageClosed()
+{
+    updateRemoteAccessibilityRegistration(false);
+}
+
+void WebViewImpl::didRelaunchProcess()
+{
+    accessibilityRegisterUIProcessTokens();
+}
+
 void WebViewImpl::setDrawsBackground(bool drawsBackground)
 {
     m_page.setDrawsBackground(drawsBackground);
@@ -2157,11 +2255,6 @@ ViewGestureController& WebViewImpl::ensureGestureController()
     return *m_gestureController;
 }
 
-void WebViewImpl::resetGestureController()
-{
-    m_gestureController = nullptr;
-}
-
 void WebViewImpl::setAllowsBackForwardNavigationGestures(bool allowsBackForwardNavigationGestures)
 {
     m_allowsBackForwardNavigationGestures = allowsBackForwardNavigationGestures;
@@ -2349,6 +2442,17 @@ void WebViewImpl::gestureEventWasNotHandledByWebCoreFromViewOnly(NSEvent *event)
 #endif
 }
 
+bool WebViewImpl::executeSavedCommandBySelector(SEL selector)
+{
+    LOG(TextInput, "Executing previously saved command %s", sel_getName(selector));
+    // The sink does two things: 1) Tells us if the responder went unhandled, and
+    // 2) prevents any NSBeep; we don't ever want to beep here.
+    RetainPtr<WKResponderChainSink> sink = adoptNS([[WKResponderChainSink alloc] initWithResponderChain:m_view]);
+    [m_view _superDoCommandBySelector:selector];
+    [sink detach];
+    return ![sink didReceiveUnhandledCommand];
+}
+
 } // namespace WebKit
 
 #endif // PLATFORM(MAC)
index c47bae2d7db2c00aa60f53ef2d7fd9acb12e1d46..a15f8b4b3e8f23e24ee299c74a57b207e3bdee7e 100644 (file)
@@ -111,7 +111,7 @@ PageClientImpl::~PageClientImpl()
 
 std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy()
 {
-    return [m_wkView _createDrawingAreaProxy];
+    return m_impl->createDrawingAreaProxy();
 }
 
 void PageClientImpl::setViewNeedsDisplay(const WebCore::IntRect& rect)
@@ -241,12 +241,12 @@ ColorSpaceData PageClientImpl::colorSpace()
 
 void PageClientImpl::processDidExit()
 {
-    [m_wkView _processDidExit];
+    m_impl->processDidExit();
 }
 
 void PageClientImpl::pageClosed()
 {
-    [m_wkView _pageClosed];
+    m_impl->pageClosed();
 #if USE(DICTATION_ALTERNATIVES)
     m_alternativeTextUIController->clear();
 #endif
@@ -254,7 +254,7 @@ void PageClientImpl::pageClosed()
 
 void PageClientImpl::didRelaunchProcess()
 {
-    [m_wkView _didRelaunchProcess];
+    m_impl->didRelaunchProcess();
 }
 
 void PageClientImpl::preferencesDidChange()
@@ -405,12 +405,12 @@ void PageClientImpl::notifyApplicationAboutInputContextChange()
 
 FloatRect PageClientImpl::convertToDeviceSpace(const FloatRect& rect)
 {
-    return [m_wkView _convertToDeviceSpace:rect];
+    return toDeviceSpace(rect, [m_wkView window]);
 }
 
 FloatRect PageClientImpl::convertToUserSpace(const FloatRect& rect)
 {
-    return [m_wkView _convertToUserSpace:rect];
+    return toUserSpace(rect, [m_wkView window]);
 }
    
 IntPoint PageClientImpl::screenToRootView(const IntPoint& point)
@@ -617,7 +617,7 @@ void PageClientImpl::intrinsicContentSizeDidChange(const IntSize& intrinsicConte
 
 bool PageClientImpl::executeSavedCommandBySelector(const String& selectorString)
 {
-    return [m_wkView _executeSavedCommandBySelector:NSSelectorFromString(selectorString)];
+    return m_impl->executeSavedCommandBySelector(NSSelectorFromString(selectorString));
 }
 
 #if USE(DICTATION_ALTERNATIVES)