2019-01-07 Devin Rousso Web Inspector: Audit: run arrow shouldn't be visible when running tests https://bugs.webkit.org/show_bug.cgi?id=192209 Reviewed by Brian Burg. * UserInterface/Views/AuditTreeElement.js: (WI.AuditTreeElement.prototype.onattach): (WI.AuditTreeElement.prototype.ondetach): (WI.AuditTreeElement.prototype._updateLevel): (WI.AuditTreeElement.prototype._handleAuditManagerTestScheduled): Added. (WI.AuditTreeElement.prototype._handleAuditManagerTestCompleted): Added. * UserInterface/Views/AuditTreeElement.css: Added. (.tree-outline .item.audit:matches(.test-case, .test-group):not(.manager-active) > .status:hover > img): Added. (.tree-outline .item.audit.manager-active > .status > img.show-on-hover, .tree-outline .item.audit.test-group.expanded > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status): Added. (.tree-outline .item.audit:matches(.test-case, .test-group) > .status:hover > img): Deleted. (.tree-outline .item.audit.test-group.expanded > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status): Deleted. 2019-01-07 Devin Rousso Web Inspector: extend XHR breakpoints to work with fetch https://bugs.webkit.org/show_bug.cgi?id=185843 Reviewed by Matt Baker. * UserInterface/Controllers/DOMDebuggerManager.js: (WI.DOMDebuggerManager): (WI.DOMDebuggerManager.supportsURLBreakpoints): Added. (WI.DOMDebuggerManager.prototype.get urlBreakpoints): Added. (WI.DOMDebuggerManager.prototype.urlBreakpointForURL): Added. (WI.DOMDebuggerManager.prototype.addURLBreakpoint): Added. (WI.DOMDebuggerManager.prototype.removeURLBreakpoint): Added. (WI.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints): (WI.DOMDebuggerManager.prototype._updateURLBreakpoint): Added. (WI.DOMDebuggerManager.prototype._resolveURLBreakpoint): Added. (WI.DOMDebuggerManager.prototype._saveURLBreakpoints): Added. (WI.DOMDebuggerManager.prototype._urlBreakpointDisabledStateDidChange): Added. (WI.DOMDebuggerManager.prototype.get xhrBreakpoints): Deleted. (WI.DOMDebuggerManager.prototype.xhrBreakpointForURL): Deleted. (WI.DOMDebuggerManager.prototype.addXHRBreakpoint): Deleted. (WI.DOMDebuggerManager.prototype.removeXHRBreakpoint): Deleted. (WI.DOMDebuggerManager.prototype._updateXHRBreakpoint.breakpointUpdated): Deleted. (WI.DOMDebuggerManager.prototype._updateXHRBreakpoint): Deleted. (WI.DOMDebuggerManager.prototype._resolveXHRBreakpoint): Deleted. (WI.DOMDebuggerManager.prototype._saveXHRBreakpoints): Deleted. (WI.DOMDebuggerManager.prototype._xhrBreakpointDisabledStateDidChange): Deleted. * UserInterface/Controllers/DebuggerManager.js: (WI.DebuggerManager.prototype._pauseReasonFromPayload): * UserInterface/Views/DebuggerSidebarPanel.js: (WI.DebuggerSidebarPanel): (WI.DebuggerSidebarPanel.prototype.willDismissPopover): (WI.DebuggerSidebarPanel.prototype._addBreakpoint): (WI.DebuggerSidebarPanel.prototype._treeSelectionDidChange): (WI.DebuggerSidebarPanel.prototype._addTreeElement): (WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection): (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointClicked): * UserInterface/Views/NavigationSidebarPanel.js: (WI.NavigationSidebarPanel.prototype._isTreeElementWithoutRepresentedObject): * UserInterface/Models/URLBreakpoint.js: Renamed from Source/WebInspectorUI/UserInterface/Models/XHRBreakpoint.js. * UserInterface/Views/URLBreakpointPopover.css: Renamed from Source/WebInspectorUI/UserInterface/Views/XHRBreakpointPopover.css. * UserInterface/Views/URLBreakpointPopover.js: Renamed from Source/WebInspectorUI/UserInterface/Views/XHRBreakpointPopover.js. * UserInterface/Views/URLBreakpointTreeElement.css: Renamed from Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.css. * UserInterface/Views/URLBreakpointTreeElement.js: Renamed from Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js. * UserInterface/Base/Setting.js: (WI.Setting.migrateValue): Added. * UserInterface/Main.html: * UserInterface/Test.html: * Localizations/en.lproj/localizedStrings.js: 2019-01-07 Devin Rousso Web Inspector: Network: show secure connection details per-request https://bugs.webkit.org/show_bug.cgi?id=191539 Reviewed by Joseph Pecoraro. * UserInterface/Models/Resource.js: (WI.Resource): (WI.Resource.prototype.get security): Added. (WI.Resource.prototype.updateForResponse): (WI.Resource.prototype.updateWithMetrics): (WI.Resource.prototype.get responseSecurity): Deleted. * UserInterface/Views/ResourceSecurityContentView.js: (WI.ResourceSecurityContentView): (WI.ResourceSecurityContentView.prototype.initialLayout): (WI.ResourceSecurityContentView.prototype.layout): (WI.ResourceSecurityContentView.prototype._refreshConnectionSection): Added. (WI.ResourceSecurityContentView.prototype._refreshCetificateSection): (WI.ResourceSecurityContentView.prototype._handleResourceMetricsDidChange): Added. * UserInterface/Views/ResourceSecurityContentView.css: (body[dir] .resource-security > section:matches(.connection, .certificate) > .details): Added. (@media (prefers-dark-interface) body[dir] .resource-security > section:matches(.connection, .certificate) > .details): Added. (body[dir] .resource-security > section.certificate > .details): Deleted. (@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details): Deleted. * Localizations/en.lproj/localizedStrings.js: 2019-01-07 Nikita Vasilyev Web Inspector: "white" isn't recognized as a color keyword https://bugs.webkit.org/show_bug.cgi?id=193173 Reviewed by Joseph Pecoraro. Attempt to parse "atom" token types as colors. Display color picker only for color-aware properties. For instance, display it for "color: white" but not for "-apple-pay-button-style: white". * UserInterface/Models/CSSKeywordCompletions.js: (addKeywordsForName): (WI.CSSKeywordCompletions.forProperty): (WI.CSSKeywordCompletions.isColorAwareProperty): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype._renderValue): (WI.SpreadsheetStyleProperty.prototype._addColorTokens): 2019-01-04 Joseph Pecoraro Web Inspector: subclasses of WI.ClusterContentView don't save/restore content views after the initial view https://bugs.webkit.org/show_bug.cgi?id=192451 Reviewed by Devin Rousso. * UserInterface/Models/BackForwardEntry.js: (WI.BackForwardEntry.prototype.prepareToHide): * UserInterface/Views/ClusterContentView.js: (WI.ClusterContentView.prototype.get shouldSaveStateOnHide): * UserInterface/Views/ContentView.js: (WI.ContentView.prototype.get shouldSaveStateOnHide): Allow ClusterContentViews to save its state whenever its hidden, this means it can be properly restored to the last state it had instead of the initial state it was shown with. 2019-01-04 Devin Rousso Web Inspector: Audit: disable breakpoints when running Audit https://bugs.webkit.org/show_bug.cgi?id=193158 Reviewed by Joseph Pecoraro. * UserInterface/Controllers/DebuggerManager.js: (WI.DebuggerManager): (WI.DebuggerManager.prototype._startDisablingBreakpointsTemporarily): (WI.DebuggerManager.prototype._stopDisablingBreakpointsTemporarily): (WI.DebuggerManager.prototype._handleAuditManagerTestScheduled): Added. (WI.DebuggerManager.prototype._handleAuditManagerTestCompleted): Added. * UserInterface/Views/DebuggerSidebarPanel.js: (WI.DebuggerSidebarPanel.prototype._timelineCapturingWillStart): (WI.DebuggerSidebarPanel.prototype._timelineCapturingStopped): (WI.DebuggerSidebarPanel.prototype._handleAuditManagerTestScheduled): Added. (WI.DebuggerSidebarPanel.prototype._handleAuditManagerTestCompleted): Added. (WI.DebuggerSidebarPanel.prototype._updateBreakpointsDisabledBanner): * UserInterface/Views/DebuggerSidebarPanel.css: (.sidebar > .panel.navigation.debugger .warning-banner + .warning-banner): Added. * UserInterface/Base/Main.js: (WI.loaded): * UserInterface/Test/Test.js: (WI.loaded): Move `WI.auditManager` higher in the managers list so that it can be used in `WI.DebuggerManager`'s constructor. * Localizations/en.lproj/localizedStrings.js: 2019-01-04 Joseph Pecoraro Web Inspector: Add a Setting Toggle for Source Maps https://bugs.webkit.org/show_bug.cgi?id=193148 Reviewed by Devin Rousso. * UserInterface/Controllers/NetworkManager.js: (WI.NetworkManager.prototype.downloadSourceMap): Don't download source maps if the setting is disabled. * UserInterface/Base/Setting.js: * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createGeneralSettingsView): Settings toggle for source maps. Enabled by default. * Localizations/en.lproj/localizedStrings.js: 2019-01-04 Joseph Pecoraro Web Inspector: Include `globalThis` in default JavaScript completions https://bugs.webkit.org/show_bug.cgi?id=193147 Reviewed by Devin Rousso. * UserInterface/Controllers/CodeMirrorCompletionController.js: Add `globalThis` which is a new global value. 2019-01-03 Devin Rousso Web Inspector: conic-gradient color picker doesn't accurately show color when saturation value is not 100% https://bugs.webkit.org/show_bug.cgi?id=192729 Reviewed by Joseph Pecoraro. Rework `WI.ColorWheel` to use similar canvas drawing logic as `WI.LegacyColorWheel` so that it's able to adjust the saturation value as the pixels gets closer to the center. * UserInterface/Models/Color.js: (WI.Color.rgb2hsl): Added. (WI.Color.hsl2rgb): Added. (WI.Color.cmyk2rgb): (WI.Color.prototype.isKeyword): (WI.Color.prototype._toRGBString): (WI.Color.prototype._toRGBAString): (WI.Color.prototype._toHSLString): (WI.Color.prototype._toHSLAString): (WI.Color.prototype._rgbaToHSLA): (WI.Color.prototype._hslaToRGBA): (WI.Color.rgb2hsv): Deleted. (WI.Color.hsv2rgb): Deleted. (WI.Color.prototype._rgbToHSL): Deleted. (WI.Color.prototype._hslToRGB): Deleted. Adjust the conversion functions of `WI.Color` to be more accurate. * UserInterface/Views/ColorWheel.js: (WI.ColorWheel): (WI.ColorWheel.prototype.set dimension): (WI.ColorWheel.prototype.set brightness): (WI.ColorWheel.prototype.get tintedColor): (WI.ColorWheel.prototype.set tintedColor): (WI.ColorWheel.prototype._updateColorForMouseEvent): (WI.ColorWheel.prototype._updateCanvas): Added. (WI.ColorWheel.prototype._updateGradient): Deleted. * UserInterface/Views/ColorWheel.css: (.color-wheel > canvas): Added. (.color-wheel > .gradient): Deleted. * UserInterface/Views/ColorPicker.js: (WI.ColorPicker): (WI.ColorPicker.prototype.set color): (WI.ColorPicker.prototype.sliderValueDidChange): (WI.ColorPicker.prototype._updateSliders): (WI.ColorPicker.prototype._showColorComponentInputs): (WI.ColorPicker.supportsConicGradient): Deleted. * UserInterface/Main.html: * UserInterface/Views/LegacyColorWheel.js: Removed. 2019-01-02 Nikita Vasilyev Web Inspector: Styles: selection lost when inspector is blurred https://bugs.webkit.org/show_bug.cgi?id=192124 Reviewed by Devin Rousso. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css: (body:matches(.window-docked-inactive, .window-inactive) .spreadsheet-style-declaration-editor .property.selected): Selection should be gray when Web Inspector window isn't focused. * UserInterface/Views/SpreadsheetStyleProperty.js: 2019-01-02 Nikita Vasilyev Web Inspector: Styles: it shouldn't be possible to delete read-only properties https://bugs.webkit.org/show_bug.cgi?id=193099 Reviewed by Devin Rousso. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor): Drive-by: Forward Delete should work the same way as Delete (Backspace). 2019-01-02 Devin Rousso Web Inspector: Implement `queryObjects` Command Line API https://bugs.webkit.org/show_bug.cgi?id=176766 Reviewed by Joseph Pecoraro. * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js: (WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames): Add `queryObjects` to the list of command line functions. 2018-12-21 Devin Rousso Web Inspector: Styles Redesign: remove unused CSS style icons https://bugs.webkit.org/show_bug.cgi?id=192999 Reviewed by Matt Baker. * UserInterface/Main.html: * UserInterface/Views/StyleRuleIcons.css: Removed. * UserInterface/Images/StyleRule.svg: Removed. * UserInterface/Images/StyleRuleInheritedElement.svg: Removed. * UserInterface/Images/StyleRulePseudoElement.svg: Removed. * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj: * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters: 2018-12-21 Nikita Vasilyev Web Inspector: Styles: editing focus lost when inspector is blurred https://bugs.webkit.org/show_bug.cgi?id=192123 Reviewed by Devin Rousso. * UserInterface/Views/SpreadsheetSelectorField.js: (WI.SpreadsheetSelectorField.prototype._handleBlur): * UserInterface/Views/SpreadsheetTextField.js: (WI.SpreadsheetTextField.prototype._handleBlur): 2018-12-21 Devin Rousso Web Inspector: Settings: experimental setting editors are misaligned in other locales https://bugs.webkit.org/show_bug.cgi?id=192971 Reviewed by Joseph Pecoraro. * UserInterface/Views/SettingsTabContentView.css: (.content-view.settings > .settings-view > .container): (.content-view.settings > .settings-view > .container > .title): 2018-12-21 Devin Rousso Web Inspector: update scroll position when revealing a virtualized WI.DataGridNode https://bugs.webkit.org/show_bug.cgi?id=192992 Reviewed by Joseph Pecoraro. When `reveal`ing a `WI.DataGridNode`, if it is not currently in the DOM tree (e.g. it's been virtualized by it's owner `WI.DataGrid`), we need to scroll to it's position so that it gets added to the DOM tree before it can be revealed/selected. * UserInterface/Views/DataGrid.js: (WI.DataGrid.prototype.layout): (WI.DataGrid.prototype.updateVisibleRows): (WI.DataGrid.prototype._updateVisibleRows): Deleted. * UserInterface/Views/DataGridNode.js: (WI.DataGridNode.prototype.reveal): 2018-12-20 Nikita Vasilyev Web Inspector: Dark Mode: Type profiler popovers have black text on dark background https://bugs.webkit.org/show_bug.cgi?id=192916 Reviewed by Devin Rousso. * UserInterface/Views/SourceCodeTextEditor.css: (.popover .debugger-popover-content > .body): * UserInterface/Views/TypeTreeElement.css: (.item.type-tree-element.prototype): (.item.type-tree-element.prototype:hover,): * UserInterface/Views/TypeTreeView.css: (.type-tree): * UserInterface/Views/Variables.css: (:root): 2018-12-20 Nikita Vasilyev Web Inspector: Styles: Pressing Esc when editing name/value should select entire property https://bugs.webkit.org/show_bug.cgi?id=192919 Reviewed by Devin Rousso. - Esc still hides the completion popover. - Esc still discards changes. - When there's no completion popover, Esc selects outer scope. I.e., it goes from editing name/value to selecting the entire property. - Pressing Esc for newly added properties discards those properties. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyDidPressEsc): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidPressEsc): * UserInterface/Views/SpreadsheetTextField.js: (WI.SpreadsheetTextField.prototype._discardChange): (WI.SpreadsheetTextField.prototype._handleKeyDown): 2018-12-20 Joseph Pecoraro Web Inspector: Charles Proxy errors opening har files exported from Safari (invalid startedDateTime) https://bugs.webkit.org/show_bug.cgi?id=192959 Reviewed by Brian Burg. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype.tableCellContextMenuClicked): (WI.NetworkTableContentView.prototype._updateExportButton): (WI.NetworkTableContentView.prototype._canExportHAR): Disallow HAR export if we don't have load data, such as the requestSentDate for the main resource or sub-resources. (WI.NetworkTableContentView.prototype._HARResources): Only export resources that have load data. 2018-12-20 Joseph Pecoraro Web Inspector: Autoformat doesn't work on icloud.com (javascript-packed.js) https://bugs.webkit.org/show_bug.cgi?id=192946 Rubber-stamped by Devin Rousso. * UserInterface/Base/Utilities.js: (whitespaceRatio): (isTextLikelyMinified): Check the first 2500 and the last 2500 characters whitespace ratio. If either is below 20% then treat as minified. 2018-12-20 Joseph Pecoraro ITMLKit Inspector: Elements tab does not show DOM Tree https://bugs.webkit.org/show_bug.cgi?id=192910 Reviewed by Brian Burg. * UserInterface/Protocol/Connection.js: (InspectorBackend.Connection.prototype._dispatchEvent): Better logging for errors. * UserInterface/Base/Main.js: * UserInterface/Controllers/AppController.js: (WI.AppController.prototype.activateExtraDomains): Let Targets get a chance to activate extra domains. Perform a little more work in these cases. * UserInterface/Protocol/Target.js: (WI.Target): (WI.Target.prototype.activateExtraDomain): Expose agents for domains that are active. Expose agents for extra domains when they are activated. 2018-12-20 Joseph Pecoraro ITMLKit Inspector: Computed Style Box Model section throws exceptions https://bugs.webkit.org/show_bug.cgi?id=192911 Reviewed by Matt Baker. * UserInterface/Views/BoxModelDetailsSectionRow.js: (WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createBoxPartElement): (WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaElement): (WI.BoxModelDetailsSectionRow.prototype._updateMetrics): ITMLKit doesn't always provide a display/position/width/height etc properties. Protect against this, and just show an empty message in the box model section if those properties do not exist. 2018-12-20 Devin Rousso Web Inspector: UIString should take an optional key and description to aid localization https://bugs.webkit.org/show_bug.cgi?id=153962 Reviewed by Brian Burg. * UserInterface/Base/LoadLocalizedStrings.js: (WI.UIString): * UserInterface/Test/Test.js: (WI.UIString): * UserInterface/Views/AuditTestGroupContentView.js: (WI.AuditTestGroupContentView.prototype.initialLayout): 2018-12-20 Devin Rousso Web Inspector: Audits: don't cache default audits https://bugs.webkit.org/show_bug.cgi?id=192918 Reviewed by Brian Burg. Instead of adding the default audits to the "audits" `WI.ObjectStore`, which preserves them across WebInspector sessions, load them every time WebInspector is opened (unless there are existing audits) so that the localized strings are able to respond to locale changes. * UserInterface/Controllers/AuditManager.js: (WI.AuditManager.prototype.removeTest): (WI.AuditManager.prototype.addDefaultTestsIfNeeded): 2018-12-20 Devin Rousso Web Inspector: Dark Mode: unreadable background color for tables containing object previews https://bugs.webkit.org/show_bug.cgi?id=192887 Reviewed by Brian Burg. * UserInterface/Views/LogContentView.css: (.console-messages:focus .console-item .data-grid tr.selected td:not(:last-child)): Added. (@media (prefers-dark-interface) .console-item .data-grid tr.selected): Added. (@media (prefers-dark-interface) .console-messages:focus .console-item.selected .data-grid tr.selected): Added. (@media (prefers-dark-interface) .console-messages:focus .console-item .data-grid tr.selected td:not(:last-child)): Added. * UserInterface/Views/IndexedDatabaseObjectStoreContentView.css: (.content-view.indexed-database-object-store > .data-grid tr.selected): (.content-view.indexed-database-object-store > .data-grid:focus tr.selected): Added. (@media (prefers-dark-interface) .content-view.indexed-database-object-store > .data-grid tr.selected): Added. (@media (prefers-dark-interface) .content-view.indexed-database-object-store > .data-grid:focus tr.selected): Added. (@media (prefers-dark-interface) .content-view.indexed-database-object-store > .data-grid:focus tr.selected td:not(:last-child)): Added. 2018-12-19 Devin Rousso Web Inspector: Audit: fix descriptions for default tests https://bugs.webkit.org/show_bug.cgi?id=192764 Reviewed by Matt Baker. * UserInterface/Controllers/AuditManager.js: (WI.AuditManager.prototype.addDefaultTestsIfNeeded): * Localizations/en.lproj/localizedStrings.js: 2018-12-19 Nikita Vasilyev Web Inspector: "E" icon on debugger dashboard is too close to current function name https://bugs.webkit.org/show_bug.cgi?id=192915 Reviewed by Matt Baker. * UserInterface/Views/DebuggerDashboardView.css: (.dashboard.debugger > .location): (body[dir=ltr] .dashboard.debugger > .location :matches(.function-icon, .event-listener-icon)): (body[dir=rtl] .dashboard.debugger > .location :matches(.function-icon, .event-listener-icon)): (.dashboard.debugger > .location .function-icon): Deleted. (body[dir=ltr] .dashboard.debugger > .location .function-icon): Deleted. (body[dir=rtl] .dashboard.debugger > .location .function-icon): Deleted. 2018-12-19 Nikita Vasilyev Web Inspector: Dark Mode: ThreadTreeElement status icon is hard to see when hovered https://bugs.webkit.org/show_bug.cgi?id=192097 Reviewed by Matt Baker. * UserInterface/Views/ThreadTreeElement.css: (.tree-outline > .item.thread .status-button.resume): (.tree-outline > .item.thread .status-button.resume:active): 2018-12-19 Devin Rousso Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'effectiveDOMNode.enabledPseudoClasses') https://bugs.webkit.org/show_bug.cgi?id=192783 Reviewed by Joseph Pecoraro. * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js: (WI.GeneralStyleDetailsSidebarPanel.prototype._forcedPseudoClassCheckboxChanged): (WI.GeneralStyleDetailsSidebarPanel.prototype._updatePseudoClassCheckboxes): 2018-12-19 Devin Rousso Web Inspector: REGRESSION (r237195): Timelines: selecting a rendering frame row moves the time selection https://bugs.webkit.org/show_bug.cgi?id=192773 Reviewed by Joseph Pecoraro. * UserInterface/Views/TimelineOverview.js: (WI.TimelineOverview.prototype._recordSelected): The Frames timeline uses `frameIndex` instead of `startTime`/`endTime`, so when trying to ensure that the selected record is within the filtered range, use `frameIndex` instead. The associated `WI.TimelineRuler` will already be using an index-based approach for selection, so this will match. 2018-12-19 Devin Rousso Web Inspector: Canvas: the recording auto-capture input shouldn't start focused https://bugs.webkit.org/show_bug.cgi?id=192454 Reviewed by Joseph Pecoraro. * UserInterface/Views/CanvasOverviewContentView.js: (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel): (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged): 2018-12-19 Nikita Vasilyev Web Inspector: Styles: shift-clicking a color-swatch to change formats starts editing the color https://bugs.webkit.org/show_bug.cgi?id=192784 Reviewed by Devin Rousso. * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch): 2018-12-19 Matt Baker Web Inspector: Elements tab: arrow key after undoing a DOM node delete selects the wrong element https://bugs.webkit.org/show_bug.cgi?id=192871 Reviewed by Devin Rousso. Undoing a DOM node removal reinserts the node into the DOMTreeOutline. When the reinserted node precedes the selected node in the tree, the SelectionController should update `_lastSelectedIndex`. * UserInterface/Controllers/SelectionController.js: (WI.SelectionController.prototype.didInsertItem): 2018-12-19 Devin Rousso Web Inspector: Audit: provide localization support for % pass display https://bugs.webkit.org/show_bug.cgi?id=192870 Reviewed by Brian Burg. * UserInterface/Views/AuditTestGroupContentView.js: (WI.AuditTestGroupContentView.prototype.initialLayout): (WI.AuditTestGroupContentView.prototype.layout): * UserInterface/Views/AuditTestGroupContentView.css: (.content-view.audit-test-group > header > .percentage-pass): (.content-view.audit-test-group > header > .percentage-pass > span): Added. (@media (prefers-dark-interface) .content-view.audit-test-group > header > .percentage-pass): Added. (@media (prefers-dark-interface) .content-view.audit-test-group > header > .percentage-pass > span): Added. (.content-view.audit-test-group > header > .percentage-pass:not(:empty)::after): Deleted. * Localizations/en.lproj/localizedStrings.js: 2018-12-19 Nikita Vasilyev Web Inspector: Computed: make UI more usable when the panel is narrow https://bugs.webkit.org/show_bug.cgi?id=192578 Reviewed by Devin Rousso. * UserInterface/Views/ComputedStyleSection.css: (.computed-style-section .computed-property-item .property-traces): (.computed-style-section .computed-property-item.expanded .disclosure-button): (.computed-style-section .computed-property-item .property-trace-item): (.computed-style-section .computed-property-item .property-trace-item::before): (.computed-style-section .computed-property-item .property): (.computed-style-section .computed-property-item .property-trace-item .selector): Allow CSS property values and selectors to take more than one line. (.computed-style-section .property-trace-item .property .name,): * UserInterface/Views/ComputedStyleSection.js: (WI.ComputedStyleSection.prototype._createTrace): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.update): 2018-12-18 Simon Fraser Web Inspector: Timelines: correctly label Intersection Observer callbacks https://bugs.webkit.org/show_bug.cgi?id=192669 Reviewed by Joseph Pecoraro. Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls to Intersection Observer, Performance Observer and Mutation Observer callbacks so that they get correctly labeled in the Inspector timeline. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Controllers/TimelineManager.js: (WI.TimelineManager.prototype._processRecord): * UserInterface/Models/ScriptTimelineRecord.js: (WI.ScriptTimelineRecord.EventType.displayName): * UserInterface/Views/TimelineTabContentView.js: (WI.TimelineTabContentView.iconClassNameForRecord): 2018-12-19 Devin Rousso Web Inspector: Audit: "Clear Filters" button gets clipped when window is vertically small https://bugs.webkit.org/show_bug.cgi?id=192868 Reviewed by Matt Baker. * UserInterface/Views/Main.css: (.message-text-view): 2018-12-19 Nikita Vasilyev Web Inspector: Dark Mode: selected text is too light when Inspector window is inactive https://bugs.webkit.org/show_bug.cgi?id=190542 Reviewed by Devin Rousso. * UserInterface/Views/CodeMirrorOverrides.css: (.CodeMirror .CodeMirror-selected): 2018-12-19 Nikita Vasilyev Web Inspector: column sort controls in Layers tab sidebar don't render correctly in dark mode https://bugs.webkit.org/show_bug.cgi?id=192845 Reviewed by Devin Rousso. * UserInterface/Views/DataGrid.css: (@media (prefers-dark-interface)): (.data-grid th.sortable:active): Drive-by: replace obnoxiously light background of the pressed header with a more subtle gray. (.data-grid th.sort-ascending > div:first-child::after, .data-grid th.sort-descending > div:first-child::after): Invert colors of the arrow glyph. 2018-12-18 Devin Rousso Web Inspector: Layers: increase default column width for other localizations https://bugs.webkit.org/show_bug.cgi?id=192812 Reviewed by Brian Burg. * UserInterface/Views/LayerDetailsSidebarPanel.js: (WI.LayerDetailsSidebarPanel.prototype._buildDataGrid): * UserInterface/Views/LayerTreeDetailsSidebarPanel.js: (WI.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection): 2018-12-18 Joseph Pecoraro Web Inspector: m3u8 content not shown, it should be text https://bugs.webkit.org/show_bug.cgi?id=192731 Reviewed by Devin Rousso. * UserInterface/Base/MIMETypeUtilities.js: (WI.shouldTreatMIMETypeAsText): Support m3u8/m3u files as text. 2018-12-17 Devin Rousso Web Inspector: Canvas: path view is misaligned https://bugs.webkit.org/show_bug.cgi?id=192761 Reviewed by Joseph Pecoraro. * UserInterface/Views/RecordingContentView.css: (.content-view:not(.tab).recording :matches(img, canvas)): (.content-view:not(.tab).recording canvas.path): 2018-12-17 Devin Rousso Web Inspector: Audit: add plural result strings https://bugs.webkit.org/show_bug.cgi?id=192769 Reviewed by Brian Burg. * UserInterface/Views/AuditTestContentView.js: (WI.AuditTestContentView.prototype.showNoResultDataPlaceholder): * UserInterface/Views/AuditTestGroupContentView.js: (WI.AuditTestGroupContentView.prototype.layout): * Localizations/en.lproj/localizedStrings.js: 2018-12-17 Devin Rousso Web Inspector: Settings: add singular "space" UIString https://bugs.webkit.org/show_bug.cgi?id=192766 Reviewed by Brian Burg. * UserInterface/Views/SettingEditor.js: (WI.SettingEditor): (WI.SettingEditor.prototype.get label): (WI.SettingEditor.prototype.set label): Added. * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createGeneralSettingsView): (WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting): Added. (WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting.updateLabel): Added. * Localizations/en.lproj/localizedStrings.js: 2018-12-15 Nikita Vasilyev Web Inspector: Styles: toggling selected properties may cause data corruption https://bugs.webkit.org/show_bug.cgi?id=192396 Reviewed by Devin Rousso. Uncommenting a property after a commented out property used to insert an unnecessary semicolon, and not updating ranges of the following properties. For example: /* color: red; */ /* font-size: 12px */ Uncommenting `font-size` would result in something like this: /* color: red; */; font-size: 12px ^ unnecessary semicolon Now the semicolon doesn't get inserted and the white space is preserved better: /* color: red; */ font-size: 12px * UserInterface/Models/CSSProperty.js: (WI.CSSProperty.prototype._updateOwnerStyleText): (WI.CSSProperty.prototype._appendSemicolonIfNeeded): Removed. (WI.CSSProperty.prototype._prependSemicolonIfNeeded): Added. * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.remove): (WI.SpreadsheetStyleProperty.prototype.update): (WI.SpreadsheetStyleProperty.prototype._handleNameChange): (WI.SpreadsheetStyleProperty.prototype._handleValueChange): Style declaration should be locked while editing. Add asserts to ensure this. 2018-12-14 Matt Baker Web Inspector: REGRESSION(r238599): Uncaught Exception: TypeError: null is not an object (evaluating 'treeElement.listItemElement.classList') https://bugs.webkit.org/show_bug.cgi?id=192090 Reviewed by Devin Rousso. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline.prototype.selectionControllerSelectionDidChange): Check that `listItemElement` is valid before accessing it to update class names. The selection can change before the TreeElement has been attached. 2018-12-14 Matt Baker Web Inspector: Cookies view should use model objects instead of raw payload data https://bugs.webkit.org/show_bug.cgi?id=189533 Reviewed by Joseph Pecoraro and Devin Rousso. * UserInterface/Models/Cookie.js: (WI.Cookie): (WI.Cookie.fromPayload): (WI.Cookie.parseSetCookieResponseHeader): (WI.Cookie.prototype.get type): (WI.Cookie.prototype.get name): (WI.Cookie.prototype.get value): (WI.Cookie.prototype.get header): (WI.Cookie.prototype.get expires): (WI.Cookie.prototype.get maxAge): (WI.Cookie.prototype.get path): (WI.Cookie.prototype.get domain): (WI.Cookie.prototype.get secure): (WI.Cookie.prototype.get httpOnly): (WI.Cookie.prototype.get sameSite): (WI.Cookie.prototype.get size): (WI.Cookie.prototype.get url): (WI.Cookie.prototype.expirationDate): Cleanup Cookie object; add pubic getters for data, `url` property, static `fromPayload` method, and calculate `_size` if missing. * UserInterface/Views/CookieStorageContentView.js: (WI.CookieStorageContentView.prototype.tableDidRemoveRows): (WI.CookieStorageContentView.prototype._reloadCookies): Create Cookie objects from the payload instead of using raw payload data. 2018-12-13 Devin Rousso Web Inspector: remove DOM.BackendNodeId and associated commands/events https://bugs.webkit.org/show_bug.cgi?id=192478 Reviewed by Matt Baker. * Versions/Inspector-iOS-8.0.json: * Versions/Inspector-iOS-9.0.json: * Versions/Inspector-iOS-9.3.json: * Versions/Inspector-iOS-10.0.json: * Versions/Inspector-iOS-10.3.json: * Versions/Inspector-iOS-11.0.json: * Versions/Inspector-iOS-11.3.json: * Versions/Inspector-iOS-12.0.json: * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js: 2018-12-13 Devin Rousso Web Inspector: experimental settings reload button disappears after changing more than one setting https://bugs.webkit.org/show_bug.cgi?id=192645 Reviewed by Joseph Pecoraro. * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createExperimentalSettingsView.listenForChange): (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): 2018-12-13 Matt Baker Web Inspector: REGRESSION(r238602): Elements: deleting multiple DOM nodes doesn't select the nearest node after deletion https://bugs.webkit.org/show_bug.cgi?id=192116 Reviewed by Devin Rousso. * UserInterface/Controllers/SelectionController.js: (WI.SelectionController.prototype.removeSelectedItems): Finding a new index to select should go through the delegate instead of naively advancing the index. * UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement.prototype._populateNodeContextMenu): (WI.DOMTreeElement.prototype.ondelete): Deleted. The menu item for removing the DOM node is now managed by the parent DOMTreeOutline, since its UI and behavior now depend on whether there are multiple elements selected. * UserInterface/Views/DOMTreeOutline.js: (WI.DOMTreeOutline.prototype.populateContextMenu): (WI.DOMTreeOutline.prototype.ondelete.level): (WI.DOMTreeOutline.prototype.ondelete): Implement `ondelete` to remove selected DOM nodes using the delete and backspace keys. Also used by the DOMTreeOutline's context menu handler. 2018-12-13 Matt Baker Web Inspector: Table selection becomes corrupted when deleting selected cookies https://bugs.webkit.org/show_bug.cgi?id=192388 Reviewed by Devin Rousso. * UserInterface/Controllers/SelectionController.js: (WI.SelectionController): (WI.SelectionController.prototype.didRemoveItems): (WI.SelectionController.prototype._updateSelectedItems): (WI.SelectionController.prototype.didRemoveItem): Deleted. Replace `didRemoveItem` with a method taking an IndexSet. Calling the single-index version while iterating over multiple rows in ascending order is unsafe, a detail best left to the SelectionController. * UserInterface/Views/Table.js: (WI.Table.prototype.removeRow): (WI.Table.prototype._removeRows): Notify SelectionController of removed rows. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline.prototype.insertChild): (WI.TreeOutline.prototype.removeChildAtIndex): Remove the child from the element's `children` after calling `_forgetTreeElement`, which needs to calculate the child's index to pass to the SelectionController. (WI.TreeOutline.prototype.removeChildren): Remove child items during iteration so that `children` doesn't contain detached TreeElements while calling `_forgetTreeElement`. (WI.TreeOutline.prototype._rememberTreeElement): (WI.TreeOutline.prototype._forgetTreeElement): 2018-12-10 Matt Baker Web Inspector: REGRESSION (r238599): unable to select specific timeline https://bugs.webkit.org/show_bug.cgi?id=192443 Reviewed by Joseph Pecoraro. When determining the trailing horizontal edge for TreeElement mouse events, TreeOutline should not assume that its containing DOM element is only as wide as its
    element. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline.prototype.treeElementFromEvent): 2018-12-10 Matt Baker Web Inspector: Move TreeOutlineGroup coordination out of TreeElement https://bugs.webkit.org/show_bug.cgi?id=192487 Reviewed by Devin Rousso. * UserInterface/Views/TreeElement.js: (WI.TreeElement.prototype.select): (WI.TreeElement.prototype.deselect): * UserInterface/Views/TreeOutlineGroup.js: (WI.TreeOutlineGroup): (WI.TreeOutlineGroup.prototype.itemAdded): (WI.TreeOutlineGroup.prototype.itemRemoved): (WI.TreeOutlineGroup.prototype._removeConflictingTreeSelections): (WI.TreeOutlineGroup.prototype._treeOutlineSelectionDidChange): (WI.TreeOutlineGroup.groupForTreeOutline): Deleted. (WI.TreeOutlineGroup.prototype.didSelectTreeElement): Deleted. make the group responsible for listening to selection changes from the TreeOutlines it manages, and synchronizing the selection between them. 2018-12-10 Dean Jackson Use text/javascript as recommended by the HTML specification https://bugs.webkit.org/show_bug.cgi?id=192525 Reviewed by Jon Lee. The HTML specification says we should use text/javascript for JavaScript files: https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type * UserInterface/Base/MIMETypeUtilities.js: (WI.mimeTypeForFileExtension): * UserInterface/Views/TextEditor.js: (WI.TextEditor.prototype._attemptToDetermineMIMEType): 2018-12-06 Matt Baker Web Inspector: REGRESSION(r238602): Elements: collapsing a DOM node with the left arrow doesn't work https://bugs.webkit.org/show_bug.cgi?id=192353 Reviewed by Devin Rousso. * UserInterface/Views/TreeElement.js: (WI.TreeElement.prototype.deselect): Don't early return when the element is not the selected tree element. This condition no longer holds now that TreeOutline supports multiple selection. 2018-12-05 Matt Baker Web Inspector: SelectionController should not extend the selection when allowsMultipleSelection is false https://bugs.webkit.org/show_bug.cgi?id=192390 Reviewed by Devin Rousso. * UserInterface/Controllers/SelectionController.js: (WI.SelectionController.prototype.selectItem): 2018-12-04 Nikita Vasilyev Web Inspector: Add style editing debug mode https://bugs.webkit.org/show_bug.cgi?id=192282 Reviewed by Matt Baker. Introduce a style editing debug mode to help to troubleshoot complex bugs in the style editor. - Log CSS changes; - Display red border for locked style declarations. * UserInterface/Base/Setting.js: * UserInterface/Models/CSSProperty.js: (WI.CSSProperty.prototype._updateOwnerStyleText): * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createDebugSettingsView): * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css: (.spreadsheet-style-declaration-editor.debug-style-locked::after): * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._updateStyleLock): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._updateDebugLockStatus): 2018-12-04 Matt Baker Web Inspector: REGRESSION(r238602): Elements: changing selection no longer highlights the selected node https://bugs.webkit.org/show_bug.cgi?id=192354 Reviewed by Joseph Pecoraro. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline.prototype._treeKeyDown): (WI.TreeOutline.prototype._handleMouseDown): 2018-12-04 Joseph Pecoraro Web Inspector: REGRESSION(r238330): Timeline auto-capture does not work after page transition https://bugs.webkit.org/show_bug.cgi?id=192248 Reviewed by Devin Rousso. * UserInterface/Base/Main.js: (WI.transitionPageTarget): Let the TimelineManager perform work on page transitions. * UserInterface/Controllers/TimelineManager.js: (WI.TimelineManager.prototype.initializeTarget): Initialize the autocapture state of the target. (WI.TimelineManager.prototype.transitionPageTarget): When transitioning pages perform a legacy (frontend based) timeline capture. 2018-12-04 Matt Baker Web Inspector: Elements: $0 is shown for all selected elements https://bugs.webkit.org/show_bug.cgi?id=192119 Reviewed by Devin Rousso. * UserInterface/Views/ContentBrowserTabContentView.js: (WI.ContentBrowserTabContentView.prototype._revealAndSelectRepresentedObject): * UserInterface/Views/DOMTreeContentView.js: (WI.DOMTreeContentView): (WI.DOMTreeContentView.prototype.layout): (WI.DOMTreeContentView.prototype._domTreeSelectionDidChange): Update the selected DOM node using the TreeOutline's selection change event, instead of in `onselect`, which wasn't always called. * UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement.prototype.onselect): Deleted. (WI.DOMTreeElement.prototype.ondeselect): Deleted. Eliminate `onselect` and `ondeselect`. TreeOutline clients should use the TreeOutline.Event.SelectedDidChange event instead. * UserInterface/Views/DOMTreeOutline.css: (.tree-outline.dom li.last-selected > span::after): (.tree-outline.dom:focus li.last-selected > span::after): (.tree-outline.dom li.selected > span::after): Deleted. (.tree-outline.dom:focus li.selected > span::after): Deleted. * UserInterface/Views/DOMTreeOutline.js: (WI.DOMTreeOutline.prototype.updateSelection): Deleted. * UserInterface/Views/DebuggerSidebarPanel.js: (WI.DebuggerSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange): * UserInterface/Views/FolderizedTreeElement.js: (WI.FolderizedTreeElement.prototype._addTreeElement): * UserInterface/Views/NavigationSidebarPanel.js: (WI.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement): (WI.NavigationSidebarPanel.prototype._treeElementWasFiltered): (WI.NavigationSidebarPanel): * UserInterface/Views/OpenResourceDialog.js: (WI.OpenResourceDialog.prototype._populateResourceTreeOutline): (WI.OpenResourceDialog.prototype._handleKeydownEvent): * UserInterface/Views/SourceCodeTreeElement.js: (WI.SourceCodeTreeElement.prototype.descendantResourceTreeElementTypeDidChange): * UserInterface/Views/TreeElement.js: (WI.TreeElement.prototype.select): (WI.TreeElement.prototype.revealAndSelect): (WI.TreeElement.prototype.deselect): Remove `suppressOnDeselect` and rename `suppressOnSelect` to `suppressNotification`. Now that `ondeselect` has been removed `suppressOnDeselect` is no longer meaningful, as TreeOutline generates a single `SelectedDidChange` event when the selected item changes. In the case of `revealAndSelect`, both arguments had the same value. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline): (WI.TreeOutline.prototype.selectionControllerSelectionDidChange): Add a unique class name to the last selected TreeElement to distinguish it from other selected elements. 2018-12-04 Matt Baker Web Inspector: Elements: ⌘-A should select all visible nodes https://bugs.webkit.org/show_bug.cgi?id=192120 Reviewed by Devin Rousso. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline.prototype._treeKeyDown): Remove an early return, allowing `WI.SelectionController` to handle ⌘-A and select all items. 2018-12-04 Devin Rousso Web Inspector: Audit: tests should support async operations https://bugs.webkit.org/show_bug.cgi?id=192171 Reviewed by Joseph Pecoraro. * UserInterface/Controllers/RuntimeManager.js: (WI.RuntimeManager.supportsAwaitPromise): Added. * UserInterface/Models/AuditTestCase.js: (WI.AuditTestCase.prototype.async run.async parseResponse.checkResultProperty.addErrorForValueType): Deleted. (WI.AuditTestCase.prototype.async run.async parseResponse.checkResultProperty): Deleted. (WI.AuditTestCase.prototype.async run.async parseResponse.async resultArrayForEach): Deleted. (WI.AuditTestCase.prototype.async run.async parseResponse): Added. (WI.AuditTestCase.prototype.async run): (WI.AuditTestCase.prototype.async run.checkResultProperty.addErrorForValueType): Deleted. (WI.AuditTestCase.prototype.async run.checkResultProperty): Deleted. (WI.AuditTestCase.prototype.async run.async resultArrayForEach): Deleted. * UserInterface/Models/AuditTestCaseResult.js: (WI.AuditTestCaseResult.async fromPayload): (WI.AuditTestCaseResult.prototype.toJSON): * UserInterface/Views/AuditTestCaseContentView.js: (WI.AuditTestCaseContentView.prototype.layout): 2018-12-03 Devin Rousso Web Inspector: Audit: save the expanded state of test groups https://bugs.webkit.org/show_bug.cgi?id=192346 Reviewed by Matt Baker. * UserInterface/Views/AuditTreeElement.js: (WI.AuditTreeElement): (WI.AuditTreeElement.prototype.onattach): (WI.AuditTreeElement.prototype.onexpand): Added. (WI.AuditTreeElement.prototype.oncollapse): Added. 2018-12-03 Devin Rousso Web Inspector: Audit: sidebar briefly shows "No Filter Results" before populating default audits https://bugs.webkit.org/show_bug.cgi?id=192341 Reviewed by Matt Baker. * UserInterface/Views/AuditNavigationSidebarPanel.js: (WI.AuditNavigationSidebarPanel.prototype.initialLayout): (WI.AuditNavigationSidebarPanel.prototype._addTest): (WI.AuditNavigationSidebarPanel.prototype._addResult): (WI.AuditNavigationSidebarPanel.prototype.applyFiltersToTreeElement): Deleted. Delay the construction of the "Results" folder until it's needed, since adding a hidden `WI.TreeElement` will cause the placeholder to appear. 2018-12-03 Devin Rousso Web Inspector: Audit: navigating while tests are running should stop and clear all results https://bugs.webkit.org/show_bug.cgi?id=192317 Reviewed by Joseph Pecoraro. * UserInterface/Controllers/AuditManager.js: (WI.AuditManager.prototype.async start): (WI.AuditManager.prototype._handleFrameMainResourceDidChange): * UserInterface/Views/AuditNavigationSidebarPanel.js: (WI.AuditNavigationSidebarPanel.prototype.initialLayout): Drive-by: pass the index of the saved result. 2018-12-03 Devin Rousso Web Inspector: Audit: "Add Default Audits" shown when there are no filter results https://bugs.webkit.org/show_bug.cgi?id=192105 Reviewed by Matt Baker. * UserInterface/Views/NavigationSidebarPanel.js: (WI.NavigationSidebarPanel): (WI.NavigationSidebarPanel.prototype.get hasActiveFilters): Added. (WI.NavigationSidebarPanel.prototype.suppressFilteringOnTreeElements): (WI.NavigationSidebarPanel.prototype.showEmptyContentPlaceholder): (WI.NavigationSidebarPanel.prototype.hideEmptyContentPlaceholder): (WI.NavigationSidebarPanel.prototype.updateEmptyContentPlaceholder): (WI.NavigationSidebarPanel.prototype.updateFilter): (WI.NavigationSidebarPanel.prototype._checkForEmptyFilterResults.checkTreeOutlineForEmptyFilterResults): (WI.NavigationSidebarPanel.prototype._filterDidChange): (WI.NavigationSidebarPanel.prototype._updateFilter): Deleted. (WI.NavigationSidebarPanel.prototype._createEmptyContentPlaceholderIfNeeded): Deleted. * UserInterface/Views/AuditNavigationSidebarPanel.js: (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved): Drive-by: change capitalization for consistency with other navigation sidebars. * Localizations/en.lproj/localizedStrings.js: 2018-12-03 Devin Rousso Web Inspector: Canvas: add singular localized string for "Record first %s frames" https://bugs.webkit.org/show_bug.cgi?id=192189 Reviewed by Joseph Pecoraro. * UserInterface/Views/CanvasOverviewContentView.js: (WI.CanvasOverviewContentView): (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount): (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel): Added. (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput): (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged): (WI.CanvasOverviewContentView.prototype.initialLayout): Deleted. Drive-by: update the auto-capture navigation item when the view is first created so there is no flashing of in the navigation bar (before `initialLayout` is called). * UserInterface/Views/CheckboxNavigationItem.js: (WI.CheckboxNavigationItem): (WI.CheckboxNavigationItem.prototype.set label): Added. * Localizations/en.lproj/localizedStrings.js: 2018-12-03 Matt Baker Web Inspector: REGRESSION(r238599): Multiple Selection: restoring selection when opening WebInspector puts the TreeElement into a permanent selected state https://bugs.webkit.org/show_bug.cgi?id=192091 Reviewed by Devin Rousso. * UserInterface/Controllers/SelectionController.js: (WI.SelectionController.prototype.didInsertItem): Fix a bug where selected indexes were overwritten by the inserted index. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline): (WI.TreeOutline.prototype.insertChild): Update the SelectionController with the newly inserted index before attaching the TreeElement. Attaching the TreeElement can cause it to become selected, which would add the index to the SelectionController, only to have it immediately incremented by the call to `didInsertItem`. Additionally, change `insertionIndex` to be the index of the inserted item instead of the inserted item's previous sibling. (WI.TreeOutline.prototype._rememberTreeElement): (WI.TreeOutline.prototype._forgetTreeElement): (WI.TreeOutline.prototype._indexOfTreeElement.previousElement): Deleted. Eliminate TreeElement index caching, which could become stale and cause the wrong index to be calculated. Additionally, instead of walking up the parent chain to determine the index, start at the root and use existing method `traverseNextTreeElement`. 2018-12-03 Devin Rousso Web Inspector: Audit: test tree elements should start out collapsed https://bugs.webkit.org/show_bug.cgi?id=192107 Reviewed by Matt Baker. * UserInterface/Views/AuditTreeElement.js: (WI.AuditTreeElement.prototype.onattach): 2018-12-03 Nikita Vasilyev Web Inspector: Styles: can't select properties of read-only rules https://bugs.webkit.org/show_bug.cgi?id=192266 Reviewed by Devin Rousso. Implement multiple properties selection for read-only rules (such as User Agent Stylesheets) in the Styles panel. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout): Keep selection on layout. (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingFirstProperty): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingLastProperty): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyBlur): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseEnter): SpreadsheetCSSStyleDeclarationEditor is used by ComputedStyleDetailsPanel, which doesn't have: - spreadsheetCSSStyleDeclarationEditorPropertyBlur - spreadsheetCSSStyleDeclarationEditorPropertyMouseEnter (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyFocusMoved): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown): * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.startEditingName): (WI.SpreadsheetStyleProperty.prototype.startEditingValue): 2018-11-30 Brian Burg Web Inspector: resource combining should be more robust against missing WebKitAdditions https://bugs.webkit.org/show_bug.cgi?id=192255 Reviewed by Joseph Pecoraro. * Scripts/copy-user-interface-resources.pl: (combineOrStripResourcesForWebKitAdditions): 2018-11-30 Nikita Vasilyev Web Inspector: Jumping from Computed to Styles should select property https://bugs.webkit.org/show_bug.cgi?id=192198 Reviewed by Devin Rousso. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css: (.spreadsheet-style-declaration-editor .property.highlighted): Deleted. (@keyframes style-property-highlight): Deleted. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty): Remove unnecessary `__propertyView` property. * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.detached): (WI.SpreadsheetStyleProperty.prototype.highlight): Deleted. 2018-11-30 Matt Baker Web Inspector: REGRESSION(r238599): Multiple Selection: selecting a breakpoint will change the selection to it's parent on the first click https://bugs.webkit.org/show_bug.cgi?id=192093 Reviewed by Devin Rousso. * UserInterface/Views/TreeElement.js: (WI.TreeElement.prototype.select): TreeElement shouldn't manage the TreeOutline's selection barrier. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline): (WI.TreeOutline.prototype.get processingSelectionChange): (WI.TreeOutline.prototype.selectionControllerSelectionDidChange): (WI.TreeOutline.prototype.selectTreeElementInternal): The selection re-entry barrier `processingSelectionChange` should be managed internally by TreeOutline, and exposed as a read-only property. Fix a bug where the barrier was cleared before dispatching the change notification, which can cause re-entry as a side effect. 2018-11-30 Devin Rousso Web Inspector: Settings: reload button needs horizontal spacing https://bugs.webkit.org/show_bug.cgi?id=192231 Reviewed by Matt Baker. * UserInterface/Views/SettingsTabContentView.css: (.content-view.settings > .settings-view > .container button): (.content-view.settings > .settings-view > .container > .title): (.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]): (body[dir=ltr] .content-view.settings > .settings-view > .container > .title): Deleted. (body[dir=rtl] .content-view.settings > .settings-view > .container > .title): Deleted. (body[dir=ltr] .content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]): Deleted. (body[dir=rtl] .content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]): Deleted. Drive-by: replace `dir=*` attribute rules with `-webkit-margin-*` properties. 2018-11-30 Joseph Pecoraro Web Inspector: Uncaught Exception opening Web Inspector to Debugger Tab https://bugs.webkit.org/show_bug.cgi?id=192174 Reviewed by Devin Rousso. * UserInterface/Protocol/InspectorBackend.js: (InspectorBackendClass.prototype.runAfterPendingDispatches): Dispatch the callback with a timeout if there is no backend target yet so it doesn't get lost. * UserInterface/Protocol/Connection.js: (InspectorBackend.Connection.prototype.runAfterPendingDispatches): Change the ambiguous name "script" to the more familiar "callback". 2018-11-30 Devin Rousso Web Inspector: replace all unicode characters with the escaped character code https://bugs.webkit.org/show_bug.cgi?id=192216 Reviewed by Brian Burg. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Controllers/BreakpointPopoverController.js: * UserInterface/Debug/UncaughtExceptionReporter.js: * UserInterface/Models/AuditTestCase.js: * UserInterface/Models/Canvas.js: * UserInterface/Models/RecordingAction.js: * UserInterface/Models/ScriptTimelineRecord.js: * UserInterface/Views/AuditTestCaseContentView.js: * UserInterface/Views/AuditTestContentView.js: * UserInterface/Views/AuditTestGroupContentView.js: * UserInterface/Views/CallFrameView.js: * UserInterface/Views/CanvasContentView.js: * UserInterface/Views/CanvasOverviewContentView.css: * UserInterface/Views/ConsoleMessageView.css: * UserInterface/Views/ContextMenuUtilities.js: * UserInterface/Views/DOMEventsBreakdownView.js: * UserInterface/Views/DataGrid.css: * UserInterface/Views/DataGrid.js: * UserInterface/Views/DatabaseTableContentView.js: * UserInterface/Views/DebuggerDashboardView.css: * UserInterface/Views/DebuggerSidebarPanel.js: * UserInterface/Views/ErrorObjectView.js: * UserInterface/Views/EventBreakpointPopover.js: * UserInterface/Views/InlineSwatch.js: * UserInterface/Views/LayerTreeDataGridNode.js: * UserInterface/Views/LayerTreeDetailsSidebarPanel.js: * UserInterface/Views/Layers3DContentView.js: * UserInterface/Views/LayoutTimelineDataGridNode.js: * UserInterface/Views/NetworkTableContentView.css: * UserInterface/Views/NetworkTableContentView.js: * UserInterface/Views/ObjectPreviewView.js: * UserInterface/Views/ProfileDataGridNode.js: * UserInterface/Views/ResourceTimelineDataGridNode.js: * UserInterface/Views/ScriptDetailsTimelineView.css: * UserInterface/Views/TextEditor.css: * UserInterface/Views/TreeOutline.css: 2018-11-29 Matt Baker Web Inspector: RTL: disclosure triangles should be flipped and aligned right https://bugs.webkit.org/show_bug.cgi?id=192089 Reviewed by Devin Rousso. * UserInterface/Views/ComputedStyleSection.css: (.computed-style-section .computed-property-item .disclosure-button): (body[dir=rtl] .computed-style-section .computed-property-item .disclosure-button): * UserInterface/Views/ConsoleMessageView.css: (.console-message.expandable .console-top-level-message::before): (body[dir=rtl] .console-message.expandable .console-top-level-message::before): * UserInterface/Views/ErrorObjectView.css: (.error-object > .formatted-error::before): (body[dir=rtl] .error-object > .formatted-error::before): (.error-object .content): * UserInterface/Views/LogContentView.css: (.console-group-title::before): (body[dir=ltr] .console-group-title::before): (body[dir=rtl] .console-group-title::before): * UserInterface/Views/ObjectTreeView.css: (body[dir=rtl] .object-tree > :matches(.title, .object-preview)::before): * UserInterface/Views/TypeTreeElement.css: (body[dir=rtl] .item.type-tree-element.parent > .disclosure-button): 2018-11-28 Dean Jackson [ES Modules] Allow .mjs content when loaded from file:// https://bugs.webkit.org/show_bug.cgi?id=192100 Reviewed by Sam Weinig. Add a mapping from .mjs to application/javascript. * UserInterface/Base/MIMETypeUtilities.js: (WI.mimeTypeForFileExtension): 2018-11-29 Matt Baker Web Inspector: Elements: selecting more than one DOM node causes the scope highlight to contrast https://bugs.webkit.org/show_bug.cgi?id=192118 Reviewed by Devin Rousso. Use an alpha blended border for the "selected" DOM scope highlight, matching the "hovered" scope highlight. * UserInterface/Views/DOMTreeOutline.css: (.tree-outline.dom li.selected + ol.children.expanded): 2018-11-28 Joseph Pecoraro Web Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash https://bugs.webkit.org/show_bug.cgi?id=192016 Reviewed by Devin Rousso. * UserInterface/Base/Main.js: (WI.loaded): (WI.initializeBackendTarget): (WI.contentLoaded): (WI.whenTargetsAvailable): Don't evaluate any InspectorFrontendAPI commands until the frontend has initialized a main target and the user interface. 2018-11-28 Nikita Vasilyev Web Inspector: Styles: enable selection of multiple properties by default https://bugs.webkit.org/show_bug.cgi?id=192109 Reviewed by Devin Rousso. * UserInterface/Base/Setting.js: * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): Remove the checkbox. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css: (.spreadsheet-style-declaration-editor .property): (.spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)): (.spreadsheet-style-declaration-editor .property.selected): (.spreadsheet-style-declaration-editor .property.selected:focus): (.multiple-properties-selection .spreadsheet-style-declaration-editor .property): Deleted. (.multiple-properties-selection .spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)): Deleted. (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected): Deleted. (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected:focus): Deleted. Remove `.multiple-properties-selection` class. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout): * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: (WI.SpreadsheetCSSStyleDeclarationSection): (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch): * UserInterface/Views/SpreadsheetTextField.js: (WI.SpreadsheetTextField): (WI.SpreadsheetTextField.prototype._handleFocus): Deleted. 2018-11-28 Devin Rousso Web Inspector: Audit: empty results folder is shown after clearing filters https://bugs.webkit.org/show_bug.cgi?id=192106 Reviewed by Matt Baker. * UserInterface/Views/AuditNavigationSidebarPanel.js: (WI.AuditNavigationSidebarPanel.prototype.applyFiltersToTreeElement): Added. 2018-11-28 Matt Baker Web Inspector: Remove unused DataGrid and TreeOutline code https://bugs.webkit.org/show_bug.cgi?id=191622 Reviewed by Devin Rousso. * UserInterface/Views/CanvasDetailsSidebarPanel.js: (WI.CanvasDetailsSidebarPanel.prototype.initialLayout): * UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement.prototype.insertChildElement): * UserInterface/Views/DOMTreeOutline.js: (WI.DOMTreeOutline): (WI.DOMTreeOutline.prototype.update): * UserInterface/Views/DataGrid.js: (WI.DataGrid.prototype.removeChildrenRecursive): Deleted. * UserInterface/Views/DataGridNode.js: (WI.DataGridNode.prototype.removeChildren): (WI.DataGridNode.prototype.removeChildrenRecursive): Deleted. * UserInterface/Views/ErrorObjectView.css: (.error-object:not(.expanded) .content): (.error-object .content): (.error-object:not(.expanded) .tree-outline): Deleted. (.error-object .tree-outline): Deleted. * UserInterface/Views/ErrorObjectView.js: (WI.ErrorObjectView): (WI.ErrorObjectView.prototype.get treeOutline): Deleted. Use a simple container since TreeOutline features aren't used, and remove unused property `treeOutline`. * UserInterface/Views/RecordingTraceDetailsSidebarPanel.js: (WI.RecordingTraceDetailsSidebarPanel): * UserInterface/Views/TreeElement.js: (WI.TreeElement.prototype.removeChildren): (WI.TreeElement.prototype.removeChildrenRecursive): Deleted. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline): (WI.TreeOutline.prototype.removeChildrenRecursive): Deleted. (WI.TreeOutline.prototype.reattachIfIndexChanged): Deleted. Removed `element` parameter now that the only use case has been removed. 2018-11-27 Matt Baker Web Inspector: Elements tab should allow selecting/deleting multiple DOM nodes https://bugs.webkit.org/show_bug.cgi?id=192059 Reviewed by Devin Rousso. Enable multiple DOM node selection in the DOMTreeContentView. * UserInterface/Controllers/SelectionController.js: (WI.SelectionController): (WI.SelectionController.prototype.get allowsEmptySelection): (WI.SelectionController.prototype.set allowsEmptySelection): Allow clients to control whether the last selected item can be deselected. (WI.SelectionController.prototype.deselectItem): (WI.SelectionController.prototype.didInsertItem): Rewritten to prevent infinite loop. (WI.SelectionController.prototype.didRemoveItem): (WI.SelectionController.prototype._updateSelectedItems): (WI.SelectionController.prototype._adjustIndexesAfter): Deleted. * UserInterface/Views/DOMTreeContentView.js: (WI.DOMTreeContentView): * UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement.prototype.updateSelectionArea): * UserInterface/Views/DOMTreeOutline.js: (WI.DOMTreeOutline.prototype.updateSelection): Updating the selection area DOM element should not assume that only one TreeElement is selected at a time. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline.prototype.get allowsEmptySelection): (WI.TreeOutline.prototype.set allowsEmptySelection): (WI.TreeOutline.prototype.set selectedTreeElement): (WI.TreeOutline.prototype.get selectedTreeElements): (WI.TreeOutline.prototype._treeKeyDown): * UserInterface/Views/TreeOutlineGroup.js: (WI.TreeOutlineGroup): (WI.TreeOutlineGroup.prototype._removeConflictingTreeSelections): Eliminate use of `TreeElement.prototype.deselect`. 2018-11-27 Matt Baker Web Inspector: TreeOutline should re-use multiple-selection logic from Table https://bugs.webkit.org/show_bug.cgi?id=191483 Reviewed by Devin Rousso. Update TreeOutline to use SelectionController. Adopting SelectionController in TreeOutline is not as straightforward as it was in Table. Selected items are tracked by index, and TreeElement lacks an explicit index. As a consequence TreeElement indexes are calcualted as needed and cached. The cache is cleared whenever an element is added or removed. * UserInterface/Controllers/SelectionController.js: (WI.SelectionController.prototype.didInsertItem): (WI.SelectionController.prototype.didRemoveItem): (WI.SelectionController.prototype.handleKeyDown): Drive-by syntax error fix. (WI.SelectionController.prototype._adjustIndexesAfter): (WI.SelectionController): * UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement.prototype.canSelectOnMouseDown): (WI.DOMTreeElement.prototype.selectOnMouseDown): Deleted. * UserInterface/Views/DOMTreeOutline.js: (WI.DOMTreeOutline.prototype._onmousedown): Item selection is now handled by SelectionController. * UserInterface/Views/ShaderProgramTreeElement.js: (WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown): (WI.ShaderProgramTreeElement.prototype.selectOnMouseDown): Deleted. * UserInterface/Views/TreeElement.js: (WI.TreeElement.prototype.canSelectOnMouseDown): (WI.TreeElement.prototype._attach): (WI.TreeElement.prototype.select): (WI.TreeElement.prototype.deselect): Route item selection through the parent TreeOutline, in order to go though the TreeOutline's SelectionController. (WI.TreeElement.treeElementMouseDown): Deleted. Moved handler to TreeOutline, which owns the SelectionController that needs to respond to mouse events. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline): (WI.TreeOutline.prototype.get allowsMultipleSelection): (WI.TreeOutline.prototype.set allowsMultipleSelection): (WI.TreeOutline.prototype.get selectedTreeElement): (WI.TreeOutline.prototype.set selectedTreeElement): (WI.TreeOutline.prototype.insertChild): (WI.TreeOutline.prototype.removeChildAtIndex): (WI.TreeOutline.prototype._rememberTreeElement): (WI.TreeOutline.prototype._forgetTreeElement): (WI.TreeOutline.prototype._treeKeyDown): (WI.TreeOutline.prototype.selectionControllerNumberOfItems): (WI.TreeOutline.prototype.selectionControllerSelectionDidChange): (WI.TreeOutline.prototype.selectionControllerNextSelectableIndex): (WI.TreeOutline.prototype.selectionControllerPreviousSelectableIndex): (WI.TreeOutline.prototype.selectTreeElementInternal): (WI.TreeOutline._generateStyleRulesIfNeeded._indexOfTreeElement.previousElement): (WI.TreeOutline._generateStyleRulesIfNeeded): 2018-11-27 Nikita Vasilyev Web Inspector: Experimental Computed panel is unreadable in Dark Mode https://bugs.webkit.org/show_bug.cgi?id=192053 Reviewed by Matt Baker. * UserInterface/Views/ComputedStyleDetailsPanel.css: (@media (prefers-dark-interface)): (.computed-with-traces .details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)): * UserInterface/Views/ComputedStyleSection.css: (.computed-style-section .computed-property-item.expanded): (.computed-style-section .computed-property-item.expanded + .computed-property-item): (@media (prefers-dark-interface)): 2018-11-27 Nikita Vasilyev Web Inspector: Computed panel: allow to expand properties to show list of overridden values https://bugs.webkit.org/show_bug.cgi?id=191984 Reviewed by Devin Rousso. Introduce the new experimental Computed Style Cascades. Each property now can expand to show a list of overridden values, their corresponding selectors, and source locations. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Base/Setting.js: * UserInterface/Main.html: * UserInterface/Models/DOMNodeStyles.js: (WI.DOMNodeStyles.prototype.get uniqueOrderedStyles): Move `uniqueOrderedStyles` function unmodified from SpreadsheetRulesStyleDetailsPanel so it can be used by ComputedStyleDetailsPanel, too. * UserInterface/Views/ComputedStyleDetailsPanel.css: (.computed-with-traces .computed-style-properties): (.computed-with-traces .details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)): (.computed-with-traces .details-section.computed-style-properties > .content): (.computed-with-traces .computed-style-properties .property .go-to-arrow): * UserInterface/Views/ComputedStyleDetailsPanel.js: (WI.ComputedStyleDetailsPanel.prototype.refresh): (WI.ComputedStyleDetailsPanel.prototype.applyFilter): (WI.ComputedStyleDetailsPanel.prototype.focusFirstSection): (WI.ComputedStyleDetailsPanel.prototype.initialLayout): (WI.ComputedStyleDetailsPanel.prototype._computePropertyTraces): (WI.ComputedStyleDetailsPanel.prototype._computedStyleShowAllCheckboxValueChanged): (WI.ComputedStyleDetailsPanel.prototype._handlePropertiesSectionCollapsedStateChanged): (WI.ComputedStyleDetailsPanel.prototype._handleEditorFilterApplied): (WI.ComputedStyleDetailsPanel): Use the new Computed section (WI.ComputedStyleSection) only when it's enabled in the experimental settings. Otherwise, use the current Computed section. * UserInterface/Views/ComputedStyleDetailsSidebarPanel.js: (WI.ComputedStyleDetailsSidebarPanel): * UserInterface/Views/ComputedStyleSection.css: Added. (.computed-style-section): (.computed-style-section .computed-property-item): (.computed-style-section .computed-property-item.expanded): (.computed-style-section .computed-property-item.expanded + .computed-property-item): (.computed-style-section .computed-property-item .disclosure-button): (.computed-style-section .computed-property-item .property-traces): (.computed-style-section .computed-property-item.expanded .property-traces): (.computed-style-section .computed-property-item.expanded .disclosure-button): (.computed-style-section .computed-property-item .property-trace-item): (.computed-style-section .computed-property-item .property-trace-item .property.overridden .value): (.computed-style-section .property-trace-item-left,): (.computed-style-section .property-trace-item-right): (.computed-style-section .computed-property-item .property-trace-item .value): (.computed-style-section .property .value): (.computed-style-section .computed-property-item .property): (.computed-style-section .computed-property-item .property .name): (.computed-style-section .computed-property-item .property-trace-item .selector): (.computed-style-section .computed-property-item .origin): (.computed-style-section .computed-property-item .go-to-link): (.computed-style-section .property-trace-item .property .name,): (.computed-style-section .property-trace-item .property .value + span): (.computed-style-properties.details-section > .content,): * UserInterface/Views/ComputedStyleSection.js: Added. (WI.ComputedStyleSection): (WI.ComputedStyleSection.prototype.get style): (WI.ComputedStyleSection.prototype.set style): (WI.ComputedStyleSection.prototype.get styleTraces): (WI.ComputedStyleSection.prototype.set styleTraces): (WI.ComputedStyleSection.prototype.set showsImplicitProperties): (WI.ComputedStyleSection.prototype.set alwaysShowPropertyNames): (WI.ComputedStyleSection.prototype.set propertyVisibilityMode): (WI.ComputedStyleSection.prototype.set hideFilterNonMatchingProperties): (WI.ComputedStyleSection.prototype.get propertiesToRender): (WI.ComputedStyleSection.prototype.layout): (WI.ComputedStyleSection.prototype.detached): (WI.ComputedStyleSection.prototype.hidden): (WI.ComputedStyleSection.prototype.applyFilter): (WI.ComputedStyleSection.prototype.spreadsheetStylePropertyShowProperty): (WI.ComputedStyleSection.prototype._createTrace): (WI.ComputedStyleSection.prototype._handlePropertiesChanged): * UserInterface/Views/ExpandableView.js: Added. (WI.ExpandableView): (WI.ExpandableView.prototype.get element): (WI.ExpandableView.prototype._onDisclosureButtonClick): (WI.ExpandableView.prototype._update): * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout): (WI.SpreadsheetCSSStyleDeclarationSection.prototype.layout): Replace `_renderOrigin` with WI.StyleOriginView so it could be used by WI.ComputedStyleSection. * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js: (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.update): (WI.SpreadsheetStyleProperty.prototype._isEditable): (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch): Introduce `readOnly` option so WI.SpreadsheetStyleProperty could be used by WI.ComputedStyleSection. * UserInterface/Views/StyleOriginView.js: Added. (WI.StyleOriginView): 2018-11-27 Timothy Hatcher Web Inspector: Add support for forcing color scheme appearance in DOM tree. https://bugs.webkit.org/show_bug.cgi?id=191820 rdar://problem/46153172 Reviewed by Devin Rousso. * Localizations/en.lproj/localizedStrings.js: Updated. * UserInterface/Controllers/CSSManager.js: (WI.CSSManager): (WI.CSSManager.prototype.get defaultAppearance): Added. (WI.CSSManager.prototype.get forcedAppearance): Added. (WI.CSSManager.prototype.set forcedAppearance): Added. (WI.CSSManager.prototype.canForceAppearance): Added. (WI.CSSManager.prototype.defaultAppearanceDidChange): Added. * UserInterface/Images/Appearance.svg: Added. * UserInterface/Protocol/PageObserver.js: (WI.PageObserver.prototype.defaultAppearanceChanged): Added. * UserInterface/Views/DOMTreeContentView.js: (WI.DOMTreeContentView): (WI.DOMTreeContentView.prototype.get navigationItems): (WI.DOMTreeContentView.prototype._defaultAppearanceDidChange): Added. (WI.DOMTreeContentView.prototype._toggleAppearance): Added. 2018-11-27 Matt Baker Web Inspector: Cookies table needs copy keyboard shortcut and context menu support https://bugs.webkit.org/show_bug.cgi?id=191482 Reviewed by Joseph Pecoraro. * UserInterface/Views/CookieStorageContentView.js: (WI.CookieStorageContentView.prototype.handleCopyEvent): (WI.CookieStorageContentView.prototype.tableCellContextMenuClicked): As with Delete, if the target row is selected, all selected rows are copied. Otherwise only the target row is copied. This distinction will be surfaced in the UI in https://webkit.org/b/191095. (WI.CookieStorageContentView.prototype.tablePopulateCell): (WI.CookieStorageContentView.prototype._cookiesAtIndexes): (WI.CookieStorageContentView.prototype._formatCookiesAsText): (WI.CookieStorageContentView.prototype._formatCookiePropertyForColumn): (WI.CookieStorageContentView): Break Cookie property formatting into a helper method, which is used for formatting Table cells and creating plain text for the clipboard. * UserInterface/Views/Table.js: (WI.Table.prototype.get columns): 2018-11-27 Matt Baker Web Inspector: Table selection should be handled by a SelectionController https://bugs.webkit.org/show_bug.cgi?id=191977 Reviewed by Devin Rousso. Add a SelectionController class, which manages an IndexSet of selected items, and provides operations for adding and removing items from the selection. Complex behaviors such as shift-clicking to select a range of items, and updating the selection using the keyboard, are forwarded to the controller using special-purpose methods that accept DOM Event objects. * UserInterface/Base/Utilities.js: * UserInterface/Controllers/SelectionController.js: Added. (WI.SelectionController): (WI.SelectionController.prototype.get delegate): (WI.SelectionController.prototype.get lastSelectedItem): (WI.SelectionController.prototype.get selectedItems): (WI.SelectionController.prototype.get allowsMultipleSelection): (WI.SelectionController.prototype.set allowsMultipleSelection): (WI.SelectionController.prototype.get numberOfItems): (WI.SelectionController.prototype.hasSelectedItem): (WI.SelectionController.prototype.selectItem): (WI.SelectionController.prototype.deselectItem): (WI.SelectionController.prototype.selectAll): (WI.SelectionController.prototype.deselectAll): (WI.SelectionController.prototype.removeSelectedItems): (WI.SelectionController.prototype.reset): (WI.SelectionController.prototype.didRemoveItem): (WI.SelectionController.prototype.handleKeyDown): (WI.SelectionController.prototype.handleItemMouseDown.normalizeRange): (WI.SelectionController.prototype.handleItemMouseDown): (WI.SelectionController.prototype._deselectAllAndSelect): (WI.SelectionController.prototype._selectItemsFromArrowKey): (WI.SelectionController.prototype._nextSelectableIndex): (WI.SelectionController.prototype._previousSelectableIndex): (WI.SelectionController.prototype._updateSelectedItems): * UserInterface/Main.html: * UserInterface/Test.html: * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get selectedRow): (WI.Table.prototype.get selectedRows): (WI.Table.prototype.get allowsMultipleSelection): (WI.Table.prototype.set allowsMultipleSelection): (WI.Table.prototype.isRowSelected): (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.selectAll): (WI.Table.prototype.deselectAll): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): (WI.Table.prototype.selectionControllerSelectionDidChange): (WI.Table.prototype.selectionControllerNumberOfItems): (WI.Table.prototype.selectionControllerNextSelectableIndex): (WI.Table.prototype.selectionControllerPreviousSelectableIndex): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._handleMouseDown): (WI.Table.prototype._removeRows): (WI.Table.prototype._toggleSelectedRowStyle): (WI.Table.prototype._selectRowsFromArrowKey): Deleted. (WI.Table.prototype._handleMouseDown.normalizeRange): Deleted. (WI.Table.prototype._deselectAllAndSelect): Deleted. (WI.Table.prototype._notifySelectionDidChange): Deleted. (WI.Table.prototype._updateSelectedRows): Deleted. 2018-11-26 Devin Rousso Web Inspector: "No Filter Results" in navigation sidebar should have a button to clear filters https://bugs.webkit.org/show_bug.cgi?id=191916 Reviewed by Joseph Pecoraro. * UserInterface/Views/NavigationSidebarPanel.js: (WI.NavigationSidebarPanel.prototype.resetFilter): Added. (WI.NavigationSidebarPanel.prototype._checkForEmptyFilterResults.checkTreeOutlineForEmptyFilterResults): * UserInterface/Views/FilterBar.js: (WI.FilterBar.prototype.clear): * UserInterface/Views/FilterBarButton.js: (WI.FilterBarButton.prototype.toggle): * UserInterface/Views/ResourceSidebarPanel.js: (WI.ResourceSidebarPanel.prototype.resetFilter): Added. * UserInterface/Views/StorageSidebarPanel.js: (WI.StorageSidebarPanel.prototype.resetFilter): Added. * UserInterface/Views/AuditTestContentView.js: (WI.AuditTestContentView.prototype.showFilteredPlaceholder): * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype._showEmptyFilterResultsMessage): * UserInterface/Views/Main.css: (.message-text-view > .message + button): Added. * Localizations/en.lproj/localizedStrings.js: 2018-11-26 Devin Rousso Web Inspector: Audit: automatically add to tab bar when the experimental setting is enabled https://bugs.webkit.org/show_bug.cgi?id=191659 Reviewed by Joseph Pecoraro. * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): * UserInterface/Base/Main.js: (WI.loaded): Drive-by: use existing constants instead of hard-coded strings for consistency. 2018-11-25 Devin Rousso Web Inspector: Timelines: add Media timeline https://bugs.webkit.org/show_bug.cgi?id=191625 Reviewed by Matt Baker. Add a new timeline to Timelines for media related events (e.g. event/fullscreen/low-power). Mimics what is visible by using the same instrumentation points as the Network tab when "Group Media Requests" is enabled. * UserInterface/Models/MediaInstrument.js: Added. (WI.MediaInstrument): (WI.MediaInstrument.supported): (WI.MediaInstrument.prototype.get timelineRecordType): (WI.MediaInstrument.prototype.startInstrumentation): (WI.MediaInstrument.prototype.stopInstrumentation): * UserInterface/Models/MediaTimelineRecord.js: Added. (WI.MediaTimelineRecord): (WI.MediaTimelineRecord.prototype.get eventType): (WI.MediaTimelineRecord.prototype.get domNode): (WI.MediaTimelineRecord.prototype.get domEvent): (WI.MediaTimelineRecord.prototype.get isLowPower): (WI.MediaTimelineRecord.prototype.get displayName): (WI.MediaTimelineRecord.prototype.saveIdentityToCookie): * UserInterface/Views/MediaTimelineDataGridNode.js: Added. (WI.MediaTimelineDataGridNode): (WI.MediaTimelineDataGridNode.prototype.get records): (WI.MediaTimelineDataGridNode.prototype.get data): (WI.MediaTimelineDataGridNode.prototype.createCellContent): (WI.MediaTimelineDataGridNode.prototype.iconClassNames): (WI.MediaTimelineDataGridNode.prototype.filterableDataForColumn): * UserInterface/Views/MediaTimelineOverviewGraph.js: Added. (WI.MediaTimelineOverviewGraph): (WI.MediaTimelineOverviewGraph.prototype.reset): (WI.MediaTimelineOverviewGraph.prototype.shown): (WI.MediaTimelineOverviewGraph.prototype.hidden): (WI.MediaTimelineOverviewGraph.prototype.layout): (WI.MediaTimelineOverviewGraph.prototype.updateSelectedRecord): (WI.MediaTimelineOverviewGraph.prototype._handleRecordAdded): * UserInterface/Views/MediaTimelineOverviewGraph.css: Added. (.timeline-overview-graph.media > .timeline-record-bar): (.timeline-overview-graph.media > .timeline-record-bar > .segment): * UserInterface/Views/MediaTimelineView.js: Added. (WI.MediaTimelineView): (WI.MediaTimelineView.prototype.get secondsPerPixel): (WI.MediaTimelineView.prototype.get selectionPathComponents): (WI.MediaTimelineView.prototype.closed): (WI.MediaTimelineView.prototype.reset): (WI.MediaTimelineView.prototype.dataGridSortComparator.compareDOMNodes): (WI.MediaTimelineView.prototype.dataGridSortComparator.): (WI.MediaTimelineView.prototype.dataGridSortComparator): (WI.MediaTimelineView.prototype.layout): (WI.MediaTimelineView.prototype._processPendingRecords): (WI.MediaTimelineView.prototype._handleRecordAdded): (WI.MediaTimelineView.prototype._handleSelectionPathComponentSiblingSelected): * UserInterface/Views/MediaTimelineView.css: Added. (.timeline-view.media > .data-grid): * UserInterface/Views/DOMEventsBreakdownView.js: (WI.DOMEventsBreakdownView.prototype.layout): * UserInterface/Views/DOMNodeEventsContentView.js: (WI.DOMNodeEventsContentView.prototype.initialLayout): * UserInterface/Views/NetworkDOMNodeDetailView.js: (WI.NetworkDOMNodeDetailView): (WI.NetworkDOMNodeDetailView.prototype.showContentViewForIdentifier): * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView): (WI.NetworkTableContentView.prototype.get filterNavigationItems): (WI.NetworkTableContentView.prototype._populateWaterfallGraph): (WI.NetworkTableContentView.prototype._showDetailView): (WI.NetworkTableContentView.prototype._waterfallPopoverContentForNodeEntry): Remove passing of `startTimestamp` to `WI.DOMEventsBreakdownView`, as we should be showing absolute timestamps for each event, not relative to the start of the recording. * UserInterface/Views/TimelineIcons.css: (.media-icon .icon): Added. (.dom-event-record .icon): Added. (.dom-event-record.fullscreen .icon): Added. (.low-power-record .icon): Added. * UserInterface/Controllers/TimelineManager.js: (WI.TimelineManager.availableTimelineTypes): (WI.TimelineManager.prototype.capturingStarted): (WI.TimelineManager.prototype.capturingStopped): (WI.TimelineManager.prototype._updateAutoCaptureInstruments): (WI.TimelineManager.prototype._handleDOMNodeDidFireEvent): Added. (WI.TimelineManager.prototype._handleDOMNodeLowPowerChanged): Added. * UserInterface/Views/TimelineRuler.js: (WI.TimelineRuler.prototype.clearMarkers): (WI.TimelineRuler.prototype._handleClick): * UserInterface/Views/TimelineOverview.js: (WI.TimelineOverview.prototype._timelineRulerMouseClicked): * UserInterface/Models/TimelineRecording.js: (WI.TimelineRecording.prototype.reset): (WI.TimelineRecording.prototype.addEventMarker): (WI.TimelineRecording.prototype.addRecord): (WI.TimelineRecording.prototype._keyForRecord): Drive-by: rework the logic for "click" event pass-through to the graph underneath. * UserInterface/Models/Instrument.js: (WI.Instrument.createForTimelineType): * UserInterface/Models/TimelineRecord.js: * UserInterface/Views/TimelineTabContentView.js: (WI.TimelineTabContentView.displayNameForTimelineType): (WI.TimelineTabContentView.iconClassNameForTimelineType): (WI.TimelineTabContentView.genericClassNameForTimelineType): (WI.TimelineTabContentView.iconClassNameForRecord): (WI.TimelineTabContentView.displayNameForRecord): * UserInterface/Views/TimelineRecordBar.css: (.timeline-record-bar.timeline-record-type-media > .segment): Added. * UserInterface/Views/ContentView.js: (WI.ContentView.createFromRepresentedObject): * UserInterface/Views/TimelineOverviewGraph.js: (WI.TimelineOverviewGraph.createForTimeline): * UserInterface/Models/ScriptTimelineRecord.js: (WI.ScriptTimelineRecord.EventType.displayName): * UserInterface/Main.html: * UserInterface/Test.html: * Localizations/en.lproj/localizedStrings.js: * UserInterface/Images/DOMEvent.svg: Added. * UserInterface/Images/DOMEventFullscreen.svg: Added. * UserInterface/Images/LowPower.svg: Added. * UserInterface/Images/MediaInstrument.svg: Added. 2018-11-25 Matt Baker Web Inspector: Remove parameters from TreeOutline SelectionDidChange event https://bugs.webkit.org/show_bug.cgi?id=191770 Reviewed by Devin Rousso. * UserInterface/Controllers/CallFrameTreeController.js: (WI.CallFrameTreeController.prototype._treeSelectionDidChange): * UserInterface/Views/AuditNavigationSidebarPanel.js: (WI.AuditNavigationSidebarPanel.prototype._treeSelectionDidChange): * UserInterface/Views/CanvasSidebarPanel.js: (WI.CanvasSidebarPanel): (WI.CanvasSidebarPanel.prototype._treeSelectionDidChange): (WI.CanvasSidebarPanel.prototype._treeOutlineSelectionDidChange): Deleted. * UserInterface/Views/CanvasTabContentView.js: (WI.CanvasTabContentView.prototype._canvasTreeOutlineSelectionDidChange): * UserInterface/Views/DebuggerSidebarPanel.js: (WI.DebuggerSidebarPanel.prototype._treeSelectionDidChange): * UserInterface/Views/OpenResourceDialog.js: (WI.OpenResourceDialog.prototype._treeSelectionDidChange): * UserInterface/Views/ResourceSidebarPanel.js: (WI.ResourceSidebarPanel.prototype._treeSelectionDidChange): * UserInterface/Views/SearchSidebarPanel.js: (WI.SearchSidebarPanel.prototype._treeSelectionDidChange): * UserInterface/Views/StorageSidebarPanel.js: (WI.StorageSidebarPanel._treeSelectionDidChange): * UserInterface/Views/TimelineDataGrid.js: (WI.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange): (WI.TimelineDataGrid): * UserInterface/Views/TimelineTabContentView.js: (WI.TimelineTabContentView.prototype._recordingsTreeSelectionDidChange): Use `event.target.selectedTreeElement` instead of `event.data.selectedElement`. * UserInterface/Views/TimelineOverview.js: (WI.TimelineOverview.prototype._timelinesTreeSelectionDidChange): (WI.TimelineOverview.prototype._timelinesTreeSelectionDidChange.updateGraphSelectedState): Deleted. Refactor away the single place `event.data.deselectedElement` was used. * UserInterface/Views/TreeElement.js: (WI.TreeElement.prototype.select): (WI.TreeElement.prototype.deselect): Remove `selectedElement` and `deselectedElement` from event data. 2018-11-19 Devin Rousso Web Inspector: Audit: removing and re-adding the tab will duplicate tests https://bugs.webkit.org/show_bug.cgi?id=191843 Reviewed by Matt Baker. * UserInterface/Controllers/AuditManager.js: (WI.AuditManager.prototype.loadStoredTests): If we already have tests, don't attempt to load any stored tests. 2018-11-19 Joseph Pecoraro Web Inspector: "Reload Web Inspector" button no longer partially works https://bugs.webkit.org/show_bug.cgi?id=191773 Reviewed by Devin Rousso. * UserInterface/Base/Main.js: * UserInterface/Debug/UncaughtExceptionReporter.js: (sheetElement.innerHTML): * UserInterface/Views/SettingsTabContentView.js: 2018-11-17 Devin Rousso Web Inspector: Network: add button to show system certificate dialog https://bugs.webkit.org/show_bug.cgi?id=191458 Reviewed by Joseph Pecoraro. * UserInterface/Controllers/NetworkManager.js: (WI.NetworkManager.supportsShowCertificate): Added. * UserInterface/Models/Resource.js: (WI.Resource.prototype.showCertificate): Added. * UserInterface/Views/ResourceSecurityContentView.js: (WI.ResourceSecurityContentView.prototype._refreshCetificateSection): * UserInterface/Views/ResourceSecurityContentView.css: (.resource-security .details > .show-certificate > .key): Added. (.resource-security .details > .show-certificate > .key > .error): Added. * Localizations/en.lproj/localizedStrings.js: 2018-11-16 Devin Rousso Web Inspector: Audit: add default tests https://bugs.webkit.org/show_bug.cgi?id=191758 Reviewed by Matt Baker. * UserInterface/Controllers/AuditManager.js: (WI.AuditManager.prototype.loadStoredTests): (WI.AuditManager.prototype.addDefaultTestsIfNeeded): Added. If there are no previously saved tests in the database, automatically add the default set. * UserInterface/Views/AuditNavigationSidebarPanel.js: (WI.AuditNavigationSidebarPanel.prototype._addTest): (WI.AuditNavigationSidebarPanel.prototype._addResult): (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved): * UserInterface/Views/AuditNavigationSidebarPanel.css: (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view): Added. (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > .message): Added. (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > button): Added. When the last test is removed, show a placeholder message that allows the user to re-add the default set of tests. * UserInterface/Views/NavigationSidebarPanel.js: (WI.NavigationSidebarPanel.prototype.showEmptyContentPlaceholder): (WI.NavigationSidebarPanel.prototype._createEmptyContentPlaceholderIfNeeded): * Localizations/en.lproj/localizedStrings.js: 2018-11-16 Devin Rousso Web Inspector: Audit: minor style improvements https://bugs.webkit.org/show_bug.cgi?id=191727 Reviewed by Joseph Pecoraro. * UserInterface/Controllers/AuditManager.js: (WI.AuditManager): (WI.AuditManager.prototype._handleFrameMainResourceDidChange): Added. Clear test results when the main frame navigates, but don't clear the saved results. * UserInterface/Models/AuditTestCase.js: (WI.AuditTestCase.prototype.async run): * UserInterface/Models/AuditTestCaseResult.js: (WI.AuditTestCaseResult): (WI.AuditTestCaseResult.async fromPayload): (WI.AuditTestCaseResult.prototype.get resolvedDOMNodes): Added. (WI.AuditTestCaseResult.prototype.toJSON): Capture the full CSS path for any returned DOM nodes when the test finishes running, so that if the node moves around the path isn't modified as well. * UserInterface/Views/AuditTestCaseContentView.js: (WI.AuditTestCaseContentView.prototype.layout): Always show the URL for the test when viewing a saved result. * UserInterface/Views/AuditTestContentView.css: (.content-view-container > .content-view.audit-test > header p): (.content-view.audit-test > header): * UserInterface/Views/AuditTestCaseContentView.css: (.content-view.audit-test-case > header): Added. (.content-view.audit-test-case > header h1 > img): (.content-view.audit-test-case > header > .metadata > .source): Added. (.content-view.audit-test-case > header > .metadata > .duration): (.content-view.audit-test-case > section table > tr > td:first-child): * UserInterface/Views/AuditTestGroupContentView.css: (.content-view.audit-test-group > header): Horizontally align items in the header for visual consistency. 2018-11-16 Joseph Pecoraro Web Inspector: Include default filtering of InspectorBackend.dumpInspectorProtocolMessages with multi target backend https://bugs.webkit.org/show_bug.cgi?id=191785 Reviewed by Matt Baker. * UserInterface/Debug/Bootstrap.js: (dumpMessagesCurrentState): (applyDumpMessagesState): (WI.runBootstrapOperations): Include tri-state for the logs button. * UserInterface/Protocol/InspectorBackend.js: (InspectorBackendClass.prototype.set filterMultiplexingBackendInspectorProtocolMessages): (InspectorBackendClass.prototype.get filterMultiplexingBackendInspectorProtocolMessages): (InspectorBackendClass.prototype._startOrStopAutomaticTracing): Add new filtering state (the Setting already got added in the past). * UserInterface/Protocol/LoggingProtocolTracer.js: (WI.LoggingProtocolTracer): (WI.LoggingProtocolTracer.prototype.set filterMultiplexingBackend): (WI.LoggingProtocolTracer.prototype.get filterMultiplexingBackend): (WI.LoggingProtocolTracer.prototype._processEntry): Perform new filtering. 2018-11-16 Joseph Pecoraro Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local Inspector) https://bugs.webkit.org/show_bug.cgi?id=191740 Reviewed by Timothy Hatcher. * UserInterface/Protocol/Connection.js: (InspectorBackend.Connection.prototype._dispatchResponse): Hide the TargetAgent does not exist message. This is necessary so that WebKitLegacy tests don't include this line in output each test. * UserInterface/Test.html: * UserInterface/Test/Test.js: (WI.loaded): (WI.resetMainExecutionContext): (WI.performOneTimeFrontendInitializationsUsingTarget): Behave more like Main.js and initialize a MultiplexingBackendTarget when the TargetAgent is available. * UserInterface/Protocol/InspectorBackend.js: (InspectorBackendClass.prototype.runAfterPendingDispatches): Use the main target, a.k.a. the page connection. The backend target's messages don't have any responses, so this was effectively not waiting at all. 2018-11-16 Matt Baker Web Inspector: TreeOutline shouldn't select first child of an expanded element on right arrow key https://bugs.webkit.org/show_bug.cgi?id=191766 Reviewed by Devin Rousso. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline.prototype._treeKeyDown): 2018-11-14 Matt Baker Web Inspector: Table should recalculate scrollable height when resized https://bugs.webkit.org/show_bug.cgi?id=191328 Reviewed by Devin Rousso. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype._hideDetailView): Force table columns to layout after hiding the detail view. * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.showColumn): Call `_resizeColumnsAndFiller` instead of `resize`. The latter also cleared `_cachedWidth`, which isn't unnecessary since the width hasn't changed. (WI.Table.prototype.layout): previously `_resizeColumnsAndFiller` always occurred after `_updateVisibleRows`, it was just a matter of whether the cached width and height were cleared first. That now happens in `sizeDidChange`. (WI.Table.prototype.sizeDidChange): (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype.resize): Deleted. Internally this cleared the cached width and height, which moved to `sizeDidChange`. Externally this was used by NetworkTableContentView to force columns to layout after hiding the details view. Calling `updateLayout` on the table accomplishes the same thing using the standard View API. (WI.Table.prototype._resizeColumnsAndFiller): Only update the cached width, since the height will already have been updated. The number of rows doesn't change during this method, so that check was removed. 2018-11-14 Devin Rousso Web Inspector: REGRESSION(r236540): Debugger: breakpoints are sorted alphabetically instead of numerically https://bugs.webkit.org/show_bug.cgi?id=191560 Reviewed by Joseph Pecoraro. When sorting breakpoints, if the `WI.TreeElement`s being compared both contain instances of `WI.Breakpoint`, sort by `WI.SourceCodeLocation` instead of title. We only do this for `WI.Breakpoint` because they are the only debuggable item that has a `WI.SourceCodeLocation` (e.g. `WI.EventBreakpoint` is just an event name string). * UserInterface/Views/DebuggerSidebarPanel.js: (WI.DebuggerSidebarPanel.prototype._addTreeElement): (WI.DebuggerSidebarPanel.prototype._compareBreakpointTreeElements): Added. (WI.DebuggerSidebarPanel.prototype._addIssue): (WI.DebuggerSidebarPanel.prototype._addTreeElement.comparator): Deleted. (WI.DebuggerSidebarPanel.prototype._compareTreeElements): Deleted. 2018-11-14 Nikita Vasilyev Web Inspector: Styles: shift-clicking on a property should extend selection https://bugs.webkit.org/show_bug.cgi?id=191575 Reviewed by Devin Rousso. When there's at least one property is selected, Shift-clicking another property should extend the selection. Pressing Up or Down keys while holding Shift also extends the selection. Remove unnecessary `_startedSelection`. Use `hasSelectedProperties` and `_isMousePressed` instead. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: `_isMousePressed` was set to `true` by mistake, causing numerous assertion fails. (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.set focusIndex): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.hasSelectedProperties): Renamed from _hasSelectedProperties. (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.extendSelectedProperties): Added. (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseLeave): Removed. (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown): Implement Shift-ArrowUp/ArrowDown keys. * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: (WI.SpreadsheetCSSStyleDeclarationSection): (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyBlur): (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyMouseLeave): Removed. This was only used to set _startedSelection. (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown): (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowClick): (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick): Remove _startedSelection and use hasSelectedProperties method instead. * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty): Remove spreadsheetStylePropertyMouseLeave since it is no longer used. 2018-11-14 Devin Rousso Web Inspector: Canvas: send a call stack with each action instead of an array of call frames https://bugs.webkit.org/show_bug.cgi?id=191628 Reviewed by Dean Jackson. * UserInterface/Models/Recording.js: (WI.Recording.prototype.async swizzle): * UserInterface/Models/RecordingAction.js: (WI.RecordingAction.fromPayload): (WI.RecordingAction.prototype.async swizzle): 2018-11-14 Devin Rousso Web Inspector: add drag+drop for importing Audits and Recordings https://bugs.webkit.org/show_bug.cgi?id=191566 Reviewed by Joseph Pecoraro. Reorganize the file loading logic for the Audit and Canvas tabs/managers. Add "drop" event handlers to the tabs that add and show the corresponding object for the imported data. * UserInterface/Views/AuditTabContentView.js: (WI.AuditTabContentView): (WI.AuditTabContentView.prototype._handleDragOver): Added. (WI.AuditTabContentView.prototype._handleDrop): Added. * UserInterface/Views/CanvasTabContentView.js: (WI.CanvasTabContentView): (WI.CanvasTabContentView.prototype._addCanvas): (WI.CanvasTabContentView.prototype._recordingImportedOrStopped): (WI.CanvasTabContentView.prototype._handleDragOver): Added. (WI.CanvasTabContentView.prototype._handleDrop): Added. * UserInterface/Controllers/AuditManager.js: (WI.AuditManager.prototype.async processJSON): Added. (WI.AuditManager.prototype.export): (WI.AuditManager.prototype.import): Deleted. * UserInterface/Controllers/CanvasManager.js: (WI.CanvasManager.prototype.processJSON): Added. (WI.CanvasManager.prototype.importRecording): Deleted. * UserInterface/Views/AuditNavigationSidebarPanel.js: (WI.AuditNavigationSidebarPanel): (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView): (WI.AuditNavigationSidebarPanel.prototype._handleImportButtonNavigationItemClicked): * UserInterface/Views/CanvasSidebarPanel.js: (WI.CanvasSidebarPanel): (WI.CanvasSidebarPanel.prototype._handleImportButtonNavigationItemClicked): Added. (WI.CanvasSidebarPanel.prototype._recordingChanged): (WI.CanvasSidebarPanel.prototype._updateRecordNavigationItem): * UserInterface/Views/CanvasOverviewContentView.js: (WI.CanvasOverviewContentView): (WI.CanvasOverviewContentView.prototype._handleImportButtonNavigationItemClicked): Added. * UserInterface/Base/FileUtilities.js: (WI.FileUtilities.save): Added. (WI.FileUtilities.importText): Added. (WI.FileUtilities.importJSON): Added. (WI.FileUtilities.async readText): Added. (WI.FileUtilities.async readJSON): Added. (WI.saveDataToFile): Deleted. (WI.loadDataFromFile): Deleted. * UserInterface/Base/Main.js: (WI._contextMenuRequested): (WI._save): (WI._saveAs): * UserInterface/Views/ContextMenuUtilities.js: (WI.appendContextMenuItemsForSourceCode): * UserInterface/Views/LogContentView.js: (WI.LogContentView.prototype._handleContextMenuEvent): * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype._exportHAR): * UserInterface/Views/RecordingContentView.js: (WI.RecordingContentView.prototype._exportRecording): * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: (WI.SpreadsheetCSSStyleDeclarationSection.prototype._save): Move file related functions into a static class container. * Localizations/en.lproj/localizedStrings.js: 2018-11-14 Joseph Pecoraro Web Inspector: Include target identifier in protocol logging https://bugs.webkit.org/show_bug.cgi?id=191478 Reviewed by Devin Rousso. * UserInterface/Protocol/Connection.js: (InspectorBackend.Connection.prototype._dispatchResponse): (InspectorBackend.Connection.prototype._dispatchEvent): (InspectorBackend.Connection.prototype._sendMessageToBackend): Call tracer log methods with the connection. * UserInterface/Debug/CapturingProtocolTracer.js: * UserInterface/Protocol/ProtocolTracer.js: * UserInterface/Protocol/LoggingProtocolTracer.js: (WI.LoggingProtocolTracer): (WI.LoggingProtocolTracer.prototype.logFrontendException): (WI.LoggingProtocolTracer.prototype.logFrontendRequest): (WI.LoggingProtocolTracer.prototype.logWillHandleResponse): (WI.LoggingProtocolTracer.prototype.logDidHandleResponse): (WI.LoggingProtocolTracer.prototype.logDidHandleEvent): Include the connection in log methods. (WI.LoggingProtocolTracer.prototype.logProtocolError): Removed, this is never called. (WI.LoggingProtocolTracer.prototype._processEntry): Include the target identifier in entry messages. 2018-11-14 Joseph Pecoraro Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector) https://bugs.webkit.org/show_bug.cgi?id=191494 Reviewed by Devin Rousso. This starts introducing multi-target support into the Web Inspector frontend. Specifically a backend connection that is persistent, but has the ability to connect to and transition between Page targets received through that backend connection. This patch introduces the concept of a "Backend Target" which is the single connection that the frontend contains to a backend. The old way of connecting directly to a target is still supported. In that case the frontend constructs a DirectBackendTarget for the debuggable type the frontend was spawns for. However, if the frontend opens and has a TargetAgent, then it is likely connected to a multi-target supporting backend and instead constructs a MultiplexingBackendTarget, and will receive further information about sub-targets to connect to. The only sub-target at the moment is a Page sub-target. As part of bringing up multi-target support this adds a few measures to handle situations where the frontend is playing fast and loose with agents. When the frontend does `FooAgent.method` it intends that to be performed on the "main" target being debugged. Likewise when the frontend loops over targets it expects them to be the debuggable targets. This patch profiles a new implementation of `WI.mainTarget` and `WI.targets` to match the assumptions being made by the frontend. - In a direct-target world, there is a single target which should be used for global agents and in WI.targets. - In a multi-target world, the page target is the one that should be used for global agents and WI.targets is the list of sub-targets (excluding the MultiplexingBackendTarget). In a multi-target world, there are now commonly two Targets. The MultiplexingBackendTarget and a PageTarget sub-target. In the future this may include more targets, such as ServiceWorkers, DedicatedWorkers, and perhaps even frames. In a multi-target world, the frontend is immediately told about targets as soon as it opens (via Target.targetCreated). In order to support this, frontend initialization happens without a main target being available. So this makes a few small changes to frontend initialization to perform a bit of work once we know what the main target is. During a page transition the frontend is told to destroy existing targets and is soon after told about any new page targets (via Target.targetDestroyed and Target.targetCreated). The frontend special cases this page transition. It expects only one Page target to be alive at any time, accessible through WI.pageTarget. When a page transition happens the WI.pageTarget changes, and the frontend performs a bit of work to prepare the UI to handle the transition: `.transitionPageTarget` / WI.Notification.TransitionPageTarget. For the most part the UI behaves fine as long once there are main frame change and main resource change events, but those other events allow the frontend to respond to the specific page transition cases. * UserInterface/Base/Main.js: (WI.loaded): (WI.initializeBackendTarget): (WI.initializePageTarget): (WI.transitionPageTarget): (WI.terminatePageTarget): (WI.resetMainExecutionContext): (WI.redirectGlobalAgentsToConnection): (WI.contentLoaded): New global functions for target initialization and page transitioning. * UserInterface/Test/Test.js: (WI.loaded): (WI.initializeBackendTarget): (WI.initializePageTarget): (WI.transitionPageTarget): (WI.terminatePageTarget): (WI.resetMainExecutionContext): (WI.redirectGlobalAgentsToConnection): New global functions for target initialization. Tests continue to be a direct connection to the Page. * UserInterface/Protocol/TargetObserver.js: (WI.TargetObserver.prototype.targetCreated): (WI.TargetObserver.prototype.targetDestroyed): (WI.TargetObserver.prototype.dispatchMessageFromTarget): New observer goes to the manager. * UserInterface/Controllers/TargetManager.js: (WI.TargetManager): (WI.TargetManager.prototype.get targets): (WI.TargetManager.prototype.get allTargets): (WI.TargetManager.prototype.targetForIdentifier): (WI.TargetManager.prototype.targetCreated): (WI.TargetManager.prototype.targetDestroyed): (WI.TargetManager.prototype.dispatchMessageFromTarget): (WI.TargetManager.prototype.createMultiplexingBackendTarget): (WI.TargetManager.prototype.createDirectBackendTarget): (WI.TargetManager.prototype._addTarget): (WI.TargetManager.prototype._removeTarget): (WI.TargetManager.prototype._createTarget): (WI.TargetManager.prototype._checkAndHandlePageTargetTransition): (WI.TargetManager.prototype._checkAndHandlePageTargetTermination): (WI.TargetManager.prototype.addTarget): Deleted. (WI.TargetManager.prototype.removeTarget): Deleted. (WI.TargetManager.prototype.initializeMainTarget): Deleted. TargetManager is where we handle creating and destroying targets and their connections. In order to simplify things a bit we make `WI.targets`, which goes through `get targets()` an array instead of a Set. And this includes only the sub-targets. * UserInterface/Controllers/WorkerManager.js: (WI.WorkerManager.prototype.workerCreated): (WI.WorkerManager.prototype.workerTerminated): Workers are still special-target-like things that multiplex through WorkerAgent instead of TargetAgent. We'd like to promote these to be full targets in the future. * UserInterface/Protocol/DirectBackendTarget.js: Renamed from Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js. (WI.DirectBackendTarget): (WI.DirectBackendTarget.connectionInfoForDebuggable): (WI.DirectBackendTarget.prototype.get mainResource): (WI.DirectBackendTarget.prototype.set mainResource): This is the only "MainTarget" class. It is the backend target for a direct connection. * UserInterface/Protocol/MultiplexingBackendTarget.js: (WI.MultiplexingBackendTarget): (WI.MultiplexingBackendTarget.prototype.initialize): (WI.MultiplexingBackendTarget.prototype.get name): (WI.MultiplexingBackendTarget.prototype.get executionContext): (WI.MultiplexingBackendTarget.prototype.get mainResource): This is the new backend target for a multi-target connection. We don't expect it to be treated like other targets, so we don't expect anyone to ask it for resources/executionContext/name info. * UserInterface/Controllers/RuntimeManager.js: (WI.TargetManager.prototype.evaluateInInspectedWindow): This can be triggered by watch expressions before any target, and therefore execution context, is available. Just return null, when an execution context is available those clients will try again. * UserInterface/Debug/Bootstrap.js: Provide an WI.isEngineeringBuild boolean that can be used for various debugging features. * UserInterface/Main.html: * UserInterface/Test.html: New resources. * UserInterface/Protocol/InspectorBackend.js: (InspectorBackendClass.prototype.dispatch): (InspectorBackendClass.prototype.runAfterPendingDispatches): (InspectorBackend.Agent): `InspectorBackend.mainConnection` was renamed `InspectorBackend.backendConnection`. * UserInterface/Protocol/Connection.js: (InspectorBackend.Connection): (InspectorBackend.Connection.prototype._dispatchResponse): (InspectorBackend.Connection.prototype._sendCommandToBackendWithCallback): (InspectorBackend.Connection.prototype._sendCommandToBackendExpectingPromise): (InspectorBackend.BackendConnection): (InspectorBackend.BackendConnection.prototype.sendMessageToBackend): (InspectorBackend.WorkerConnection): (InspectorBackend.TargetConnection): (InspectorBackend.TargetConnection.sendMessageToBackend): Use a global sequence id to make filtering a bit easier in protocol tracing. TargetConnection is identical to WorkerConnection except it uses TargetAgent instead of WorkerAgent to perform multiplexing. * UserInterface/Protocol/JavaScriptContextTarget.js: (WI.JavaScriptContextTarget): * UserInterface/Protocol/PageTarget.js: (WI.PageTarget): (WI.PageTarget.prototype.get displayName): Specialized target types. * UserInterface/Views/DebuggerSidebarPanel.js: (WI.DebuggerSidebarPanel): (WI.DebuggerSidebarPanel.prototype._targetAdded): (WI.DebuggerSidebarPanel.prototype._targetRemoved): (WI.DebuggerSidebarPanel.prototype._updateCallStackTreeOutline): * UserInterface/Views/SourceCodeTextEditor.js: (WI.SourceCodeTextEditor.prototype._targetAdded): (WI.SourceCodeTextEditor.prototype._targetRemoved): (WI.SourceCodeTextEditor.prototype._callFramesDidChange): (WI.SourceCodeTextEditor.prototype._updateThreadIndicatorWidget): (WI.SourceCodeTextEditor.prototype._reinsertAllThreadIndicators): * UserInterface/Views/QuickConsole.js: (WI.QuickConsole.prototype.initializeMainExecutionContextPathComponent): (WI.QuickConsole.prototype._targetAdded): (WI.QuickConsole.prototype._targetRemoved): We make target added get called with all targets, including the MultiplexingBackendTarget and PageTargets, both of which would not have happened before. Before it was only WorkerTargets. Make these sites a little more robust for the type of target they expect to be able to handle. * UserInterface/Base/Object.js: * UserInterface/Controllers/DOMManager.js: (WI.DOMManager): (WI.DOMManager.prototype.transitionPageTarget): (WI.DOMManager.prototype.requestDocument): (WI.DOMManager.prototype._setDocument): * UserInterface/Controllers/NetworkManager.js: (WI.NetworkManager): (WI.NetworkManager.prototype.transitionPageTarget): (WI.NetworkManager.prototype.executionContextCreated): (WI.NetworkManager.prototype._processMainFrameResourceTreePayload): * UserInterface/Models/DefaultDashboard.js: (WI.DefaultDashboard): (WI.DefaultDashboard.prototype._mainResourceDidChange): (WI.DefaultDashboard.prototype._transitionPageTarget): * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView): (WI.NetworkTableContentView.prototype._mainResourceDidChange): (WI.NetworkTableContentView.prototype._transitionPageTarget): Special case handling when performing a page transition. * UserInterface/Views/SettingsTabContentView.js: * UserInterface/Debug/UncaughtExceptionReporter.js: Document reloads are not supported right now. 2018-11-14 Devin Rousso Web Inspector: Canvas: don't start with auto-capture enabled https://bugs.webkit.org/show_bug.cgi?id=191553 Reviewed by Matt Baker. * UserInterface/Views/CanvasOverviewContentView.js: (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount): (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize): (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput): * UserInterface/Views/CanvasOverviewContentView.css: (.navigation-bar > .item.canvas-recording-auto-capture > label > input): 2018-11-14 Devin Rousso Web Inspector: Network Graphs are missing minimum sizes, might have no graph at all https://bugs.webkit.org/show_bug.cgi?id=191208 Reviewed by Joseph Pecoraro. `WI.NetworkTableContentView` used to rely on the `WI.timelineManager.persistentNetworkTimeline` for events when a new resource is added. It also listened for `WI.Frame.Event.MainResourceDidChange` on it's own, which was also listened to by `WI.timelineManager.persistentNetworkTimeline`. Due to the order in which these listeners are added, the new main resource would get added to the `WI.timelineManager.persistentNetworkTimeline` (and the `WI.NetworkTableContentView` shortly after), and right after that the `WI.NetworkTableContentView` would reset the graph in it's own listener for `WI.Frame.Event.MainResourceDidChange`. This patch removes `WI.timelineManager.persistentNetworkTimeline` and instead makes it so that `WI.NetworkTableContentView` listens for resource added and main frame changed events on its own (similar to other views that follow this pattern), ensuring that there are no event races. Also relaxes the "requirement" that prevented 0 width blocks from being drawn, allowing requests served from memory/disk to appear in the graph (their time is effectively 0). * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView): (WI.NetworkTableContentView.prototype.closed): (WI.NetworkTableContentView.prototype._populateWaterfallGraph): (WI.NetworkTableContentView.prototype._populateWaterfallGraph.appendBlock): (WI.NetworkTableContentView.prototype._updateWaterfallTimeRange): Added. (WI.NetworkTableContentView.prototype._resourceLoadingDidFinish): (WI.NetworkTableContentView.prototype._resourceLoadingDidFail): (WI.NetworkTableContentView.prototype._handleResourceAdded): Added. (WI.NetworkTableContentView.prototype._insertResourceAndReloadTable): (WI.NetworkTableContentView.prototype._handleNodeDidFireEvent): (WI.NetworkTableContentView.prototype._handleNodeLowPowerChanged): * UserInterface/Views/NetworkTableContentView.css: (.network-table .waterfall .block:matches(.mouse-tracking, .filler) + .block:not(.mouse-tracking, .filler)): Added. (.network-table .waterfall .block.filler + .block): Deleted. * UserInterface/Controllers/TimelineManager.js: (WI.TimelineManager): (WI.TimelineManager.prototype._mainResourceDidChange): (WI.TimelineManager.prototype._resourceWasAdded): (WI.TimelineManager.prototype.get persistentNetworkTimeline): Deleted. 2018-11-13 Matt Baker Web Inspector: Table should support select all (Cmd-A) https://bugs.webkit.org/show_bug.cgi?id=190299 Reviewed by Devin Rousso. * UserInterface/Views/Table.js: (WI.Table.prototype.selectAll): (WI.Table.prototype._handleKeyDown): 2018-11-13 Matt Baker Web Inspector: Table with no selection should select the first/last row on down/up arrow key https://bugs.webkit.org/show_bug.cgi?id=190100 Reviewed by Devin Rousso. Pressing the up or down arrow key when nothing is selected should select the last or first row, respectively. After selecting the row make sure it is visible by calling the new Table method `revealRow`. * UserInterface/Views/Table.js: (WI.Table.prototype.revealRow): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._selectRowsFromArrowKey): 2018-11-13 Nikita Vasilyev Web Inspector: Styles: Command-A should select all properties https://bugs.webkit.org/show_bug.cgi?id=191435 Reviewed by Devin Rousso. When focused on a style property, Command-A on Mac (Control-A on other platforms) should select all properties of the style rule. * UserInterface/Base/Utilities.js: * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.selectProperties): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown): 2018-11-12 Devin Rousso Web Inspector: Network: show secure certificate details per-request https://bugs.webkit.org/show_bug.cgi?id=191447 Reviewed by Joseph Pecoraro. * UserInterface/Controllers/NetworkManager.js: (WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache): (WI.NetworkManager.prototype.resourceRequestDidReceiveResponse): * UserInterface/Models/Resource.js: (WI.Resource.prototype.get responseSecurity): Added. (WI.Resource.prototype.get loadedSecurely): Added. (WI.Resource.prototype.updateForResponse): * UserInterface/Views/NetworkResourceDetailView.js: (WI.NetworkResourceDetailView): (WI.NetworkResourceDetailView.prototype.initialLayout): (WI.NetworkResourceDetailView.prototype.showContentViewForIdentifier): * UserInterface/Views/NetworkResourceDetailView.css: (.content-view.resource-details .go-to-arrow): Added. (.content-view.resource-details.showing-find-banner .search-highlight): Added. * UserInterface/Views/ResourceSecurityContentView.js: Added. (WI.ResourceSecurityContentView): (WI.ResourceSecurityContentView.prototype.initialLayout): (WI.ResourceSecurityContentView.prototype.layout): (WI.ResourceSecurityContentView.prototype.closed): (WI.ResourceSecurityContentView.prototype.get supportsSearch): (WI.ResourceSecurityContentView.prototype.get numberOfSearchResults): (WI.ResourceSecurityContentView.prototype.get hasPerformedSearch): (WI.ResourceSecurityContentView.prototype.set automaticallyRevealFirstSearchResult): (WI.ResourceSecurityContentView.prototype.performSearch): (WI.ResourceSecurityContentView.prototype.searchCleared): (WI.ResourceSecurityContentView.prototype.revealPreviousSearchResult): (WI.ResourceSecurityContentView.prototype.revealNextSearchResult): (WI.ResourceSecurityContentView.prototype._refreshCetificateSection): (WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs): (WI.ResourceSecurityContentView.prototype._revealSearchResult): (WI.ResourceSecurityContentView.prototype._handleResourceResponseReceived): * UserInterface/Views/ResourceSecurityContentView.css: Added. (body[dir] .resource-security > section.certificate > .details): (.resource-security .details .key): (.resource-security .dns-name + .dns-name > .key,): (.resource-security .show-more): (@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details): (@media (prefers-dark-interface) .resource-security .details .key): * UserInterface/Views/ResourceCookiesContentView.js: (WI.ResourceCookiesContentView.prototype._refreshRequestCookiesSection): (WI.ResourceCookiesContentView.prototype._refreshResponseCookiesSection): (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithMessage): Deleted. (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted. * UserInterface/Views/ResourceHeadersContentView.js: (WI.ResourceHeadersContentView.prototype._refreshSummarySection): (WI.ResourceHeadersContentView.prototype._refreshRedirectHeadersSections): (WI.ResourceHeadersContentView.prototype._refreshRequestHeadersSection): (WI.ResourceHeadersContentView.prototype._refreshResponseHeadersSection): (WI.ResourceHeadersContentView.prototype._refreshQueryStringSection): (WI.ResourceHeadersContentView.prototype._refreshRequestDataSection): (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithMessage): Deleted. (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted. (WI.ResourceHeadersContentView.prototype._appendKeyValuePair): Deleted. * UserInterface/Views/ResourceHeadersContentView.css: (.resource-headers .h1-status > .key,): (body[dir] .resource-headers > section.error > .details): Deleted. (.resource-headers > section.error .key): Deleted. (.resource-headers .details): Deleted. (.resource-headers .details .pair): Deleted. (body[dir=rtl] .resource-headers .details .pair): Deleted. (.resource-headers .details .key): Deleted. (.resource-headers .value): Deleted. (.resource-headers .go-to-arrow): Deleted. (.resource-headers.showing-find-banner .search-highlight): Deleted. * UserInterface/Views/ResourceDetailsSection.js: (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithMessage): Added. (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithLoadingIndicator): Added. (WI.ResourceDetailsSection.prototype.appendKeyValuePair): Added. * UserInterface/Views/ResourceDetailsSection.css: (.resource-details > section > .details): Added. (.resource-details > section > .details > .pair): Added. (body[dir=rtl] .resource-details > section > .details > .pair): Added. (.resource-details > section > .details > .pair > .key): Added. (.resource-details > section > .details > .pair > .value): Added. (body[dir] .resource-details > section.error > .details): Added. (.resource-details > section.error > .details > .pair > .key): Added. Move commonly used functions/styles from container classes onto this object. * UserInterface/Main.html: * Localizations/en.lproj/localizedStrings.js: 2018-11-12 Matt Baker Web Inspector: Table should support shift-extending the row selection https://bugs.webkit.org/show_bug.cgi?id=189718 Reviewed by Devin Rousso. Allow the table selection to be extended by shift-clicking a row, or by holding shift and pressing either the up or down arrow key. If both command and shift are pressed, shift is ignored. The selection behavior is modeled after AppKit's NSTableView. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.addRange): (WI.IndexSet.prototype.deleteRange): (WI.IndexSet.prototype.equals): (WI.IndexSet.prototype.difference): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.set allowsMultipleSelection): (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype._handleKeyDown): Holding shift and pressing either the up or down arrow key extends the selection to the next unselected row adjacent to the anchor row, or causes the anchor row to be deselected, decreasing the selection. The table chooses the action to take based on the direction of movement (up or down), and the currently selected rows. (WI.Table.prototype._selectRowsFromArrowKey): (WI.Table.prototype._handleMouseDown.normalizeRange): (WI.Table.prototype._handleMouseDown): Clicking a row while holding down shift extends the selection to include the rows between the anchor row (exclusive) and clicked row (inclusive). The anchor row is equal to the value of `_selectedRowIndex` prior to clicking a new row. (WI.Table.prototype._deselectAllAndSelect): (WI.Table.prototype._removeRows): (WI.Table.prototype._toggleSelectedRowStyle): (WI.Table.prototype._updateSelectedRows): Helper method for updating the selection to the specified rows, and updating DOM styles for rows that are added to or removed from the selection. 2018-11-12 Nikita Vasilyev Web Inspector: Styles: inline swatches don't work when Multiple Properties Selection is enabled https://bugs.webkit.org/show_bug.cgi?id=191165 Reviewed by Devin Rousso. * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch): * UserInterface/Views/SpreadsheetTextField.js: (WI.SpreadsheetTextField): `click` is fired after `mouseup` and inline swatches are activated by `click` event. Changing this to `click` allows swatches to activate before editing starts. (WI.SpreadsheetTextField.prototype._handleMouseDown): Clicking on the field that is being edited should't restart editing. It should move the text caret. 2018-11-12 Don Olmstead Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile https://bugs.webkit.org/show_bug.cgi?id=189230 Reviewed by Joseph Pecoraro. Runs all png images through zopflipng. This results in a smaller file size and takes care of this issue as a byproduct. * UserInterface/Images/ApplicationCache.png: * UserInterface/Images/ApplicationCache@2x.png: * UserInterface/Images/ApplicationCacheManifest.png: * UserInterface/Images/ApplicationCacheManifest@2x.png: * UserInterface/Images/Breakpoint.png: * UserInterface/Images/Breakpoint@2x.png: * UserInterface/Images/BreakpointInactive.png: * UserInterface/Images/BreakpointInactive@2x.png: * UserInterface/Images/ClippingCSS.png: * UserInterface/Images/ClippingCSS@2x.png: * UserInterface/Images/ClippingCSSLarge.png: * UserInterface/Images/ClippingCSSLarge@2x.png: * UserInterface/Images/ClippingGeneric.png: * UserInterface/Images/ClippingGeneric@2x.png: * UserInterface/Images/ClippingGenericLarge.png: * UserInterface/Images/ClippingGenericLarge@2x.png: * UserInterface/Images/ClippingJS.png: * UserInterface/Images/ClippingJS@2x.png: * UserInterface/Images/ClippingJSLarge.png: * UserInterface/Images/ClippingJSLarge@2x.png: * UserInterface/Images/ColorIcon.png: * UserInterface/Images/ColorIcon@2x.png: * UserInterface/Images/Cookie.png: * UserInterface/Images/Cookie@2x.png: * UserInterface/Images/Database.png: * UserInterface/Images/Database@2x.png: * UserInterface/Images/DatabaseTable.png: * UserInterface/Images/DatabaseTable@2x.png: * UserInterface/Images/DocumentCSS.png: * UserInterface/Images/DocumentCSS@2x.png: * UserInterface/Images/DocumentCSSLarge.png: * UserInterface/Images/DocumentCSSLarge@2x.png: * UserInterface/Images/DocumentFont.png: * UserInterface/Images/DocumentFont@2x.png: * UserInterface/Images/DocumentFontLarge.png: * UserInterface/Images/DocumentFontLarge@2x.png: * UserInterface/Images/DocumentGL.png: * UserInterface/Images/DocumentGL@2x.png: * UserInterface/Images/DocumentGeneric.png: * UserInterface/Images/DocumentGeneric@2x.png: * UserInterface/Images/DocumentGenericLarge.png: * UserInterface/Images/DocumentGenericLarge@2x.png: * UserInterface/Images/DocumentImage.png: * UserInterface/Images/DocumentImage@2x.png: * UserInterface/Images/DocumentImageLarge.png: * UserInterface/Images/DocumentImageLarge@2x.png: * UserInterface/Images/DocumentJS.png: * UserInterface/Images/DocumentJS@2x.png: * UserInterface/Images/DocumentJSLarge.png: * UserInterface/Images/DocumentJSLarge@2x.png: * UserInterface/Images/DocumentMarkup.png: * UserInterface/Images/DocumentMarkup@2x.png: * UserInterface/Images/DocumentMarkupLarge.png: * UserInterface/Images/DocumentMarkupLarge@2x.png: * UserInterface/Images/FolderGeneric.png: * UserInterface/Images/FolderGeneric@2x.png: * UserInterface/Images/GradientStop.png: * UserInterface/Images/GradientStop@2x.png: * UserInterface/Images/GradientStopSelected.png: * UserInterface/Images/GradientStopSelected@2x.png: * UserInterface/Images/HoverMenuButton.png: * UserInterface/Images/HoverMenuButton@2x.png: * UserInterface/Images/InstructionPointer.png: * UserInterface/Images/InstructionPointer@2x.png: * UserInterface/Images/LocalStorage.png: * UserInterface/Images/LocalStorage@2x.png: * UserInterface/Images/SessionStorage.png: * UserInterface/Images/SessionStorage@2x.png: * UserInterface/Images/SliderThumb.png: * UserInterface/Images/SliderThumb@2x.png: * UserInterface/Images/SliderThumbPressed.png: * UserInterface/Images/SliderThumbPressed@2x.png: * UserInterface/Images/WebSocket.png: * UserInterface/Images/WebSocket@2x.png: * UserInterface/Images/WebSocketLarge.png: * UserInterface/Images/WebSocketLarge@2x.png: * UserInterface/Images/WorkerScript.png: * UserInterface/Images/WorkerScript@2x.png: * UserInterface/Images/WorkerScriptLarge.png: * UserInterface/Images/WorkerScriptLarge@2x.png: 2018-11-12 Nikita Vasilyev Web Inspector: Styles: Pressing Tab or Enter should start editing focused property https://bugs.webkit.org/show_bug.cgi?id=191510 Reviewed by Dean Jackson. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown): 2018-11-08 Joseph Pecoraro Web Inspector: Start moving toward better multi-target support https://bugs.webkit.org/show_bug.cgi?id=191345 Reviewed by Devin Rousso. This change continues the move toward better multi-target support by explicitly using explicit target agents in more places, and converting generalized feature checks into target agnostic versions that use the new InspectorBackend.domains, which does not vary based on the connected targets / debuggable type. I also audited uses of RuntimeAgent, ConsoleAgent, and DebuggerAgent for better multi-target support since these agents should already have complete multi-target support. * UserInterface/Protocol/Target.js: (WI.Target.prototype.initialize): Move explicitly to target.Agent feature checks with a known target. * UserInterface/Controllers/DebuggerManager.js: (WI.DebuggerManager.prototype.initializeTarget): (WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange): Move explicitly to target.DebuggerAgent for feature checks with a known target. * UserInterface/Controllers/NetworkManager.js: (WI.NetworkManager.prototype.initializeTarget): Move explicitly to target.NetworkAgent for feature checks with a known target. * UserInterface/Controllers/RuntimeManager.js: (WI.RuntimeManager.prototype.initializeTarget): (WI.RuntimeManager.prototype.saveResult): * UserInterface/Protocol/RemoteObject.js: (WI.RemoteObject.prototype.updatePreview): (WI.RemoteObject.prototype.getDisplayablePropertyDescriptors): (WI.RemoteObject.prototype.deprecatedGetDisplayableProperties): * UserInterface/Views/SourceCodeTextEditor.js: (WI.SourceCodeTextEditor.prototype._createTypeTokenAnnotator): (WI.SourceCodeTextEditor.prototype._createBasicBlockAnnotator): Move explicitly to target.RuntimeAgent for feature checks with a known target. * UserInterface/Models/CSSCompletions.js: (WI.CSSCompletions.initializeCSSCompletions): Move explicitly to target.CSSAgent for feature checks with a known target. * UserInterface/Views/ContextMenuUtilities.js: Use the DebuggerAgent from the target associated with the DOMNode's remote object instead of assuming the main target. * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createGeneralSettingsView): Update the ConsoleAgent setting on all targets that support it. * UserInterface/Views/BreakpointActionView.js: (WI.BreakpointActionView): All backends support BreakpointActionType, the assertion can go away. * UserInterface/Views/LogContentView.js: (WI.LogContentView.prototype.get navigationItems): * UserInterface/Views/DOMTreeContentView.js: (WI.DOMTreeContentView.prototype.get navigationItems): Include additional `window.FooAgent` checks for these since they will need to be revisited in the future. * UserInterface/Protocol/InspectorBackend.js: (InspectorBackendClass.prototype.get domains): (InspectorBackendClass.prototype.activateDomain): Expose InspectorBackend.domains. for feature checking. * UserInterface/Controllers/BreakpointPopoverController.js: (WI.BreakpointPopoverController.prototype._createPopoverContent): * UserInterface/Controllers/CSSManager.js: (WI.CSSManager): (WI.CSSManager.prototype._mainResourceDidChange): * UserInterface/Controllers/TimelineManager.js: (WI.TimelineManager.prototype._attemptAutoCapturingForFrame): (WI.TimelineManager.prototype._updateAutoCaptureInstruments): (WI.TimelineManager): * UserInterface/Models/Canvas.js: (WI.Canvas.prototype.startRecording): (WI.Canvas.prototype.recordingFinished): * UserInterface/Models/ScriptSyntaxTree.js: (WI.ScriptSyntaxTree.functionReturnDivot): * UserInterface/Protocol/DebuggerObserver.js: (WI.DebuggerObserver): * UserInterface/Protocol/NetworkObserver.js: (WI.NetworkObserver.prototype.requestWillBeSent): * UserInterface/Views/DebuggerSidebarPanel.js: (WI.DebuggerSidebarPanel): (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointClicked): * UserInterface/Views/NetworkTimelineView.js: (WI.NetworkTimelineView): * UserInterface/Views/ResourceDetailsSidebarPanel.js: (WI.ResourceDetailsSidebarPanel.prototype._refreshRequestAndResponse): * UserInterface/Views/WebSocketContentView.js: (WI.WebSocketContentView): (WI.NetworkManager.prototype.webSocketWillSendHandshakeRequest): (WI.DebuggerManager.prototype.debuggerDidResume): Feature check in a target agnostic way. 2018-11-08 Matt Baker Web Inspector: ResourceQueryController should early return when query is longer than search string https://bugs.webkit.org/show_bug.cgi?id=191436 Reviewed by Devin Rousso. * UserInterface/Controllers/ResourceQueryController.js: * UserInterface/Models/ResourceQueryMatch.js: (WI.ResourceQueryMatch): Drive-by fixes. 2018-11-08 Joseph Pecoraro Uncaught Exception: undefined is not an object (evaluating 'treeElement.parent.removeChild') https://bugs.webkit.org/show_bug.cgi?id=191454 Reviewed by Matt Baker. * UserInterface/Views/ResourceSidebarPanel.js: (WI.ResourceSidebarPanel.prototype._scriptsCleared): This was intending to iterate the Map's values, which are tree elements. 2018-11-08 Joseph Pecoraro Web Inspector: Potential for watch expressions to never show results https://bugs.webkit.org/show_bug.cgi?id=191438 Reviewed by Matt Baker. * UserInterface/Views/ScopeChainDetailsSidebarPanel.js: (WI.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection): If there was no object don't bail, continue and resolve the Promise. In this case we can fallback to show `undefined`. This code might not be reachable right now, but is wrong as is. 2018-11-08 Joseph Pecoraro Web Inspector: Debugger Popover does not work when paused in Worker https://bugs.webkit.org/show_bug.cgi?id=191342 Reviewed by Devin Rousso. * UserInterface/Views/SourceCodeTextEditor.js: (WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate): (WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression): When receiving the result of the popover evaluation associate the RemoteObject with the target we used to evaluate (such as the Debugger call frame), not the target associated with the editor. 2018-11-08 Joseph Pecoraro Web Inspector: Restrict domains at the target level instead of only at the window level https://bugs.webkit.org/show_bug.cgi?id=191344 Reviewed by Devin Rousso. With this change the list of agents available on the target should accurately reflect the domains that target supports. We should start moving in the direction that if we are checking for, or using, a feature, we should ideally be using code that looks like `target.FooAgent.method` and not `window.FooAgent` or an unprefixed `FooAgent`. More changes to follow. * UserInterface/Controllers/AppControllerBase.js: * UserInterface/Base/DebuggableType.js: Added. Extract debuggable type enum out into its own file loaded early on. * UserInterface/Main.html: * UserInterface/Test.html: Load DebuggableType.js. * UserInterface/Controllers/NetworkManager.js: (WI.NetworkManager.prototype.initializeTarget): With these changes target.ServiceWorker is only exposed on a ServiceWorker target. * UserInterface/Protocol/Connection.js: (InspectorBackend.WorkerConnection): With these changes Target.js restricts the domains exposed on the Target so just clone all of the agents (we don't need to do anything special). * UserInterface/Protocol/InspectorBackend.js: (InspectorBackendClass.prototype.activateDomain): Update supported domains per-type. If there is no explicit availability then the domain is supported on all types. (InspectorBackendClass.prototype.supportedDomainsForDebuggableType): Get supported domains per-type. (InspectorBackendClass.prototype.get workerSupportedDomains): Deleted. (InspectorBackendClass.prototype.workerSupportedDomain): Deleted. workerSupportedDomains is now unnecessary. * UserInterface/Protocol/Target.js: (WI.Target.prototype._supportedDomainsForTargetType): Restrict supported domains for this target based on its type. * UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js: * Versions/Inspector-iOS-10.3.json: * Versions/Inspector-iOS-11.0.json: * Versions/Inspector-iOS-11.3.json: * Versions/Inspector-iOS-12.0.json: Regenerate protocol files now that workerSupportedDomains is unnecessary and explicit availability has been added to other domains. 2018-11-07 Nikita Vasilyev REGRESSION(r236705): Web Inspector: wrong text color for selected DataGrid row https://bugs.webkit.org/show_bug.cgi?id=191405 Reviewed by Matt Baker. Selection background color for both Dark Mode mode and Light Mode is dark blue. The text color for both cases should be white. * UserInterface/Views/DataGrid.css: (body:not(.window-inactive, .window-docked-inactive) .data-grid:focus tr.editable.selected .cell-content > input): 2018-11-07 Joseph Pecoraro Web Inspector: Fix "Javascript" => "JavaScript" enum in protocol generated objects https://bugs.webkit.org/show_bug.cgi?id=191340 Reviewed by Devin Rousso. * UserInterface/Models/Canvas.js: (WI.Canvas.fromPayload): Insert a missing break statement for the WebGPU case. * UserInterface/Models/MemoryTimelineRecord.js: (WI.MemoryTimelineRecord.memoryCategoriesFromProtocol): Use new enum name. * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js: * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js: Update enums with new generator. 2018-11-06 Joseph Pecoraro REGRESSION: Web Inspector: Popovers drawing incorrectly in Network Tab (clicking between a few items) https://bugs.webkit.org/show_bug.cgi?id=191323 Reviewed by Devin Rousso. * UserInterface/Views/Popover.js: (WI.Popover.prototype._drawBackground): Save and restore the context state between updates. Something was affecting the clearRect, making it so that it didn't actually clear the entire rect each time. 2018-11-05 Devin Rousso Web Inspector: Audit: turn off Start button when all tests are removed https://bugs.webkit.org/show_bug.cgi?id=191235 Reviewed by Matt Baker. * UserInterface/Views/AuditNavigationSidebarPanel.js: (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved): 2018-11-05 Matt Baker Web Inspector: Table selection should not require that rows be in the cache https://bugs.webkit.org/show_bug.cgi?id=190993 Reviewed by Devin Rousso. Deselecting a table row shouldn't depend on it being in the cache. This allows us to implement select all, and other kinds of bulk selection actions that affect rows that haven't been revealed. * UserInterface/Views/Table.js: (WI.Table.prototype.deselectRow): 2018-11-05 Devin Rousso Web Inspector: show save/restore stack for recorded 2D Canvases https://bugs.webkit.org/show_bug.cgi?id=175283 Reviewed by Matt Baker. Instead of using plain objects for holding the `WI.Recording`'s state, use a model object so that more data can be passed around. When visualizing the state, show any previously saved states in a `WI.DetailsSection` underneath the current state. If there are no saved states (meaning there is only the current state), don't use a `WI.DetailsSection`. * UserInterface/Models/RecordingState.js: Added. (WI.RecordingState): (WI.RecordingState.fromContext): (WI.RecordingState.async swizzleInitialState): (WI.RecordingState.prototype.get source): (WI.RecordingState.prototype.has): (WI.RecordingState.prototype.get return): (WI.RecordingState.prototype.toJSON): (WI.RecordingState.prototype.[Symbol.iterator]): * UserInterface/Models/Recording.js: (WI.Recording.prototype.async _process): (WI.Recording.prototype.async _swizzleState): Deleted. * UserInterface/Models/RecordingAction.js: (WI.RecordingAction.prototype.process): (WI.RecordingAction.deriveCurrentState): Deleted. * UserInterface/Views/RecordingContentView.js: (WI.RecordingContentView.prototype._generateContentCanvas2D): * UserInterface/Views/RecordingStateDetailsSidebarPanel.js: (WI.RecordingStateDetailsSidebarPanel): (WI.RecordingStateDetailsSidebarPanel.prototype.get scrollElement): (WI.RecordingStateDetailsSidebarPanel.prototype.sizeDidChange): Added. (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D): (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D.isColorProperty): Deleted. (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D.createInlineSwatch): Deleted. * UserInterface/Views/RecordingStateDetailsSidebarPanel.css: (.sidebar > .panel.details.recording-state > .content .details-section > .header .source): Added. (.sidebar > .panel.details.recording-state > .content .data-grid tr.modified): Added. (.sidebar > .panel.details.recording-state > .content .data-grid tr:not(.selected).non-standard .name-column): Added. (.sidebar > .panel.details.recording-state > .content .data-grid tr:not(.selected) .unavailable): Added. (.sidebar > .panel.details.recording-state > .content .data-grid .inline-swatch): Added. (.sidebar > .panel.details.recording-state > .content > .data-grid tr.modified): Deleted. (.sidebar > .panel.details.recording-state > .content > .data-grid tr:not(.selected).non-standard): Deleted. (.sidebar > .panel.details.recording-state > .content > .data-grid tr:not(.selected) .unavailable): Deleted. (.sidebar > .panel.details.recording-state > .content > .data-grid .inline-swatch): Deleted. * UserInterface/Main.html: * UserInterface/Test.html: * Localizations/en.lproj/localizedStrings.js: 2018-11-03 Devin Rousso Web Inspector: Canvas: capture changes to that would affect the recorded context https://bugs.webkit.org/show_bug.cgi?id=190854 Reviewed by Matt Baker. * UserInterface/Models/RecordingAction.js: (WI.RecordingAction): (WI.RecordingAction.isFunctionForType): (WI.RecordingAction.constantNameForParameter): (WI.RecordingAction.prototype.get contextReplacer): Added. (WI.RecordingAction.prototype.async.swizzle): (WI.RecordingAction.prototype.apply): Create a constant list of actions for each recording type that need to replace the context with a different value before being applied (e.g. `width` should be applied to the `context`'s `canvas` instead of directly to the `context`). * UserInterface/Views/RecordingContentView.js: (WI.RecordingContentView.prototype._generateContentCanvas2D.actionModifiesPath): Added. (WI.RecordingContentView.prototype._generateContentCanvas2D): (WI.RecordingContentView._actionModifiesPath): Deleted. Generate the path context after the actions are applied to the preview context so that the final width/height are known and can be used. This is needed because changing the width/height causes the content to be erased. * UserInterface/Views/RecordingActionTreeElement.js: (WI.RecordingActionTreeElement._generateDOM): (WI.RecordingActionTreeElement._classNameForAction): * UserInterface/Views/RecordingActionTreeElement.css: (.tree-outline:focus .item.action.selected:not(.invalid, .initial-state, .has-context-replacer) > .icon): Added. (.item.action > .titles .context-replacer::after): Added. (.item.action.has-context-replacer > .icon): Added. (@media (prefers-dark-interface) .item.action:not(.invalid, .initial-state, .has-context-replacer) > .icon): Added. (.tree-outline:focus .item.action.selected:not(.initial-state, .invalid) > .icon): Deleted. (@media (prefers-dark-interface) .item.action:not(.initial-state) > .icon): Deleted. (@media (prefers-dark-interface) .tree-outline:not(.hide-disclosure-buttons) .item.action:not(.initial-state, .parent) > .icon): Deleted. Add the context replacer text to the beginning of the action's name if it exists. * UserInterface/Views/CanvasContentView.js: (WI.CanvasContentView.prototype._refreshPixelSize): (WI.CanvasContentView.prototype._updatePixelSize): Deleted. Update preview image when the canvas' size changes. 2018-11-02 Matt Baker Web Inspector: support multiple selection/deletion of cookie records https://bugs.webkit.org/show_bug.cgi?id=66381 Reviewed by Devin Rousso. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Views/CookieStorageContentView.js: (WI.CookieStorageContentView): (WI.CookieStorageContentView.prototype.get scrollableElements): (WI.CookieStorageContentView.prototype.tableNumberOfRows): (WI.CookieStorageContentView.prototype.tableSortChanged): (WI.CookieStorageContentView.prototype.tableCellContextMenuClicked): (WI.CookieStorageContentView.prototype.tableDidRemoveRows): (WI.CookieStorageContentView.prototype.tablePopulateCell): (WI.CookieStorageContentView.prototype.initialLayout): (WI.CookieStorageContentView.prototype._generateSortComparator): (WI.CookieStorageContentView.prototype._refreshButtonClicked): (WI.CookieStorageContentView.prototype._reloadCookies): (WI.CookieStorageContentView.prototype._updateSort): (WI.CookieStorageContentView.prototype._handleTableKeyDown): (WI.CookieStorageContentView.prototype.update): Deleted. (WI.CookieStorageContentView.prototype._rebuildTable): Deleted. (WI.CookieStorageContentView.prototype._sortDataGrid.localeCompare): Deleted. (WI.CookieStorageContentView.prototype._sortDataGrid.numberCompare): Deleted. (WI.CookieStorageContentView.prototype._sortDataGrid.expiresCompare): Deleted. (WI.CookieStorageContentView.prototype._sortDataGrid): Deleted. (WI.CookieStorageContentView.prototype._deleteCallback): Deleted. Replace DataGrid with Table. The content view serves as the table delegate and data source, and handles delete and backspace key events to allow deleting the selected cookies. Cookies may also be deleted from the table context menu and a new button in the navigation bar. * UserInterface/Views/Table.js: (WI.Table.prototype.isRowSelected): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype._getOrCreateRow): (WI.Table.prototype._handleMouseDown): (WI.Table.prototype._removeRows): (WI.Table.prototype._isRowSelected): Deleted. Make `isSelectedRow` public. It is more convenient and efficient than calling `Table.prototype.selectedRows.includes(rowIndex)`. 2018-11-01 Devin Rousso Web Inspector: View: introduce a didLayoutSubtree https://bugs.webkit.org/show_bug.cgi?id=191176 Reviewed by Matt Baker. Introduce logic to allow subclasses of `WI.View` to perform logic after every `WI.View` in their subtree has finished `layout`. * UserInterface/Views/View.js: (WI.View.prototype.didLayoutSubtree): Added. (WI.View.prototype._layoutSubtree): * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype.layout): (WI.NetworkTableContentView.prototype.didLayoutSubtree): Added. 2018-11-01 Devin Rousso Web Inspector: Network: remove unnecessary media event tracking https://bugs.webkit.org/show_bug.cgi?id=191174 Reviewed by Joseph Pecoraro. Renames "Group by Node" to "Group Media Requests" for clarity. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView): (WI.NetworkTableContentView.prototype.reset): (WI.NetworkTableContentView.prototype.showRepresentedObject): (WI.NetworkTableContentView.prototype.networkDetailViewClose): (WI.NetworkTableContentView.prototype._populateNameCell): (WI.NetworkTableContentView.prototype._populateWaterfallGraph.createDOMEventLine): (WI.NetworkTableContentView.prototype._populateWaterfallGraph): (WI.NetworkTableContentView.prototype.layout): (WI.NetworkTableContentView.prototype._entryForDOMNode): (WI.NetworkTableContentView.prototype._handleGroupByDOMNodeCheckedDidChange): (WI.NetworkTableContentView.prototype._restoreSelectedRow): (WI.NetworkTableContentView.prototype._handleResourceEntryMousedownWaterfall): (WI.NetworkTableContentView.prototype._handleNodeEntryMousedownWaterfall): (WI.NetworkTableContentView.prototype._handleMousedownWaterfall): * UserInterface/Views/NetworkTableContentView.css: (.network-table .data-container .cell.name .range): Added. (.network-table .data-container .cell.name .range::before): Added. (.network-table:focus .data-container li.selected .cell.name .range): Added. (@media (prefers-dark-interface) .network-table .data-container .cell.name .range): Added. Always display the "Byte Range" title as a "subtitle", regardless of the media requests setting being toggled. Drive-by: update the position of the waterfall popover whenever the time range changes. Drive-by: close the details view if a node is selected and the media requests setting is turned off. * UserInterface/Views/Popover.js: (WI.Popover.prototype.resize): Added. (WI.Popover.prototype.handleEvent): * Localizations/en.lproj/localizedStrings.js: 2018-11-01 Devin Rousso Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'mouseBlock.addEventListener') https://bugs.webkit.org/show_bug.cgi?id=191020 Reviewed by Joseph Pecoraro. * UserInterface/Views/TimelineRuler.js: (WI.TimelineRuler): Since `undefined` is not a number, it isn't less than `0`, which caused us to divide by `undefined` (equivalent to dividing by `0`), resulting in `NaN`. 2018-11-01 Nikita Vasilyev Uncaught Exception: TypeError: undefined is not an object (evaluating 'WI.modifierKeys.metaKey') (at ScopeBarItem.js:87:67) https://bugs.webkit.org/show_bug.cgi?id=191173 Reviewed by Devin Rousso. WI.modifierKeys was accessed before it was initialized. Move it from WI.contentLoaded to WI.loaded, which happens before WI.contentLoaded. * UserInterface/Base/Main.js: (WI.loaded): (WI.contentLoaded): 2018-11-01 Nikita Vasilyev REGRESSION(r237652): Web Inspector: dumpInspectorProtocolMessages is always enabled https://bugs.webkit.org/show_bug.cgi?id=191161 Reviewed by Joseph Pecoraro. * UserInterface/Protocol/InspectorBackend.js: (InspectorBackendClass.prototype.get dumpInspectorProtocolMessages): 2018-11-01 Nikita Vasilyev Web Inspector: Styles: Toggle selected properties by pressing Space or Command+/ https://bugs.webkit.org/show_bug.cgi?id=181145 Reviewed by Brian Burg. Pressing Space key or Command-/ toggles (comments out or uncomments) selected properties. This patch only works with "Enable Selection of Multiple Properties" checked. It shouldn't introduce any changes when this setting is unchecked. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.get selectionRange): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.selectProperties): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty): (WI.SpreadsheetStyleProperty.prototype.update): Renamed from _update. (WI.SpreadsheetStyleProperty.prototype.updateStatus): (WI.SpreadsheetStyleProperty.prototype.applyFilter): (WI.SpreadsheetStyleProperty.prototype.handleCopyEvent): Make `update` method public. No other changes were made. 2018-10-31 Devin Rousso Web Inspector: Canvas: create a setting for auto-recording newly created contexts https://bugs.webkit.org/show_bug.cgi?id=190856 Reviewed by Brian Burg. * UserInterface/Controllers/CanvasManager.js: (WI.CanvasManager.supportsRecordingAutoCapture): Added. (WI.CanvasManager.prototype.setRecordingAutoCaptureFrameCount): Added. * UserInterface/Models/Canvas.js: (WI.Canvas.prototype.startRecording): (WI.Canvas.prototype.recordingStarted): (WI.Canvas.prototype.recordingFinished): * UserInterface/Models/Recording.js: * UserInterface/Views/CanvasOverviewContentView.js: (WI.CanvasOverviewContentView): (WI.CanvasOverviewContentView.prototype.get navigationItems): (WI.CanvasOverviewContentView.prototype.initialLayout): Added. (WI.CanvasOverviewContentView.prototype.attached): (WI.CanvasOverviewContentView.prototype.detached): (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount): Added. (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize): Added. (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput): Added. (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureCheckedDidChange): Added. (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureEnabledChanged): Added. (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged): Added. * UserInterface/Views/CanvasOverviewContentView.css: (.navigation-bar > .item.canvas-recording-auto-capture > label): Added. (.navigation-bar > .item.canvas-recording-auto-capture > label > input): Added. (.navigation-bar > .item.canvas-recording-auto-capture > label > input::-webkit-inner-spin-button): Added. (.popover-content > .tree-outline .item.recording > .icon): Deleted. (.popover-content > .tree-outline .item.recording:hover): Deleted. (.popover-content > .tree-outline .item.recording:hover > .icon): Deleted. Drive-by: removed unused CSS rules. * UserInterface/Views/CanvasContentView.js: (WI.CanvasContentView.prototype.initialLayout): (WI.CanvasContentView.prototype._updateProgressView): (WI.CanvasContentView.prototype._updateViewRelatedItems): * UserInterface/Views/CanvasTabContentView.js: (WI.CanvasTabContentView.prototype._recordingImportedOrStopped): * UserInterface/Views/CheckboxNavigationItem.js: (WI.CheckboxNavigationItem): (WI.CheckboxNavigationItem.prototype._handleLabelClick): Added. * UserInterface/Base/Setting.js: * Localizations/en.lproj/localizedStrings.js: 2018-10-31 Devin Rousso Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls https://bugs.webkit.org/show_bug.cgi?id=190641 Reviewed by Joseph Pecoraro. * UserInterface/Protocol/DOMObserver.js: (WI.DOMObserver.prototype.videoLowPowerChanged): Added. * UserInterface/Controllers/DOMManager.js: (WI.DOMManager.prototype.videoLowPowerChanged): Added. * UserInterface/Models/DOMNode.js: (WI.DOMNode): (WI.DOMNode.prototype.get lowPowerRanges): Added. (WI.DOMNode.prototype.videoLowPowerChanged): Added. (WI.DOMNode.prototype.canEnterLowPowerMode): Added. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype._populateDomainCell): (WI.NetworkTableContentView.prototype._tryLinkResourceToDOMNode): (WI.NetworkTableContentView.prototype._handleNodeLowPowerChanged): Added. * UserInterface/Views/NetworkTableContentView.css: (.network-table :not(.header) .cell.waterfall .waterfall-container > .area): (.network-table :not(.header) .cell.waterfall .waterfall-container > .area.dom-fullscreen): Added. (.network-table :not(.header) .cell.waterfall .waterfall-container > .area.low-power): Added. (.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-fullscreen): Deleted. * UserInterface/Views/DOMNodeEventsContentView.js: (WI.DOMNodeEventsContentView): (WI.DOMNodeEventsContentView.prototype.initialLayout): (WI.DOMNodeEventsContentView.prototype.closed): Deleted. (WI.DOMNodeEventsContentView.prototype._handleDOMNodeDidFireEvent): Deleted. * UserInterface/Views/DOMEventsBreakdownView.js: (WI.DOMEventsBreakdownView): (WI.DOMEventsBreakdownView.prototype.initialLayout): (WI.DOMEventsBreakdownView.prototype.layout): Added. (WI.DOMEventsBreakdownView.prototype._handleDOMNodeDidFireEvent): Added. (WI.DOMEventsBreakdownView.prototype._handleDOMNodeLowPowerChanged): Added. (WI.DOMEventsBreakdownView.prototype.addEvent): Deleted. (WI.DOMEventsBreakdownView.prototype._populateTable.percentOfTotalTime): Deleted. (WI.DOMEventsBreakdownView.prototype._populateTable): Deleted. * UserInterface/Views/DOMEventsBreakdownView.css: (.dom-events-breakdown .graph > .area): Added. (.dom-events-breakdown .graph > .area.fullscreen): (.dom-events-breakdown .graph > .area.low-power): Added. * Localizations/en.lproj/localizedStrings.js: 2018-10-31 Devin Rousso Web Inspector: Audit: save imported audits across WebInspector sessions https://bugs.webkit.org/show_bug.cgi?id=190858 Reviewed by Brian Burg. * UserInterface/Base/ObjectStore.js: Added. (WI.ObjectStore): (WI.ObjectStore.supported): (WI.ObjectStore._open): (WI.ObjectStore.get _databaseName): (WI.ObjectStore.prototype.associateObject): (WI.ObjectStore.prototype.async getAll): (WI.ObjectStore.prototype.async add): (WI.ObjectStore.prototype.async addObject): (WI.ObjectStore.prototype.async delete): (WI.ObjectStore.prototype.async deleteObject): (WI.ObjectStore.prototype._resolveKeyPath): (WI.ObjectStore.prototype.async _operation.listener): (WI.ObjectStore.prototype.async _operation): Wrapper for a global `IndexedDB` instance for all of WebInspector (per level). Instances of `WI.ObjectStore` are able to control a given `IDBObjectStore` using a promise-based API. *NOTE*: due to the constraint that `IDBObjectStore`s are only able to be created when the owner `IndexedDB` is "upgrade"d, all `WI.ObjectStore` must be declared before the database is opened for the first time. Additionally, any time a new `WI.ObjectStore` is added, the `version` needs to be incremented to ensure that the "upgrade" event fires. To use any of the `*Object` functions, one must implement a `toJSON` on the object provided. This is so that `WI.ObjectStore` is able to add the resulting identifier value to the owner object while storing its `toJSON` value in the IndexedDB (e.g. for objects that have cycles). * UserInterface/Controllers/AuditManager.js: (WI.AuditManager.prototype.import): (WI.AuditManager.prototype.loadStoredTests): Added. (WI.AuditManager.prototype.removeTest): Added. (WI.AuditManager.prototype._addTest): * UserInterface/Views/AuditTabContentView.js: (WI.AuditTabContentView.prototype.initialLayout): Added. Attempt to load stored audits when the Audit tab is first shown (lazy-load). * UserInterface/Views/AuditNavigationSidebarPanel.js: (WI.AuditNavigationSidebarPanel.prototype.initialLayout): (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved): Added. * UserInterface/Views/AuditTreeElement.js: (WI.AuditTreeElement.prototype.ondelete): Only allow top-level audits to be deleted, as that is what matches the `WI.ObjectStore`. * UserInterface/Main.html: * UserInterface/Test.html: 2018-10-31 Joseph Pecoraro Web Inspector: Move a few remaining global WI settings to WI.settings https://bugs.webkit.org/show_bug.cgi?id=191137 Reviewed by Brian Burg. Move and better name some of the WI.settings created in Main.js to WI.settings, alongside other global settings. * UserInterface/Base/Main.js: (WI.loaded): Move settings, and register for settings changes in contentLoaded. * UserInterface/Base/Setting.js: New settings, and sort values. * UserInterface/Test/Test.js: (WI.loaded): Update setting values for tests. * UserInterface/Controllers/NetworkManager.js: (WI.NetworkManager.prototype.initializeTarget): * UserInterface/Controllers/RuntimeManager.js: (WI.RuntimeManager.prototype.initializeTarget): * UserInterface/Models/DOMNode.js: (WI.DOMNode.prototype.get children): (WI.DOMNode.prototype.get nextSibling): (WI.DOMNode.prototype.get previousSibling): (WI.DOMNode.prototype.get childNodeCount): * UserInterface/Protocol/Target.js: (WI.Target.prototype.initialize): * UserInterface/Views/DOMTreeContentView.js: (WI.DOMTreeContentView): (WI.DOMTreeContentView.prototype.closed): (WI.DOMTreeContentView.prototype._togglePaintFlashing): (WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged): (WI.DOMTreeContentView.prototype._showShadowDOMSettingChanged): (WI.DOMTreeContentView.prototype._toggleShowsShadowDOMSetting): * UserInterface/Views/DOMTreeOutline.js: (WI.DOMTreeOutline): (WI.DOMTreeOutline.prototype.close): (WI.DOMTreeOutline.prototype._revealAndSelectNode): * UserInterface/Views/LayerTreeDetailsSidebarPanel.js: (WI.LayerTreeDetailsSidebarPanel.prototype.initialLayout): (WI.LayerTreeDetailsSidebarPanel.prototype._updateDisplayWithLayers): * UserInterface/Views/Layers3DContentView.js: (WI.Layers3DContentView): (WI.Layers3DContentView.prototype.closed): (WI.Layers3DContentView.prototype._showPaintRectsSettingChanged): (WI.Layers3DContentView.prototype._togglePaintFlashing): * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView): (WI.NetworkTableContentView.prototype.closed): (WI.NetworkTableContentView.prototype._resourceCachingDisabledSettingChanged): (WI.NetworkTableContentView.prototype._toggleDisableResourceCache): * UserInterface/Views/ScriptContentView.js: (WI.ScriptContentView): (WI.ScriptContentView.prototype.closed): (WI.ScriptContentView.prototype._contentDidPopulate): (WI.ScriptContentView.prototype._enableControlFlowProfilerSettingChanged): (WI.ScriptContentView.prototype._showJavaScriptTypeInformationSettingChanged): * UserInterface/Views/SourceCodeTextEditor.js: (WI.SourceCodeTextEditor.prototype.shown): (WI.SourceCodeTextEditor.prototype._proceedPopulateWithContent): (WI.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState): (WI.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled): * UserInterface/Views/TextResourceContentView.js: (WI.TextResourceContentView): (WI.TextResourceContentView.prototype.closed): (WI.TextResourceContentView.prototype._contentDidPopulate): (WI.TextResourceContentView.prototype._enableControlFlowProfilerSettingChanged): (WI.TextResourceContentView.prototype._showJavaScriptTypeInformationSettingChanged): Renamed setting. 2018-10-31 Devin Rousso Web Inspector: Styles: missing contextmenu items for links https://bugs.webkit.org/show_bug.cgi?id=191021 Reviewed by Joseph Pecoraro. * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype._renderValue): (WI.SpreadsheetStyleProperty.prototype._handleLinkContextMenu): Added. If the token is subtype of "link", add contextmenu items to the wrapper element. * UserInterface/Views/ContextMenuUtilities.js: (WI.appendContextMenuItemsForURL.showResourceWithOptions): (WI.appendContextMenuItemsForURL): Drive-by: don't assume that `options` will be provided. * Localizations/en.lproj/localizedStrings.js: 2018-10-31 Nikita Vasilyev Web Inspector: Styles: implement copying and deletion of multiple properties https://bugs.webkit.org/show_bug.cgi?id=191037 Reviewed by Brian Burg. This patch should only work with "Enable Selection of Multiple Properties" checked. It shouldn't introduce any changes when this setting is unchecked. Mousedown on a property (1) and moving the mouse cursor to another property (2) should select properties 1, 2, and all properties between them until mouseup is fired. Once selected: - Pressing Command-C should copy the selected properties. - Pressing Delete should remove the properties. * UserInterface/Models/CSSProperty.js: (WI.CSSProperty.prototype.get formattedText): * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css: (.spreadsheet-style-declaration-editor): (.multiple-properties-selection .spreadsheet-style-declaration-editor .property): (.multiple-properties-selection .spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)): (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected): (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected:focus): (@media (prefers-dark-interface)): * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.selectProperties): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.deselectProperties): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyBlur): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseEnter): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseLeave): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._hasSelectedProperties): Property selection is defined as two numbers: anchorIndex and focusIndex. The property with focusIndex is actually focused. The focus outline is replaced by a more subtle left blue border. * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css: (.spreadsheet-css-declaration.selecting,): * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: (WI.SpreadsheetCSSStyleDeclarationSection): (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyBlur): (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyMouseEnter): (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyMouseLeave): (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown): (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowMouseUp): (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty): Implement copying the same way it's done for DataGrid: by adding copyHandler property to the focused element. Add `tabIndex=-1` so the property element can be focused. (WI.SpreadsheetStyleProperty.prototype.get property): (WI.SpreadsheetStyleProperty.prototype.get selected): (WI.SpreadsheetStyleProperty.prototype.set selected): (WI.SpreadsheetStyleProperty.prototype.remove): (WI.SpreadsheetStyleProperty.prototype.updateStatus): (WI.SpreadsheetStyleProperty.prototype.handleCopyEvent): (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidCommit): (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidBlur): (WI.SpreadsheetStyleProperty.prototype._handleNamePaste): 2018-10-31 Devin Rousso Web Inspector: Audit: attempt to re-link DOM nodes for imported results https://bugs.webkit.org/show_bug.cgi?id=191044 Reviewed by Brian Burg. When importing a `WI.AuditTestCaseResult`, attempt to `querySelector` for each item in `data.domNodes`. If a node is found, replace it with that node and show a tree instead. * UserInterface/Models/AuditTestCase.js: (WI.AuditTestCase.async fromPayload): Added. (WI.AuditTestCase.fromPayload): Deleted. * UserInterface/Models/AuditTestGroup.js: (WI.AuditTestGroup.async fromPayload): Added. (WI.AuditTestGroup.fromPayload): Deleted. * UserInterface/Models/AuditTestCaseResult.js: (WI.AuditTestCaseResult.async fromPayload): Added. (WI.AuditTestCaseResult.fromPayload): Deleted. * UserInterface/Models/AuditTestGroupResult.js: (WI.AuditTestGroupResult.async fromPayload): Added. (WI.AuditTestGroupResult.fromPayload): Deleted. * UserInterface/Controllers/AuditManager.js: (WI.AuditManager.prototype.import): 2018-10-31 Joseph Pecoraro Follow-up review comment to r237652. Reviewed by Brian Burg. * UserInterface/Controllers/DebuggerManager.js: (WI.DebuggerManager): 2018-10-31 Joseph Pecoraro Web Inspector: Separate target initialization from frontend initialization https://bugs.webkit.org/show_bug.cgi?id=191052 Reviewed by Brian Burg. * UserInterface/Base/Main.js: (WI.loaded): (WI.performOneTimeFrontendInitializationsUsingTarget): Create the targets after the rest of frontend initialization. This is a step toward a frontend opening and being told about multiple targets instead of knowing in advance a single target it is connected to. All backend messages during frontend initialization now happen with an explicit target. * UserInterface/Controllers/ApplicationCacheManager.js: (WI.ApplicationCacheManager): (WI.ApplicationCacheManager.prototype.initializeTarget): (WI.ApplicationCacheManager.prototype.initialize): * UserInterface/Controllers/CSSManager.js: (WI.CSSManager): (WI.CSSManager.prototype.initializeTarget): * UserInterface/Controllers/CanvasManager.js: (WI.CanvasManager): (WI.CanvasManager.prototype.initializeTarget): * UserInterface/Controllers/ConsoleManager.js: (WI.ConsoleManager): (WI.ConsoleManager.prototype.initializeLogChannels): * UserInterface/Controllers/DOMManager.js: (WI.DOMManager): (WI.DOMManager.prototype.initializeTarget): * UserInterface/Controllers/DOMStorageManager.js: (WI.DOMStorageManager): (WI.DOMStorageManager.prototype.initializeTarget): * UserInterface/Controllers/DatabaseManager.js: (WI.DatabaseManager): (WI.DatabaseManager.prototype.initializeTarget): * UserInterface/Controllers/DebuggerManager.js: (WI.DebuggerManager): (WI.DebuggerManager.prototype.initializeTarget): (WI.DebuggerManager.restoreBreakpointsSoon): Deleted. * UserInterface/Controllers/HeapManager.js: (WI.HeapManager.prototype.initializeTarget): * UserInterface/Controllers/IndexedDBManager.js: (WI.IndexedDBManager): (WI.IndexedDBManager.prototype.initializeTarget): * UserInterface/Controllers/LayerTreeManager.js: (WI.LayerTreeManager.prototype.initializeTarget): * UserInterface/Controllers/MemoryManager.js: (WI.MemoryManager.prototype.initializeTarget): * UserInterface/Controllers/NetworkManager.js: (WI.NetworkManager): (WI.NetworkManager.prototype.initializeTarget): * UserInterface/Controllers/RuntimeManager.js: (WI.RuntimeManager): (WI.RuntimeManager.prototype.initializeTarget): * UserInterface/Controllers/TargetManager.js: (WI.TargetManager): (WI.TargetManager.prototype.initializeTargetsWithMainTarget): * UserInterface/Controllers/TimelineManager.js: (WI.TimelineManager): (WI.TimelineManager.prototype.initializeTarget): (WI.TimelineManager.prototype.set enabledTimelineTypes): (WI.TimelineManager.prototype._updateAutoCaptureInstruments): * UserInterface/Controllers/WorkerManager.js: (WI.WorkerManager): (WI.WorkerManager.prototype.initializeTarget): Move Target initialization out of the constructor into a top level `initializeTarget` function. This will be expected to be called by any target that the frontend connects to. (WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange): Drive-by fix. Update all targets if the setting changes. (WI.WorkerManager.prototype.workerCreated): Call initialize on the new target. * UserInterface/Models/CSSCompletions.js: (WI.CSSCompletions.initializeCSSCompletions): (WI.CSSCompletions.requestCSSCompletions): Deleted. Rename requestCSSCompletions to initializeCSSCompletions to try and standardize on "initialize" being used for most frontend one time initialization tasks. This being one such operation that only needs to be performed once on a target that supports it. * UserInterface/Protocol/Target.js: (WI.Target): (WI.Target.prototype.initialize): Perform explicit target initialization, such as initializing the state of all backend domains / agents. This is done by asking each of the managers to do initialization work for this target. (WI.Target.prototype.get ApplicationCacheAgent): (WI.Target.prototype.get CSSAgent): (WI.Target.prototype.get CanvasAgent): (WI.Target.prototype.get ConsoleAgent): (WI.Target.prototype.get DOMAgent): (WI.Target.prototype.get DOMDebuggerAgent): (WI.Target.prototype.get DOMStorageAgent): (WI.Target.prototype.get DatabaseAgent): (WI.Target.prototype.get DebuggerAgent): (WI.Target.prototype.get HeapAgent): (WI.Target.prototype.get IndexedDBAgent): (WI.Target.prototype.get InspectorAgent): (WI.Target.prototype.get LayerTreeAgent): (WI.Target.prototype.get MemoryAgent): (WI.Target.prototype.get NetworkAgent): (WI.Target.prototype.get PageAgent): (WI.Target.prototype.get RecordingAgent): (WI.Target.prototype.get RuntimeAgent): (WI.Target.prototype.get ScriptProfilerAgent): (WI.Target.prototype.get ServiceWorkerAgent): (WI.Target.prototype.get TargetAgent): (WI.Target.prototype.get TimelineAgent): (WI.Target.prototype.get WorkerAgent): Accessors for all of the agents on a Target. * UserInterface/Protocol/WorkerTarget.js: (WI.WorkerTarget): This is now automatically done in the base class. * UserInterface/Test/Test.js: (WI.loaded): (WI.performOneTimeFrontendInitializationsUsingTarget): New necessary top level hooks, and initialize more like Main.js. 2018-10-31 Devin Rousso Web Inspector: Audit: show metadata for results https://bugs.webkit.org/show_bug.cgi?id=190853 Reviewed by Brian Burg. * UserInterface/Models/AuditTestCase.js: (WI.AuditTestCase.prototype.async run): Capture timestamps around the `RunetimeAgent.evaluate` call, as well as the URL of the page. * UserInterface/Models/AuditTestCaseResult.js: (WI.AuditTestCaseResult): (WI.AuditTestCaseResult.fromPayload): (WI.AuditTestCaseResult.prototype.get metadata): Added. (WI.AuditTestCaseResult.prototype.toJSON): * UserInterface/Views/AuditTestCaseContentView.js: (WI.AuditTestCaseContentView.prototype.initialLayout): (WI.AuditTestCaseContentView.prototype.layout): * UserInterface/Views/AuditTestCaseContentView.css: (.content-view.audit-test-case > header h1): Added. (.content-view.audit-test-case > header h1 > img): Added. (.content-view.audit-test-case > header > .metadata): Added. (.content-view.audit-test-case > header > .metadata > .source > time): Added. (.content-view.audit-test-case > header > .metadata > .source > a): Added. (.content-view.audit-test-case > header > .metadata > .duration): Added. (.content-view.audit-test-case > header > h1): Deleted. (.content-view.audit-test-case > header > h1 > img): Deleted. Display any metadata information where the `WI.ScopeBar` is for `WI.AuditTestGroupContentView`s. * UserInterface/Views/AuditTestContentView.css: (.content-view.audit-test > header): (.content-view.audit-test > header > .information): Added. * UserInterface/Views/AuditTestGroupContentView.css: (.content-view.audit-test-group > header): (.content-view.audit-test-group > header > .percentage-pass): (.content-view.audit-test-group > header > .information): Deleted. Move common CSS rules to common parent class. * UserInterface/Base/Utilities.js: 2018-10-30 Devin Rousso Web Inspector: Audit: create Audit Tab https://bugs.webkit.org/show_bug.cgi?id=190754 Reviewed by Matt Baker. Create an Audit tab for running audits on the inspected page. Leverage `Runtime.evaluate` for running the audit tests (arbitrary JavaScript), and use the returned value to generate a preview UI of the results. All tests/results can be exported/imported to formatted JSON: `AuditTestCase` JSON: { "type": "test-case", "name": , "description": , "test": , } `AuditTestGroup` JSON: { "type": "test-group", "name": , "description": , "tests": [...], } `AuditTestCaseResult` JSON: { "type": "test-case-result", "name": , "description": , "level": <"pass", "warn", "fail", "error", "unsupported">, "data": { "domNodes": [...], "domAttributes": [...], "errors": [...], }, } `AuditTestGroupResult` JSON: { "type": "test-group-result", "name": , "description": , "results": [...], } More keys may be added in the future (especially for `AuditTestCaseResult.data`). * UserInterface/Controllers/AuditManager.js: (WI.AuditManager): (WI.AuditManager.synthesizeError): Added. (WI.AuditManager.prototype.get tests): Added. (WI.AuditManager.prototype.get results): Added. (WI.AuditManager.prototype.get runningState): Added. (WI.AuditManager.prototype.start): Added. (WI.AuditManager.prototype.stop): Added. (WI.AuditManager.prototype.import): Added. (WI.AuditManager.prototype.export): Added. (WI.AuditManager.prototype._addTest): Added. (WI.AuditManager.prototype._addResult): Added. (WI.AuditManager.prototype.get testSuites): Deleted. (WI.AuditManager.prototype.get reports): Deleted. (WI.AuditManager.prototype.async runAuditTestByRepresentedObject): Deleted. (WI.AuditManager.prototype.reportForId): Deleted. (WI.AuditManager.prototype.removeAllReports): Deleted. (WI.AuditManager.prototype.async _runTestCase): Deleted. * UserInterface/Models/AuditTestBase.js: Added. (WI.AuditTestBases): (WI.AuditTestBases.prototype.get name): (WI.AuditTestBases.prototype.get description): (WI.AuditTestBases.prototype.get runningState): (WI.AuditTestBases.prototype.get result): (WI.AuditTestBases.prototype.async start): (WI.AuditTestBases.prototype.stop): (WI.AuditTestBases.prototype.clearResult): (WI.AuditTestBases.prototype.saveIdentityToCookie): (WI.AuditTestBases.prototype.toJSON): (WI.AuditTestBases.prototype.async run): * UserInterface/Models/AuditTestCase.js: (WI.AuditTestCase): (WI.AuditTestCase.fromPayload): Added. (WI.AuditTestCase.prototype.toJSON): Added. (WI.AuditTestCase.prototype.async run): Added. (WI.AuditTestCase.prototype.async run.setLevel): Added. (WI.AuditTestCase.prototype.async run.addError): Added. (WI.AuditTestCase.prototype.async run.checkResultProperty.addErrorForValueType): Added. (WI.AuditTestCase.prototype.async run.checkResultProperty): Added. (WI.AuditTestCase.prototype.async run.async resultArrayForEach): Added. (WI.AuditTestCase.prototype.get id): Deleted. (WI.AuditTestCase.prototype.get name): Deleted. (WI.AuditTestCase.prototype.get suite): Deleted. (WI.AuditTestCase.prototype.get setup): Deleted. (WI.AuditTestCase.prototype.get tearDown): Deleted. (WI.AuditTestCase.prototype.get errorDetails): Deleted. * UserInterface/Models/AuditTestGroup.js: Added. (WI.AuditTestGroup): (WI.AuditTestGroup.fromPayload): (WI.AuditTestGroup.prototype.get tests): (WI.AuditTestGroup.prototype.stop): (WI.AuditTestGroup.prototype.clearResult): (WI.AuditTestGroup.prototype.async run): (WI.AuditTestGroup.prototype.toJSON): (WI.AuditTestGroup.prototype._updateResult): (WI.AuditTestGroup.prototype._handleTestCompleted): (WI.AuditTestGroup.prototype._handleTestProgress): * UserInterface/Models/AuditTestResultBase.js: Added. (WI.AuditTestResultBase): (WI.AuditTestResultBase.prototype.get name): (WI.AuditTestResultBase.prototype.get description): (WI.AuditTestResultBase.prototype.get result): (WI.AuditTestResultBase.prototype.get didPass): (WI.AuditTestResultBase.prototype.get didWarn): (WI.AuditTestResultBase.prototype.get didFail): (WI.AuditTestResultBase.prototype.get didError): (WI.AuditTestResultBase.prototype.get unsupported): (WI.AuditTestResultBase.prototype.saveIdentityToCookie): (WI.AuditTestResultBase.prototype.toJSON): * UserInterface/Models/AuditTestCaseResult.js: Added. (WI.AuditTestCaseResult): (WI.AuditTestCaseResult.fromPayload.checkArray): (WI.AuditTestCaseResult.fromPayload): (WI.AuditTestCaseResult.prototype.get level): (WI.AuditTestCaseResult.prototype.get data): (WI.AuditTestCaseResult.prototype.get didPass): (WI.AuditTestCaseResult.prototype.get didWarn): (WI.AuditTestCaseResult.prototype.get didFail): (WI.AuditTestCaseResult.prototype.get didError): (WI.AuditTestCaseResult.prototype.get unsupported): (WI.AuditTestCaseResult.prototype.toJSON): * UserInterface/Models/AuditTestGroupResult.js: Added. (WI.AuditTestGroupResult): (WI.AuditTestGroupResult.fromPayload): (WI.AuditTestGroupResult.prototype.get results): (WI.AuditTestGroupResult.prototype.get levelCounts): (WI.AuditTestGroupResult.prototype.get didPass): (WI.AuditTestGroupResult.prototype.get didWarn): (WI.AuditTestGroupResult.prototype.get didFail): (WI.AuditTestGroupResult.prototype.get didError): (WI.AuditTestGroupResult.prototype.get unsupported): (WI.AuditTestGroupResult.prototype.toJSON): * UserInterface/Views/AuditTabContentView.js: Added. (WI.AuditTabContentView): (WI.AuditTabContentView.tabInfo): (WI.AuditTabContentView.isTabAllowed): (WI.AuditTabContentView.prototype.get type): (WI.AuditTabContentView.prototype.get supportsSplitContentBrowser): (WI.AuditTabContentView.prototype.canShowRepresentedObject): (WI.AuditTabContentView.prototype.shown): (WI.AuditTabContentView.prototype.hidden): (WI.AuditTabContentView.prototype._handleSpace): * UserInterface/Views/AuditNavigationSidebarPanel.js: Added. (WI.AuditNavigationSidebarPanel): (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView): (WI.AuditNavigationSidebarPanel.prototype.initialLayout): (WI.AuditNavigationSidebarPanel.prototype.closed): (WI.AuditNavigationSidebarPanel.prototype._addTest): (WI.AuditNavigationSidebarPanel.prototype._addResult): (WI.AuditNavigationSidebarPanel.prototype._updateStartStopButtonNavigationItemState): (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestAdded): (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestCompleted): (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestScheduled): (WI.AuditNavigationSidebarPanel.prototype._treeSelectionDidChange): (WI.AuditNavigationSidebarPanel.prototype._handleStartStopButtonNavigationItemClicked): (WI.AuditNavigationSidebarPanel.prototype._handleImportButtonNavigationItemClicked): * UserInterface/Views/AuditNavigationSidebarPanel.css: Added. (.sidebar > .panel.navigation.audit > .content): * UserInterface/Views/AuditTreeElement.js: Added. (WI.AuditTreeElement): (WI.AuditTreeElement.prototype.get result): (WI.AuditTreeElement.prototype.onattach): (WI.AuditTreeElement.prototype.ondetach): (WI.AuditTreeElement.prototype.onpopulate): (WI.AuditTreeElement.prototype.populateContextMenu): (WI.AuditTreeElement.prototype._start): (WI.AuditTreeElement.prototype._updateLevel): (WI.AuditTreeElement.prototype._showRunningSpinner): (WI.AuditTreeElement.prototype._showRunningProgress): (WI.AuditTreeElement.prototype._handleTestCaseCompleted): (WI.AuditTreeElement.prototype._handleTestResultCleared): (WI.AuditTreeElement.prototype._handleTestCaseScheduled): (WI.AuditTreeElement.prototype._handleTestGroupCompleted): (WI.AuditTreeElement.prototype._handleTestGroupProgress): (WI.AuditTreeElement.prototype._handleTestGroupScheduled): (WI.AuditTreeElement.prototype._handleStatusClick): * UserInterface/Views/AuditTreeElement.css: Added. (.tree-outline .item.audit > .status): (.tree-outline .item.audit > .status > img): (.tree-outline .item.audit:matches(.test-case, .test-group) > .status:hover > img): (.tree-outline .item.audit > .status:not(:hover) > img.show-on-hover, .tree-outline .item.audit.test-group.expanded > .status:not(:hover)): (.tree-outline .item.audit.test-group.expanded > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status): (.tree-outline .item.audit > .status > img.pass): (.tree-outline .item.audit > .status > img.warn): (.tree-outline .item.audit > .status > img.fail): (.tree-outline .item.audit > .status > img.error): (.tree-outline .item.audit > .status > img.unsupported): (.audit.test-case .icon): (.audit.test-group .icon): (.audit.test-case-result .icon): (.audit.test-group-result .icon): * UserInterface/Views/AuditTestContentView.js: Added. (WI.AuditTestContentView): (WI.AuditTestContentView.prototype.get navigationItems): (WI.AuditTestContentView.prototype.get headerView): (WI.AuditTestContentView.prototype.get contentView): (WI.AuditTestContentView.prototype.get supportsSave): (WI.AuditTestContentView.prototype.get saveData): (WI.AuditTestContentView.prototype.initialLayout): (WI.AuditTestContentView.prototype.layout): (WI.AuditTestContentView.prototype.shown): (WI.AuditTestContentView.prototype.hidden): (WI.AuditTestContentView.prototype.get placeholderElement): (WI.AuditTestContentView.prototype.set placeholderElement): (WI.AuditTestContentView.prototype.showRunningPlaceholder): (WI.AuditTestContentView.prototype.showStoppingPlaceholder): (WI.AuditTestContentView.prototype.showNoResultPlaceholder): (WI.AuditTestContentView.prototype.showNoResultDataPlaceholder): (WI.AuditTestContentView.prototype.showFilteredPlaceholder): (WI.AuditTestContentView.prototype.hidePlaceholder): (WI.AuditTestContentView.prototype.applyFilter): (WI.AuditTestContentView.prototype.resetFilter): (WI.AuditTestContentView.prototype._exportAudit): (WI.AuditTestContentView.prototype._updateExportButtonNavigationItemState): (WI.AuditTestContentView.prototype._showPlaceholder): (WI.AuditTestContentView.prototype._handleExportButtonNavigationItemClicked): (WI.AuditTestContentView.prototype._handleTestChanged): * UserInterface/Views/AuditTestContentView.css: Added. (.content-view-container > .content-view.audit-test): (.content-view-container > .content-view.audit-test > header): (.content-view-container > .content-view.audit-test > header h1): (.content-view-container > .content-view.audit-test > header p): (.content-view.audit-test): (.content-view.audit-test h1): (.content-view.audit-test > header): (.content-view.audit-test > header p): (.content-view.audit-test .audit-test.filtered, .content-view.audit-test .audit-test .message-text-view): (.content-view.audit-test > section): (.content-view.audit-test > section > .message-text-view): (.content-view.audit-test.showing-placeholder): (.content-view.audit-test.showing-placeholder > section): (.content-view.audit-test.showing-placeholder > section > :not(.message-text-view)): (@media (prefers-dark-interface) .content-view.audit-test): * UserInterface/Views/AuditTestCaseContentView.js: Added. (WI.AuditTestCaseContentView): (WI.AuditTestCaseContentView.prototype.initialLayout): (WI.AuditTestCaseContentView.prototype.layout): (WI.AuditTestCaseContentView.prototype.showRunningPlaceholder): * UserInterface/Views/AuditTestCaseContentView.css: Added. (.content-view-container > .content-view.audit-test-case > header): (.content-view-container > .content-view.audit-test-case > section > :not(.message-text-view):first-child): (.content-view.audit-test-case > header > h1): (.content-view.audit-test-case > header > h1 > img): (.content-view.audit-test-case > section > :not(.message-text-view)): (.content-view.audit-test-case > section > :not(.message-text-view):last-child): (.content-view.audit-test-case > section > :not(.message-text-view) + :not(.message-text-view)): (.content-view.audit-test-case > section h1): (.content-view.audit-test-case > section table): (.content-view.audit-test-case > section table > tr + tr > td): (.content-view.audit-test-case > section table > tr > td > :not(.tree-outline)): (.content-view.audit-test-case > section table > tr > td:first-child): (.content-view.audit-test-case > section > .dom-nodes > table > tr > td:first-child): (.content-view.audit-test-case > section code): (.content-view.audit-test-case > section mark): * UserInterface/Views/AuditTestGroupContentView.js: Added. (WI.AuditTestGroupContentView): (WI.AuditTestGroupContentView.prototype.initialLayout): (WI.AuditTestGroupContentView.prototype.layout): (WI.AuditTestGroupContentView.prototype.shown): (WI.AuditTestGroupContentView.prototype.hidden): (WI.AuditTestGroupContentView.prototype.applyFilter): (WI.AuditTestGroupContentView.prototype.resetFilter): (WI.AuditTestGroupContentView.prototype.showRunningPlaceholder): (WI.AuditTestGroupContentView.prototype._subobjects): (WI.AuditTestGroupContentView.prototype._updateLevelScopeBar): (WI.AuditTestGroupContentView.prototype._handleTestGroupCompleted): (WI.AuditTestGroupContentView.prototype._handleTestGroupProgress): (WI.AuditTestGroupContentView.prototype._handleTestGroupScheduled): (WI.AuditTestGroupContentView.prototype._handleLevelScopeBarSelectionChanged): * UserInterface/Views/AuditTestGroupContentView.css: Added. (.content-view-container > .content-view.audit-test-group > header): (.content-view.audit-test-group > header): (.content-view.audit-test-group.no-matches + .audit-test-group > header): (.content-view.audit-test-group > header, .content-view.audit-test-group:not(.filtered):last-child > header): (.content-view.audit-test-group.contains-test-case > header): (.content-view.audit-test-group.contains-test-case + .audit-test-group.contains-test-case): (.content-view.audit-test-group.contains-test-case:not(.contains-test-group) > section, .content-view.audit-test-group.contains-test-case.contains-test-group > section > .audit-test-case): (.content-view.audit-test-group > header > .information): (.content-view.audit-test-group > header > .information > p): (.content-view.audit-test-group > header > nav): (.content-view.audit-test-group > header > nav:empty): (.content-view.audit-test-group > header > nav:not(:empty):before): (.content-view.audit-test-group > header > nav > .scope-bar > li): (.content-view.audit-test-group > header > nav > .scope-bar > li:not(:hover, .selected)): (.content-view.audit-test-group > header > nav > .scope-bar > li:last-child): (.content-view.audit-test-group > header > nav > .scope-bar > li::before): (.content-view.audit-test-group > header > nav > .scope-bar > li.pass::before): (.content-view.audit-test-group > header > nav > .scope-bar > li.warn::before): (.content-view.audit-test-group > header > nav > .scope-bar > li.fail::before): (.content-view.audit-test-group > header > nav > .scope-bar > li.error::before): (.content-view.audit-test-group > header > nav > .scope-bar > li.unsupported::before): (.content-view.audit-test-group > header > .percentage-pass): (.content-view.audit-test-group > header > .percentage-pass:not(:empty)::after): (.content-view.audit-test-group > section > .audit-test-case:first-child, .content-view.audit-test-group > section > .audit-test-group + .audit-test-case, .content-view.audit-test-group > section > .audit-test-case + .audit-test-group): (.content-view.audit-test-group > section > .audit-test-case:last-child): * UserInterface/Views/ScopeBarItem.js: (WI.ScopeBarItem): (WI.ScopeBarItem.prototype.set selected): * UserInterface/Views/MultipleScopeBarItem.js: (WI.MultipleScopeBarItem.prototype.set selectedScopeBarItem): Add an `independent` option that prevents selection changes from deselecting other `WI.ScopeBarItem`s in the same `WI.ScopeBar` (`exclusive` takes precedence). * UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement): (WI.DOMTreeElement.prototype.highlightAttribute): (WI.DOMTreeElement.prototype._buildAttributeDOM): * UserInterface/Views/DOMTreeOutline.css: (.tree-outline.dom li .highlight): * UserInterface/Views/ToggleButtonNavigationItem.js: (WI.ToggleButtonNavigationItem.prototype.set toggled): Also change the `label` if the `ButtonStyle` has text. * UserInterface/Base/Setting.js: * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): * UserInterface/Views/DividerNavigationItem.css: (.navigation-bar .item.divider): * UserInterface/Base/Utilities.js: (Promise.chain): Added. * UserInterface/Views/ContentView.js: (WI.ContentView.createFromRepresentedObject): (WI.ContentView.isViewable): * UserInterface/Main.html: * UserInterface/Base/Main.js: (WI.loaded): (WI.contentLoaded): * UserInterface/Test.html: * UserInterface/Base/Test.js: (WI.loaded): * UserInterface/Images/Audit.svg: Added. * UserInterface/Images/AuditStart.svg: Added. * UserInterface/Images/AuditStop.svg: Added. * UserInterface/Images/AuditTestCase.svg: Added. * UserInterface/Images/AuditTestCaseResult.svg: Added. * UserInterface/Images/AuditTestError.svg: Added. * UserInterface/Images/AuditTestFail.svg: Added. * UserInterface/Images/AuditTestGroup.svg: Added. * UserInterface/Images/AuditTestGroupResult.svg: Added. * UserInterface/Images/AuditTestNoResult.svg: Added. * UserInterface/Images/AuditTestPass.svg: Added. * UserInterface/Images/AuditTestUnsupported.svg: Added. * UserInterface/Images/AuditTestWarn.svg: Added. * Localizations/en.lproj/localizedStrings.js: 2018-10-30 Devin Rousso Web Inspector: provide options to WI.cssPath for more verbosity https://bugs.webkit.org/show_bug.cgi?id=190987 Reviewed by Brian Burg. * UserInterface/Base/DOMUtilities.js: (WI.cssPath): (WI.cssPathComponent): When the option `full` is true, print every attribute along with every node in the hierarchy until the root is reached. This partially duplicates the effect of an XPath, but instead uses CSS selectors, making it much more human readable and recognizable. 2018-10-30 Devin Rousso Web Inspector: change WI.ColorWheel to use conic-gradient() https://bugs.webkit.org/show_bug.cgi?id=189485 Reviewed by Brian Burg. Use the ("new") HSL `WI.ColorPicker` if `conic-gradient` is supported. Otherwise, use the ("old") RGB `WI.LegacyColorPicker`. * UserInterface/Views/ColorWheel.js: (WI.ColorWheel): (WI.ColorWheel.prototype.set dimension): (WI.ColorWheel.prototype.set brightness): (WI.ColorWheel.prototype.get tintedColor): (WI.ColorWheel.prototype.set tintedColor): (WI.ColorWheel.prototype.get rawColor): (WI.ColorWheel.prototype.get _hue): Added. (WI.ColorWheel.prototype.get _saturation): Added. (WI.ColorWheel.prototype._updateColorForMouseEvent): (WI.ColorWheel.prototype._setCrosshairPosition): (WI.ColorWheel.prototype._updateGradient): Added. (WI.ColorWheel.prototype._pointInCircleForEvent.distance): Deleted. (WI.ColorWheel.prototype._pointInCircleForEvent.angleFromCenterToPoint): Deleted. (WI.ColorWheel.prototype._pointInCircleForEvent.pointOnCircumference): Deleted. (WI.ColorWheel.prototype._pointInCircleForEvent): Deleted. (WI.ColorWheel.prototype._tintedColorToPointAndBrightness): Deleted. (WI.ColorWheel.prototype._drawRawCanvas): Deleted. (WI.ColorWheel.prototype._colorAtPointWithBrightness): Deleted. (WI.ColorWheel.prototype._drawTintedCanvas): Deleted. (WI.ColorWheel.prototype._draw): Deleted. * UserInterface/Views/ColorWheel.css: (.color-wheel > .gradient): Added. (.color-wheel > .crosshair): Added. * UserInterface/Views/LegacyColorWheel.js: Copied from Source/WebInspectorUI/UserInterface/Views/ColorWheel.js. * UserInterface/Views/ColorPicker.js: (WI.ColorPicker): (WI.ColorPicker.supportsConicGradient): Added. (WI.ColorPicker.prototype._updateSliders): * UserInterface/Models/Geometry.js: (WI.Point.prototype.distance): * UserInterface/Main.html: 2018-10-30 Devin Rousso Web Inspector: make the layers sidebar in the Elements tab always visible https://bugs.webkit.org/show_bug.cgi?id=190158 Reviewed by Brian Burg. * UserInterface/Views/ElementsTabContentView.js: (WI.ElementsTabContentView): * UserInterface/Views/SearchTabContentView.js: (WI.SearchTabContentView): 2018-10-30 Devin Rousso Web Inspector: refactor WI.ScopeBarItem for better extensibility https://bugs.webkit.org/show_bug.cgi?id=190986 Reviewed by Brian Burg. Renames `withModifier` to `extendSelection` for clarity of usage, and to allow the changes in (adding an option to allow `WI.ScopeBarItem`s to be selected without deselcting any other `WI.ScopeBarItem`s) to use the same variable. * UserInterface/Views/ScopeBarItem.js: (WI.ScopeBarItem): (WI.ScopeBarItem.prototype.set selected): (WI.ScopeBarItem.prototype._handleMouseDown): (WI.ScopeBarItem.prototype.setSelected): Deleted. * UserInterface/Views/ScopeBar.js: (WI.ScopeBar): (WI.ScopeBar.prototype._populate): (WI.ScopeBar.prototype._itemSelectionDidChange): * UserInterface/Views/MultipleScopeBarItem.js: (WI.MultipleScopeBarItem.prototype.set selectedScopeBarItem): * UserInterface/Views/CanvasSidebarPanel.js: (WI.CanvasSidebarPanel.prototype._updateRecordingScopeBar): * UserInterface/Views/LogContentView.js: (WI.LogContentView): * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView): * UserInterface/Views/ResourceSidebarPanel.js: (WI.ResourceSidebarPanel): * UserInterface/Views/StorageSidebarPanel.js: (WI.StorageSidebarPanel): 2018-10-29 Nikita Vasilyev Web Inspector: Flash views with red outline on initial layout https://bugs.webkit.org/show_bug.cgi?id=191048 Reviewed by Devin Rousso. * UserInterface/Views/View.js: (WI.View.prototype._layoutSubtree): (WI.View.prototype._drawLayoutFlashingOutline): 2018-10-29 Devin Rousso Web Inspector: Canvas: show warning when path moves offscreen https://bugs.webkit.org/show_bug.cgi?id=191016 Reviewed by Joseph Pecoraro. * UserInterface/Models/RecordingAction.js: (WI.RecordingAction): (WI.RecordingAction.deriveCurrentState): (WI.RecordingAction.prototype.get isVisual): (WI.RecordingAction.prototype.get warning): Added. (WI.RecordingAction.prototype.process.checkInvalidCurrentAxisPoint): Added. (WI.RecordingAction.prototype.process): (WI.RecordingAction.prototype.get hasVisibleEffect): Deleted. Replace `hasVisibleEffect` with a more general `warning` value, so that it can be used for more types of warnings. * UserInterface/Views/RecordingActionTreeElement.js: (WI.RecordingActionTreeElement.prototype.onattach): * UserInterface/Views/RecordingActionTreeElement.css: (.item.action.visual.warning:not(.invalid) > .status > .warning): Added. (.item.action.visual.no-visible-effect:not(.invalid) > .status > .warning): Deleted. * Localizations/en.lproj/localizedStrings.js: 2018-10-29 Devin Rousso Web Inspector: refactor code for getting properties via WI.RemoteObject https://bugs.webkit.org/show_bug.cgi?id=190989 Reviewed by Matt Baker. * UserInterface/Protocol/RemoteObject.js: (WI.RemoteObject.prototype.getPropertyDescriptors): Added. (WI.RemoteObject.prototype.getPropertyDescriptorsAsObject): Added. (WI.RemoteObject.prototype.getOwnPropertyDescriptors): Deleted. (WI.RemoteObject.prototype.getAllPropertyDescriptors): Deleted. (WI.RemoteObject.prototype._getPropertyDescriptors): Deleted. (WI.RemoteObject.prototype.getOwnPropertyDescriptorsAsObject): Deleted. * UserInterface/Views/ErrorObjectView.js: (WI.ErrorObjectView.prototype.update): * UserInterface/Views/ObjectTreePropertyTreeElement.js: (WI.ObjectTreePropertyTreeElement.prototype._updateChildren): * UserInterface/Views/ObjectTreeView.js: (WI.ObjectTreeView.prototype.update): 2018-10-29 Tim Horton Modernize WebKit nibs and lprojs for localization's sake https://bugs.webkit.org/show_bug.cgi?id=190911 Reviewed by Dan Bernstein. * WebInspectorUI.xcodeproj/project.pbxproj: English->en 2018-10-29 Devin Rousso Web Inspector: prevent Canvas tab from listening for "space" when not visibile https://bugs.webkit.org/show_bug.cgi?id=190988 Reviewed by Joseph Pecoraro. * UserInterface/Views/CanvasTabContentView.js: (WI.CanvasTabContentView): (WI.CanvasTabContentView.prototype.shown): (WI.CanvasTabContentView.prototype.hidden): Added. 2018-10-27 Matt Baker Web Inspector: Table should support deleting rows https://bugs.webkit.org/show_bug.cgi?id=189803 Reviewed by Devin Rousso. Add methods for removing rows from a Table without reloading the data source. This patch adds Table.prototype.removeRow for removing a single row, and Table.prototype.removeSelectedRows for removing the entire selection. The latter also attempts to select a new row, if possible, before removing the selection. * UserInterface/Base/IndexSet.js: (WI.IndexSet.prototype.copy): * UserInterface/Views/Table.js: (WI.Table): (WI.Table.prototype.get numberOfRows): Cache the number of rows in the table data source. Invalidate cached value whenever table data is reloaded. Removing rows immediately updates cached value, without incurring a potentially expensive reload. (WI.Table.prototype.reloadData): (WI.Table.prototype.selectRow): (WI.Table.prototype.deselectRow): (WI.Table.prototype.removeRow): (WI.Table.prototype.removeSelectedRows): Remove the selected rows and select a new row, if possible. (WI.Table.prototype._updateVisibleRows): (WI.Table.prototype._handleKeyDown): (WI.Table.prototype._deselectAllAndSelect): Drive-by fix: should work when `rowToSelect` isn't already selected. (WI.Table.prototype._removeRows): Remove rows and adjust the indexes of rows that are shifted up as a result of preceding rows being removed. 2018-10-26 Devin Rousso Web Inspector: simplify some editing code checks https://bugs.webkit.org/show_bug.cgi?id=190970 Reviewed by Joseph Pecoraro. * UserInterface/Base/Main.js: (WI._focusChanged): * UserInterface/Base/Utilities.js: * UserInterface/Views/EditingSupport.js: (WI.enclosingCodeMirror): Added. (WI.isBeingEdited): (WI.isEventTargetAnEditableField): * UserInterface/Views/QuickConsole.js: (WI.QuickConsole): 2018-10-26 Devin Rousso Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'this._classListContainer.children') https://bugs.webkit.org/show_bug.cgi?id=190966 Reviewed by Joseph Pecoraro. * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js: (WI.GeneralStyleDetailsSidebarPanel.prototype.layout): (WI.GeneralStyleDetailsSidebarPanel.prototype._classToggleButtonClicked): (WI.GeneralStyleDetailsSidebarPanel.prototype._populateClassToggles): Don't try to reload the class toggles if the we haven't `layout` yet, as the element won't yet exist. 2018-10-25 Devin Rousso Web Inspector: Canvas Recording loading goes significantly slower when "Frame" tree element is expanded https://bugs.webkit.org/show_bug.cgi?id=190497 Reviewed by Joseph Pecoraro. Save the `WI.TreeElement` that are in the DOM, and compare that with any `WI.TreeElement` that would be added to the DOM. If all of the following are true, don't edit the DOM: - no focused `WI.TreeElement` that isn't currently visible (we would scroll otherwise) - the set of previously visible `WI.TreeElement`s (e.g. not used for scroll padding) has at least one of the `WI.TreeElement`s that would be added from this update - this means that the user hasn't scrolled beyond the padding `WI.TreeElement` - there are no `WI.TreeElement`s that would be added from this update that were NOT added in a previous update - this covers the case that a `WI.TreeElement` is inserted in the visible area * UserInterface/Base/Utilities.js: * UserInterface/Views/TreeOutline.js: (WI.TreeOutline): (WI.TreeOutline.prototype.registerScrollVirtualizer): (WI.TreeOutline.prototype.updateVirtualizedElements.walk): (WI.TreeOutline.prototype.updateVirtualizedElements): 2018-10-25 Joseph Pecoraro JSContext Inspector: Broken frontend, DOMAgent is used but does not exist https://bugs.webkit.org/show_bug.cgi?id=190922 Reviewed by Devin Rousso. * UserInterface/Controllers/DOMManager.js: (WI.DOMManager.prototype.requestDocument): Feature check for agents that may not exist in a JSContext. 2018-10-25 Devin Rousso Web Inspector: add corner rounding to the network timing "blocks" https://bugs.webkit.org/show_bug.cgi?id=190379 Reviewed by Timothy Hatcher. * UserInterface/Views/NetworkTableContentView.css: (.waterfall .block): (body[dir=ltr] .waterfall .block): Added. (body[dir=rtl] .waterfall .block): Added. (.network-table .waterfall .block + .block): Added. (.network-table .waterfall .block.filler + .block, .network-table .waterfall .block:not(.request, .response) + :matches(.request, .response)): Added. (.network-table .waterfall .block:last-child): Added. 2018-10-25 Devin Rousso Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls https://bugs.webkit.org/show_bug.cgi?id=189874 Reviewed by Joseph Pecoraro. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Protocol/DOMObserver.js: (WI.DOMObserver.prototype.didFireEvent): * UserInterface/Controllers/DOMManager.js: (WI.DOMManager.prototype.didFireEvent): Allow `data` to be passed to the frontend with `didFireEvent`. * UserInterface/Models/DOMNode.js: (WI.DOMNode): (WI.DOMNode.getFullscreenDOMEvents): Added. (WI.DOMNode.prototype.didFireEvent): (WI.DOMNode.prototype._handleDOMNodeDidFireEvent): Added. (WI.DOMNode.prototype._addDOMEvent): (WI.DOMNode.prototype._shouldListenForEventListeners): Added. If an event is fired on an ancestor of this node, also record that event in this node's `domEvents`, including the `originator` node. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype._populateWaterfallGraph): * UserInterface/Views/NetworkTableContentView.css: (.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-fullscreen): Added. * UserInterface/Views/DOMEventsBreakdownView.js: (WI.DOMEventsBreakdownView.prototype.initialLayout): (WI.DOMEventsBreakdownView.prototype._populateTable): * UserInterface/Views/DOMEventsBreakdownView.css: (.dom-events-breakdown .graph > .area.fullscreen): Added. (.dom-events-breakdown .inherited > .name, .dom-events-breakdown .inherited > .graph > .point): Added. (.dom-events-breakdown:not(.has-inherited) .originator): Added. 2018-10-25 Devin Rousso Web Inspector: Network: more aggressively snap timing blocks together https://bugs.webkit.org/show_bug.cgi?id=190439 Reviewed by Timothy Hatcher. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype._populateWaterfallGraph.appendBlock): (WI.NetworkTableContentView.prototype._populateWaterfallGraph): If the time difference between the end of the previous block and the start of this block would result in less than 2px of space, extend the next block back to the previous block. 2018-10-24 Devin Rousso Web Inspector: popovers for function source code are malformed https://bugs.webkit.org/show_bug.cgi?id=190859 Reviewed by Joseph Pecoraro. Previously, the `WI.Popover` would be drawn twice: once when the `WI.CodeMirrorTokenTrackingController` determines that the user has hovered on a function token, and once again when the source for that function is formatted (after being retrieved). In the case that the formatter is able to return the prettified source within a frame (or two), the `WI.Popover` is still in the middle of animating to its new size, meaning that the changes made by the formatted `update` will be overridden on the next rAF (creates a flash). * UserInterface/Views/Popover.js: (WI.Popover.prototype): (WI.Popover.prototype._animateFrame.drawBackground): (WI.Popover.prototype._drawBackground): Add a member variable to make sure that there is only ever one rAF firing at a time. Drive-by: rework the background code to only use one canvas. * UserInterface/Views/SourceCodeTextEditor.js: (WI.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails): Don't show the `WI.Popover` until the formatter has finished prettifying the function's source code, as otherwise there is brief moment that the popover appears and is empty. 2018-10-24 Devin Rousso Web Inspector: REGRESSION (r237232): changing resources via up/down blurs the TreeOutline in Resources https://bugs.webkit.org/show_bug.cgi?id=190862 Reviewed by Matt Baker. * UserInterface/Views/TextEditor.js: (WI.TextEditor.prototype.set selectedTextRange): Don't `focus` unless the `activeElement` is not a WebInspector element (e.g. ), meaning that the previously focused element has been removed from the DOM and no longer needs to keep the focus. 2018-10-24 Devin Rousso Web Inspector: CSP request payload on medium.com is unreadable, should be pretty-printed https://bugs.webkit.org/show_bug.cgi?id=190354 Reviewed by Joseph Pecoraro. * UserInterface/Views/TextEditor.js: (WI.TextEditor.prototype.set string.update): (WI.TextEditor.prototype._attemptToDetermineMIMEType): Added. If the content doesn't already have a MIME type, attempt to determine one by trying to format it as "javascript" (e.g. request JSON that is simply missing a MIME type). * UserInterface/Views/TextContentView.js: (WI.TextContentView): (WI.TextContentView.prototype._handleTextEditorMIMETypeChanged): Added. * UserInterface/Views/TextResourceContentView.js: (WI.TextResourceContentView): (WI.TextResourceContentView.prototype._handleTextEditorMIMETypeChanged): Added. * UserInterface/Views/ScriptContentView.js: (WI.ScriptContentView): (WI.ScriptContentView.prototype._handleTextEditorMIMETypeChanged): Added. Enable the "Pretty Print" navigation button if the MIME type changes to something that is able to be formatted. Drive-by: reorder the creation of the "Pretty Print" button so that it exists if `_attemptToDetermineMIMEType` finishes synchronously. 2018-10-23 Devin Rousso Uncaught Exception: TypeError: null is not an object (evaluating 'mouseBlock.addEventListener') https://bugs.webkit.org/show_bug.cgi?id=190766 Reviewed by Brian Burg. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype._populateWaterfallGraph): When creating the `mouseBlock`, if the `startTimestamp` and `endTimestamp` are equal, we don't create an element. If this is true for the total range of the `WI.Resouce` (meaning its `startTime` and `responseEnd`), don't even try to create blocks. 2018-10-23 Devin Rousso Web Inspector: "Queued NaNms" in Network tab https://bugs.webkit.org/show_bug.cgi?id=190767 Reviewed by Brian Burg. * UserInterface/Models/ResourceTimingData.js: (WI.ResourceTimingData.prototype.get fetchStart): If the `WI.ResourceTimingData` has no `fetchStart` use the associated `WI.Resource`'s `requestSentTimestamp` (just like `startTime`). 2018-10-22 Joseph Pecoraro Web Inspector: Open Quickly dialog doesn't show named scripts that appear in the debugger sidebar https://bugs.webkit.org/show_bug.cgi?id=190649 Reviewed by Devin Rousso. * UserInterface/Views/OpenResourceDialog.js: (WI.OpenResourceDialog.prototype.didPresentDialog): (WI.OpenResourceDialog.prototype._addResourcesForTarget): (WI.OpenResourceDialog.prototype._addScriptsForTarget): Include non-resource named scripts from the main target in the open quickly dialog. 2018-10-19 Joseph Pecoraro Web Inspector: Remove unused member variable of DebuggerSidebarPanel https://bugs.webkit.org/show_bug.cgi?id=190743 Reviewed by Devin Rousso. * UserInterface/Views/DebuggerSidebarPanel.js: (WI.DebuggerSidebarPanel): 2018-10-17 Devin Rousso Web Inspector: Quickly Open to line/column does should have caret indicating where the position is https://bugs.webkit.org/show_bug.cgi?id=190643 Reviewed by Matt Baker. * UserInterface/Views/TextEditor.js: (WI.TextEditor.prototype.set selectedTextRange): (WI.TextEditor.prototype.revealPosition): Ensure that CodeMirror is focused before attempting to `setSelection`. Drive-by: allow selections past the "end" of the line (since there is a `\n` or `\r`). * UserInterface/Views/SourceCodeTextEditor.js: (WI.SourceCodeTextEditor.prototype.dialogWasDismissedWithRepresentedObject): Remove the extra `focus` call after dismissing the `WI.GoToLineDialog` since it is now handled by `WI.TextEditor` via `revealPosition`. 2018-10-16 Joseph Pecoraro Web Inspector: ⌃G to jump to line in CSS file wipes the line https://bugs.webkit.org/show_bug.cgi?id=190645 Reviewed by Devin Rousso. * UserInterface/Base/Main.js: * UserInterface/Views/Dialog.js: (WI.Dialog.prototype.dismiss): * UserInterface/Views/SourceCodeTextEditor.js: (WI.SourceCodeTextEditor.prototype.dialogWasDismissed): Deleted. Rename the handler when dismissing a dialog with a value so that it is clear this is only on a successful value and not an invalid value. Dialog now only calls this delegate with a valid value. This addresses exceptions seen when the GoToLineDialog was dimissed via Escape and an unexpected `null` value was being handled in the delegate. * UserInterface/Views/GoToLineDialog.js: (WI.GoToLineDialog.prototype._handleKeydownEvent): * UserInterface/Views/OpenResourceDialog.js: (WI.OpenResourceDialog.prototype._handleKeydownEvent): Prevent default on the event whenever we dismiss the dialog. Without this, the key event was also being sent to the editor. In this case, that meant an "Enter" key was replacing the new selection in the TextEditor with a newline! 2018-10-16 Devin Rousso Web Inspector: Canvas: capture previously saved states and add them to the recording payload https://bugs.webkit.org/show_bug.cgi?id=190473 Reviewed by Joseph Pecoraro. Instead of sending a single object of the current state of the context, send an array of objects, one for each restore point. When replaying, recreate each restore point before applying the selected action(s). * UserInterface/Models/Recording.js: (WI.Recording): (WI.Recording.fromPayload): (WI.Recording.prototype.toJSON): (WI.Recording.prototype.async._process): (WI.Recording.prototype.async._swizzleState): Added. * UserInterface/Models/RecordingAction.js: (WI.RecordingAction): (WI.RecordingAction.deriveCurrentState): Added. (WI.RecordingAction.prototype.get states): Added. (WI.RecordingAction.prototype.process): (WI.RecordingAction.prototype.get state): Deleted. Drive-by: when `process`ing, also check to see if any values in the current state changed outside of those expected in `_stateModifiers` (e.g. `restore` may modify some state values). * UserInterface/Views/RecordingContentView.js: (WI.RecordingContentView.prototype._generateContentCanvas2D): * UserInterface/Views/RecordingStateDetailsSidebarPanel.js: (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D): Default to showing the most recent (current) state. * UserInterface/Views/CanvasTabContentView.js: (WI.CanvasTabContentView.prototype.initialLayout): Added. (WI.CanvasTabContentView.prototype._addCanvas): (WI.CanvasTabContentView.prototype._removeCanvas): (WI.CanvasTabContentView.prototype._addRecording): Added. (WI.CanvasTabContentView.prototype._recordingImportedOrStopped): (WI.CanvasTabContentView.prototype._recordingAdded): Deleted. * UserInterface/Controllers/CanvasManager.js: (WI.CanvasManager): (WI.CanvasManager.prototype.get importedRecordings): Added. (WI.CanvasManager.prototype.importRecording): Drive-by: store imported recordings on `WI.CanvasManager` so that if the Canvas tab is closed we can still show the list of imported recordings. 2018-10-16 Devin Rousso Web Inspector: Canvas recording sidebar scroll position lost after switching tabs https://bugs.webkit.org/show_bug.cgi?id=190482 Reviewed by Joseph Pecoraro. * UserInterface/Views/Sidebar.js: (WI.Sidebar.prototype.removeSidebarPanel): (WI.Sidebar.prototype.set selectedSidebarPanel): Call `hidden` before setting `selected` to `false`, as that sets `display: none;` on the element, which sets the `scrollTop` to `0`. * UserInterface/Views/SidebarPanel.js: (WI.SidebarPanel.prototype.shown): (WI.SidebarPanel.prototype.hidden): (WI.SidebarPanel.prototype.get scrollElement): Added. Allow subclasses to specify the scrolling element for saving/restoring the scroll position. * UserInterface/Views/CanvasSidebarPanel.js: (WI.CanvasSidebarPanel.prototype.get scrollElement): Added. * UserInterface/Views/RecordingStateDetailsSidebarPanel.js: (WI.RecordingStateDetailsSidebarPanel.prototype.get scrollElement): Added. 2018-10-16 Devin Rousso Web Inspector: Should be a way to go directly from an event in the overview view to the specialized timeline for that event https://bugs.webkit.org/show_bug.cgi?id=135307 Reviewed by Joseph Pecoraro. When a `WI.TimelineRecordBar` is clicked, call up the delegate chain to the overview and adjust the currently selected `WI.TimelineRecordBar` among the `WI.TimelineOverviewGraph`s. Similarly, selecting a `WI.DataGridNode` in any `WI.TimelineView` subclass will use the same logic to select the corresponding `WI.TimelineRecordBar`. * UserInterface/Views/TimelineOverview.js: (WI.TimelineOverview): (WI.TimelineOverview.prototype.reset): (WI.TimelineOverview.prototype._recordSelected): * UserInterface/Views/TimelineOverviewGraph.js: (WI.TimelineOverviewGraph): (WI.TimelineOverviewGraph.prototype.set selectedRecord): (WI.TimelineOverviewGraph.prototype.get selectedRecordBar): Added. (WI.TimelineOverviewGraph.prototype.set selectedRecordBar): Added. (WI.TimelineOverviewGraph.prototype.timelineRecordBarClicked): Added. (WI.TimelineOverviewGraph.prototype._needsSelectedRecordLayout): * UserInterface/Views/TimelineRecordBar.js: (WI.TimelineRecordBar): (WI.TimelineRecordBar.prototype.get selected): Added. (WI.TimelineRecordBar.prototype.set selected): Added. (WI.TimelineRecordBar.prototype._handleClick): Added. * UserInterface/Views/TimelineRecordBar.css: (.timeline-record-bar.selected > .segment): Added. Add a `delegate` that is notified whenever the element is clicked. * UserInterface/Views/TimelineDataGridNode.js: (WI.TimelineDataGridNode.prototype.refreshGraph.createBar): * UserInterface/Views/LayoutTimelineOverviewGraph.js: (WI.LayoutTimelineOverviewGraph.prototype.updateSelectedRecord): (WI.LayoutTimelineOverviewGraph.prototype._updateRowLayout.createBar): * UserInterface/Views/NetworkTimelineOverviewGraph.js: (WI.NetworkTimelineOverviewGraph.prototype.layout.createBar): * UserInterface/Views/ScriptTimelineOverviewGraph.js: (WI.ScriptTimelineOverviewGraph.prototype.layout.createBar): (WI.ScriptTimelineOverviewGraph.prototype.updateSelectedRecord): * UserInterface/Views/TimelineRecordingContentView.js: (WI.TimelineRecordingContentView.prototype.showTimelineViewForTimeline): 2018-10-16 Devin Rousso Web Inspector: sequences of spaces longer than 16 don't show a dot https://bugs.webkit.org/show_bug.cgi?id=190528 Reviewed by Matt Baker. * UserInterface/Views/CodeMirrorAdditions.js: Create a new CSS rule and add it to a unique