Bug 57480

Summary: Inspector doesn't come to the front when a breakpoint is hit in the debugger in WebKit2
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: Web Inspector (Deprecated)Assignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: bweinstein, timothy, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed Change aroben: review+, timothy: commit-queue-

Description Adam Roben (:aroben) 2011-03-30 11:20:05 PDT
To reproduce:

1. Go to http://build.webkit.org/LeaksViewer/
2. Open the Inspector's debugger and put a breakpoint in LeaksViewer.urlPromptButtonClicked in LeaksViewer.js
3. Click back on the main page
4. Click on the "Fetch leaks" button

The breakpoint is hit in the debugger, but the Inspector doesn't come to the front. In WebKit1, it does come to the front.
Comment 1 Adam Roben (:aroben) 2011-03-30 11:20:40 PDT
I think the bug is caused by WebInspectorFrontendClient::bringToFront being unimplemented.
Comment 2 Adam Roben (:aroben) 2011-03-30 11:21:05 PDT
<rdar://problem/9209472>
Comment 3 Adam Roben (:aroben) 2011-03-31 06:07:51 PDT
If we implement this, and remove the code that immediately shows the Inspector window when it's first created, then the Inspector window might stop showing up when running run-webkit-tests.
Comment 4 Timothy Hatcher 2011-04-20 09:47:18 PDT
The bringToFront function is only used after the inspector has a window created by the client. The client is required to show it the first time. So we can't remove the code to immediately show it, unless we refactor things.
Comment 5 Timothy Hatcher 2011-04-20 09:47:44 PDT
Created attachment 90353 [details]
Proposed Change
Comment 6 WebKit Review Bot 2011-04-20 09:50:20 PDT
Attachment 90353 [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 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Adam Roben (:aroben) 2011-04-20 09:51:26 PDT
(In reply to comment #4)
> The bringToFront function is only used after the inspector has a window created by the client. The client is required to show it the first time. So we can't remove the code to immediately show it, unless we refactor things.

I thought WebKit1 didn't immediately show it, but maybe I'm wrong.
Comment 8 Adam Roben (:aroben) 2011-04-20 09:52:52 PDT
Comment on attachment 90353 [details]
Proposed Change

View in context: https://bugs.webkit.org/attachment.cgi?id=90353&action=review

>> Source/WebKit2/ChangeLog:1
>> +2011-04-20  Timothy Hatcher  <timothy@apple.com>
> 
> ChangeLog entry has no bug number  [changelog/bugnumber] [5]

I think check-webkit-style doesn't know about https: for short bug URLs. You should file a bug about that.

> Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm:139
> +    // FIXME: support bring to front in docked mode here.

You could put this FIXME in the Windows code, too.

> Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp:197
> +void WebInspectorProxy::platformBringToFront()
> +{
> +    if (!m_inspectorWindow)
> +        return;
> +
> +    ASSERT(::IsWindow(m_inspectorWindow));
> +    ::ShowWindow(m_inspectorWindow, SW_SHOW);
> +}

I don't think this will be sufficient on Windows. I think this would do the trick instead:

::SetWindowPos(m_inspectorWindow, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
Comment 9 Timothy Hatcher 2011-04-21 07:46:35 PDT
I file a bug about the style bot a while ago.

Landed in r84424 with Adam's feedback applied.