Changeset 150200 in webkit


Ignore:
Timestamp:
May 16, 2013 12:13:32 PM (11 years ago)
Author:
timothy@apple.com
Message:

Make the Find Banner in Safari work again with the docked Web Inspector.

https://webkit.org/b/116182
rdar://problem/13857423

Reviewed by Benjamin Poulain.

  • UIProcess/mac/WebInspectorProxyMac.mm:

(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
(WebKit::WebInspectorProxy::platformDetach):
Preserve the top position of the inspected view so banners in Safari still work.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r150197 r150200  
     12013-05-16  Timothy Hatcher  <timothy@apple.com>
     2
     3        Make the Find Banner in Safari work again with the docked Web Inspector.
     4
     5        https://webkit.org/b/116182
     6        rdar://problem/13857423
     7
     8        Reviewed by Benjamin Poulain.
     9
     10        * UIProcess/mac/WebInspectorProxyMac.mm:
     11        (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
     12        (WebKit::WebInspectorProxy::platformDetach):
     13        Preserve the top position of the inspected view so banners in Safari still work.
     14
    1152013-05-16  Tim Horton  <timothy_horton@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm

    r150041 r150200  
    626626    NSRect inspectorFrame = NSZeroRect;
    627627    NSRect parentBounds = [[inspectedView superview] bounds];
     628    CGFloat inspectedViewTop = NSMaxY(inspectedViewFrame);
    628629
    629630    switch (m_attachmentSide) {
     
    635636            CGFloat inspectorHeight = InspectorFrontendClientLocal::constrainedAttachedWindowHeight(currentDimension, parentHeight);
    636637
    637             inspectedViewFrame = NSMakeRect(0, inspectorHeight, NSWidth(parentBounds), parentHeight - inspectorHeight);
     638            // Preserve the top position of the inspected view so banners in Safari still work.
     639            inspectedViewFrame = NSMakeRect(0, inspectorHeight, NSWidth(parentBounds), inspectedViewTop - inspectorHeight);
    638640            inspectorFrame = NSMakeRect(0, 0, NSWidth(inspectedViewFrame), inspectorHeight);
    639641            break;
     
    647649            CGFloat inspectorWidth = InspectorFrontendClientLocal::constrainedAttachedWindowWidth(currentDimension, parentWidth);
    648650
    649             inspectedViewFrame = NSMakeRect(0, 0, parentWidth - inspectorWidth, NSHeight(parentBounds));
    650             inspectorFrame = NSMakeRect(parentWidth - inspectorWidth, 0, inspectorWidth, NSHeight(inspectedViewFrame));
     651            // Preserve the top position of the inspected view so banners in Safari still work. But don't use that
     652            // top position for the inspector view since the banners only stretch as wide as the the inspected view.
     653            inspectedViewFrame = NSMakeRect(0, 0, parentWidth - inspectorWidth, inspectedViewTop);
     654            inspectorFrame = NSMakeRect(parentWidth - inspectorWidth, 0, inspectorWidth, NSHeight(parentBounds));
    651655            break;
    652656        }
     
    715719
    716720    // Make sure that we size the inspected view's frame after detaching so that it takes up the space that the
    717     // attached inspector used to.
    718 
    719     [inspectedView setFrame:[[inspectedView superview] bounds]];
     721    // attached inspector used to. Preserve the top position of the inspected view so banners in Safari still work.
     722
     723    inspectedView.frame = NSMakeRect(0, 0, NSWidth(inspectedView.superview.bounds), NSMaxY(inspectedView.frame));
    720724
    721725    // Return early if we are not visible. This means the inspector was closed while attached
Note: See TracChangeset for help on using the changeset viewer.