Fixes a bug where Safari's find banner would be permanently hidden
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Aug 2008 16:12:43 +0000 (16:12 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Aug 2008 16:12:43 +0000 (16:12 +0000)
        when attaching or closing the Web Inspector while attached.

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

        Reviewed by Kevin McCullough.

        * WebCoreSupport/WebInspectorClient.mm:
        (-[WebInspectorWindowController close]):
        Carefully manipulate the WebFrameView's frame when closing to
        not assume the WebFrameView's frame fills the inspected WebView.
        (-[WebInspectorWindowController setAttachedWindowHeight:]):
        Carefully manipulate the WebFrameView's frame when docking to
        not assume the WebFrameView plus the Web Inspector WebViews fills
        the full inspected WebView.

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

WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebInspectorClient.mm

index 786bb23..e483a8d 100644 (file)
@@ -1,3 +1,21 @@
+2008-08-13  Timothy Hatcher  <timothy@apple.com>
+
+        Fixes a bug where Safari's find banner would be permanently hidden
+        when attaching or closing the Web Inspector while attached.
+
+        https://bugs.webkit.org/show_bug.cgi?id=20376
+
+        Reviewed by Kevin McCullough.
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (-[WebInspectorWindowController close]):
+        Carefully manipulate the WebFrameView's frame when closing to
+        not assume the WebFrameView's frame fills the inspected WebView.
+        (-[WebInspectorWindowController setAttachedWindowHeight:]):
+        Carefully manipulate the WebFrameView's frame when docking to
+        not assume the WebFrameView plus the Web Inspector WebViews fills
+        the full inspected WebView.
+
 2008-08-13  Stephanie Lewis  <slewis@apple.com>
 
         fix 64bit build
index e2cb9d0..0d7bc6c 100644 (file)
@@ -278,9 +278,12 @@ void WebInspectorClient::updateWindowTitle() const
         [_webView removeFromSuperview];
 
         WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView];
-
         NSRect frameViewRect = [frameView frame];
-        frameViewRect = NSMakeRect(0, 0, NSWidth(frameViewRect), NSHeight([_inspectedWebView frame]));
+
+        // Setting the height based on the previous height is done to work with
+        // Safari's find banner. This assumes the previous height is the Y origin.
+        frameViewRect.size.height += NSMinY(frameViewRect);
+        frameViewRect.origin.y = 0.0;
 
         [frameView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
         [frameView setFrame:frameViewRect];
@@ -368,7 +371,12 @@ void WebInspectorClient::updateWindowTitle() const
     NSRect frameViewRect = [frameView frame];
 
     CGFloat attachedHeight = round(MAX(250.0, MIN(height, (NSHeight([_inspectedWebView frame]) * 0.75))));
-    frameViewRect = NSMakeRect(0.0, attachedHeight, NSWidth(frameViewRect), NSHeight([_inspectedWebView frame]) - attachedHeight);
+
+    // Setting the height based on the difference is done to work with
+    // Safari's find banner. This assumes the previous height is the Y origin.
+    CGFloat heightDifference = (NSMinY(frameViewRect) - attachedHeight);
+    frameViewRect.size.height += heightDifference;
+    frameViewRect.origin.y = attachedHeight;
 
     [_webView setFrame:NSMakeRect(0.0, 0.0, NSWidth(frameViewRect), attachedHeight)];
     [frameView setFrame:frameViewRect];