https://bugs.webkit.org/show_bug.cgi?id=175108
Reviewed by Brian Burg.
Source/WebCore:
This patch just exposes a function to the inspector page. No new functionality was added.
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::inspectInspector):
Source/WebInspectorUI:
* UserInterface/Debug/Bootstrap.js:
(updateDebugUI):
(WI.runBootstrapOperations):
* UserInterface/Views/ButtonToolbarItem.js:
(WI.ButtonToolbarItem):
(WI.ButtonToolbarItem.prototype.get label): Deleted.
(WI.ButtonToolbarItem.prototype.set label): Deleted.
* UserInterface/Views/ButtonToolbarItem.css:
(.toolbar .item.button):
(.toolbar .item.button:not(.disabled):active):
(.toolbar .item.button:not(.disabled):matches(:focus, .activate.activated)):
(.toolbar .item.button:not(.disabled):active:matches(:focus, .activate.activated)):
(.toolbar .item.button > .glyph):
(.toolbar .item.button:not(.disabled):active > .glyph): Deleted.
(.toolbar .item.button:not(.disabled):matches(:focus, .activate.activated) > .glyph): Deleted.
(.toolbar .item.button:not(.disabled):active:matches(:focus, .activate.activated) > .glyph): Deleted.
(.toolbar .item.button > .label): Deleted.
* UserInterface/Views/ActivateButtonToolbarItem.js:
(WI.ActivateButtonToolbarItem):
(WI.ActivateButtonToolbarItem.prototype.get label): Deleted.
(WI.ActivateButtonToolbarItem.prototype.set label): Deleted.
* UserInterface/Base/Main.js:
(WI.contentLoaded):
Remove unused `label` parameter from Toolbar objects.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220235
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-08-03 Devin Rousso <drousso@apple.com>
+
+ Web Inspector: add button to open Inspector^2
+ https://bugs.webkit.org/show_bug.cgi?id=175108
+
+ Reviewed by Brian Burg.
+
+ This patch just exposes a function to the inspector page. No new functionality was added.
+
+ * inspector/InspectorFrontendHost.idl:
+ * inspector/InspectorFrontendHost.h:
+ * inspector/InspectorFrontendHost.cpp:
+ (WebCore::InspectorFrontendHost::inspectInspector):
+
2017-08-03 Matt Baker <mattbaker@apple.com>
Web Inspector: Instrument WebGLProgram created/deleted
#include "Event.h"
#include "FocusController.h"
#include "HitTestResult.h"
+#include "InspectorController.h"
#include "InspectorFrontendClient.h"
#include "JSMainThreadExecState.h"
#include "MainFrame.h"
PAL::systemBeep();
}
+void InspectorFrontendHost::inspectInspector()
+{
+ if (m_frontendPage)
+ m_frontendPage->inspectorController().show();
+}
+
} // namespace WebCore
void unbufferedLog(const String& message);
void beep();
+ void inspectInspector();
private:
#if ENABLE(CONTEXT_MENUS)
boolean isUnderTest();
void beep();
+ void inspectInspector();
};
dictionary ContextMenuItem {
+2017-08-03 Devin Rousso <drousso@apple.com>
+
+ Web Inspector: add button to open Inspector^2
+ https://bugs.webkit.org/show_bug.cgi?id=175108
+
+ Reviewed by Brian Burg.
+
+ * UserInterface/Debug/Bootstrap.js:
+ (updateDebugUI):
+ (WI.runBootstrapOperations):
+
+ * UserInterface/Views/ButtonToolbarItem.js:
+ (WI.ButtonToolbarItem):
+ (WI.ButtonToolbarItem.prototype.get label): Deleted.
+ (WI.ButtonToolbarItem.prototype.set label): Deleted.
+ * UserInterface/Views/ButtonToolbarItem.css:
+ (.toolbar .item.button):
+ (.toolbar .item.button:not(.disabled):active):
+ (.toolbar .item.button:not(.disabled):matches(:focus, .activate.activated)):
+ (.toolbar .item.button:not(.disabled):active:matches(:focus, .activate.activated)):
+ (.toolbar .item.button > .glyph):
+ (.toolbar .item.button:not(.disabled):active > .glyph): Deleted.
+ (.toolbar .item.button:not(.disabled):matches(:focus, .activate.activated) > .glyph): Deleted.
+ (.toolbar .item.button:not(.disabled):active:matches(:focus, .activate.activated) > .glyph): Deleted.
+ (.toolbar .item.button > .label): Deleted.
+ * UserInterface/Views/ActivateButtonToolbarItem.js:
+ (WI.ActivateButtonToolbarItem):
+ (WI.ActivateButtonToolbarItem.prototype.get label): Deleted.
+ (WI.ActivateButtonToolbarItem.prototype.set label): Deleted.
+ * UserInterface/Base/Main.js:
+ (WI.contentLoaded):
+ Remove unused `label` parameter from Toolbar objects.
+
2017-08-03 Matt Baker <mattbaker@apple.com>
Web Inspector: Instrument WebGLProgram created/deleted
this._closeToolbarButton = new WI.ControlToolbarItem("dock-close", WI.UIString("Close"), "Images/Close.svg", 16, 14);
this._closeToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this.close, this);
- this._undockToolbarButton = new WI.ButtonToolbarItem("undock", WI.UIString("Detach into separate window"), null, "Images/Undock.svg");
+ this._undockToolbarButton = new WI.ButtonToolbarItem("undock", WI.UIString("Detach into separate window"), "Images/Undock.svg");
this._undockToolbarButton.element.classList.add(WI.Popover.IgnoreAutoDismissClassName);
this._undockToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._undock, this);
let dockImage = WI.resolvedLayoutDirection() === WI.LayoutDirection.RTL ? "Images/DockLeft.svg" : "Images/DockRight.svg";
- this._dockToSideToolbarButton = new WI.ButtonToolbarItem("dock-right", WI.UIString("Dock to side of window"), null, dockImage);
+ this._dockToSideToolbarButton = new WI.ButtonToolbarItem("dock-right", WI.UIString("Dock to side of window"), dockImage);
this._dockToSideToolbarButton.element.classList.add(WI.Popover.IgnoreAutoDismissClassName);
let dockToSideCallback = WI.resolvedLayoutDirection() === WI.LayoutDirection.RTL ? this._dockLeft : this._dockRight;
this._dockToSideToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, dockToSideCallback, this);
- this._dockBottomToolbarButton = new WI.ButtonToolbarItem("dock-bottom", WI.UIString("Dock to bottom of window"), null, "Images/DockBottom.svg");
+ this._dockBottomToolbarButton = new WI.ButtonToolbarItem("dock-bottom", WI.UIString("Dock to bottom of window"), "Images/DockBottom.svg");
this._dockBottomToolbarButton.element.classList.add(WI.Popover.IgnoreAutoDismissClassName);
this._dockBottomToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._dockBottom, this);
else
toolTip = WI.UIString("Reload this page (%s)\nReload ignoring cache (%s)").format(this._reloadPageKeyboardShortcut.displayName, this._reloadPageIgnoringCacheKeyboardShortcut.displayName);
- this._reloadToolbarButton = new WI.ButtonToolbarItem("reload", toolTip, null, "Images/ReloadToolbar.svg");
+ this._reloadToolbarButton = new WI.ButtonToolbarItem("reload", toolTip, "Images/ReloadToolbar.svg");
this._reloadToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._reloadPageClicked, this);
- this._downloadToolbarButton = new WI.ButtonToolbarItem("download", WI.UIString("Download Web Archive"), null, "Images/DownloadArrow.svg");
+ this._downloadToolbarButton = new WI.ButtonToolbarItem("download", WI.UIString("Download Web Archive"), "Images/DownloadArrow.svg");
this._downloadToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._downloadWebArchive, this);
this._updateReloadToolbarButton();
if (this.debuggableType === WI.DebuggableType.Web) {
var toolTip = WI.UIString("Start element selection (%s)").format(WI._inspectModeKeyboardShortcut.displayName);
var activatedToolTip = WI.UIString("Stop element selection (%s)").format(WI._inspectModeKeyboardShortcut.displayName);
- this._inspectModeToolbarButton = new WI.ActivateButtonToolbarItem("inspect", toolTip, activatedToolTip, null, "Images/Crosshair.svg");
+ this._inspectModeToolbarButton = new WI.ActivateButtonToolbarItem("inspect", toolTip, activatedToolTip, "Images/Crosshair.svg");
this._inspectModeToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleInspectMode, this);
}
this._dashboardContainer = new WI.DashboardContainerView;
this._dashboardContainer.showDashboardViewForRepresentedObject(this.dashboardManager.dashboards.default);
- this._searchToolbarItem = new WI.SearchBar("inspector-search", WI.UIString("Search"), null, true);
+ this._searchToolbarItem = new WI.SearchBar("inspector-search", WI.UIString("Search"), true);
this._searchToolbarItem.addEventListener(WI.SearchBar.Event.TextChanged, this._searchTextDidChange, this);
this.toolbar.addToolbarItem(this._closeToolbarButton, WI.Toolbar.Section.Control);
window.location.reload();
});
- const toolTip = WI.unlocalizedString("Enable dump inspector messages to console");
- const activatedToolTip = WI.unlocalizedString("Disable dump inspector messages to console");
- let debugInspectorToolbarButton = new WI.ActivateButtonToolbarItem("debug-inspector", toolTip, activatedToolTip, null, "Images/Console.svg");
- debugInspectorToolbarButton.activated = InspectorBackend.dumpInspectorProtocolMessages;
- WI.toolbar.addToolbarItem(debugInspectorToolbarButton, WI.Toolbar.Section.CenterRight);
- debugInspectorToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, () => {
+ const dumpMessagesToolTip = WI.unlocalizedString("Enable dump inspector messages to console");
+ const dumpMessagesActivatedToolTip = WI.unlocalizedString("Disable dump inspector messages to console");
+ let dumpMessagesToolbarItem = new WI.ActivateButtonToolbarItem("dump-messages", dumpMessagesToolTip, dumpMessagesActivatedToolTip, "Images/Console.svg");
+ dumpMessagesToolbarItem.activated = InspectorBackend.dumpInspectorProtocolMessages;
+ dumpMessagesToolbarItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, () => {
InspectorBackend.dumpInspectorProtocolMessages = !InspectorBackend.dumpInspectorProtocolMessages;
- debugInspectorToolbarButton.activated = InspectorBackend.dumpInspectorProtocolMessages;
+ dumpMessagesToolbarItem.activated = InspectorBackend.dumpInspectorProtocolMessages;
});
WI.settings.autoLogProtocolMessages.addEventListener(WI.Setting.Event.Changed, () => {
- debugInspectorToolbarButton.activated = InspectorBackend.dumpInspectorProtocolMessages;
+ dumpMessagesToolbarItem.activated = InspectorBackend.dumpInspectorProtocolMessages;
});
+ WI.toolbar.addToolbarItem(dumpMessagesToolbarItem, WI.Toolbar.Section.CenterRight);
+
+ let inspectionLevel = InspectorFrontendHost ? InspectorFrontendHost.inspectionLevel() : 1;
+ const inspectInspectorToolTip = WI.unlocalizedString("Open Web Inspector [%d]").format(inspectionLevel + 1);
+ let inspectInspectorToolbarItem = new WI.ButtonToolbarItem("inspect-inspector", inspectInspectorToolTip);
+ inspectInspectorToolbarItem.element.textContent = inspectionLevel + 1;
+ inspectInspectorToolbarItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, () => {
+ InspectorFrontendHost.inspectInspector();
+ });
+ WI.toolbar.addToolbarItem(inspectInspectorToolbarItem, WI.Toolbar.Section.CenterRight);
function updateDebugUI()
{
- debugInspectorToolbarButton.hidden = !WI.showDebugUISetting.value;
+ dumpMessagesToolbarItem.hidden = !WI.showDebugUISetting.value;
+ inspectInspectorToolbarItem.hidden = !WI.showDebugUISetting.value;
}
WI.showDebugUISetting.addEventListener(WI.Setting.Event.Changed, () => {
WI.ActivateButtonToolbarItem = class ActivateButtonToolbarItem extends WI.ActivateButtonNavigationItem
{
- constructor(identifier, defaultToolTip, activatedToolTip, label, image, role)
+ constructor(identifier, defaultToolTip, activatedToolTip, image, role)
{
super(identifier, defaultToolTip, activatedToolTip, image, 16, 16, role);
-
- if (typeof label === "string") {
- this._labelElement = document.createElement("div");
- this._labelElement.className = WI.ButtonToolbarItem.LabelStyleClassName;
- this._element.appendChild(this._labelElement);
-
- this.label = label;
- }
- }
-
- // Public
-
- get label()
- {
- return this._labelElement.textContent;
- }
-
- set label(newLabel)
- {
- console.assert(newLabel);
- if (!newLabel || !this._labelElement)
- return;
-
- this._labelElement.textContent = newLabel;
}
};
margin: 4px;
padding: 0 10px;
-}
-
-.toolbar .item.button > .glyph {
- width: 16px;
- height: 16px;
color: hsl(0, 0%, 45%);
}
-.toolbar .item.button:not(.disabled):active > .glyph {
+.toolbar .item.button:not(.disabled):active {
color: hsl(0, 0%, 30%);
}
-.toolbar .item.button:not(.disabled):matches(:focus, .activate.activated) > .glyph {
+.toolbar .item.button:not(.disabled):matches(:focus, .activate.activated) {
color: var(--selected-background-color);
}
-.toolbar .item.button:not(.disabled):active:matches(:focus, .activate.activated) > .glyph {
+.toolbar .item.button:not(.disabled):active:matches(:focus, .activate.activated) {
color: var(--selected-background-color-active);
}
-.toolbar .item.button > .label {
- display: none;
+.toolbar .item.button > .glyph {
+ width: 16px;
+ height: 16px;
}
body.window-inactive .toolbar .item.button {
WI.ButtonToolbarItem = class ButtonToolbarItem extends WI.ButtonNavigationItem
{
- constructor(identifier, toolTip, label, image, role)
+ constructor(identifier, toolTip, image, role)
{
super(identifier, toolTip, image, 16, 16, role);
-
- if (typeof label === "string") {
- this._labelElement = document.createElement("div");
- this._labelElement.className = WI.ButtonToolbarItem.LabelStyleClassName;
- this._element.appendChild(this._labelElement);
-
- this.label = label;
- }
- }
-
- // Public
-
- get label()
- {
- return this._labelElement.textContent;
- }
-
- set label(newLabel)
- {
- console.assert(newLabel);
- if (!newLabel || !this._labelElement)
- return;
-
- this._labelElement.textContent = newLabel;
}
};
-
-WI.ButtonToolbarItem.LabelStyleClassName = "label";