Bug 27263

Summary: WebInspector: show last opened panel when invoking inspector.
Product: WebKit Reporter: Pavel Feldman <pfeldman>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: joepeck, keishi, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch
timothy: review+
patch
none
patch
none
patch
timothy: review+
patch none

Description Pavel Feldman 2009-07-14 08:40:54 PDT
Currently Elements panel is being shown on open, no matter which one user was using before.
Comment 1 Pavel Feldman 2009-07-14 08:52:35 PDT
Created attachment 32715 [details]
patch
Comment 2 Timothy Hatcher 2009-07-14 09:01:47 PDT
Comment on attachment 32715 [details]
patch

> +          if (lastActivePanelSetting.type() == Setting::StringType) {
> +              m_showAfterVisible = specialPanelForJSName(lastActivePanelSetting.string());
> +          }

No need for the curly braces.
Comment 3 Pavel Feldman 2009-07-14 09:30:16 PDT
Sending        WebCore/ChangeLog
Sending        WebCore/inspector/InspectorController.cpp
Sending        WebCore/inspector/InspectorController.h
Sending        WebCore/inspector/InspectorController.idl
Sending        WebCore/inspector/front-end/inspector.js
Transmitting file data .....
Committed revision 45861.
Comment 4 Joseph Pecoraro 2009-07-14 17:11:38 PDT
After this was applied I got a small error when I open the Inspector with the ⌥⌘C shortcut that opens the console.

TypeError: Result of expression 'WebInspector.currentPanel' [undefined] is not a valid argument for 'in'.

That comes from Console.js, at approx line 87:
http://trac.webkit.org/browser/trunk/WebCore/inspector/front-end/Console.js#L59

  function animationFinished()
  {
      if ("updateStatusBarItems" in WebInspector.currentPanel)
          WebInspector.currentPanel.updateStatusBarItems();
      WebInspector.currentFocusElement = this.promptElement;
      delete this._animating;
  }

I think that has to do with the fact that a "this.currentPanel" was deleted in this patch.
Comment 5 Joseph Pecoraro 2009-07-14 17:19:49 PDT
Eek, opening with ⌥⌘I I am getting an empty error messages from:
InspectorController.storeLastActivePanel(panelName);
Comment 6 Pavel Feldman 2009-07-14 22:47:28 PDT
Created attachment 32766 [details]
patch
Comment 7 Pavel Feldman 2009-07-14 22:53:31 PDT
Created attachment 32767 [details]
patch
Comment 8 Pavel Feldman 2009-07-14 22:54:07 PDT
Created attachment 32768 [details]
patch
Comment 9 Pavel Feldman 2009-07-15 01:11:39 PDT
Sending        WebCore/ChangeLog
Sending        WebCore/inspector/InspectorController.cpp
Sending        WebCore/inspector/InspectorController.idl
Transmitting file data ...
Committed revision 45899.
Comment 10 Keishi Hattori 2009-07-15 20:22:14 PDT
This error seems to happen because [WebInspector showConsole] firing before m_frontend is set causes m_showAfterVisible to be overridden from CurrentPanel to ConsolePanel. I'm not sure but maybe adding m_showConsoleAfterVisible would be a fix?
Comment 11 Pavel Feldman 2009-07-16 02:34:58 PDT
Created attachment 32847 [details]
patch

Special case ConsolePanel opening.
Comment 12 Eric Seidel (no email) 2009-07-20 15:04:01 PDT
Comment on attachment 32847 [details]
patch

If this is closed as fixed, nothing should be marked for review.