Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (229542 => 229543)
--- trunk/Source/WebInspectorUI/ChangeLog 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/ChangeLog 2018-03-12 19:35:00 UTC (rev 229543)
@@ -1,3 +1,84 @@
+2018-03-12 Jon Davis <j...@apple.com>
+
+ Web Inspector: Remove redundant tooltips
+ https://bugs.webkit.org/show_bug.cgi?id=183099
+
+ Reviewed by Matt Baker.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ * UserInterface/Base/Main.js:
+ (WI.contentLoaded):
+ Instantiate ConsoleDrawer so the keyboard shortcuts for FindBanner are available.
+
+ * UserInterface/Views/BreakpointTreeElement.js:
+ (WI.BreakpointTreeElement):
+ Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler.
+
+ * UserInterface/Views/ButtonNavigationItem.js:
+ (WI.ButtonNavigationItem):
+ Only show tooltips when the button style is an image.
+
+ * UserInterface/Views/ConsoleDrawer.js:
+ (WI.ConsoleDrawer):
+ (WI.ConsoleDrawer.prototype.toggleButtonShortcutTooltip):
+ Added helper to set the toggle button keyboard shortcut tooltip.
+
+ * UserInterface/Views/DOMBreakpointTreeElement.js:
+ (WI.DOMBreakpointTreeElement):
+ Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler.
+
+ * UserInterface/Views/DOMNodeTreeElement.js:
+ (WI.DOMNodeTreeElement):
+ Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler.
+
+ * UserInterface/Views/FindBanner.js:
+ (WI.FindBanner):
+ * UserInterface/Views/HierarchicalPathComponent.js:
+ (WI.HierarchicalPathComponent):
+ (WI.HierarchicalPathComponent.prototype.get tooltip):
+ (WI.HierarchicalPathComponent.prototype.set tooltip):
+ (WI.HierarchicalPathComponent.prototype.get hideTooltip):
+ (WI.HierarchicalPathComponent.prototype.set hideTooltip):
+ (WI.HierarchicalPathComponent.prototype._updateElementTitleAndText):
+ Add tooltip management features to manage tooltips separately of the displayName,
+ and provide a behavior to hide tooltips while retaining the tooltip data.
+
+ * UserInterface/Views/HierarchicalPathNavigationItem.js:
+ (WI.HierarchicalPathNavigationItem.prototype.updateLayout):
+ Hide tooltips when fully visible, show tooltips for collapsed items.
+
+ * UserInterface/Views/PinnedTabBarItem.js:
+ (WI.PinnedTabBarItem.prototype.titleDidChange):
+ Set tooltips for pinned tab bar items.
+
+ * UserInterface/Views/QuickConsole.js:
+ (WI.QuickConsole):
+ Set the ConsoleDrawer toggle button tooltip after the keyboard shortcut is registered.
+
+ * UserInterface/Views/StorageTreeElement.js:
+ (WI.StorageTreeElement):
+ Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler.
+
+ * UserInterface/Views/TabBarItem.js:
+ (WI.TabBarItem.prototype.get title):
+ (WI.TabBarItem.prototype.set title):
+ (WI.TabBarItem.prototype.titleDidChange):
+ (WI.TabBarItem):
+ Add title property management with an overridable titleDidChange handler for
+ setting tooltips when needed.
+
+ * UserInterface/Views/TimelineTreeElement.js:
+ (WI.TimelineTreeElement):
+ Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler.
+
+ * UserInterface/Views/ToggleButtonNavigationItem.js:
+ (WI.ToggleButtonNavigationItem.prototype.set defaultToolTip):
+ Added a setter for manging the default tooltip of a toggle button.
+
+ * UserInterface/Views/XHRBreakpointTreeElement.js:
+ (WI.XHRBreakpointTreeElement):
+ Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler.
+
2018-03-09 Nikita Vasilyev <nvasil...@apple.com>
Web Inspector: Sources: Open all resources in Sources tab instead of Resources/Debugger
Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -420,6 +420,8 @@
localizedStrings["Fill Mode"] = "Fill Mode";
localizedStrings["Filter"] = "Filter";
localizedStrings["Filter Full URL"] = "Filter Full URL";
+localizedStrings["Find Next (%s)"] = "Find Next (%s)";
+localizedStrings["Find Previous (%s)"] = "Find Previous (%s)";
localizedStrings["Flexbox"] = "Flexbox";
localizedStrings["Float"] = "Float";
localizedStrings["Float and Clear"] = "Float and Clear";
@@ -474,6 +476,7 @@
localizedStrings["Heap Snapshot Object (%s)"] = "Heap Snapshot Object (%s)";
localizedStrings["Height"] = "Height";
localizedStrings["Hide Console"] = "Hide Console";
+localizedStrings["Hide Console (%s)"] = "Hide Console (%s)";
localizedStrings["Hide Grid"] = "Hide Grid";
localizedStrings["Hide Path"] = "Hide Path";
localizedStrings["Hide compositing borders"] = "Hide compositing borders";
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -281,10 +281,6 @@
this._contentElement.setAttribute("role", "main");
this._contentElement.setAttribute("aria-label", WI.UIString("Content"));
- this.consoleDrawer = new WI.ConsoleDrawer(document.getElementById("console-drawer"));
- this.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.CollapsedStateChanged, this._consoleDrawerCollapsedStateDidChange, this);
- this.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.Resized, this._consoleDrawerDidResize, this);
-
this.clearKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, "K", this._clear.bind(this));
// FIXME: <https://webkit.org/b/151310> Web Inspector: Command-E should propagate to other search fields (including the system)
@@ -293,6 +289,10 @@
this.findNextKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, "G", this._findNext.bind(this));
this.findPreviousKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.Shift | WI.KeyboardShortcut.Modifier.CommandOrControl, "G", this._findPrevious.bind(this));
+ this.consoleDrawer = new WI.ConsoleDrawer(document.getElementById("console-drawer"));
+ this.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.CollapsedStateChanged, this._consoleDrawerCollapsedStateDidChange, this);
+ this.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.Resized, this._consoleDrawerDidResize, this);
+
this.quickConsole = new WI.QuickConsole(document.getElementById("quick-console"));
this._consoleRepresentedObject = new WI.LogObject;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -62,6 +62,7 @@
this._iconAnimationLayerElement = document.createElement("span");
this.iconElement.appendChild(this._iconAnimationLayerElement);
+ this.tooltipHandledSeparately = true;
}
// Public
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -34,8 +34,6 @@
this._enabled = true;
- this.tooltip = toolTipOrLabel;
-
this.element.addEventListener("click", this._mouseClicked.bind(this));
if (label)
@@ -49,6 +47,9 @@
this._label = toolTipOrLabel;
this.buttonStyle = this._image ? WI.ButtonNavigationItem.Style.Image : WI.ButtonNavigationItem.Style.Text;
+
+ if (this.buttonStyle === WI.ButtonNavigationItem.Style.Image)
+ this.tooltip = toolTipOrLabel;
}
// Public
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleDrawer.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleDrawer.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleDrawer.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -39,6 +39,7 @@
this.navigationBar.element.addEventListener("mousedown", this._consoleResizerMouseDown.bind(this));
this._toggleDrawerButton = new WI.ToggleButtonNavigationItem("toggle-drawer", WI.UIString("Hide Console"), WI.UIString("Show Console"), "Images/HideConsoleDrawer.svg", "Images/ShowConsoleDrawer.svg");
+
this._toggleDrawerButton.visibilityPriority = WI.NavigationItem.VisibilityPriority.High;
this._toggleDrawerButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, () => { WI.toggleSplitConsole(); });
this.navigationBar.insertNavigationItem(this._toggleDrawerButton, 0);
@@ -50,6 +51,11 @@
// Public
+ toggleButtonShortcutTooltip(keyboardShortcut)
+ {
+ this._toggleDrawerButton.defaultToolTip = WI.UIString("Hide Console (%s)").format(keyboardShortcut.displayName);
+ }
+
get collapsed()
{
return this._collapsed;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -40,6 +40,7 @@
this._statusImageElement = document.createElement("img");
this._statusImageElement.classList.add("status-image", "resolved");
this.status = this._statusImageElement;
+ this.tooltipHandledSeparately = true;
breakpoint.addEventListener(WI.DOMBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeTreeElement.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeTreeElement.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeTreeElement.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -33,6 +33,7 @@
super("dom-node", domNode.displayName, subtitle, domNode, {hasChildren: true});
this.status = WI.linkifyNodeReferenceElement(domNode, WI.createGoToArrowButton());
+ this.tooltipHandledSeparately = true;
}
// Protected
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -53,6 +53,7 @@
this._previousResultButton = document.createElement("button");
this._previousResultButton.classList.add("segmented", "previous-result");
this._previousResultButton.disabled = true;
+ this._previousResultButton.title = WI.UIString("Find Previous (%s)").format(WI.findPreviousKeyboardShortcut.displayName);;
this._previousResultButton.addEventListener("click", this._previousResultButtonClicked.bind(this));
this.element.appendChild(this._previousResultButton);
@@ -63,6 +64,7 @@
this._nextResultButton = document.createElement("button");
this._nextResultButton.classList.add("segmented", "next-result");
this._nextResultButton.disabled = true;
+ this._nextResultButton.title = WI.UIString("Find Next (%s)").format(WI.findNextKeyboardShortcut.displayName);;
this._nextResultButton.addEventListener("click", this._nextResultButtonClicked.bind(this));
this.element.appendChild(this._nextResultButton);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -81,6 +81,7 @@
this._selectorArrows = false;
this.displayName = displayName;
+ this.tooltip = displayName;
this.selectorArrows = showSelectorArrows;
}
@@ -217,6 +218,32 @@
this._element.classList.toggle("show-selector-arrows", !!this._selectorArrows);
}
+ get tooltip()
+ {
+ return this._tooltip;
+ }
+
+ set tooltip(x)
+ {
+ if (x === this._tooltip)
+ return;
+
+
+ this._tooltip = x;
+ this._updateElementTitleAndText();
+ }
+
+ get hideTooltip ()
+ {
+ return this._hideTooltip;
+ }
+
+ set hideTooltip(hide)
+ {
+ this._hideTooltip = hide;
+ this._updateElementTitleAndText();
+ }
+
get previousSibling() { return this._previousSibling; }
set previousSibling(newSlibling) { this._previousSibling = newSlibling || null; }
get nextSibling() { return this._nextSibling; }
@@ -230,8 +257,12 @@
if (this._truncatedDisplayNameLength && truncatedDisplayName.length > this._truncatedDisplayNameLength)
truncatedDisplayName = truncatedDisplayName.substring(0, this._truncatedDisplayNameLength) + ellipsis;
- this._element.title = this._displayName;
this._titleContentElement.textContent = truncatedDisplayName;
+
+ if (this.hideTooltip)
+ this._element.title = "";
+ else
+ this._element.title = this._tooltip;
}
_updateSelectElement()
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -118,6 +118,7 @@
for (var i = 0; i < this._components.length; ++i) {
this._components[i].hidden = false;
this._components[i].forcedWidth = null;
+ this._components[i].hideTooltip = true;
}
if (expandOnly)
@@ -161,6 +162,8 @@
for (var i = 0; i < this._components.length; ++i) {
var componentWidth = componentWidths[i];
+ this._components[i].hideTooltip = false;
+
// Try to take the whole width we need to remove from each component.
var forcedWidth = componentWidth - widthToRemove;
this._components[i].forcedWidth = forcedWidth;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/PinnedTabBarItem.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/PinnedTabBarItem.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/PinnedTabBarItem.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -39,6 +39,11 @@
return new WI.PinnedTabBarItem(image, title);
}
+ titleDidChange()
+ {
+ this.element.title = this.title;
+ }
+
// Private
_handleContextMenuEvent(event)
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -66,6 +66,9 @@
this._rebuildExecutionContextPathComponents();
+ WI.consoleDrawer.toggleButtonShortcutTooltip(this._toggleOrFocusKeyboardShortcut);
+ WI.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.CollapsedStateChanged, this._updateStyles, this);
+
WI.Frame.addEventListener(WI.Frame.Event.PageExecutionContextChanged, this._framePageExecutionContextsChanged, this);
WI.Frame.addEventListener(WI.Frame.Event.ExecutionContextsCleared, this._frameExecutionContextsCleared, this);
@@ -76,8 +79,6 @@
WI.targetManager.addEventListener(WI.TargetManager.Event.TargetAdded, this._targetAdded, this);
WI.targetManager.addEventListener(WI.TargetManager.Event.TargetRemoved, this._targetRemoved, this);
- WI.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.CollapsedStateChanged, this._updateStyles, this);
-
WI.TabBrowser.addEventListener(WI.TabBrowser.Event.SelectedTabContentViewDidChange, this._updateStyles, this);
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/StorageTreeElement.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/StorageTreeElement.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/StorageTreeElement.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -31,6 +31,7 @@
super(classNames, title, subtitle, representedObject);
this.flattened = false;
+ this.tooltipHandledSeparately = true;
}
// Public
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TabBarItem.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TabBarItem.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TabBarItem.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -99,8 +99,25 @@
get image() { return this._iconElement.src; }
set image(url) { this._iconElement.src = "" || ""; }
- get title() { return this._element.title || ""; }
- set title(title) { this._element.title = title || ""; }
+ get title()
+ {
+ return this._title;
+ }
+
+ set title(title)
+ {
+ title = title || "";
+ if (this._title === title)
+ return;
+
+ this._title = title;
+ this.titleDidChange();
+ }
+
+ titleDidChange()
+ {
+ // Implemented by subclasses.
+ }
};
WI.TabBarItem.StyleClassName = "item";
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTreeElement.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTreeElement.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTreeElement.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -35,6 +35,7 @@
this._placeholder = placeholder || false;
this.editing = this._placeholder;
+ this.tooltipHandledSeparately = true;
}
// Public
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -43,6 +43,14 @@
return this._defaultToolTip;
}
+ set defaultToolTip(toolTip)
+ {
+ this._defaultToolTip = toolTip;
+
+ if (!this._toggled)
+ this.tooltip = this._defaultToolTip;
+ }
+
get alternateToolTip()
{
return this._alternateToolTip;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js (229542 => 229543)
--- trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js 2018-03-12 19:25:19 UTC (rev 229542)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js 2018-03-12 19:35:00 UTC (rev 229543)
@@ -46,6 +46,7 @@
this._statusImageElement = document.createElement("img");
this._statusImageElement.classList.add("status-image", "resolved");
this.status = this._statusImageElement;
+ this.tooltipHandledSeparately = true;
breakpoint.addEventListener(WI.XHRBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this);