Bug 101978 - Web Inspector: Fix docking behaviour on Windows.
Summary: Web Inspector: Fix docking behaviour on Windows.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-12 13:43 PST by Roger Fong
Modified: 2012-11-27 15:39 PST (History)
10 users (show)

See Also:


Attachments
patch (3.77 KB, patch)
2012-11-12 13:45 PST, Roger Fong
bweinstein: review-
Details | Formatted Diff | Diff
revised patch (4.17 KB, patch)
2012-11-12 15:49 PST, Roger Fong
bweinstein: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Fong 2012-11-12 13:43:39 PST
There are a number of problems for docking behaviour on Windows.
For starters it does not ever constrain the inspectors size properly while docked.
It also does not properly set the whether or not the inspector can be docked/undocked.
Comment 1 Roger Fong 2012-11-12 13:45:21 PST
Created attachment 173710 [details]
patch
Comment 2 Tim Horton 2012-11-12 14:17:10 PST
Comment on attachment 173710 [details]
patch

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

> Source/WebCore/inspector/InspectorFrontendClientLocal.cpp:143
> +    // Call setDockingUnavailable before bringToFront. If we display the inspector's HWND first it causes the call to canAttachWindow to return the wrong result.

I wonder if you can talk about this in a more generic way. Using the word HWND in cross-platform code is weird (at the very least, note that this is Windows only).
Also, what/why does it cause canAttachWindow to return the wrong result?

> Source/WebKit/win/ChangeLog:8
> +        There are a number of problems for docking behaviour on Windows.

s/for/with/

> Source/WebKit/win/ChangeLog:9
> +        For starters it does not ever constrain the inspectors size properly while docked.

s/For starters/For starters,/
s/inspectors/inspector's/

> Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp:296
> +    // We need to set the attached windows height before we actually attach the window.

s/windows/window's/

> Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp:297
> +    // Make sure that m_attached is true so that setAttachedWindowHeight succeeds.

s/succeeds/doesn't return early/?
Comment 3 Brian Weinstein 2012-11-12 14:44:36 PST
Comment on attachment 173710 [details]
patch

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

I'd like to see one more version with Tim's comments and mine addressed. Patch looks good though.

> Source/WebKit/win/ChangeLog:4
> +        https://bugs.webkit.org/show_bug.cgi?id=100000

100000!!!

> Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp:258
> +        restoreAttachedWindowHeight();

A comment explaining why we are restoring the attached window height before attaching would be nice.

>> Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp:297
>> +    // Make sure that m_attached is true so that setAttachedWindowHeight succeeds.
> 
> s/succeeds/doesn't return early/?

Should this say restoreAttachedWindowHeight instead of setAttachedWindowHeight?
Comment 4 Roger Fong 2012-11-12 14:54:28 PST
> >> Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp:297
> >> +    // Make sure that m_attached is true so that setAttachedWindowHeight succeeds.
> > 
> > s/succeeds/doesn't return early/?
> 
> Should this say restoreAttachedWindowHeight instead of setAttachedWindowHeight?

I meant setAttachedWindowHeight because restore calls setAttachedWindowHeight which has a check:

if (!m_attached)
 return;

which prevents the final height from being et properly. I guess both are correct but I figured it'd be a little clearer using the method that actually fails. Do you think I should make it restoreAttachedWindowHeight tho?
Comment 5 Roger Fong 2012-11-12 15:49:32 PST
Created attachment 173746 [details]
revised patch
Comment 6 Brian Weinstein 2012-11-12 16:06:46 PST
Comment on attachment 173746 [details]
revised patch

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

> Source/WebCore/inspector/InspectorFrontendClientLocal.cpp:143
> +    // Call setDockingUnavailable before bringToFront. If we display the inspector window via bringToFront first it causes the call to canAttachWindow to return the wrong result.

Another sentence on why this is the case would be helpful.

> Source/WebKit/win/ChangeLog:15
> +        (WebInspectorFrontendClient::frontendLoaded):
> +        (WebInspectorFrontendClient::attachWindow):

A high level comment about the changes in these functions would nice for people reading the ChangeLog later.

> Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp:299
> +    // Immediately after calling showWindowWithoutNotifications(), the parent frameview's visibleHeight incorrectly returns 0 always.

Is this a WebKit bug or a Windows bug?
Comment 7 Roger Fong 2012-11-12 16:40:19 PST
Committed: http://trac.webkit.org/changeset/134327

And made the last few remaining changes.

> Is this a WebKit bug or a Windows bug?

Yeup, windows bug. I added a comment or two to clarify
Comment 8 Tim Horton 2012-11-27 15:39:36 PST
Closing since it looks like this landed.