Title: [237596] trunk/Source/WebCore
Revision
237596
Author
[email protected]
Date
2018-10-30 11:33:01 -0700 (Tue, 30 Oct 2018)

Log Message

[iOS] Use the mainframe view size to compute window.outerWidth/height.
https://bugs.webkit.org/show_bug.cgi?id=191070
<rdar://problem/42368377>

Reviewed by Tim Horton.

Use a more reasonable value for window.outerWidth and height.
(WKWebView's frame rect -> drawing area sizing -> WebPage's view size -> FrameView size)

* page/DOMWindow.cpp:
(WebCore::DOMWindow::outerHeight const):
(WebCore::DOMWindow::outerWidth const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (237595 => 237596)


--- trunk/Source/WebCore/ChangeLog	2018-10-30 18:32:20 UTC (rev 237595)
+++ trunk/Source/WebCore/ChangeLog	2018-10-30 18:33:01 UTC (rev 237596)
@@ -1,3 +1,18 @@
+2018-10-30  Zalan Bujtas  <[email protected]>
+
+        [iOS] Use the mainframe view size to compute window.outerWidth/height.
+        https://bugs.webkit.org/show_bug.cgi?id=191070
+        <rdar://problem/42368377>
+
+        Reviewed by Tim Horton.
+
+        Use a more reasonable value for window.outerWidth and height.
+        (WKWebView's frame rect -> drawing area sizing -> WebPage's view size -> FrameView size)
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::outerHeight const):
+        (WebCore::DOMWindow::outerWidth const):
+
 2018-10-30  Andy Estes  <[email protected]>
 
         [Apple Pay] PaymentRequest.canMakePayment() should resolve to true whenever Apple Pay is available

Modified: trunk/Source/WebCore/page/DOMWindow.cpp (237595 => 237596)


--- trunk/Source/WebCore/page/DOMWindow.cpp	2018-10-30 18:32:20 UTC (rev 237595)
+++ trunk/Source/WebCore/page/DOMWindow.cpp	2018-10-30 18:33:01 UTC (rev 237596)
@@ -1177,7 +1177,14 @@
 int DOMWindow::outerHeight() const
 {
 #if PLATFORM(IOS_FAMILY)
-    return 0;
+    if (!frame())
+        return 0;
+
+    auto* view = frame()->isMainFrame() ? frame()->view() : frame()->mainFrame().view();
+    if (!view)
+        return 0;
+
+    return view->frameRect().height();
 #else
     auto* frame = this->frame();
     if (!frame)
@@ -1194,7 +1201,14 @@
 int DOMWindow::outerWidth() const
 {
 #if PLATFORM(IOS_FAMILY)
-    return 0;
+    if (!frame())
+        return 0;
+
+    auto* view = frame()->isMainFrame() ? frame()->view() : frame()->mainFrame().view();
+    if (!view)
+        return 0;
+
+    return view->frameRect().width();
 #else
     auto* frame = this->frame();
     if (!frame)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to