Commit 3b260925 authored by beidson@apple.com's avatar beidson@apple.com

REGRESSION: WebInspector docking busted on Windows

<rdar://problem/7728433> and https://bugs.webkit.org/show_bug.cgi?id=35953

Reviewed by Tim Hatcher.

WebCore: 

First off, a bit of settings-key related cleanup. If they're shared over multiple files, these 
things should be properly declared Strings, not random loose char*'s.

Along with that change, we move the "inspectorStartsAttachedSettingName" from WebKit down to the
InspectorController in WebCore.

Finally, when the controller is ready to show the WebInspector window, it can use this newly
exposed settings key to call "setWindowVisible" directly instead of relying on "showWindow" to do
it indirectly.

* WebCore.base.exp:

* inspector/InspectorBackend.cpp:
(WebCore::InspectorBackend::saveFrontendSettings):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::frontendSettingsSettingName):
(WebCore::InspectorController::inspectorStartsAttachedSettingName):
(WebCore::InspectorController::scriptObjectReady): Using the new inspectorStartsAttachedSettingName
  key and some "can I attach this?" logic, call setWindowVisible directly to display the inspector
  window.
(WebCore::InspectorController::populateScriptObjects):
* inspector/InspectorController.h:

WebKit/mac: 

* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController showWindow:]): Use the InspectorController:: copy of the should attach settings key.
(-[WebInspectorWindowController attach]): Ditto.
(-[WebInspectorWindowController detach]): Ditto.

WebKit/win: 

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorClient::attachWindow): Use the InspectorController:: copy of the should attach settings key.
(WebInspectorClient::detachWindow): Ditto.
(WebInspectorClient::showWindowWithoutNotifications): Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55761 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 86d03f39
2010-03-09 Brady Eidson <beidson@apple.com>
Reviewed by Tim Hatcher.
REGRESSION: WebInspector docking busted on Windows
<rdar://problem/7728433> and https://bugs.webkit.org/show_bug.cgi?id=35953
First off, a bit of settings-key related cleanup. If they're shared over multiple files, these
things should be properly declared Strings, not random loose char*'s.
Along with that change, we move the "inspectorStartsAttachedSettingName" from WebKit down to the
InspectorController in WebCore.
Finally, when the controller is ready to show the WebInspector window, it can use this newly
exposed settings key to call "setWindowVisible" directly instead of relying on "showWindow" to do
it indirectly.
* WebCore.base.exp:
* inspector/InspectorBackend.cpp:
(WebCore::InspectorBackend::saveFrontendSettings):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::frontendSettingsSettingName):
(WebCore::InspectorController::inspectorStartsAttachedSettingName):
(WebCore::InspectorController::scriptObjectReady): Using the new inspectorStartsAttachedSettingName
key and some "can I attach this?" logic, call setWindowVisible directly to display the inspector
window.
(WebCore::InspectorController::populateScriptObjects):
* inspector/InspectorController.h:
2010-03-09 Alexey Proskuryakov <ap@apple.com>
Reviewed by Mark Rowe.
......
......@@ -405,6 +405,7 @@ __ZN7WebCore19AnimationController17suspendAnimationsEPNS_8DocumentE
__ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKNS_6StringEd
__ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKNS_6StringEd
__ZN7WebCore19CSSStyleDeclaration11setPropertyERKNS_6StringES3_Ri
__ZN7WebCore19InspectorController34inspectorStartsAttachedSettingNameEv
__ZN7WebCore19SelectionController10setFocusedEb
__ZN7WebCore19SelectionController12setSelectionERKNS_16VisibleSelectionEbbb
__ZN7WebCore19SelectionController16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
......
/*
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
*
* Redistribution and use in source and binary forms, with or without
......@@ -82,7 +82,7 @@ InspectorBackend::~InspectorBackend()
void InspectorBackend::saveFrontendSettings(const String& settings)
{
if (m_inspectorController)
m_inspectorController->setSetting(InspectorController::FrontendSettingsSettingName, settings);
m_inspectorController->setSetting(InspectorController::frontendSettingsSettingName(), settings);
}
void InspectorBackend::storeLastActivePanel(const String& panelName)
......
/*
* Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
*
* Redistribution and use in source and binary forms, with or without
......@@ -119,7 +119,18 @@ static const char* const debuggerEnabledSettingName = "debuggerEnabled";
static const char* const profilerEnabledSettingName = "profilerEnabled";
static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight";
static const char* const lastActivePanelSettingName = "lastActivePanel";
const char* const InspectorController::FrontendSettingsSettingName = "frontendSettings";
const String& InspectorController::frontendSettingsSettingName()
{
DEFINE_STATIC_LOCAL(String, settingName, ("frontendSettings"));
return settingName;
}
const String& InspectorController::inspectorStartsAttachedSettingName()
{
DEFINE_STATIC_LOCAL(String, settingName, ("inspectorStartsAttached"));
return settingName;
}
static const unsigned defaultAttachedHeight = 300;
static const float minimumAttachedHeight = 250.0f;
......@@ -554,8 +565,15 @@ void InspectorController::scriptObjectReady()
enableProfiler();
#endif
// If no preference is set - default to an attached window. This is important for inspector LayoutTests.
String shouldAttachValue = setting(inspectorStartsAttachedSettingName());
bool shouldAttach = shouldAttachValue != "false";
if (shouldAttach && !canAttachWindow())
shouldAttach = false;
// Make sure our window is visible now that the page loaded
showWindow();
setWindowVisible(true, shouldAttach);
m_client->inspectorWindowObjectCleared();
}
......@@ -671,7 +689,7 @@ void InspectorController::populateScriptObjects()
if (!m_frontend)
return;
m_frontend->populateFrontendSettings(setting(FrontendSettingsSettingName));
m_frontend->populateFrontendSettings(setting(frontendSettingsSettingName()));
if (m_resourceTrackingEnabled)
m_frontend->resourceTrackingWasEnabled();
......
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
* Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -252,8 +252,11 @@ public:
void addScriptToEvaluateOnLoad(const String& source);
void removeAllScriptsToEvaluateOnLoad();
static const String& inspectorStartsAttachedSettingName();
private:
static const char* const FrontendSettingsSettingName;
static const String& frontendSettingsSettingName();
friend class InspectorBackend;
friend class InspectorFrontendHost;
friend class InjectedScriptHost;
......
2010-03-09 Brady Eidson <beidson@apple.com>
Reviewed by Tim Hatcher.
REGRESSION: WebInspector docking busted on Windows
<rdar://problem/7728433> and https://bugs.webkit.org/show_bug.cgi?id=35953
* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController showWindow:]): Use the InspectorController:: copy of the should attach settings key.
(-[WebInspectorWindowController attach]): Ditto.
(-[WebInspectorWindowController detach]): Ditto.
2010-03-09 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
......
......@@ -44,8 +44,6 @@
using namespace WebCore;
static const char* const inspectorStartsAttachedName = "inspectorStartsAttached";
@interface WebInspectorWindowController : NSWindowController <NSWindowDelegate> {
@private
WebView *_inspectedWebView;
......@@ -327,7 +325,7 @@ void WebInspectorClient::inspectorWindowObjectCleared()
_visible = YES;
// If no preference is set - default to an attached window. This is important for inspector LayoutTests.
String shouldAttach = [_inspectedWebView page]->inspectorController()->setting(inspectorStartsAttachedName);
String shouldAttach = [_inspectedWebView page]->inspectorController()->setting(InspectorController::inspectorStartsAttachedSettingName());
_shouldAttach = shouldAttach != "false";
if (_shouldAttach && ![_inspectedWebView page]->inspectorController()->canAttachWindow())
......@@ -365,7 +363,7 @@ void WebInspectorClient::inspectorWindowObjectCleared()
if (_attachedToInspectedWebView)
return;
[_inspectedWebView page]->inspectorController()->setSetting(inspectorStartsAttachedName, "true");
[_inspectedWebView page]->inspectorController()->setSetting(InspectorController::inspectorStartsAttachedSettingName(), "true");
_movingWindows = YES;
[self close];
......@@ -379,7 +377,7 @@ void WebInspectorClient::inspectorWindowObjectCleared()
if (!_attachedToInspectedWebView)
return;
[_inspectedWebView page]->inspectorController()->setSetting(inspectorStartsAttachedName, "false");
[_inspectedWebView page]->inspectorController()->setSetting(InspectorController::inspectorStartsAttachedSettingName(), "false");
_movingWindows = YES;
[self close];
......
2010-03-09 Brady Eidson <beidson@apple.com>
Reviewed by Tim Hatcher.
REGRESSION: WebInspector docking busted on Windows
<rdar://problem/7728433> and https://bugs.webkit.org/show_bug.cgi?id=35953
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorClient::attachWindow): Use the InspectorController:: copy of the should attach settings key.
(WebInspectorClient::detachWindow): Ditto.
(WebInspectorClient::showWindowWithoutNotifications): Ditto.
2010-03-09 John Sullivan <sullivan@apple.com>
Fixed localized string key collision. update-webkit-localized-strings now
......
/*
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -52,8 +52,6 @@
using namespace WebCore;
static const char* const inspectorStartsAttachedName = "inspectorStartsAttached";
static LPCTSTR kWebInspectorWindowClassName = TEXT("WebInspectorWindowClass");
static ATOM registerWindowClass();
static LPCTSTR kWebInspectorPointerProp = TEXT("WebInspectorPointer");
......@@ -233,7 +231,7 @@ void WebInspectorClient::attachWindow()
if (m_attached)
return;
m_inspectedWebView->page()->inspectorController()->setSetting(inspectorStartsAttachedName, "true");
m_inspectedWebView->page()->inspectorController()->setSetting(InspectorController::inspectorStartsAttachedSettingName(), "true");
closeWindowWithoutNotifications();
showWindowWithoutNotifications();
......@@ -244,7 +242,7 @@ void WebInspectorClient::detachWindow()
if (!m_attached)
return;
m_inspectedWebView->page()->inspectorController()->setSetting(inspectorStartsAttachedName, "false");
m_inspectedWebView->page()->inspectorController()->setSetting(InspectorController::inspectorStartsAttachedSettingName(), "false");
closeWindowWithoutNotifications();
showWindowWithoutNotifications();
......@@ -350,7 +348,7 @@ void WebInspectorClient::showWindowWithoutNotifications()
ASSERT(m_inspectedWebViewHwnd);
// If no preference is set - default to an attached window. This is important for inspector LayoutTests.
String shouldAttach = m_inspectedWebView->page()->inspectorController()->setting(inspectorStartsAttachedName);
String shouldAttach = m_inspectedWebView->page()->inspectorController()->setting(InspectorController::inspectorStartsAttachedSettingName());
m_shouldAttachWhenShown = shouldAttach != "false";
if (m_shouldAttachWhenShown && !m_inspectedWebView->page()->inspectorController()->canAttachWindow())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment