Create full rects for the inspector and inspected views when
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2013 18:08:14 +0000 (18:08 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2013 18:08:14 +0000 (18:08 +0000)
adjusting to an inspected view frame change.

This ensures switching dock sides restores the inspected view
and inspector to fill the parent's bounds.

https://webkit.org/b/114666
rdar://problem/13660796

Reviewed by Joseph Pecoraro.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm

index 9506150abc231882b2277ec6361553e36e5a2d3c..6276cce450b1ca578f188727253bd037aaefd24c 100644 (file)
@@ -1,3 +1,19 @@
+2013-04-16  Timothy Hatcher  <timothy@apple.com>
+
+        Create full rects for the inspector and inspected views when
+        adjusting to an inspected view frame change. 
+
+        This ensures switching dock sides restores the inspected view
+        and inspector to fill the parent's bounds.
+
+        https://webkit.org/b/114666
+        rdar://problem/13660796
+
+        Reviewed by Joseph Pecoraro.
+
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
+
 2013-04-16  Balazs Kelemen  <kbalazs@webkit.org>
 
         Initialize logging channels for web processes
index e7de6ebdf0e56d178b0273827b2fa67155fc5e0c..bb348f19fa60dab6e1334f13924a1a3c00dda56d 100644 (file)
@@ -526,31 +526,31 @@ void WebInspectorProxy::inspectedViewFrameDidChange(CGFloat currentDimension)
 
     WKView *inspectedView = m_page->wkView();
     NSRect inspectedViewFrame = [inspectedView frame];
-    NSRect inspectorFrame = inspectedViewFrame;
+    NSRect inspectorFrame = NSZeroRect;
     NSRect parentBounds = [[inspectedView superview] bounds];
 
     switch (m_attachmentSide) {
         case AttachmentSideBottom: {
             if (!currentDimension)
                 currentDimension = NSHeight([m_inspectorView.get() frame]);
+
             CGFloat parentHeight = NSHeight(parentBounds);
             CGFloat inspectorHeight = InspectorFrontendClientLocal::constrainedAttachedWindowHeight(currentDimension, parentHeight);
-            inspectedViewFrame.origin.y = inspectorHeight;
-            inspectedViewFrame.size.height = parentHeight - inspectorHeight;
-            inspectorFrame.origin.y = 0;
-            inspectorFrame.size.height = inspectorHeight;
+
+            inspectedViewFrame = NSMakeRect(0, inspectorHeight, NSWidth(parentBounds), parentHeight - inspectorHeight);
+            inspectorFrame = NSMakeRect(0, 0, NSWidth(inspectedViewFrame), inspectorHeight);
             break;
         }
 
         case AttachmentSideRight: {
             if (!currentDimension)
                 currentDimension = NSWidth([m_inspectorView.get() frame]);
+
             CGFloat parentWidth = NSWidth(parentBounds);
             CGFloat inspectorWidth = InspectorFrontendClientLocal::constrainedAttachedWindowWidth(currentDimension, parentWidth);
-            inspectedViewFrame.origin.x = 0;
-            inspectedViewFrame.size.width = parentWidth - inspectorWidth;
-            inspectorFrame.origin.x = parentWidth - inspectorWidth;
-            inspectorFrame.size.width = inspectorWidth;
+
+            inspectedViewFrame = NSMakeRect(0, 0, parentWidth - inspectorWidth, NSHeight(parentBounds));
+            inspectorFrame = NSMakeRect(parentWidth - inspectorWidth, 0, inspectorWidth, NSHeight(inspectedViewFrame));
             break;
         }
     }