2018-02-09 Matt Baker Web Inspector: Object.shallowEqual always fails when comparing array property values https://bugs.webkit.org/show_bug.cgi?id=182634 Reviewed by Devin Rousso. Object.shallowEqual should use Array.shallowEqual when comparing property values, since strictly comparing objects/arrays is only true if both operands reference the same Object. * UserInterface/Base/Utilities.js: (value): 2018-02-07 Nikita Vasilyev Web Inspector: Styles: completion popover doesn't hide when switching panels https://bugs.webkit.org/show_bug.cgi?id=182464 Reviewed by Timothy Hatcher. Hide completion popover by triggering blur event on the focused text field. Removing text fields from the DOM tree would hide the completion popovers as well, but switching sidebar panels doesn't remove them from the DOM. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.hidden): * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: (WI.SpreadsheetCSSStyleDeclarationSection.prototype.hidden): * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js: (WI.SpreadsheetRulesStyleDetailsPanel.prototype.hidden): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.hidden): 2018-02-06 Nikita Vasilyev Web Inspector: Rename String.prototype.trimEnd to avoid conflicts with native trimEnd https://bugs.webkit.org/show_bug.cgi?id=182545 Reviewed by Brian Burg. Rename: - trimEnd to truncateEnd - trimMiddle to truncateMiddle * UserInterface/Base/Utilities.js: (String.prototype.trimMiddle): Deleted. (String.prototype.trimEnd): Deleted. (String.prototype.truncateMiddle): Added. (String.prototype.truncateEnd): Added. Use strict mode. Scrict mode allows `this` to be a primitive (a string, in our case). In non-strict mode, `this` is always an object. Without the strict mode, "a".truncateEnd(42) !== "a", because truncateEnd returns a string object. * UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement.prototype._buildAttributeDOM): * UserInterface/Views/DOMTreeElementPathComponent.js: (WI.DOMTreeElementPathComponent): * UserInterface/Views/SearchResultTreeElement.js: Remove an obvious comment. (WI.SearchResultTreeElement.truncateAndHighlightTitle): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype._renderValue): 2018-02-02 Devin Rousso Web Inspector: Styles Redesign: Pasting multiple properties should create properties instead of a bad property https://bugs.webkit.org/show_bug.cgi?id=179622 Reviewed by Matt Baker. * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype._remove): (WI.SpreadsheetStyleProperty.prototype._update): (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidCommit): (WI.SpreadsheetStyleProperty.prototype._handleNamePaste): When the user pastes into the name field, parse the text for a list of name-value pairs and replace the property being edited with the text of those pairs. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.addBlankProperty): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyFocusMoved): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyAddBlankPropertySoon): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._propertiesChanged): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetCSSStyleDeclarationEditorFocusMoved): Deleted. Calling `addBlankProperty` will trigger a layout on the next frame, but that might be before the CSSAgent has had a chance to finish refreshing, so we need a way to defer the creation of a new property until after we have finished the next layout (which is after the refresh). Drive-by: fix naming of some delegate functions. * UserInterface/Models/CSSProperty.js: (WI.CSSProperty.prototype.replaceWithText): Provide a way for replacing the property with new text. 2018-02-02 Matt Baker Web Inspector: TabBar redesign: remove New Tab button and add experimental feature flag https://bugs.webkit.org/show_bug.cgi?id=182342 Reviewed by Devin Rousso. This patch adds a new experimental setting group, "User Interface", with a single setting, "Enable New TabBar". When enabled, the New Tab button is no longer available in the top-level TabBar. The 'open tabs' context menu no longer allows the last non-ephemeral open tab to be closed (unchecked). * Localizations/en.lproj/localizedStrings.js: * UserInterface/Base/Main.js: (WI.contentLoaded): (WI._tryToRestorePendingTabs): Retain legacy behavior behind experimental feature setting. (WI.isNewTabWithTypeAllowed): * UserInterface/Base/Setting.js: * UserInterface/Main.html: * UserInterface/Views/CanvasTabContentView.js: (WI.CanvasTabContentView): * UserInterface/Views/ConsoleTabContentView.js: (WI.ConsoleTabContentView): * UserInterface/Views/DebuggerTabContentView.js: (WI.DebuggerTabContentView): * UserInterface/Views/ElementsTabContentView.js: (WI.ElementsTabContentView): * UserInterface/Views/GeneralTabBarItem.js: (WI.GeneralTabBarItem): (WI.GeneralTabBarItem.prototype.fromTabInfo): (WI.GeneralTabBarItem.prototype.get isEphemeral): (WI.GeneralTabBarItem.fromTabContentViewConstructor): Deleted. * UserInterface/Views/LayersTabContentView.js: (WI.LayersTabContentView): * UserInterface/Views/LegacyTabBar.js: Copied from Source/WebInspectorUI/UserInterface/Views/TabBar.js. (WI.LegacyTabBar): (WI.LegacyTabBar.prototype.get newTabTabBarItem): (WI.LegacyTabBar.prototype.updateNewTabTabBarItemState): (WI.LegacyTabBar.prototype.addTabBarItem): (WI.LegacyTabBar.prototype.insertTabBarItem.animateTabs): (WI.LegacyTabBar.prototype.insertTabBarItem.removeStyles): (WI.LegacyTabBar.prototype.insertTabBarItem): (WI.LegacyTabBar.prototype.removeTabBarItem.animateTabs): (WI.LegacyTabBar.prototype.removeTabBarItem.removeStyles): (WI.LegacyTabBar.prototype.removeTabBarItem): (WI.LegacyTabBar.prototype.selectPreviousTab): (WI.LegacyTabBar.prototype.selectNextTab): (WI.LegacyTabBar.prototype.get selectedTabBarItem): (WI.LegacyTabBar.prototype.set selectedTabBarItem): (WI.LegacyTabBar.prototype.get tabBarItems): (WI.LegacyTabBar.prototype.get normalTabCount): (WI.LegacyTabBar.prototype.layout.forceItemHidden): (WI.LegacyTabBar.prototype.layout): (WI.LegacyTabBar.prototype._tabBarItemsFromLeftToRight): (WI.LegacyTabBar.prototype._findTabBarItem): (WI.LegacyTabBar.prototype._hasMoreThanOneNormalTab): (WI.LegacyTabBar.prototype._openDefaultTab): (WI.LegacyTabBar.prototype._recordTabBarItemSizesAndPositions): (WI.LegacyTabBar.prototype._applyTabBarItemSizesAndPositions): (WI.LegacyTabBar.prototype._clearTabBarItemSizesAndPositions): (WI.LegacyTabBar.prototype._finishExpandingTabsAfterClose.): (WI.LegacyTabBar.prototype._finishExpandingTabsAfterClose): (WI.LegacyTabBar.prototype._handleMouseDown): (WI.LegacyTabBar.prototype._handleClick): (WI.LegacyTabBar.prototype._handleMouseMoved): (WI.LegacyTabBar.prototype._handleMouseUp): (WI.LegacyTabBar.prototype._handleMouseLeave): (WI.LegacyTabBar.prototype._handleContextMenu): (WI.LegacyTabBar.prototype._handleNewTabClick): (WI.LegacyTabBar.prototype._handleTabPickerTabContextMenu): (WI.LegacyTabBar.prototype._handleNewTabMouseEnter): * UserInterface/Views/NetworkTabContentView.js: (WI.NetworkTabContentView): * UserInterface/Views/NewTabContentView.js: (WI.NewTabContentView): (WI.NewTabContentView.tabInfo): (WI.NewTabContentView.isEphemeral): Deleted. * UserInterface/Views/ResourcesTabContentView.js: (WI.ResourcesTabContentView): * UserInterface/Views/SearchTabContentView.js: (WI.SearchTabContentView): (WI.SearchTabContentView.tabInfo): (WI.SearchTabContentView.isEphemeral): Deleted. * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.tabInfo): (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): (WI.SettingsTabContentView.isEphemeral): Deleted. * UserInterface/Views/StorageTabContentView.js: (WI.StorageTabContentView): * UserInterface/Views/TabBar.css: * UserInterface/Views/TabBar.js: (WI.TabBar): (WI.TabBar.prototype.insertTabBarItem): (WI.TabBar.prototype.removeTabBarItem): (WI.TabBar.prototype.set selectedTabBarItem): (WI.TabBar.prototype.get normalNonEphemeralTabCount): (WI.TabBar.prototype._handleMouseDown): (WI.TabBar.prototype._handleClick): (WI.TabBar.prototype._handleMouseMoved): (WI.TabBar.prototype._handleMouseLeave): (WI.TabBar.prototype._handleContextMenu): (WI.TabBar.prototype._handleTabPickerTabContextMenu): (WI.TabBar.prototype.get newTabTabBarItem): Deleted. (WI.TabBar.prototype.updateNewTabTabBarItemState): Deleted. (WI.TabBar.prototype._openDefaultTab): Deleted. (WI.TabBar.prototype._handleNewTabClick): Deleted. (WI.TabBar.prototype._handleNewTabMouseEnter): Deleted. Remove support for the New Tab button and default tab. Without a default tab, there is nothing to display when no tabs are open, so prevent the last non-pinned tab from being removed. * UserInterface/Views/TabBrowser.js: (WI.TabBrowser._tabBarItemRemoved): * UserInterface/Views/TabContentView.js: (WI.TabContentView.isEphemeral): Deleted. * UserInterface/Views/TimelineTabContentView.js: (WI.TimelineTabContentView): 2018-01-30 Devin Rousso Web Inspector: Replace Object.shallowMerge with ES2018 spread operator https://bugs.webkit.org/show_bug.cgi?id=182219 Reviewed by Brian Burg. * UserInterface/Base/Utilities.js: (Object.shallowMerge): Deleted. * UserInterface/Base/DOMUtilities.js: (WI.linkifyNodeReference): * UserInterface/Base/Main.js: (WI.handlePossibleLinkClick): (WI.openURL): (WI.showSourceCodeLocation): (WI.showOriginalUnformattedSourceCodeLocation): (WI.showOriginalOrFormattedSourceCodeLocation): (WI.showOriginalOrFormattedSourceCodeTextRange): (WI.linkifyLocation): * UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement.prototype._insertAdjacentHTML): * UserInterface/Views/WebSocketContentView.js: (WI.WebSocketContentView.prototype._addRow): 2018-01-26 Matt Baker Web Inspector: Timelines content browser NavigationBar is squashed at narrow heights https://bugs.webkit.org/show_bug.cgi?id=182196 Reviewed by Joseph Pecoraro. * UserInterface/Views/NavigationBar.css: (.navigation-bar): 2018-01-26 Matt Baker Web Inspector: TabBar redesign: improvements to tab layout and resize behavior https://bugs.webkit.org/show_bug.cgi?id=181468 Reviewed by Devin Rousso. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Images/TabPicker.svg: Added. New ">>" icon for the tab picker button. * UserInterface/Views/CanvasTabContentView.js: (WI.CanvasTabContentView): * UserInterface/Views/ConsoleTabContentView.js: (WI.ConsoleTabContentView): * UserInterface/Views/DebuggerTabContentView.js: (WI.DebuggerTabContentView): * UserInterface/Views/ElementsTabContentView.js: (WI.ElementsTabContentView): * UserInterface/Views/GeneralTabBarItem.js: (WI.GeneralTabBarItem): (WI.GeneralTabBarItem.fromTabContentViewConstructor): (WI.GeneralTabBarItem.prototype.get title): Add missing override for getter/setter pair. (WI.GeneralTabBarItem.prototype.set title): (WI.GeneralTabBarItem.prototype._handleContextMenuEvent): Show the close button on ephemeral tabs only (Search, New Tab). Replace unused `representedObject` parameter with `isEphemeral`, which determines whether to show a close button for the tab. * UserInterface/Views/LayersTabContentView.js: (WI.LayersTabContentView): * UserInterface/Views/NavigationBar.js: Remove unused symbol. * UserInterface/Views/NetworkTabContentView.js: (WI.NetworkTabContentView): * UserInterface/Views/NewTabContentView.js: (WI.NewTabContentView): * UserInterface/Views/PinnedTabBarItem.js: (WI.PinnedTabBarItem): Remove unused parameter. * UserInterface/Views/ResourcesTabContentView.js: (WI.ResourcesTabContentView): * UserInterface/Views/SearchTabContentView.js: (WI.SearchTabContentView): * UserInterface/Views/StorageTabContentView.js: (WI.StorageTabContentView): * UserInterface/Views/TabBar.css: (.tab-bar > .item): (.tab-bar.calculate-width > .item): (.tab-bar > .item.pinned.tab-picker): (.tab-bar > .item > .close): (.tab-bar > .item > .title): (.tab-bar:not(.collapsed) > .item > .title): (.tab-bar.collapsed > .item:not(.pinned) > .icon): (.tab-bar > .item:hover > .close): (.tab-bar.collapsed > .item:hover > .close): (.tab-bar:not(.collapsed) > .item.ephemeral:hover > .icon): (.tab-bar.collapsed > .item.ephemeral:hover > .title): (body[dir=ltr] .tab-bar > .item > .close): Deleted. (body[dir=rtl] .tab-bar > .item > .close): Deleted. (.tab-bar > .item > .flex-space): Deleted. (.tab-bar > .item:not(.pinned) > .flex-space:last-child): Deleted. (body[dir=ltr] .tab-bar > .item:not(.pinned) > .flex-space:last-child): Deleted. (body[dir=rtl] .tab-bar > .item:not(.pinned) > .flex-space:last-child): Deleted. (body[dir=ltr] .tab-bar > .item > .title): Deleted. (body[dir=rtl] .tab-bar > .item > .title): Deleted. (.tab-bar.collapsed > .item): Deleted. (.tab-bar.collapsed > .item > .flex-space): Deleted. (.tab-bar.collapsed > .item > .close): Deleted. (body[dir=ltr] .tab-bar.collapsed > .item > .close): Deleted. (body[dir=rtl] .tab-bar.collapsed > .item > .close): Deleted. (.tab-bar.hide-titles > .item > .title): Deleted. (.tab-bar.collapsed:not(.hide-titles) > .item:not(.pinned):hover > .icon,): Deleted. (.tab-bar.collapsed:not(.hide-titles) > .item:hover > .close,): Deleted. Clean up tab styles and prevent tabs from shrinking during flex layout. Added new `calculate-width` class, to disable flex layout when measuring the minimum width of the TabBar required to fit all tab items. * UserInterface/Views/TabBar.js: (WI.TabBar): (WI.TabBar.prototype.set selectedTabBarItem): (WI.TabBar.prototype.layout.forceItemHidden): (WI.TabBar.prototype.layout): Perform two layout passes, similar to NavigationBar. The first pass disables flex layout and measures tab items at full size. If the bar isn't wide enough to show all the tabs, hide their icons and measure again. If there still isn't room, hide tabs starting from the end of the bar and display the tab picker. (WI.TabBar.prototype._handleMouseDown): (WI.TabBar.prototype._handleTabPickerTabContextMenu): * UserInterface/Views/TabBarItem.js: (WI.TabBarItem): * UserInterface/Views/TimelineTabContentView.js: (WI.TimelineTabContentView): 2018-01-25 Joseph Pecoraro Web Inspector: Network Table: Sort indicator is not displayed when sorted column is hidden and re-shown https://bugs.webkit.org/show_bug.cgi?id=182164 Reviewed by Brian Burg. * UserInterface/Views/Table.js: (WI.Table.prototype.showColumn): Re-add the sort classes if the column being shown is the active sort column. 2018-01-25 Joseph Pecoraro Web Inspector: Network - Cookies view should behave better at narrow widths, all data is hidden https://bugs.webkit.org/show_bug.cgi?id=182163 Reviewed by Brian Burg. * UserInterface/Views/ResourceCookiesContentView.css: (.resource-cookies .table): Give these tables a reasonable minimum size so that if the inspector is narrow, the content view can still be scrolled to see all of the table data. * UserInterface/Views/Table.css: (.table > .header): Match the data-container and mark overflow as hidden, otherwise super narrow widths show header content beyond the edge. 2018-01-25 Joseph Pecoraro Web Inspector: "Displayed Columns" should not be displayed in context menu if all columns are required columns https://bugs.webkit.org/show_bug.cgi?id=182162 Reviewed by Matt Baker. * UserInterface/Views/Table.js: (WI.Table.prototype._handleHeaderContextMenu): Only add the header column when we know there are hideable columns. 2018-01-24 Joseph Pecoraro Web Inspector: Simplify update-LegacyInspectorBackendCommands.rb https://bugs.webkit.org/show_bug.cgi?id=182067 Reviewed by Brian Burg. * Scripts/update-LegacyInspectorBackendCommands.rb: Remove stale dependency_json, it has always been empty for a while now. Switch to framework WebInspectorUI to generate only the backend commands and not spend time generating a bunch of cpp files. 2018-01-24 Nikita Vasilyev REGRESSION (r226994): Web Inspector: Styles: Suggestions popover floats in top-left corner of Web Inspector after tabbing https://bugs.webkit.org/show_bug.cgi?id=182027 Reviewed by Matt Baker. r226994 added a layout of all properties on property removal. Layout caused a property element to be removed from DOM right before dislaying the suggestion popover, resulting in the popover being displayed at the top left corner. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved): Only update property view indices when a property is removed. * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty): (WI.SpreadsheetStyleProperty.prototype.set index): * UserInterface/Views/SpreadsheetTextField.js: (WI.SpreadsheetTextField.prototype._updateCompletions): Checking this._element.parentNode to see if the element is attached to the DOM tree is unreliable, since the element may have a non-null parent node that is detached from the DOM tree. To fix that, we could traverse element's ancestors, but I used a concise isConnected property instead. 2018-01-24 Joseph Pecoraro ReferenceError:​ Can't find variable:​ DOMAgent (at ScriptSyntaxTree.js:​178:​22)​ https://bugs.webkit.org/show_bug.cgi?id=182059 Reviewed by Matt Baker. * UserInterface/Models/ScriptSyntaxTree.js: (WI.ScriptSyntaxTree.functionReturnDivot): DOMAgent won't be available in a ServiceWorker or JSContext inspector. So add a check for DOMAgent, and assume if DOMAgent doesn't exist that we should fall back to the latest path (non-iOS 9) target. 2018-01-23 Joseph Pecoraro Web Inspector: Network's columns shake when scrolling at non-default zoom level https://bugs.webkit.org/show_bug.cgi?id=181998 Reviewed by Matt Baker. * UserInterface/Views/Table.js: When zoomed the bounding client rect values were fractional, which was unexpected by this area of code. Floor the values to get a value we expect to be able to evenly distribute. 2018-01-22 Nikita Vasilyev Web Inspector: Styles Redesign: data corruption when updating values quickly https://bugs.webkit.org/show_bug.cgi?id=179461 Reviewed by Joseph Pecoraro. Data corruption used to happen because CSSStyleDeclaration.prototype.text didn't update synchronously. Making two or more quick changes resulted in corrupted data. Imagine we modify a CSS value 3 times: Front-end: (1)-(2)---(3) Back-end: (1)-----(2)-(3) The first response from the backend could happen after the 2nd edit. In this patch, CSSStyleDeclaration is locked when its view is being edited. To correctly display invalid and overridden properties, the backend is allowed to update CSSStyleDeclaration and CSSProperty when they're locked if the text from the backend matches the model's text. This should happen when the backend is caught up with the front-end changes. * UserInterface/Models/CSSProperty.js: (WI.CSSProperty.prototype.update): * UserInterface/Models/CSSStyleDeclaration.js: (WI.CSSStyleDeclaration): (WI.CSSStyleDeclaration.prototype.get locked): (WI.CSSStyleDeclaration.prototype.set locked): (WI.CSSStyleDeclaration.prototype.set text): * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.detached): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.get editing): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.set focused): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.set inlineSwatchActive): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.stylePropertyInlineSwatchActivated): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.stylePropertyInlineSwatchDeactivated): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._propertiesChanged): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._updateStyleLock): Lock CSSStyleDeclaration when a CSS property name or value is focused or an inline widget is active. * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: (WI.SpreadsheetCSSStyleDeclarationSection): (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown): (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty): (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch): When selector is focused, clicking on the white-space should not add a new blank property. 2018-01-19 Ross Kirsling Web Inspector: Layers tab should do away with popovers (if possible) https://bugs.webkit.org/show_bug.cgi?id=181805 Reviewed by Matt Baker. * Localizations/en.lproj/localizedStrings.js: Remove superfluous colon from a string. * UserInterface/Main.html: * UserInterface/Views/LayerDetailsSidebarPanel.css: * UserInterface/Views/Layers3DContentView.css: Added. Remove popover styling from sidebar, add new file with similar styling for canvas overlay. * UserInterface/Views/LayerDetailsSidebarPanel.js: (WI.LayerDetailsSidebarPanel): (WI.LayerDetailsSidebarPanel.prototype.selectNodeByLayerId): (WI.LayerDetailsSidebarPanel.prototype._dataGridSelectedNodeChanged): (WI.LayerDetailsSidebarPanel.prototype._updateLayers): (WI.LayerDetailsSidebarPanel.prototype._updateBottomBar): (WI.LayerDetailsSidebarPanel.prototype.willDismissPopover): Deleted. (WI.LayerDetailsSidebarPanel.prototype._showPopoverForSelectedNode): Deleted. (WI.LayerDetailsSidebarPanel.prototype._presentPopover): Deleted. (WI.LayerDetailsSidebarPanel.prototype._contentForPopover): Deleted. (WI.LayerDetailsSidebarPanel.prototype._populateListOfCompositingReasons.addReason): Deleted. (WI.LayerDetailsSidebarPanel.prototype._populateListOfCompositingReasons): Deleted. * UserInterface/Views/Layers3DContentView.js: (WI.Layers3DContentView): (WI.Layers3DContentView.prototype.shown): (WI.Layers3DContentView.prototype.selectLayerById): (WI.Layers3DContentView.prototype._canvasMouseDown): (WI.Layers3DContentView.prototype._buildLayerInfoElement): (WI.Layers3DContentView.prototype._updateLayerInfoElement): (WI.Layers3DContentView.prototype._updateReasonsList): Remove popover from sidebar table, overlay div with same data arrangement on top of the canvas. Also reverse the fix from r226671 since the visualization is no longer unusable without the sidebar! 2018-01-19 Matt Baker Web Inspector: Canvas Tab: Multiple "waiting for frames" messages displayed https://bugs.webkit.org/show_bug.cgi?id=181865 Reviewed by Devin Rousso. * UserInterface/Views/CanvasContentView.js: (WI.CanvasContentView.prototype._recordingStarted): (WI.CanvasContentView.prototype._recordingStopped): 2018-01-19 Nikita Vasilyev Web Inspector: Styles Redesign: tabbing on commented out property throws exception https://bugs.webkit.org/show_bug.cgi?id=180676 Reviewed by Joseph Pecoraro. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingFirstProperty): Tabbing from the selector field should focus on the first editable property. When no editable properties are present, a new blank property should be added after the commented out ones. (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingLastProperty): Shift-tabbing from the selector field should focus on the last editable property of the previous CSS rule. When no editable properties are present, a new blank property should be added after the commented out ones. (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetCSSStyleDeclarationEditorFocusMoved): When navigating between properties skip the commented out ones. (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._editablePropertyAfter): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._editablePropertyBefore): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.get enabled): (WI.SpreadsheetStyleProperty.prototype._update): 2018-01-19 Nikita Vasilyev Web Inspector: Make styles sidebar always LTR https://bugs.webkit.org/show_bug.cgi?id=175357 Reviewed by Joseph Pecoraro. * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js: (WI.SpreadsheetRulesStyleDetailsPanel): 2018-01-19 Keith Miller HaveInternalSDK includes should be "#include?" https://bugs.webkit.org/show_bug.cgi?id=179670 Reviewed by Dan Bernstein. * Configurations/Base.xcconfig: 2018-01-18 Dan Bernstein [Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions https://bugs.webkit.org/show_bug.cgi?id=181803 Reviewed by Tim Horton. * Configurations/Base.xcconfig: Updated. * Configurations/DebugRelease.xcconfig: Ditto. * Configurations/Version.xcconfig: Ditto. 2018-01-18 Devin Rousso Web Inspector: Canvas Tab: record button on canvas card doesn't always show on hover, or is misplaced https://bugs.webkit.org/show_bug.cgi?id=179183 Reviewed by Joseph Pecoraro. * UserInterface/Views/CanvasOverviewContentView.css: (.content-view.canvas-overview .content-view.canvas:not(.is-recording) > header > .navigation-bar > .item.record-start-stop): Deleted. 2018-01-17 Devin Rousso Web Inspector: clicking on a path component that has no siblings should select it https://bugs.webkit.org/show_bug.cgi?id=181772 Reviewed by Joseph Pecoraro. * UserInterface/Views/HierarchicalPathComponent.js: (WI.HierarchicalPathComponent.prototype._updateSelectElement): (WI.HierarchicalPathComponent.prototype._selectElementMouseDown): 2018-01-17 Joseph Pecoraro Web Inspector: Add back localized strings for Styles sidebar panels https://bugs.webkit.org/show_bug.cgi?id=181748 Reviewed by Brian Burg. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Views/ComputedStyleDetailsSidebarPanel.js: (WI.ComputedStyleDetailsSidebarPanel): * UserInterface/Views/RulesStyleDetailsSidebarPanel.js: (WI.RulesStyleDetailsSidebarPanel): * UserInterface/Views/VisualStyleDetailsSidebarPanel.js: (WI.VisualStyleDetailsSidebarPanel): Add back localized strings for panel titles lost in r225547. 2018-01-17 Joseph Pecoraro Web Inspector: Super long URL string causes bad wrapping in Resources detail sidebar https://bugs.webkit.org/show_bug.cgi?id=181617 Reviewed by Brian Burg. * UserInterface/Views/DetailsSection.css: (.details-section > .content > .group > .row.simple > .value): Set the break to all characters. 2018-01-16 Matt Baker Web Inspector: Canvas tab: typing a "space" in the QuickConsole shouldn't trigger a recording https://bugs.webkit.org/show_bug.cgi?id=181706 Reviewed by Joseph Pecoraro. * UserInterface/Views/CanvasOverviewContentView.js: (WI.CanvasOverviewContentView): (WI.CanvasOverviewContentView.prototype._handleSpace): 2018-01-16 Joseph Pecoraro Web Inspector: Make Console's Execution Context picker stand out when it is non-default https://bugs.webkit.org/show_bug.cgi?id=181628 Reviewed by Matt Baker. * UserInterface/Views/HierarchicalPathComponent.css: (.hierarchical-path-component > .selector-arrows): * UserInterface/Views/HierarchicalPathComponent.js: (WI.HierarchicalPathComponent.prototype.set selectorArrows): Switch to SVG element so we can style the arrows. * UserInterface/Views/QuickConsole.css: (.quick-console > .navigation-bar > .hierarchical-path .execution-context): (.quick-console > .navigation-bar > .hierarchical-path .execution-context .separator): (.quick-console > .navigation-bar > .hierarchical-path.non-default-execution-context .execution-context): (.quick-console > .navigation-bar > .hierarchical-path.non-default-execution-context .execution-context .selector-arrows): Styles for the execution context picker. We hide the unused separator and instead use margin so that the selected background and border don't have an extra 7px on the right/end side. * UserInterface/Views/QuickConsole.js: (WI.QuickConsole.prototype._activeExecutionContextChanged): Toggle the non-default class name on the path. 2018-01-16 Nikita Vasilyev Web Inspector: Styles: pressing down key should select first item from completion list when focusing on empty value https://bugs.webkit.org/show_bug.cgi?id=181633 Reviewed by Joseph Pecoraro. * UserInterface/Views/SpreadsheetTextField.js: (WI.SpreadsheetTextField.prototype._updateCompletions): 2018-01-16 Nikita Vasilyev Web Inspector: Styles Redesign: Long value causes bad wrapping https://bugs.webkit.org/show_bug.cgi?id=181618 Reviewed by Joseph Pecoraro. Wrap long values only when editing. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css: (.spreadsheet-style-declaration-editor .value.editing): 2018-01-16 Nikita Vasilyev Web Inspector: Styles Redesign: clicking on the white space after the property sometimes places a blank property at the wrong index https://bugs.webkit.org/show_bug.cgi?id=179585 Reviewed by Joseph Pecoraro. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved): Layout call is needed to update data-property-index attributes on the property views. 2018-01-16 Joseph Pecoraro Web Inspector: Network Tab - Export HAR Context Menu not working https://bugs.webkit.org/show_bug.cgi?id=181694 Reviewed by Brian Burg. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype.tableCellContextMenuClicked): Ensure `this` works in the handler. 2018-01-15 Matt Baker Web Inspector: TabBar redesign: add context menu to TabBar for toggling available tabs https://bugs.webkit.org/show_bug.cgi?id=181448 Reviewed by Devin Rousso. * UserInterface/Base/Main.js: (WI.loaded): (WI.contentLoaded): Reorder production tab classes and default (open) tabs. (WI.registerTabClass): Removed. Not used. * UserInterface/Base/Object.js: Remove notification that is no longer used. * UserInterface/Views/GeneralTabBarItem.js: (WI.GeneralTabBarItem): (WI.GeneralTabBarItem.prototype.set title): (WI.GeneralTabBarItem.prototype._handleContextMenuEvent): Deleted. Remove per-tab context menu (provided Close Tab and Close Other Tabs). * UserInterface/Views/NewTabContentView.js: (WI.NewTabContentView): * UserInterface/Views/TabBar.js: (WI.TabBar): (WI.TabBar.prototype._handleContextMenu): * UserInterface/Views/TabBrowser.js: (WI.TabBrowser): (WI.TabBrowser._handleNewTabContextMenu): Deleted. No longer needed. 2018-01-13 Nikita Vasilyev Web Inspector: Styles Redesign: properties should never be semitransparent or crossed out while editing https://bugs.webkit.org/show_bug.cgi?id=180793 Reviewed by Devin Rousso. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css: (.spreadsheet-style-declaration-editor .value.editing): (.spreadsheet-style-declaration-editor .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) .content > *): (.spreadsheet-style-declaration-editor .property.invalid-name:not(.disabled) .content > *): (.spreadsheet-style-declaration-editor .property.invalid-value:not(.disabled) .content .value): (.spreadsheet-style-declaration-editor .property.not-inherited .content > *): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype._update): 2018-01-12 Joseph Pecoraro Web Inspector: Drop support for iOS 7 targets https://bugs.webkit.org/show_bug.cgi?id=181549 Reviewed by Brian Burg. * Versions/Inspector-iOS-7.0.json: Removed. * UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js: Removed. Remove protocol snapshot and generated commands for iOS 7. * UserInterface/Base/Main.js: * UserInterface/Controllers/BreakpointPopoverController.js: (WI.BreakpointPopoverController.prototype._createPopoverContent): * UserInterface/Controllers/DebuggerManager.js: (WI.DebuggerManager.prototype._setBreakpoint): * UserInterface/Controllers/SourceMapManager.js: (WI.SourceMapManager.prototype._loadAndParseSourceMap): * UserInterface/Models/Instrument.js: (WI.Instrument.startLegacyTimelineAgent): * UserInterface/Models/ResourceTimingData.js: * UserInterface/Models/ScriptTimelineRecord.js: (WI.ScriptTimelineRecord.EventType.displayName): * UserInterface/Models/SourceMapResource.js: (WI.SourceMapResource.prototype.requestContentFromBackend): * UserInterface/Protocol/CSSObserver.js: (WI.CSSObserver.prototype.regionLayoutUpdated): Deleted. * UserInterface/Protocol/RemoteObject.js: (WI.RemoteObject.fromPayload): Remove code that was only necessary to support iOS 7. 2018-01-12 Joseph Pecoraro Web Inspector: Support JSX (React) syntax highlighting https://bugs.webkit.org/show_bug.cgi?id=181607 Reviewed by Brian Burg. * UserInterface/Base/MIMETypeUtilities.js: (WI.mimeTypeForFileExtension): (WI.fileExtensionForMIMEType): * UserInterface/Models/Resource.js: Support the jsx extension and mime types. * UserInterface/Main.html: * Scripts/update-codemirror-resources.rb: * UserInterface/External/CodeMirror/jsx.js: Added. Include new mode from CodeMirror@d8926768. 2018-01-11 Joseph Pecoraro Web Inspector: Rename "Query String" section as "Query String Parameters" for clarity https://bugs.webkit.org/show_bug.cgi?id=181464 Reviewed by Darin Adler. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Views/ResourceHeadersContentView.js: (WI.ResourceHeadersContentView.prototype.initialLayout): 2018-01-11 Joseph Pecoraro Web Inspector: Remove unused variable in WI.DebuggerSidebarPanel https://bugs.webkit.org/show_bug.cgi?id=181517 Reviewed by Matt Baker. * UserInterface/Views/DebuggerSidebarPanel.js: 2018-01-10 Joseph Pecoraro REGRESSION(r218975): Web Inspector: Add back NavigationSidebarPanel initialization parameter used by SearchSidebarPanel (top overflow shadow) https://bugs.webkit.org/show_bug.cgi?id=181518 Reviewed by Matt Baker. * UserInterface/Views/NavigationSidebarPanel.css: (.sidebar > .panel.navigation > .overflow-shadow.top): * UserInterface/Views/NavigationSidebarPanel.js: (WI.NavigationSidebarPanel): Add back the initialization parameter still used by SearchSidebarPanel and add back its implementation. There were still references to dynamically update _topOverflowShadowElement in NavigationSidebarPanel. 2018-01-10 Joseph Pecoraro Web Inspector: Incorrect check with WI.debuggableType https://bugs.webkit.org/show_bug.cgi?id=181515 Reviewed by Brian Burg. * UserInterface/Base/Main.js: (WI.contentLoaded): This moved to WI.sharedApp a while ago. 2018-01-10 Matt Baker Web Inspector: Canvas tab: throttle recording slider updates https://bugs.webkit.org/show_bug.cgi?id=180839 Reviewed by Joseph Pecoraro * UserInterface/Base/Utilities.js: Add Object.throttle and Function.cancelThrottle. Repeated calls to a function on a throttled object are delayed, so that the function isn't invoked more frequently than the specified delay value. For a description of throttling behavior see: - http://www.chrislondon.co/throttling-vs-debouncing - http://benalman.com/projects/jquery-throttle-debounce-plugin * UserInterface/Views/RecordingContentView.js: (WI.RecordingContentView.prototype.updateActionIndex): Throttle frequency of canvas snapshot creation to 200ms. (WI.RecordingContentView.prototype.hidden): Prevent trailing edge call after hiding the view. 2018-01-10 Joseph Pecoraro Web Inspector: Should not try to autocomplete subsections of a string https://bugs.webkit.org/show_bug.cgi?id=181461 Reviewed by Brian Burg. * UserInterface/Controllers/CodeMirrorCompletionController.js: (WI.CodeMirrorCompletionController.prototype._completeAtCurrentPosition): Disable autocompletion within strings. 2018-01-09 Joseph Pecoraro REGRESSION(r201855): Web Inspector: Should see "length" autocompletion suggestion on a string literal https://bugs.webkit.org/show_bug.cgi?id=181462 Reviewed by Matt Baker. * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js: (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.inspectedPage_evalResult_getCompletions): This is code that runs on the inspected target, which may have an old version of WebKit/JavaScriptCore, so don't use new syntax like this. (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded): We intended to return the result by as a JSON value instead of a RemoteObject. 2018-01-09 Ross Kirsling Web Inspector: Layers sidebar shows popover on selection even when collapsed https://bugs.webkit.org/show_bug.cgi?id=181465 Reviewed by Matt Baker. * UserInterface/Views/LayerDetailsSidebarPanel.js: (WI.LayerDetailsSidebarPanel.prototype.selectNodeByLayerId): Have sidebar show itself if necessary before displaying popover. 2018-01-08 Joseph Pecoraro Web Inspector: Find next / previous within a resource content view does not have bouncy highlight when editor scrolls https://bugs.webkit.org/show_bug.cgi?id=181279 Reviewed by Brian Burg. * UserInterface/Views/TextEditor.js: (WI.TextEditor.prototype._revealSearchResult): Reposition the bouncy highlight on scroll based on the CodeMirror line/ch position of the search result. (WI.TextEditor.prototype._removeBouncyHighlightElementIfNeeded): Track the bouncy highlight scroll handler in a member variable so that we always remember to remove it and don't leak scroll handlers. 2018-01-07 David Kilzer Enable -Wcast-qual for WebInspectorUI, WebKitLegacy, WebKit projects Reviewed by Darin Adler. * Configurations/Base.xcconfig: (WARNING_CFLAGS): Add -Wcast-qual. 2018-01-05 Joseph Pecoraro Web Inspector: Add another Protocol Version https://bugs.webkit.org/show_bug.cgi?id=181354 Reviewed by Matt Baker. * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js: Added. * Versions/Inspector-iOS-11.3.json: Added. 2018-01-04 Devin Rousso Web Inspector: replace HTMLCanvasElement with CanvasRenderingContext for instrumentation logic https://bugs.webkit.org/show_bug.cgi?id=180770 Reviewed by Joseph Pecoraro. * UserInterface/Models/Canvas.js: (WI.Canvas.fromPayload): (WI.Canvas.prototype.get contextType): (WI.Canvas.prototype.saveIdentityToCookie): (WI.Canvas.prototype.get frame): Deleted. 2018-01-04 Joseph Pecoraro REGRESSION (r225709): Web Inspector: CSS Source maps not loading https://bugs.webkit.org/show_bug.cgi?id=181314 Reviewed by Brian Burg. * UserInterface/Controllers/SourceMapManager.js: (WI.SourceMapManager.prototype._loadAndParseSourceMap): * UserInterface/Models/SourceMapResource.js: (WI.SourceMapResource.prototype.requestContentFromBackend): Correct this so that we only fall back to a reasonable frame id if we couldn't determine a frame id from earlier. Previously this was incorrectly clearing the frame id if we had gotten it earlier. * UserInterface/Test.html: * UserInterface/Test/Test.js: (WI.loaded): Add SourceMap related files for tests. 2018-01-04 Brian Burg Web Inspector: Capture Element Screenshot looks fuzzy https://bugs.webkit.org/show_bug.cgi?id=175734 Reviewed by Joseph Pecoraro and Simon Fraser. Spruce up these functions a bit. They now optionally return a promise if no callback is supplied. They now can take either a WI.DOMNode or a node id. * UserInterface/Controllers/DOMTreeManager.js: (WI.DOMTreeManager.prototype.querySelector): (WI.DOMTreeManager.prototype.querySelectorAll): 2018-01-04 Brian Burg Web Inspector: add RemoteObject.fetchProperties and some basic tests for RemoteObject API https://bugs.webkit.org/show_bug.cgi?id=180945 Reviewed by Joseph Pecoraro. Add a new method, fetchProperties, which async fetches an arbitrary list of properties from a RemoteObject. This is intended for writing tests and other quick evaluations, so it has some behaviors that are suitable in these situations: - If the evaluation throws an exception, the result will reject with that exception. - If there is a protocol error for some reason, the result will reject with an exception. - Non-string and non-number keys cause an exception, as this is probably not intended. - Does not accept a callback, returns a promise only. New code should use async. For full fidelity introspection of property descriptors, clients should use the existing getOwnPropertyDescriptor[s] class of methods. * UserInterface/Protocol/RemoteObject.js: (WI.RemoteObject.prototype.async.fetchProperties): Added. - Validate specified keys and remove duplicates. - Request properties one-by-one to avoid fetching all descriptors and dealing with previews. - Unwrap returned primitive values to avoid unnecessary munging in tests. (WI.RemoteObject.prototype.getProperty): - Rework this to return a promise if no callback was supplied. - Introduce stricter property type checking to avoid unintended mistakes. (WI.RemoteObject.prototype.callFunction): - Rework this to return a promise if no callback was supplied. - Turn thrown exceptions and protocol errors into rejected promises. 2018-01-04 Joseph Pecoraro Web Inspector: ⌘G / ⇧⌘G text search does not working after closing find banner https://bugs.webkit.org/show_bug.cgi?id=181280 Reviewed by Matt Baker. * UserInterface/Views/ContentBrowser.js: (WI.ContentBrowser.prototype._findBannerDidHide): When the find banner is hidden trigger a new ContentView method, searchHidden instead of the destructive searchCleared. This allows most content views (text editors, DOM tree, Network Headers view) to keep their populated search results. * UserInterface/Views/ContentView.js: (WI.ContentView.prototype.searchHidden): * UserInterface/Views/LogContentView.js: (WI.LogContentView.prototype.searchHidden): By default searchHidden does nothing. The Console's LogContentView treats the find banner differently and clears its search results. * UserInterface/Views/TextEditor.js: (WI.TextEditor.prototype.searchCleared): Modernize some code while working in this area. * UserInterface/Views/Main.css: (.bouncy-highlight): Ensure black text on yellow background in the bouncy highlight. In the DOM Tree it could have been white if the find banner was closed. 2018-01-03 Ting-Wei Lan Replace hard-coded paths in shebangs with #!/usr/bin/env https://bugs.webkit.org/show_bug.cgi?id=181040 Reviewed by Alex Christensen. * Scripts/combine-resources.pl: * Scripts/copy-user-interface-resources-dryrun.rb: * Scripts/copy-user-interface-resources.pl: * Scripts/fix-worker-imports-for-optimized-builds.pl: * Scripts/remove-console-asserts-dryrun.rb: * Scripts/remove-console-asserts.pl: * Scripts/update-LegacyInspectorBackendCommands.rb: * Scripts/update-codemirror-resources.rb: * WebInspectorUI.vcxproj/build-webinspectorui.pl: 2018-01-03 Joseph Pecoraro Web Inspector: "Log Value" context menu is sometimes unavailable https://bugs.webkit.org/show_bug.cgi?id=181278 Reviewed by Devin Rousso. * UserInterface/Views/ObjectPreviewView.css: (.object-preview > .title): * UserInterface/Views/ObjectTreeView.css: (.object-tree.expanded > .title): Make the expanded object title information 16px tall to match ObjectTree tree element row heights. This eliminates the floating console message location from overlapping the first ObjectTree's TreeElement and causing truncation and other behavior issues (like Context Menu identification). 2018-01-03 Joseph Pecoraro Web Inspector: RTL - DOM Tree Element selection doesn't work https://bugs.webkit.org/show_bug.cgi?id=181275 Reviewed by Devin Rousso. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline.prototype.treeElementFromEvent): Provide a better explanation for why we are making the `x` adjustment here, to detect the inner most tree element along the horizontal. Fix the algorithm for RTL, since the intent is to adjust to the trailing edge of the container which is on the opposite side in RTL. 2018-01-03 Joseph Pecoraro Web Inspector: Find banner sometimes does not work (when already populated and shown for first time on resource) https://bugs.webkit.org/show_bug.cgi?id=181255 Reviewed by Matt Baker. * UserInterface/Views/TextEditor.js: (WI.TextEditor.prototype.set string): Defer any early searches until the initial content of a TextEditor has been set. Such searches can happen when the FindBanner already has content when a ContentView is first opened and needs to load its content from the backend. Further, even though the content may be loaded from the backend before the search results, microtask hops might cause the content to get to the TextEditor after the search results. 2018-01-03 Joseph Pecoraro REGRESSION: Web Inspector: Debugger tab doesn't restore selected resource on reload https://bugs.webkit.org/show_bug.cgi?id=181253 Reviewed by Matt Baker. * UserInterface/Views/DebuggerSidebarPanel.js: (WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie): Add braces to ensure the trailing else is actually trailing the outer chain as it was intended to be. 2018-01-02 Joseph Pecoraro Web Inspector: Clicking source location link in Console unexpectedly jumps to Network tab https://bugs.webkit.org/show_bug.cgi?id=181229 Reviewed by Matt Baker. * UserInterface/Base/Main.js: Cleanup linkifyURLAsNode. Ignore Search tab in generic handlePossibleLinkClick when not already in the Search tab. * UserInterface/Views/CallFrameView.js: (WI.CallFrameView): Ignore Search and Network tab in CallFrame links. * UserInterface/Views/TabBrowser.js: (WI.TabBrowser.prototype.bestTabContentViewForRepresentedObject): Improve style. == Rolled over to ChangeLog-2018-01-01 ==