Web Inspector: update sheet rect whenever inspector window size changes
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 01:43:00 +0000 (01:43 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 01:43:00 +0000 (01:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196942
<rdar://problem/49920241>

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI._windowResized):
(WI._updateSheetRect): Added.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js

index 657c790..e060048 100644 (file)
@@ -1,3 +1,16 @@
+2019-04-15  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: update sheet rect whenever inspector window size changes
+        https://bugs.webkit.org/show_bug.cgi?id=196942
+        <rdar://problem/49920241>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Base/Main.js:
+        (WI.contentLoaded):
+        (WI._windowResized):
+        (WI._updateSheetRect): Added.
+
 2019-04-15  Nikita Vasilyev  <nvasilyev@apple.com>
 
         Unreviewed, fix typo in a comment.
index ab08d2e..0875955 100644 (file)
@@ -583,8 +583,7 @@ WI.contentLoaded = function()
         InspectorFrontendAPI.loadCompleted();
     });
 
-    let mainElementRect = document.getElementById("main").getBoundingClientRect();
-    InspectorFrontendHost.setSheetRect(mainElementRect.x, mainElementRect.y, mainElementRect.width, mainElementRect.height);
+    WI._updateSheetRect();
 
     // Tell the InspectorFrontendHost we loaded, which causes the window to display
     // and pending InspectorFrontendAPI commands to be sent.
@@ -1678,6 +1677,13 @@ WI._windowResized = function(event)
     WI.toolbar.updateLayout(WI.View.LayoutReason.Resize);
     WI.tabBar.updateLayout(WI.View.LayoutReason.Resize);
     WI._tabBrowserSizeDidChange();
+    WI._updateSheetRect();
+};
+
+WI._updateSheetRect = function()
+{
+    let mainElementRect = document.getElementById("main").getBoundingClientRect();
+    InspectorFrontendHost.setSheetRect(mainElementRect.x, mainElementRect.y, mainElementRect.width, mainElementRect.height);
 };
 
 WI._updateModifierKeys = function(event)