Bug 61420 - WebKit2: Web Inspector: Web Inspector opens a blank window when a breakpoint is hit when docked
Summary: WebKit2: Web Inspector: Web Inspector opens a blank window when a breakpoint ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-05-24 22:24 PDT by Timothy Hatcher
Modified: 2011-05-25 09:58 PDT (History)
11 users (show)

See Also:


Attachments
Proposed Change (3.29 KB, patch)
2011-05-24 22:28 PDT, Timothy Hatcher
bweinstein: review+
timothy: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2011-05-24 22:24:49 PDT
WebInspectorProxy::platformBringToFront orders the wrong window to the front.
Comment 1 Timothy Hatcher 2011-05-24 22:25:09 PDT
<rdar://problem/9464685>
Comment 2 Timothy Hatcher 2011-05-24 22:28:09 PDT
Created attachment 94744 [details]
Proposed Change
Comment 3 WebKit Review Bot 2011-05-24 22:32:16 PDT
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 4 Brian Weinstein 2011-05-24 23:10:05 PDT
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 5 Brian Weinstein 2011-05-24 23:10:17 PDT
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 6 Brian Weinstein 2011-05-24 23:28:12 PDT
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.
Comment 7 Timothy Hatcher 2011-05-24 23:38:18 PDT
Landed in r87275.
Comment 8 Darin Adler 2011-05-25 09:58:31 PDT
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.