WebInspectorProxy::platformBringToFront orders the wrong window to the front.
<rdar://problem/9464685>
Created attachment 94744 [details] Proposed Change
Attachment 94744 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1 Source/WebKit2/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 94744 [details] Proposed Change View in context: https://bugs.webkit.org/attachment.cgi?id=94744&action=review > Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp:230 > + HWND parentWindow = m_isAttached ? ::GetParent(m_page->nativeWindow()) : m_inspectorWindow; Actually, I'm not sure if this is right in the non-attached case. We might want this to be - ::GetAncestor(m_page->nativeWindow(), GA_ROOT). We bring the root window to the front, which isn't necessarily the parent of the web view.
Comment on attachment 94744 [details] Proposed Change View in context: https://bugs.webkit.org/attachment.cgi?id=94744&action=review >>> Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp:230 >>> + HWND parentWindow = m_isAttached ? ::GetParent(m_page->nativeWindow()) : m_inspectorWindow; >> >> Actually, I'm not sure if this is right in the non-attached case. We might want this to be - ::GetAncestor(m_page->nativeWindow(), GA_ROOT). We bring the root window to the front, which isn't necessarily the parent of the web view. > > Actually, I'm not sure if this is right in the non-attached case. We might want this to be - ::GetAncestor(m_page->nativeWindow(), GA_ROOT). We bring the root window to the front, which isn't necessarily the parent of the web view. This should be: HWND parentWindow = m_isAttached ? ::GetAncestor(m_page->nativeWindow(), GA_ROOT) : m_inspectorWindow; And it will need the same FIXME as the Mac code.
Landed in r87275.
Comment on attachment 94744 [details] Proposed Change View in context: https://bugs.webkit.org/attachment.cgi?id=94744&action=review > Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm:158 > + // FIXME: this will not bring a background tab in Safari to the front, only its window. > + [m_inspectorView.get().window makeKeyAndOrderFront:nil]; Might be worth mentioning the Chrome::focus function, which would do the right thing for both tabs and windows and would work cross-platform.