[Webkit-unassigned] [Bug 171841] In a WKWebView app, window.screenX and window.screenY are garbage

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 8 18:44:54 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=171841

--- Comment #2 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
diff --git a/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h b/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h
index d9381d3d19b4f4533b02a0e04400da81f61dcb84..61fe613cbbddc7142ccb73e3aa360a4f280041fe 100644
--- a/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h
+++ b/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h
@@ -88,6 +88,7 @@ private:
         void runJavaScriptPrompt(WebKit::WebPageProxy*, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy*, const WebCore::SecurityOriginData&, Function<void (const WTF::String&)>&& completionHandler) override;
         void exceededDatabaseQuota(WebPageProxy*, WebFrameProxy*, API::SecurityOrigin*, const WTF::String& databaseName, const WTF::String& displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentUsage, unsigned long long expectedUsage, Function<void (unsigned long long)>&& completionHandler) override;
         void reachedApplicationCacheOriginQuota(WebPageProxy*, const WebCore::SecurityOrigin&, uint64_t currentQuota, uint64_t totalBytesNeeded, Function<void (unsigned long long)>&& completionHandler) override;
+        WebCore::FloatRect windowFrame(WebKit::WebPageProxy*) override;
 #if PLATFORM(MAC)
         bool runOpenPanel(WebPageProxy*, WebFrameProxy*, const WebCore::SecurityOriginData&, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;
 #endif
diff --git a/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm b/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm
index 4f21e823301c3c6adcd39d6ce0b077ce7c4ca5b1..3a8e3c4ce5ac1a07d386898c1ef734b9d2cd6cb6 100644
--- a/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm
+++ b/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm
@@ -529,6 +529,15 @@ void UIDelegate::UIClient::reachedApplicationCacheOriginQuota(WebPageProxy*, con
     }).get()];
 }

+WebCore::FloatRect UIDelegate::UIClient::windowFrame(WebKit::WebPageProxy*)
+{
+    WKWebView *webView = m_uiDelegate.m_webView;
+    if (!webView.window)
+        return { };
+        
+    return webView.window.frame;
+}
+
 void UIDelegate::UIClient::printFrame(WebKit::WebPageProxy*, WebKit::WebFrameProxy* webFrameProxy)
 {
     ASSERT_ARG(webFrameProxy, webFrameProxy);

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170509/2cbd2cc3/attachment-0001.html>


More information about the webkit-unassigned mailing list