Changeset 229543 in webkit
- Timestamp:
- Mar 12, 2018 12:35:00 PM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r229495 r229543 1 2018-03-12 Jon Davis <jond@apple.com> 2 3 Web Inspector: Remove redundant tooltips 4 https://bugs.webkit.org/show_bug.cgi?id=183099 5 6 Reviewed by Matt Baker. 7 8 * Localizations/en.lproj/localizedStrings.js: 9 * UserInterface/Base/Main.js: 10 (WI.contentLoaded): 11 Instantiate ConsoleDrawer so the keyboard shortcuts for FindBanner are available. 12 13 * UserInterface/Views/BreakpointTreeElement.js: 14 (WI.BreakpointTreeElement): 15 Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler. 16 17 * UserInterface/Views/ButtonNavigationItem.js: 18 (WI.ButtonNavigationItem): 19 Only show tooltips when the button style is an image. 20 21 * UserInterface/Views/ConsoleDrawer.js: 22 (WI.ConsoleDrawer): 23 (WI.ConsoleDrawer.prototype.toggleButtonShortcutTooltip): 24 Added helper to set the toggle button keyboard shortcut tooltip. 25 26 * UserInterface/Views/DOMBreakpointTreeElement.js: 27 (WI.DOMBreakpointTreeElement): 28 Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler. 29 30 * UserInterface/Views/DOMNodeTreeElement.js: 31 (WI.DOMNodeTreeElement): 32 Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler. 33 34 * UserInterface/Views/FindBanner.js: 35 (WI.FindBanner): 36 * UserInterface/Views/HierarchicalPathComponent.js: 37 (WI.HierarchicalPathComponent): 38 (WI.HierarchicalPathComponent.prototype.get tooltip): 39 (WI.HierarchicalPathComponent.prototype.set tooltip): 40 (WI.HierarchicalPathComponent.prototype.get hideTooltip): 41 (WI.HierarchicalPathComponent.prototype.set hideTooltip): 42 (WI.HierarchicalPathComponent.prototype._updateElementTitleAndText): 43 Add tooltip management features to manage tooltips separately of the displayName, 44 and provide a behavior to hide tooltips while retaining the tooltip data. 45 46 * UserInterface/Views/HierarchicalPathNavigationItem.js: 47 (WI.HierarchicalPathNavigationItem.prototype.updateLayout): 48 Hide tooltips when fully visible, show tooltips for collapsed items. 49 50 * UserInterface/Views/PinnedTabBarItem.js: 51 (WI.PinnedTabBarItem.prototype.titleDidChange): 52 Set tooltips for pinned tab bar items. 53 54 * UserInterface/Views/QuickConsole.js: 55 (WI.QuickConsole): 56 Set the ConsoleDrawer toggle button tooltip after the keyboard shortcut is registered. 57 58 * UserInterface/Views/StorageTreeElement.js: 59 (WI.StorageTreeElement): 60 Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler. 61 62 * UserInterface/Views/TabBarItem.js: 63 (WI.TabBarItem.prototype.get title): 64 (WI.TabBarItem.prototype.set title): 65 (WI.TabBarItem.prototype.titleDidChange): 66 (WI.TabBarItem): 67 Add title property management with an overridable titleDidChange handler for 68 setting tooltips when needed. 69 70 * UserInterface/Views/TimelineTreeElement.js: 71 (WI.TimelineTreeElement): 72 Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler. 73 74 * UserInterface/Views/ToggleButtonNavigationItem.js: 75 (WI.ToggleButtonNavigationItem.prototype.set defaultToolTip): 76 Added a setter for manging the default tooltip of a toggle button. 77 78 * UserInterface/Views/XHRBreakpointTreeElement.js: 79 (WI.XHRBreakpointTreeElement): 80 Suppress tooltips by setting the tooltipHandledSeprately flag with no custom handler. 81 1 82 2018-03-09 Nikita Vasilyev <nvasilyev@apple.com> 2 83 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r229495 r229543 421 421 localizedStrings["Filter"] = "Filter"; 422 422 localizedStrings["Filter Full URL"] = "Filter Full URL"; 423 localizedStrings["Find Next (%s)"] = "Find Next (%s)"; 424 localizedStrings["Find Previous (%s)"] = "Find Previous (%s)"; 423 425 localizedStrings["Flexbox"] = "Flexbox"; 424 426 localizedStrings["Float"] = "Float"; … … 475 477 localizedStrings["Height"] = "Height"; 476 478 localizedStrings["Hide Console"] = "Hide Console"; 479 localizedStrings["Hide Console (%s)"] = "Hide Console (%s)"; 477 480 localizedStrings["Hide Grid"] = "Hide Grid"; 478 481 localizedStrings["Hide Path"] = "Hide Path"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r229495 r229543 282 282 this._contentElement.setAttribute("aria-label", WI.UIString("Content")); 283 283 284 this.consoleDrawer = new WI.ConsoleDrawer(document.getElementById("console-drawer"));285 this.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.CollapsedStateChanged, this._consoleDrawerCollapsedStateDidChange, this);286 this.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.Resized, this._consoleDrawerDidResize, this);287 288 284 this.clearKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, "K", this._clear.bind(this)); 289 285 … … 293 289 this.findNextKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, "G", this._findNext.bind(this)); 294 290 this.findPreviousKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.Shift | WI.KeyboardShortcut.Modifier.CommandOrControl, "G", this._findPrevious.bind(this)); 291 292 this.consoleDrawer = new WI.ConsoleDrawer(document.getElementById("console-drawer")); 293 this.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.CollapsedStateChanged, this._consoleDrawerCollapsedStateDidChange, this); 294 this.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.Resized, this._consoleDrawerDidResize, this); 295 295 296 296 this.quickConsole = new WI.QuickConsole(document.getElementById("quick-console")); -
trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js
r220119 r229543 63 63 this._iconAnimationLayerElement = document.createElement("span"); 64 64 this.iconElement.appendChild(this._iconAnimationLayerElement); 65 this.tooltipHandledSeparately = true; 65 66 } 66 67 -
trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js
r225250 r229543 35 35 this._enabled = true; 36 36 37 this.tooltip = toolTipOrLabel;38 39 37 this.element.addEventListener("click", this._mouseClicked.bind(this)); 40 38 … … 50 48 51 49 this.buttonStyle = this._image ? WI.ButtonNavigationItem.Style.Image : WI.ButtonNavigationItem.Style.Text; 50 51 if (this.buttonStyle === WI.ButtonNavigationItem.Style.Image) 52 this.tooltip = toolTipOrLabel; 52 53 } 53 54 -
trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleDrawer.js
r223931 r229543 40 40 41 41 this._toggleDrawerButton = new WI.ToggleButtonNavigationItem("toggle-drawer", WI.UIString("Hide Console"), WI.UIString("Show Console"), "Images/HideConsoleDrawer.svg", "Images/ShowConsoleDrawer.svg"); 42 42 43 this._toggleDrawerButton.visibilityPriority = WI.NavigationItem.VisibilityPriority.High; 43 44 this._toggleDrawerButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, () => { WI.toggleSplitConsole(); }); … … 50 51 51 52 // Public 53 54 toggleButtonShortcutTooltip(keyboardShortcut) 55 { 56 this._toggleDrawerButton.defaultToolTip = WI.UIString("Hide Console (%s)").format(keyboardShortcut.displayName); 57 } 52 58 53 59 get collapsed() -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js
r220119 r229543 41 41 this._statusImageElement.classList.add("status-image", "resolved"); 42 42 this.status = this._statusImageElement; 43 this.tooltipHandledSeparately = true; 43 44 44 45 breakpoint.addEventListener(WI.DOMBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this); -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeTreeElement.js
r220119 r229543 34 34 35 35 this.status = WI.linkifyNodeReferenceElement(domNode, WI.createGoToArrowButton()); 36 this.tooltipHandledSeparately = true; 36 37 } 37 38 -
trunk/Source/WebInspectorUI/UserInterface/Views/FindBanner.js
r223308 r229543 54 54 this._previousResultButton.classList.add("segmented", "previous-result"); 55 55 this._previousResultButton.disabled = true; 56 this._previousResultButton.title = WI.UIString("Find Previous (%s)").format(WI.findPreviousKeyboardShortcut.displayName);; 56 57 this._previousResultButton.addEventListener("click", this._previousResultButtonClicked.bind(this)); 57 58 this.element.appendChild(this._previousResultButton); … … 64 65 this._nextResultButton.classList.add("segmented", "next-result"); 65 66 this._nextResultButton.disabled = true; 67 this._nextResultButton.title = WI.UIString("Find Next (%s)").format(WI.findNextKeyboardShortcut.displayName);; 66 68 this._nextResultButton.addEventListener("click", this._nextResultButtonClicked.bind(this)); 67 69 this.element.appendChild(this._nextResultButton); -
trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.js
r227108 r229543 82 82 83 83 this.displayName = displayName; 84 this.tooltip = displayName; 84 85 this.selectorArrows = showSelectorArrows; 85 86 } … … 218 219 } 219 220 221 get tooltip() 222 { 223 return this._tooltip; 224 } 225 226 set tooltip(x) 227 { 228 if (x === this._tooltip) 229 return; 230 231 232 this._tooltip = x; 233 this._updateElementTitleAndText(); 234 } 235 236 get hideTooltip () 237 { 238 return this._hideTooltip; 239 } 240 241 set hideTooltip(hide) 242 { 243 this._hideTooltip = hide; 244 this._updateElementTitleAndText(); 245 } 246 220 247 get previousSibling() { return this._previousSibling; } 221 248 set previousSibling(newSlibling) { this._previousSibling = newSlibling || null; } … … 231 258 truncatedDisplayName = truncatedDisplayName.substring(0, this._truncatedDisplayNameLength) + ellipsis; 232 259 233 this._element.title = this._displayName;234 260 this._titleContentElement.textContent = truncatedDisplayName; 261 262 if (this.hideTooltip) 263 this._element.title = ""; 264 else 265 this._element.title = this._tooltip; 235 266 } 236 267 -
trunk/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js
r223308 r229543 119 119 this._components[i].hidden = false; 120 120 this._components[i].forcedWidth = null; 121 this._components[i].hideTooltip = true; 121 122 } 122 123 … … 162 163 var componentWidth = componentWidths[i]; 163 164 165 this._components[i].hideTooltip = false; 166 164 167 // Try to take the whole width we need to remove from each component. 165 168 var forcedWidth = componentWidth - widthToRemove; -
trunk/Source/WebInspectorUI/UserInterface/Views/PinnedTabBarItem.js
r228581 r229543 40 40 } 41 41 42 titleDidChange() 43 { 44 this.element.title = this.title; 45 } 46 42 47 // Private 43 48 -
trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js
r227003 r229543 67 67 this._rebuildExecutionContextPathComponents(); 68 68 69 WI.consoleDrawer.toggleButtonShortcutTooltip(this._toggleOrFocusKeyboardShortcut); 70 WI.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.CollapsedStateChanged, this._updateStyles, this); 71 69 72 WI.Frame.addEventListener(WI.Frame.Event.PageExecutionContextChanged, this._framePageExecutionContextsChanged, this); 70 73 WI.Frame.addEventListener(WI.Frame.Event.ExecutionContextsCleared, this._frameExecutionContextsCleared, this); … … 76 79 WI.targetManager.addEventListener(WI.TargetManager.Event.TargetAdded, this._targetAdded, this); 77 80 WI.targetManager.addEventListener(WI.TargetManager.Event.TargetRemoved, this._targetRemoved, this); 78 79 WI.consoleDrawer.addEventListener(WI.ConsoleDrawer.Event.CollapsedStateChanged, this._updateStyles, this);80 81 81 82 WI.TabBrowser.addEventListener(WI.TabBrowser.Event.SelectedTabContentViewDidChange, this._updateStyles, this); -
trunk/Source/WebInspectorUI/UserInterface/Views/StorageTreeElement.js
r220119 r229543 32 32 33 33 this.flattened = false; 34 this.tooltipHandledSeparately = true; 34 35 } 35 36 -
trunk/Source/WebInspectorUI/UserInterface/Views/TabBarItem.js
r228573 r229543 100 100 set image(url) { this._iconElement.src = url || ""; } 101 101 102 get title() { return this._element.title || ""; } 103 set title(title) { this._element.title = title || ""; } 102 get title() 103 { 104 return this._title; 105 } 106 107 set title(title) 108 { 109 title = title || ""; 110 if (this._title === title) 111 return; 112 113 this._title = title; 114 this.titleDidChange(); 115 } 116 117 titleDidChange() 118 { 119 // Implemented by subclasses. 120 } 104 121 }; 105 122 -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTreeElement.js
r224433 r229543 36 36 this._placeholder = placeholder || false; 37 37 this.editing = this._placeholder; 38 this.tooltipHandledSeparately = true; 38 39 } 39 40 -
trunk/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js
r225250 r229543 42 42 { 43 43 return this._defaultToolTip; 44 } 45 46 set defaultToolTip(toolTip) 47 { 48 this._defaultToolTip = toolTip; 49 50 if (!this._toggled) 51 this.tooltip = this._defaultToolTip; 44 52 } 45 53 -
trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js
r220119 r229543 47 47 this._statusImageElement.classList.add("status-image", "resolved"); 48 48 this.status = this._statusImageElement; 49 this.tooltipHandledSeparately = true; 49 50 50 51 breakpoint.addEventListener(WI.XHRBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this);
Note: See TracChangeset
for help on using the changeset viewer.