Modified: trunk/Source/WebKit2/ChangeLog (150199 => 150200)
--- trunk/Source/WebKit2/ChangeLog 2013-05-16 19:11:43 UTC (rev 150199)
+++ trunk/Source/WebKit2/ChangeLog 2013-05-16 19:13:32 UTC (rev 150200)
@@ -1,3 +1,17 @@
+2013-05-16 Timothy Hatcher <[email protected]>
+
+ 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.
+
2013-05-16 Tim Horton <[email protected]>
[wk2] Minimum layout width is lost if the WebProcess crashes
Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (150199 => 150200)
--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm 2013-05-16 19:11:43 UTC (rev 150199)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm 2013-05-16 19:13:32 UTC (rev 150200)
@@ -625,6 +625,7 @@
NSRect inspectedViewFrame = [inspectedView frame];
NSRect inspectorFrame = NSZeroRect;
NSRect parentBounds = [[inspectedView superview] bounds];
+ CGFloat inspectedViewTop = NSMaxY(inspectedViewFrame);
switch (m_attachmentSide) {
case AttachmentSideBottom: {
@@ -634,7 +635,8 @@
CGFloat parentHeight = NSHeight(parentBounds);
CGFloat inspectorHeight = InspectorFrontendClientLocal::constrainedAttachedWindowHeight(currentDimension, parentHeight);
- inspectedViewFrame = NSMakeRect(0, inspectorHeight, NSWidth(parentBounds), parentHeight - inspectorHeight);
+ // Preserve the top position of the inspected view so banners in Safari still work.
+ inspectedViewFrame = NSMakeRect(0, inspectorHeight, NSWidth(parentBounds), inspectedViewTop - inspectorHeight);
inspectorFrame = NSMakeRect(0, 0, NSWidth(inspectedViewFrame), inspectorHeight);
break;
}
@@ -646,8 +648,10 @@
CGFloat parentWidth = NSWidth(parentBounds);
CGFloat inspectorWidth = InspectorFrontendClientLocal::constrainedAttachedWindowWidth(currentDimension, parentWidth);
- inspectedViewFrame = NSMakeRect(0, 0, parentWidth - inspectorWidth, NSHeight(parentBounds));
- inspectorFrame = NSMakeRect(parentWidth - inspectorWidth, 0, inspectorWidth, NSHeight(inspectedViewFrame));
+ // Preserve the top position of the inspected view so banners in Safari still work. But don't use that
+ // top position for the inspector view since the banners only stretch as wide as the the inspected view.
+ inspectedViewFrame = NSMakeRect(0, 0, parentWidth - inspectorWidth, inspectedViewTop);
+ inspectorFrame = NSMakeRect(parentWidth - inspectorWidth, 0, inspectorWidth, NSHeight(parentBounds));
break;
}
}
@@ -714,9 +718,9 @@
[m_inspectorView.get() removeFromSuperview];
// Make sure that we size the inspected view's frame after detaching so that it takes up the space that the
- // attached inspector used to.
+ // attached inspector used to. Preserve the top position of the inspected view so banners in Safari still work.
- [inspectedView setFrame:[[inspectedView superview] bounds]];
+ inspectedView.frame = NSMakeRect(0, 0, NSWidth(inspectedView.superview.bounds), NSMaxY(inspectedView.frame));
// Return early if we are not visible. This means the inspector was closed while attached
// and we should not create and show the inspector window.