Title: [247855] trunk/Source/WebKitLegacy/win
Revision
247855
Author
[email protected]
Date
2019-07-25 23:15:38 -0700 (Thu, 25 Jul 2019)

Log Message

[Win][WK1] The inspected webview window is misplaced after changing Web Inspector frontend window height
https://bugs.webkit.org/show_bug.cgi?id=200152

Reviewed by Brent Fulgham.

In WebInspectorFrontendClient::setAttachedWindowHeight, the size
of m_inspectedWebViewHwnd was changed to the whole host window
size. But, it's too tall because MiniBrowser's host window has a
toolbar. The toolbar height should be taken into account.

Change to the height of m_inspectedWebViewHwnd to the sum of
inspected WebView and inspector frontend WebView heights.

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::setAttachedWindowHeight):

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (247854 => 247855)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2019-07-26 04:58:09 UTC (rev 247854)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2019-07-26 06:15:38 UTC (rev 247855)
@@ -1,3 +1,21 @@
+2019-07-25  Fujii Hironori  <[email protected]>
+
+        [Win][WK1] The inspected webview window is misplaced after changing Web Inspector frontend window height
+        https://bugs.webkit.org/show_bug.cgi?id=200152
+
+        Reviewed by Brent Fulgham.
+
+        In WebInspectorFrontendClient::setAttachedWindowHeight, the size
+        of m_inspectedWebViewHwnd was changed to the whole host window
+        size. But, it's too tall because MiniBrowser's host window has a
+        toolbar. The toolbar height should be taken into account.
+
+        Change to the height of m_inspectedWebViewHwnd to the sum of
+        inspected WebView and inspector frontend WebView heights.
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorFrontendClient::setAttachedWindowHeight):
+
 2019-07-23  Wenson Hsieh  <[email protected]>
 
         [macOS 10.15] Web process crashes when attempting to show the font panel via Font > Show Fonts

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp (247854 => 247855)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp	2019-07-26 04:58:09 UTC (rev 247854)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp	2019-07-26 06:15:38 UTC (rev 247855)
@@ -327,17 +327,21 @@
     RECT hostWindowRect;
     GetClientRect(hostWindow, &hostWindowRect);
 
+    RECT frontendRect;
+    GetClientRect(m_frontendWebViewHwnd, &frontendRect);
+
     RECT inspectedRect;
     GetClientRect(m_inspectedWebViewHwnd, &inspectedRect);
 
-    int totalHeight = hostWindowRect.bottom - hostWindowRect.top;
+    int hostWindowHeight = hostWindowRect.bottom;
     int webViewWidth = inspectedRect.right - inspectedRect.left;
+    int webViewHeight = frontendRect.bottom + inspectedRect.bottom;
 
-    SetWindowPos(m_frontendWebViewHwnd, 0, 0, totalHeight - height, webViewWidth, height, SWP_NOZORDER);
+    SetWindowPos(m_frontendWebViewHwnd, 0, 0, hostWindowHeight - height, webViewWidth, height, SWP_NOZORDER);
 
     // We want to set the inspected web view height to the totalHeight, because the height adjustment
     // of the inspected web view happens in onWebViewWindowPosChanging, not here.
-    SetWindowPos(m_inspectedWebViewHwnd, 0, 0, 0, webViewWidth, totalHeight, SWP_NOZORDER);
+    SetWindowPos(m_inspectedWebViewHwnd, 0, 0, hostWindowHeight - webViewHeight, webViewWidth, webViewHeight, SWP_NOZORDER);
 
     RedrawWindow(m_frontendWebViewHwnd, 0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_UPDATENOW);
     RedrawWindow(m_inspectedWebViewHwnd, 0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_UPDATENOW);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to