blob: 773c4df77c4134cc1487950cc57a5df67e85baa5 [file] [log] [blame]
2020-02-28 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r257411): Web Inspector: Can't add a breakpoint by pressing the plus button
https://bugs.webkit.org/show_bug.cgi?id=208359
<rdar://problem/59870712>
Reviewed by Brian Burg.
In r257411 I added event.stop() (which is a shortcut for event.preventDefault() and
event.stopImmediatePropagation()) to mousedown handler. Calling event.stopImmediatePropagation()
prevented other mousedown event handlers from running.
This patch no longer calls event.stopImmediatePropagation().
* UserInterface/Views/ButtonNavigationItem.js:
(WI.ButtonNavigationItem.prototype._handleMouseDown):
2020-02-27 Devin Rousso <drousso@apple.com>
Web Inspector: allow use of dark mode theme independently from system-wide theme
https://bugs.webkit.org/show_bug.cgi?id=186308
<rdar://problem/40785895>
Reviewed by Timothy Hatcher.
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
Create a setting for controlling/preserving the theme of the frontend UI.
* UserInterface/Base/Main.js:
(WI.loaded):
(WI.contentLoaded):
Apply the created setting when Web Inspector is opened or if its value changes.
* UserInterface/Views/SettingEditor.js:
(WI.SettingEditor.prototype._createEditorElement):
Allow horizontal dividers in `<select>` setting editors.
* Localizations/en.lproj/localizedStrings.js:
2020-02-27 Devin Rousso <drousso@apple.com>
Web Inspector: localize the placeholder "Header" and "value" when editing a local override
https://bugs.webkit.org/show_bug.cgi?id=208276
<rdar://problem/59763619>
Reviewed by Brian Burg.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover.prototype.show):
2020-02-26 Devin Rousso <drousso@apple.com>
REGRESSION: (257410) [ macOS ] inspector/network/client-blocked-load.html is failing
https://bugs.webkit.org/show_bug.cgi?id=208251
<rdar://problem/59812765>
Reviewed by Timothy Hatcher.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode):
The test failed because it expected `url` to be an empty string (`""`) instead of `null`.
Use the given `url` parameter exactly as provided instead of trying to add a fallback in the
case of a falsy value. Given the prevalence of usage of `WI.SourceCode`, it's better to
match the existing behavior of before r257410 than change it and risk other subtle bugs.
2020-02-25 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: AXI: buttons should be focusable when navigating by pressing Tab
https://bugs.webkit.org/show_bug.cgi?id=208163
<rdar://problem/59745448>
Reviewed by Brian Burg.
Buttons now accessible with Tab navigation. The focused button has the native focus outline.
Clicking on the button does NOT move the focus. For example, when you're focused on the
console prompt, clicking on the icon to hide the right sidebar keeps you focused where
you were — the console prompt. This behavior matches macOS.
Convert WI.NavigationItem with role=button from `<div>` to `<button>` elements.
Button elements have implicit tabIndex=0. When focused, pressing Space or Enter
triggers "click" event.
* UserInterface/Views/ActivateButtonNavigationItem.js:
(WI.ActivateButtonNavigationItem.prototype.set activated):
Add "aria-pressed" and "aria-label" attributes for VoiceOver.
* UserInterface/Views/ButtonNavigationItem.css:
(.navigation-bar .item.button:not(.image-only):focus,):
(.navigation-bar .item.button.image-only:focus):
(.navigation-bar .item.button:not(.disabled):matches(.activate.activated, .radio.selected) > .glyph):
(.navigation-bar .item.button:not(.disabled):active:matches(.activate.activated, .radio.selected) > .glyph):
Before this patch, focused button looked the same as activated buttons.
For example, the focused (non-active) bullseye icon looked exactly the
same as unfocused active bullseye icon, which was misleading.
* UserInterface/Views/ButtonNavigationItem.js:
(WI.ButtonNavigationItem):
(WI.ButtonNavigationItem.prototype._mouseClicked):
(WI.ButtonNavigationItem.prototype._handleMouseDown):
Clicking on a button shouldn't move focus. For example, when you're focused on the console prompt,
clicking on the icon to hide the right sidebar should keep you focused where you were - the console prompt.
(WI.ButtonNavigationItem.prototype._handleKeyDown):
* UserInterface/Views/ButtonToolbarItem.css:
(.toolbar .item.button):
Adjust outline offset to remove the gap between the outline and the border of the button.
(.toolbar .item.button:not(.disabled).activate.activated):
(@media (prefers-color-scheme: dark) body:not(.window-inactive) .toolbar .item.button:not(.disabled).activate.activated > .glyph):
* UserInterface/Views/ControlToolbarItem.css:
(.toolbar .item.control:focus):
(.toolbar .item.control:focus > .glyph):
Draw the outline around the X (close button) glyph, not the button itself (which is much wider than the glyph).
* UserInterface/Views/NavigationBar.css:
(.navigation-bar .item):
(.navigation-bar .item:focus):
* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar):
"focus" and "blur" events don't bubble. These event handlers didn't capture the event.
(WI.NavigationBar.prototype._mouseDown):
(WI.NavigationBar.prototype._keyDown):
* UserInterface/Views/NavigationItem.js:
(WI.NavigationItem):
* UserInterface/Views/RadioButtonNavigationItem.css:
(.navigation-bar .item.radio.button:focus):
* UserInterface/Views/Toolbar.css:
(.toolbar .item):
2020-02-25 Devin Rousso <drousso@apple.com>
Web Inspector: safari app extension isolated worlds and injected files use the extension's identifier instead of its name
https://bugs.webkit.org/show_bug.cgi?id=206911
<rdar://problem/58026635>
Reviewed by Brian Burg.
* UserInterface/Controllers/BrowserManager.js: Added.
(WI.BrowserManager):
(WI.BrowserManager.prototype.initializeTarget):
(WI.BrowserManager.prototype.enable):
(WI.BrowserManager.prototype.disable):
(WI.BrowserManager.prototype.isExtensionScheme):
(WI.BrowserManager.prototype.extensionNameForId):
(WI.BrowserManager.prototype.extensionNameForURL):
* UserInterface/Protocol/BrowserObserver.js: Added.
(WI.BrowserObserver.prototype.extensionsEnabled):
(WI.BrowserObserver.prototype.extensionsDisabled):
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.get BrowserAgent): Added.
* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Main.html:
* UserInterface/Test/Test.js:
(WI.loaded):
* UserInterface/Test.html:
Add an observer and manager for the `Browser` domain.
* UserInterface/Protocol/MultiplexingBackendTarget.js:
(WI.MultiplexingBackendTarget):
(WI.MultiplexingBackendTarget.prototype.initialize):
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager.prototype.initializeTarget): Added.
The `Browser` agent lives in the UIProcess alongside the `Target` agent (meaning there
should only be one per debuggable rather than one per target) and as such is not routed
through the `Target` agent.
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole.prototype._displayNameForExecutionContext):
Attempt to match the execution context name against any known extension identifier, and
use the extension's display name if one is found.
* UserInterface/Base/URLUtilities.js:
(WI.displayNameForHost):
Attempt to match the host against any known extension identifier, and use the extension's
display name if one is found.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._addStyleSheet):
(WI.SourcesNavigationSidebarPanel.prototype._addScript):
* UserInterface/Base/Utilities.js:
(isWebKitExtensionScheme): Deleted.
* .eslintrc:
Use `WI.BrowserManager.prototype.isExtensionScheme` instead of the global function.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode):
(WI.SourceCode.prototype.get url): Added.
(WI.SourceCode.prototype.get urlComponents): Added.
* UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet):
(WI.CSSStyleSheet.prototype.get injected):
(WI.CSSStyleSheet.prototype.get url): Deleted.
(WI.CSSStyleSheet.prototype.get urlComponents): Deleted.
* UserInterface/Models/Resource.js:
(WI.Resource):
(WI.Resource.prototype.get url): Deleted.
(WI.Resource.prototype.get urlComponents): Deleted.
* UserInterface/Models/Script.js:
(WI.Script):
(WI.Script.prototype.get url): Deleted.
(WI.Script.prototype.get urlComponents): Deleted.
All subclasses of `WI.SourceCode` have separate `get url` and `get urlComponents` functions,
so unify them in the common superclass so that it's guaranteed to exist.
2020-02-25 Devin Rousso <drousso@apple.com>
Web Inspector: move code for debug outlined focus element to the Debug folder so it isn't shipped
https://bugs.webkit.org/show_bug.cgi?id=208217
Reviewed by Joseph Pecoraro.
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI.contentLoaded.setFocusDebugOutline): Deleted.
* UserInterface/Views/Main.css:
(body.focus-debug *:focus): Deleted.
* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):
(WI.runBootstrapOperations.setFocusDebugOutline): Added.
* UserInterface/Debug/Bootstrap.css: Added.
(body.focus-debug *:focus):
* UserInterface/Main.html:
2020-02-25 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: VoiceOver should read "Console prompt" when focusing on it
https://bugs.webkit.org/show_bug.cgi?id=208028
<rdar://problem/59641238>
Reviewed by Brian Burg.
Before this change, VoiceOver read "edit text blank" when focusing on the console prompt.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ConsolePrompt.js:
(WI.ConsolePrompt):
2020-02-25 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: VoiceOver: TreeOutline does not correctly indicate selected item
https://bugs.webkit.org/show_bug.cgi?id=207968
Reviewed by Brian Burg.
Previously, the entire TreeOutline's DOM element had focus. With this patch,
selected item DOM element has focus instead. When clicking on the treeElement,
set tabIndex to 0 and focus on it.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom): Fix indentation.
(.tree-outline.dom:not(.non-selectable):focus-within li.selected .selection-area):
(.tree-outline.dom:not(.non-selectable) li.hovered:not(.selected) .selection-area):
(.tree-outline.dom:focus-within li.inspected-node.selected > span::after):
(.tree-outline.dom li):
Remove outline - selection is already indicated by the background.
(.tree-outline.dom:focus-within li.selected .pseudo-class-indicator):
(.tree-outline.dom:focus-within li.selected):
(.tree-outline.dom:focus-within li.selected *):
(.tree-outline.dom:focus-within li.parent.selected::before):
(.tree-outline.dom:focus-within li.parent.expanded.selected::before):
* UserInterface/Views/DOMTreeOutline.js:
* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype._attach):
(WI.TreeElement.prototype.collapse):
(WI.TreeElement.prototype.expand):
(WI.TreeElement.prototype.select):
(WI.TreeElement.prototype.deselect):
(WI.TreeElement.prototype.focus):
(WI.TreeElement.prototype.unfocus):
* UserInterface/Views/TreeOutline.css:
(.tree-outline .item.selected:focus .disclosure-button):
(.tree-outline .item.selected.expanded:focus .disclosure-button):
(.tree-outline .item.selected:focus):
(.tree-outline .item.selected:focus .subtitle):
(.tree-outline:not(.large) .item.selected:focus .status .indeterminate-progress-spinner):
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._treeKeyDown):
(WI.TreeOutline.prototype._handleMouseDown):
2020-02-19 Jon Davis <jond@apple.com>
Fixed object trees using the wrong theme of type icon
https://bugs.webkit.org/show_bug.cgi?id=207980
Reviewed by Darin Adler.
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property.boolean > .icon):
(.object-tree-property.function > .icon):
(.object-tree-property.number > .icon):
(.object-tree-property.bigint > .icon):
(.object-tree-property.object > .icon):
(.object-tree-property.object.null > .icon):
(.object-tree-property.object.node > .icon):
(.object-tree-property.regex > .icon):
(.object-tree-property.string > .icon):
(.object-tree-property.symbol > .icon):
(.object-tree-property.accessor > .icon,):
(.object-tree-property.had-error > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.boolean > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.function > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.number > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.bigint > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.object > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.object.null > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.object.node > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.regex > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.string > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.symbol > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.accessor > .icon,):
(@media (prefers-color-scheme: dark) .object-tree-property.had-error > .icon):
2020-02-17 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Add "outline focused element" debug setting
https://bugs.webkit.org/show_bug.cgi?id=207819
<rdar://problem/59489993>
Reviewed by Timothy Hatcher.
When debugging accessibility issues of Web Inspector, it's helpful
to know what element is focused. Many elements have `outline: none`
and no clear indication of what's focused.
Add a debug setting to display a bright purple outline for all focused
elements.
* UserInterface/Base/Main.js:
(WI.contentLoaded):
* UserInterface/Base/Setting.js:
* UserInterface/Views/Main.css:
(body.focus-debug *:focus):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createDebugSettingsView):
2020-02-17 Jon Davis <jond@apple.com>
Update resource, type, and instrument icons for light, dark, and override colors
https://bugs.webkit.org/show_bug.cgi?id=207587
Reviewed by Timothy Hatcher.
* UserInterface/Images/ApplicationCacheManifest.svg: Added.
* UserInterface/Images/Beacon.svg:
* UserInterface/Images/ClippingIcons.svg: Added.
* UserInterface/Images/Cookie.svg: Added.
* UserInterface/Images/Database.svg: Added.
* UserInterface/Images/DocumentIcons.svg: Added.
* UserInterface/Images/FolderGeneric.svg: Added.
* UserInterface/Images/InstrumentIcons.svg: Added.
* UserInterface/Images/Origin.svg:
* UserInterface/Images/Stopwatch.svg:
* UserInterface/Images/TableIcons.svg: Added.
* UserInterface/Images/TypeIcons.svg: Added.
* UserInterface/Views/AuditTreeElement.css:
(.audit.test-case .icon):
(.audit.test-group .icon):
(.audit.test-case-result .icon):
(.audit.test-group-result .icon):
(@media (prefers-color-scheme: dark) .audit.test-case .icon):
(@media (prefers-color-scheme: dark) .audit.test-group .icon):
(@media (prefers-color-scheme: dark) .audit.test-case-result .icon):
(@media (prefers-color-scheme: dark) .audit.test-group-result .icon):
* UserInterface/Views/BreakpointTreeElement.css:
(.breakpoint-exception-icon .icon):
(.breakpoint-assertion-icon .icon):
(.breakpoint-microtask-icon .icon):
(.breakpoint-paused-icon .icon):
(@media (prefers-color-scheme: dark) .breakpoint-exception-icon .icon):
(@media (prefers-color-scheme: dark) .breakpoint-assertion-icon .icon):
(@media (prefers-color-scheme: dark) .breakpoint-microtask-icon .icon):
(@media (prefers-color-scheme: dark) .breakpoint-paused-icon .icon):
* UserInterface/Views/CallFrameIcons.css:
(.program-icon .icon):
(.function-icon .icon):
(.event-listener-icon .icon):
(.native-icon .icon):
(.tail-deleted .icon):
(@media (prefers-color-scheme: dark) .program-icon .icon):
(@media (prefers-color-scheme: dark) .function-icon .icon):
(@media (prefers-color-scheme: dark) .event-listener-icon .icon):
(@media (prefers-color-scheme: dark) .native-icon .icon):
(@media (prefers-color-scheme: dark) .tail-deleted .icon):
* UserInterface/Views/CanvasSidebarPanel.css:
(.sidebar > .panel.navigation.canvas > .content > .recording-content > .tree-outline .item.folder-icon > .icon):
(@media (prefers-color-scheme: dark) .sidebar > .panel.navigation.canvas > .content > .recording-content > .tree-outline .item.folder-icon > .icon):
* UserInterface/Views/DOMBreakpointTreeElement.css:
(.breakpoint.dom.breakpoint-for-subtree-modified:not(.breakpoint-paused-icon) .icon):
(.breakpoint.dom.breakpoint-for-attribute-modified:not(.breakpoint-paused-icon) .icon):
(.breakpoint.dom.breakpoint-for-node-removed:not(.breakpoint-paused-icon) .icon):
(@media (prefers-color-scheme: dark) .breakpoint.dom.breakpoint-for-subtree-modified:not(.breakpoint-paused-icon) .icon):
(@media (prefers-color-scheme: dark) .breakpoint.dom.breakpoint-for-attribute-modified:not(.breakpoint-paused-icon) .icon):
(@media (prefers-color-scheme: dark) .breakpoint.dom.breakpoint-for-node-removed:not(.breakpoint-paused-icon) .icon):
* UserInterface/Views/DOMNodeTreeElement.css:
(.tree-outline .item.dom-node .icon):
(@media (prefers-color-scheme: dark) .tree-outline .item.dom-node .icon):
* UserInterface/Views/FolderIcon.css:
(.folder-icon .icon):
(.tree-outline:focus .folder-icon.selected .icon):
(.origin-icon .icon):
(.tree-outline:focus .origin-icon.selected .icon):
(@media (prefers-color-scheme: dark) .folder-icon .icon):
(@media (prefers-color-scheme: dark) .origin-icon .icon):
* UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css:
(.timeline-overview-graph.heap-allocations > img.snapshot):
(@media (prefers-color-scheme: dark) .timeline-overview-graph.heap-allocations > img.snapshot):
* UserInterface/Views/HeapAllocationsTimelineView.css:
(.timeline-view.heap-allocations > .data-grid td .icon.heap-snapshot):
(@media (prefers-color-scheme: dark) .timeline-view.heap-allocations > .data-grid td .icon.heap-snapshot):
* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot .icon):
(.heap-snapshot .icon.native):
(.heap-snapshot .icon.boolean):
(.heap-snapshot .icon.function):
(.heap-snapshot .icon.number):
(.heap-snapshot .icon.bigint):
(.heap-snapshot .icon.object):
(.heap-snapshot .icon.node):
(.heap-snapshot .icon.regex):
(.heap-snapshot .icon.string):
(.heap-snapshot .icon.symbol):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon.native):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon.boolean):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon.function):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon.number):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon.bigint):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon.object):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon.node):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon.regex):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon.string):
(@media (prefers-color-scheme: dark) .heap-snapshot .icon.symbol):
* UserInterface/Views/IdleTreeElement.css:
(.details-section.call-stack .idle .icon):
(@media (prefers-color-scheme: dark) .details-section.call-stack .idle .icon):
* UserInterface/Views/LayerDetailsSidebarPanel.css:
(.panel.details.layer .name-column .icon):
(.panel.details.layer tr.reflection .name-column .icon):
(.panel.details.layer tr.pseudo-element .name-column .icon):
(@media (prefers-color-scheme: dark) .panel.details.layer .name-column .icon):
(@media (prefers-color-scheme: dark) .panel.details.layer tr.reflection .name-column .icon):
(@media (prefers-color-scheme: dark) .panel.details.layer tr.pseudo-element .name-column .icon):
* UserInterface/Views/LayerTreeDetailsSidebarPanel.css:
(.panel.details.layer-tree .name-column .icon):
(.panel.details.layer-tree tr.reflection .name-column .icon):
(.panel.details.layer-tree tr.pseudo-element .name-column .icon):
(@media (prefers-color-scheme: dark) .panel.details.layer-tree .name-column .icon):
(@media (prefers-color-scheme: dark) .panel.details.layer-tree tr.reflection .name-column .icon):
(@media (prefers-color-scheme: dark) .panel.details.layer-tree tr.pseudo-element .name-column .icon):
* UserInterface/Views/NetworkTableContentView.css:
(.network-table > .table li:not(.selected) .cell:not(.current-session)):
(.network-table > .table .cell.dom-node.name .icon):
(@media (prefers-color-scheme: dark) .breakpoint-assertion-icon .icon):
(@media (prefers-color-scheme: dark) .network-table > .table .cell.dom-node.name .icon):
(.network-table .cell.dom-node.name .icon): Deleted.
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property.boolean > .icon):
(.object-tree-property.function > .icon):
(.object-tree-property.number > .icon):
(.object-tree-property.bigint > .icon):
(.object-tree-property.object > .icon):
(.object-tree-property.object.null > .icon):
(.object-tree-property.object.node > .icon):
(.object-tree-property.regex > .icon):
(.object-tree-property.string > .icon):
(.object-tree-property.symbol > .icon):
(.object-tree-property.accessor > .icon,):
(.object-tree-property.had-error > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.boolean > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.function > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.number > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.bigint > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.object > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.object.null > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.object.node > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.regex > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.string > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.symbol > .icon):
(@media (prefers-color-scheme: dark) .object-tree-property.accessor > .icon,):
(@media (prefers-color-scheme: dark) .object-tree-property.had-error > .icon):
* UserInterface/Views/PathComponentIcons.css:
(.request-icon .icon):
(.response-icon .icon):
(.heap-snapshot-summary-icon .icon):
(.heap-snapshot-instances-icon .icon):
(.heap-snapshot-object-graph-icon .icon):
(.dom-element-icon .icon):
(.dom-pseudo-element-icon .icon):
(.dom-text-node-icon .icon):
(.dom-comment-icon .icon):
(.dom-document-type-icon .icon):
(.dom-document-icon .icon):
(.dom-character-data-icon .icon):
(.dom-node-icon .icon):
(.object-icon .icon):
(.function-icon .icon):
(.native-icon .icon):
(.program-icon .icon):
(.events-icon .icon):
(.call-trees-icon .icon):
(.snapshot-list-icon .icon):
(.snapshot-diff-icon .icon):
(.image-icon .icon):
(.source-icon .icon):
(@media (prefers-color-scheme: dark) .request-icon .icon):
(@media (prefers-color-scheme: dark) .response-icon .icon):
(@media (prefers-color-scheme: dark) .heap-snapshot-summary-icon .icon):
(@media (prefers-color-scheme: dark) .heap-snapshot-instances-icon .icon):
(@media (prefers-color-scheme: dark) .heap-snapshot-object-graph-icon .icon):
(@media (prefers-color-scheme: dark) .dom-element-icon .icon):
(@media (prefers-color-scheme: dark) .dom-pseudo-element-icon .icon):
(@media (prefers-color-scheme: dark) .dom-text-node-icon .icon):
(@media (prefers-color-scheme: dark) .dom-comment-icon .icon):
(@media (prefers-color-scheme: dark) .dom-document-type-icon .icon):
(@media (prefers-color-scheme: dark) .dom-document-icon .icon):
(@media (prefers-color-scheme: dark) .dom-character-data-icon .icon):
(@media (prefers-color-scheme: dark) .dom-node-icon .icon):
(@media (prefers-color-scheme: dark) .object-icon .icon):
(@media (prefers-color-scheme: dark) .function-icon .icon):
(@media (prefers-color-scheme: dark) .native-icon .icon):
(@media (prefers-color-scheme: dark) .program-icon .icon):
(@media (prefers-color-scheme: dark) .events-icon .icon):
(@media (prefers-color-scheme: dark) .call-trees-icon .icon):
(@media (prefers-color-scheme: dark) .snapshot-list-icon .icon):
(@media (prefers-color-scheme: dark) .snapshot-diff-icon .icon):
(@media (prefers-color-scheme: dark) .source-icon .icon):
* UserInterface/Views/ProfileView.css:
(.profile > .data-grid td .icon.function-icon):
(.profile > .data-grid td .icon.native-icon):
(.profile > .data-grid td .icon.program-icon):
(@media (prefers-color-scheme: dark) .profile > .data-grid td .icon.function-icon):
(@media (prefers-color-scheme: dark) .profile > .data-grid td .icon.native-icon):
(@media (prefers-color-scheme: dark) .profile > .data-grid td .icon.program-icon):
* UserInterface/Views/ResourceIcons.css:
(.resource-icon .icon):
(.resource-icon.override .icon):
(.resource-icon.resource-type-document .icon):
(.resource-icon.resource-type-document.override .icon):
(.resource-icon.resource-type-image .icon):
(.resource-icon.resource-type-image.override .icon):
(.resource-icon.resource-type-font .icon):
(.resource-icon.resource-type-font.override .icon):
(:matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon):
(:matches(.resource-icon.resource-type-style-sheet.override, .style-sheet-icon.override) .icon):
(.resource-icon.resource-type-script .icon):
(.resource-icon.resource-type-script.override .icon):
(.anonymous-script-icon .icon):
(.source-map-resource.resource-icon .icon):
(.source-map-resource.resource-icon.resource-type-style-sheet .icon):
(.source-map-resource.resource-icon.resource-type-script .icon):
(.script.worker-icon .icon):
(.script.worker-icon.override .icon):
(.resource-icon.resource-type-websocket .icon):
(.resource-icon.resource-type-ping .icon,):
(.resource-icon.resource-type-range .icon):
(@media (prefers-color-scheme: dark) .resource-icon .icon):
(@media (prefers-color-scheme: dark) .resource-icon.override .icon):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-document .icon):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-document.override .icon):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-image .icon):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-image.override .icon):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-font .icon):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-font.override .icon):
(@media (prefers-color-scheme: dark) :matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon):
(@media (prefers-color-scheme: dark) :matches(.resource-icon.resource-type-style-sheet.override, .style-sheet-icon.override) .icon):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-script .icon):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-script.override .icon):
(@media (prefers-color-scheme: dark) .anonymous-script-icon .icon):
(@media (prefers-color-scheme: dark) .source-map-resource.resource-icon .icon):
(@media (prefers-color-scheme: dark) .source-map-resource.resource-icon.resource-type-style-sheet .icon):
(@media (prefers-color-scheme: dark) .source-map-resource.resource-icon.resource-type-script .icon):
(@media (prefers-color-scheme: dark) .script.worker-icon .icon):
(@media (prefers-color-scheme: dark) .script.worker-icon.override .icon):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-websocket .icon):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-ping .icon,):
(@media (prefers-color-scheme: dark) .resource-icon.resource-type-range .icon):
(.large .resource-icon .icon): Deleted.
(.large .resource-icon.resource-type-document .icon): Deleted.
(.large .resource-icon.resource-type-image .icon): Deleted.
(.large .resource-icon.resource-type-font .icon): Deleted.
(.large :matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon): Deleted.
(.large .resource-icon.resource-type-script .icon): Deleted.
(.large .anonymous-script-icon .icon): Deleted.
(.large .source-map-resource.resource-icon .icon): Deleted.
(.large .source-map-resource.resource-icon.resource-type-style-sheet .icon): Deleted.
(.large .source-map-resource.resource-icon.resource-type-script .icon): Deleted.
(.large .script.worker-icon .icon): Deleted.
(.large .resource-icon.resource-type-websocket .icon): Deleted.
(.large .resource-icon.resource-type-range .icon): Deleted.
* UserInterface/Views/SearchIcons.css:
(.dom-match-element-icon .icon):
(.dom-match-text-node-icon .icon):
(.dom-match-comment-icon .icon):
(.dom-match-document-type-icon .icon):
(.dom-match-character-data-icon .icon):
(.dom-match-node-icon .icon):
(.source-code-match .icon):
(@media (prefers-color-scheme: dark) .dom-match-element-icon .icon):
(@media (prefers-color-scheme: dark) .dom-match-text-node-icon .icon):
(@media (prefers-color-scheme: dark) .dom-match-comment-icon .icon):
(@media (prefers-color-scheme: dark) .dom-match-document-type-icon .icon):
(@media (prefers-color-scheme: dark) .dom-match-character-data-icon .icon):
(@media (prefers-color-scheme: dark) .dom-match-node-icon .icon):
(@media (prefers-color-scheme: dark) .source-code-match .icon):
* UserInterface/Views/StorageIcons.css:
(.application-cache-manifest .icon):
(.application-cache-frame .icon):
(.cookie-icon .icon):
(.local-storage-icon .icon):
(.session-storage-icon .icon):
(.database-icon .icon):
(.database-table-icon .icon):
(@media (prefers-color-scheme: dark) .application-cache-manifest .icon):
(@media (prefers-color-scheme: dark) .application-cache-frame .icon):
(@media (prefers-color-scheme: dark) .local-storage-icon .icon):
(@media (prefers-color-scheme: dark) .session-storage-icon .icon):
(@media (prefers-color-scheme: dark) .database-icon .icon):
(@media (prefers-color-scheme: dark) .database-table-icon .icon):
* UserInterface/Views/StyleRuleIcons.css:
(.author-style-rule-icon .icon):
(.author-style-rule-icon.pseudo-selector .icon):
(.user-style-rule-icon .icon):
(.user-style-rule-icon.pseudo-selector .icon):
(.user-agent-style-rule-icon .icon):
(.user-agent-style-rule-icon.pseudo-selector .icon):
(.inspector-style-rule-icon .icon):
(.inspector-style-rule-icon.pseudo-selector .icon):
(.inherited-style-rule-icon .icon):
(.inherited-element-style-rule-icon .icon):
(@media (prefers-color-scheme: dark) .author-style-rule-icon .icon):
(@media (prefers-color-scheme: dark) .author-style-rule-icon.pseudo-selector .icon):
(@media (prefers-color-scheme: dark) .user-style-rule-icon .icon):
(@media (prefers-color-scheme: dark) .user-style-rule-icon.pseudo-selector .icon):
(@media (prefers-color-scheme: dark) .user-agent-style-rule-icon .icon):
(@media (prefers-color-scheme: dark) .user-agent-style-rule-icon.pseudo-selector .icon):
(@media (prefers-color-scheme: dark) .inspector-style-rule-icon .icon):
(@media (prefers-color-scheme: dark) .inspector-style-rule-icon.pseudo-selector .icon):
(@media (prefers-color-scheme: dark) .inherited-style-rule-icon .icon):
(@media (prefers-color-scheme: dark) .inherited-element-style-rule-icon .icon):
* UserInterface/Views/TimelineIcons.css:
(.network-icon .icon):
(.script-icon .icon):
(.cpu-icon .icon):
(.memory-icon .icon):
(.heap-allocations-icon .icon):
(.layout-icon .icon):
(.rendering-frame-icon .icon):
(.media-icon .icon):
(.stopwatch-icon .icon):
(.style-record .icon):
(.layout-record .icon):
(.paint-record .icon):
(.composite-record .icon):
(.rendering-frame-record .icon):
(.api-record .icon):
(.evaluated-record .icon):
(.event-record .icon):
(.probe-record .icon):
(.console-profile-record .icon):
(.garbage-collection-profile-record .icon):
(.timer-record .icon):
(.animation-frame-record .icon):
(.css-animation-record .icon):
(.css-transition-record .icon):
(.media-element-record .icon):
(.heap-snapshot-record .icon):
(@media (prefers-color-scheme: dark) .network-icon .icon):
(@media (prefers-color-scheme: dark) .script-icon .icon):
(@media (prefers-color-scheme: dark) .cpu-icon .icon):
(@media (prefers-color-scheme: dark) .memory-icon .icon):
(@media (prefers-color-scheme: dark) .heap-allocations-icon .icon):
(@media (prefers-color-scheme: dark) .layout-icon .icon):
(@media (prefers-color-scheme: dark) .rendering-frame-icon .icon):
(@media (prefers-color-scheme: dark) .media-icon .icon):
(@media (prefers-color-scheme: dark) .stopwatch-icon .icon):
(@media (prefers-color-scheme: dark) .style-record .icon):
(@media (prefers-color-scheme: dark) .layout-record .icon):
(@media (prefers-color-scheme: dark) .paint-record .icon):
(@media (prefers-color-scheme: dark) .composite-record .icon):
(@media (prefers-color-scheme: dark) .rendering-frame-record .icon):
(@media (prefers-color-scheme: dark) .api-record .icon):
(@media (prefers-color-scheme: dark) .evaluated-record .icon):
(@media (prefers-color-scheme: dark) .event-record .icon):
(@media (prefers-color-scheme: dark) .probe-record .icon):
(@media (prefers-color-scheme: dark) .console-profile-record .icon):
(@media (prefers-color-scheme: dark) .garbage-collection-profile-record .icon):
(@media (prefers-color-scheme: dark) .timer-record .icon):
(@media (prefers-color-scheme: dark) .animation-frame-record .icon):
(@media (prefers-color-scheme: dark) .css-animation-record .icon):
(@media (prefers-color-scheme: dark) .css-transition-record .icon):
(@media (prefers-color-scheme: dark) .media-element-record .icon):
(@media (prefers-color-scheme: dark) .heap-snapshot-record .icon):
* UserInterface/Views/URLBreakpointTreeElement.css:
(.breakpoint.url:not(.breakpoint-paused-icon) .icon):
(@media (prefers-color-scheme: dark) .breakpoint.url:not(.breakpoint-paused-icon) .icon):
2020-02-14 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: VoiceOver doesn't read selected panel tab
https://bugs.webkit.org/show_bug.cgi?id=207735
<rdar://problem/59445157>
Reviewed by Timothy Hatcher.
* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar):
(WI.NavigationBar.prototype._mouseDown):
(WI.NavigationBar.prototype._mouseUp):
Navigation bar itself shouldn't receive focus - its items should.
* UserInterface/Views/RadioButtonNavigationItem.js:
(WI.RadioButtonNavigationItem):
"tab" was passed as a label by mistake. VoiceOver read every tab as "tab" instead of it's actual label.
(WI.RadioButtonNavigationItem.prototype.set selected):
When clicking on a tab, focus on it so VoiceOver could read it.
2020-02-14 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Bezier editor popover should be strictly LTR
https://bugs.webkit.org/show_bug.cgi?id=206968
<rdar://problem/59007065>
Reviewed by Timothy Hatcher.
webkitConvertPointFromPageToNode does not work correctly with the zoom level other than 1.
Replace all uses of webkitConvertPointFromPageToNode with getBoundingClientRect.
* UserInterface/Models/Geometry.js:
(WI.Point.fromEventInElement):
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare.prototype._updateColorForMouseEvent):
* UserInterface/Views/GradientSlider.js:
(WI.GradientSlider.prototype._updateShadowKnob):
* UserInterface/Views/Slider.js:
(WI.Slider.prototype._localPointForEvent):
(WI.Slider):
2020-02-12 Pavel Feldman <pavel.feldman@gmail.com>
Web Inspector: encode binary web socket frames using base64
https://bugs.webkit.org/show_bug.cgi?id=207448
Previous representation of binary frames is lossy using fromUTF8WithLatin1Fallback,
this patch consistently encodes binary data using base64.
Reviewed by Timothy Hatcher.
* UserInterface/Models/WebSocketResource.js:
(WI.WebSocketResource.prototype.addFrame):
2020-02-11 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector RTL: Elements closing tag is reversed
https://bugs.webkit.org/show_bug.cgi?id=207214
Reviewed by Timothy Hatcher.
Wrap text nodes in `unicode-bidi: isolate-override`. From MDN:
isolate-override:
This keyword applies the isolation behavior of the isolate
keyword to the surrounding content and the override behavior
of the bidi-override keyword to the inner content.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li > span > .html-text-node):
2020-02-09 Keith Rollin <krollin@apple.com>
Re-enable LTO for ARM builds
https://bugs.webkit.org/show_bug.cgi?id=207402
<rdar://problem/49190767>
Reviewed by Sam Weinig.
Bug 190758 re-enabled LTO for Production builds for x86-family CPUs.
Enabling it for ARM was left out due to a compiler issue. That issue
has been fixed, and so now we can re-enable LTO for ARM.
* Configurations/Base.xcconfig:
2020-02-07 Jon Lee <jonlee@apple.com>
Web Inspector: Revert slim toolbar
https://bugs.webkit.org/show_bug.cgi?id=207422
Reviewed by Timothy Hatcher.
The slim toolbar needs a little more work before landing.
This patch reverts r255547, r255557, r255890, r255892, r255893, r255901, r255980.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
* UserInterface/Base/Setting.js:
* UserInterface/Controllers/ConsoleManager.js:
* UserInterface/Debug/Bootstrap.js:
* UserInterface/Images/NewTab.svg: Added.
* UserInterface/Images/NewTabPlus.svg: Added.
* UserInterface/Images/Origin.svg:
* UserInterface/Images/SearchResults.svg: Added.
* UserInterface/Images/SourcesPaused.svg: Removed.
* UserInterface/Main.html:
* UserInterface/Models/DebuggerDashboard.js: Copied from Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css.
* UserInterface/Models/DefaultDashboard.js: Added.
* UserInterface/Views/ActivateButtonToolbarItem.js: Copied from Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css.
* UserInterface/Views/AuditTabContentView.js:
* UserInterface/Views/ButtonNavigationItem.css:
* UserInterface/Views/ButtonNavigationItem.js:
* UserInterface/Views/ButtonToolbarItem.css: Copied from Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.css.
* UserInterface/Views/ButtonToolbarItem.js: Copied from Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css.
* UserInterface/Views/ConsoleTabContentView.js:
* UserInterface/Views/ContentBrowserTabContentView.js:
* UserInterface/Views/ControlToolbarItem.css: Copied from Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.css.
* UserInterface/Views/ControlToolbarItem.js: Copied from Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.css.
* UserInterface/Views/DOMTreeContentView.css:
* UserInterface/Views/DashboardContainerView.css: Added.
* UserInterface/Views/DashboardContainerView.js: Added.
* UserInterface/Views/DashboardView.js: Copied from Source/WebInspectorUI/UserInterface/Views/PinnedTabBarItem.js.
* UserInterface/Views/DebuggerDashboardView.css: Added.
* UserInterface/Views/DebuggerDashboardView.js: Added.
* UserInterface/Views/DefaultDashboardView.css: Added.
* UserInterface/Views/DefaultDashboardView.js: Added.
* UserInterface/Views/DividerNavigationItem.css:
* UserInterface/Views/ElementsTabContentView.js:
* UserInterface/Views/FlexibleSpaceNavigationItem.css:
* UserInterface/Views/GeneralTabBarItem.js:
* UserInterface/Views/GraphicsTabContentView.js:
* UserInterface/Views/GroupNavigationItem.js:
* UserInterface/Views/LayersTabContentView.js:
* UserInterface/Views/LegacyTabBar.js: Copied from Source/WebInspectorUI/UserInterface/Views/TabBar.js.
* UserInterface/Views/Main.css:
* UserInterface/Views/NavigationBar.js:
* UserInterface/Views/NetworkDetailView.css:
* UserInterface/Views/NetworkTabContentView.js:
* UserInterface/Views/NetworkTableContentView.css:
* UserInterface/Views/NetworkTableContentView.js:
* UserInterface/Views/NewTabContentView.css: Copied from Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineOverviewGraph.css.
* UserInterface/Views/NewTabContentView.js: Added.
* UserInterface/Views/PinnedTabBarItem.js:
* UserInterface/Views/QuickConsole.js:
* UserInterface/Views/RenderingFrameTimelineOverviewGraph.css:
* UserInterface/Views/SearchTabContentView.js:
* UserInterface/Views/SettingsTabContentView.js:
* UserInterface/Views/Sidebar.js:
* UserInterface/Views/SizesToFitNavigationBar.js: Copied from Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css.
* UserInterface/Views/SourcesTabContentView.js:
* UserInterface/Views/StorageTabContentView.js:
* UserInterface/Views/TabBar.css:
* UserInterface/Views/TabBar.js:
* UserInterface/Views/TabBarItem.js:
* UserInterface/Views/TabBrowser.js:
* UserInterface/Views/TabContentView.js:
* UserInterface/Views/TimelineOverview.css:
* UserInterface/Views/TimelineRecordFrame.css:
* UserInterface/Views/TimelineRuler.css:
* UserInterface/Views/TimelineTabContentView.js:
* UserInterface/Views/Toolbar.css: Added.
* UserInterface/Views/Toolbar.js: Added.
* UserInterface/Views/Variables.css:
2020-02-07 Devin Rousso <drousso@apple.com>
Web Inspector: Add another Protocol Version (iOS 13.4)
https://bugs.webkit.org/show_bug.cgi?id=207213
<rdar://problem/52846208>
Reviewed by Timothy Hatcher.
* UserInterface/Protocol/Legacy/13.4/InspectorBackendCommands.js: Added.
* Versions/Inspector-iOS-13.4.json: Added.
2020-02-06 Fujii Hironori <Hironori.Fujii@sony.com>
[Web Inspector][WinCairo] Selecting an error message in Console causes "TypeError:​ selection.focusNode.closest is not a function."
https://bugs.webkit.org/show_bug.cgi?id=207248
Reviewed by Devin Rousso.
r242174 replaced Node.enclosingNodeOrSelfWithClass with
Element.closest. However, selection.focusNode isn't necessarily an
Element, but can be a Text node.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._mousemove): Use selection.focusNode.parentElement.closest
if selection.focusNode is not a instance of Element.
2020-02-06 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r249831): Sources: endless spinner when trying to view a resource
https://bugs.webkit.org/show_bug.cgi?id=207346
<rdar://problem/59209016>
Reviewed by Timothy Hatcher.
* UserInterface/Workers/Formatter/HTMLParser.js:
(HTMLParser.prototype._parseAttr):
Attributes are allowed to contain "/".
https://html.spec.whatwg.org/multipage/parsing.html#before-attribute-value-state
2020-02-06 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(?): Search: selecting a DOM node search result switches to the Elements Tab
https://bugs.webkit.org/show_bug.cgi?id=207322
Reviewed by Timothy Hatcher.
* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype._tabBarItemSelected):
The Search Tab is marked such that it isn't saved to `WI._openTabsSetting`, as otherwise
more than one Search Tab could be added to the tab bar (one from the setting and one from
the default pinned tab). It is also marked as being pinned, however, meaning that we know it
will always be in the tab bar, even if we also know it won't be in `WI._openTabsSetting`. As
such, we should update it's position in the `_recentTabContentViews` list so that we can use
it when showing represented objects (if able) via `bestTabContentViewForRepresentedObject`.
2020-02-05 Devin Rousso <drousso@apple.com>
Web Inspector: the height of the undocked title area shouldn't change when zoomed
https://bugs.webkit.org/show_bug.cgi?id=207228
Reviewed by Timothy Hatcher.
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI.contentLoaded.updateZoomFactorCSSVariable): Added.
Save the zoom factor as a number in a CSS variable on the `<body>`.
* UserInterface/Views/Variables.css:
(body.mac-platform:not(.docked)): Added.
(body:not(.docked)): Deleted.
Divide the default `22px` by the current zoom factor so that it cancels out when rendered.
Make it so that the undocked title area is only shown on macOS <https://webkit.org/b/204627#c47>
2020-02-05 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Some cookie table column headers should not be localizable
https://bugs.webkit.org/show_bug.cgi?id=206920
Reviewed by Timothy Hatcher.
Keep headers that match cookie directives always in English.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/CookieStorageContentView.js:
(WI.CookieStorageContentView.prototype.initialLayout):
2020-02-05 Devin Rousso <drousso@apple.com>
Web Inspector: slightly increase the horizontal padding around scope bar items
https://bugs.webkit.org/show_bug.cgi?id=207321
Reviewed by Timothy Hatcher.
* UserInterface/Views/ScopeBar.css:
(.scope-bar):
(body[dir=ltr] .scope-bar > li.multiple > select):
(body[dir=rtl] .scope-bar > li.multiple > select):
* UserInterface/Views/RadioButtonNavigationItem.css:
(.navigation-bar .item.radio.button.text-only):
2020-02-05 Devin Rousso <drousso@apple.com>
Web Inspector: Tab Bar: move window management items to the left and don't show reload/download unless remotely inspecting
https://bugs.webkit.org/show_bug.cgi?id=207318
Reviewed by Timothy Hatcher.
Move the window management buttons to the left side to match the system look/feel.
Hide the reload/download buttons when inspecting locally, as there are other ways of
reloading the inspected page or downloading a Web Archive.
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI._updateDockNavigationItems):
(WI._updateReloadTabBarButton):
(WI._updateDownloadTabBarButton):
(WI._updateInspectModeTabBarButton):
(WI._updateTabBarDividers): Added.
(WI._updateConsoleTabBarButtons):
* UserInterface/Debug/Bootstrap.js:
(updateDebugUI):
(WI.runBootstrapOperations):
2020-02-05 Devin Rousso <drousso@apple.com>
Web Inspector: Network: the resource detail view cuts off the bottom statistics bar
https://bugs.webkit.org/show_bug.cgi?id=207320
Reviewed by Timothy Hatcher.
* UserInterface/Views/Variables.css:
(:root):
Add a `--network-statistics-height` variable.
* UserInterface/Views/NetworkDetailView.css:
(.network-detail):
* UserInterface/Views/NetworkTableContentView.css:
(.network-table > .statistics):
Use the `--network-statistics-height` variable to make sure the statistics row and the
details view for the selected network entry don't overlap.
Drive-by: center the content of the statistics row to better match the system look/feel.
2020-02-05 Devin Rousso <drousso@apple.com>
Web Inspector: increase the height of the tab bar to match other navigation bars
https://bugs.webkit.org/show_bug.cgi?id=207317
Reviewed by Timothy Hatcher.
* UserInterface/Views/Variables.css:
(:root):
Define `--tab-bar-height` in terms of `--navigation-bar-height` so they share the same value.
* UserInterface/Views/TabBar.css:
(.tab-bar > .tabs > .item):
(.tab-bar > .tabs > .item.pinned):
(.tab-bar > .tabs > .item.pinned.tab-picker): Deleted.
Increase the width to match the `--tab-bar-height` so that pinned tab bar items are square.
2020-02-05 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Dragging handles in the easing popover selects sidebar text
https://bugs.webkit.org/show_bug.cgi?id=207316
Reviewed by Timothy Hatcher.
* UserInterface/Views/BezierEditor.js:
(WI.BezierEditor.prototype._handleMousedown):
2020-02-05 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: add a special breakpoint for controlling whether `debugger` statements pause
https://bugs.webkit.org/show_bug.cgi?id=206818
Reviewed by Timothy Hatcher.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.async initializeTarget):
(WI.DebuggerManager.prototype.get debuggerStatementsBreakpoint): Added.
(WI.DebuggerManager.prototype.isBreakpointRemovable):
(WI.DebuggerManager.prototype._breakpointDisabledStateDidChange):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
* UserInterface/Views/BreakpointTreeElement.css:
(.breakpoint-debugger-statement-icon .icon): Added.
* UserInterface/Images/DebuggerStatement.svg: Added.
* Localizations/en.lproj/localizedStrings.js:
2020-02-05 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Bezier editor popover should be strictly LTR
https://bugs.webkit.org/show_bug.cgi?id=206968
<rdar://problem/59007065>
Reviewed by Timothy Hatcher.
- Don't mirror the coordinate system.
- Don't reverste the order of the cubic bezier values, e.g. `cubic-bezier(0, 0.5, 1, 0.5)`.
* UserInterface/Views/BezierEditor.css:
(90%):
(to):
(body[dir=ltr] .bezier-editor): Deleted.
(body[dir=rtl] .bezier-editor): Deleted.
(body[dir=rtl] .bezier-editor > .bezier-container): Deleted.
* UserInterface/Views/BezierEditor.js:
2020-02-03 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix the inspector files combination after r255547
* UserInterface/Main.html: Remove Views/SizesToFitNavigationBar.js that was removed in r255547
2020-02-01 Devin Rousso <drousso@apple.com>
Web Inspector: move the items in the toolbar into the tab bar to save vertical space
https://bugs.webkit.org/show_bug.cgi?id=204627
Reviewed by Timothy Hatcher.
Merge the toolbar are and tab bar to waste less vertical space.
The inspect, download, reload, and device settings buttons are pinned before the tabs.
If there are any console warnings/errors, an icon for each type of message is shown between
the left buttons and the tabs, and each button's opacity is animated whenever a new message
is added.
Whenever the debugger pauses, change the tab bar icon of the Sources Tab to an image that
includes paused iconography (||) to help convey the debugger's state no matter which tab is
currently selected, just like the debugger dashboard.
The docking configuration, debug, and close buttons are pinned after the tabs.
The dashboard network information has been moved to the Network Tab (described below).
When undocked, the tab bar and all the content below it are pushed down by 22px to make room
for the system close/minimize/maximize buttons and the window title.
* UserInterface/Base/Main.js:
(WI.loaded):
(WI._handleSettingsKeyboardShortcut):
(WI._tryToRestorePendingTabs):
(WI.isNewTabWithTypeAllowed):
(WI._openDefaultTab): Deleted.
(WI.showNewTabTab): Deleted.
* UserInterface/Views/Main.css:
(#undocked-title-area): Added.
(body.docked #undocked-title-area): Added.
(body.window-inactive #undocked-title-area): Added.
(#main):
(@keyframes tab-bar-console-item-pulse): Added.
(.tab-bar > .navigation-bar :matches(.console-warnings, .console-errors):not(.disabled).pulsing): Added.
(@media (prefers-color-scheme: dark) #undocked-title-area): Added.
(@media (prefers-color-scheme: dark) body.window-inactive #undocked-title-area): Added.
(body.docked.bottom): Deleted.
(body.docked.bottom #toolbar): Deleted.
(body.docked.bottom #toolbar .item:not(.flexible-space)): Deleted.
* UserInterface/Views/TabBar.js:
(WI.TabBar):
(WI.TabBar.prototype.addNavigationItemBefore): Added.
(WI.TabBar.prototype.addNavigationItemAfter): Added.
(WI.TabBar.prototype.insertTabBarItem):
(WI.TabBar.prototype.insertTabBarItem.animateTabs):
(WI.TabBar.prototype.insertTabBarItem.removeStyles):
(WI.TabBar.prototype.removeTabBarItem):
(WI.TabBar.prototype.removeTabBarItem.animateTabs):
(WI.TabBar.prototype.removeTabBarItem.removeStyles):
(WI.TabBar.prototype.set selectedTabBarItem):
(WI.TabBar.prototype.get tabCount): Added.
(WI.TabBar.prototype.layout):
(WI.TabBar.prototype.didLayoutSubtree): Added.
(WI.TabBar.prototype._recordTabBarItemSizesAndPositions):
(WI.TabBar.prototype._finishExpandingTabsAfterClose):
(WI.TabBar.prototype._finishExpandingTabsAfterClose.animateTabs):
(WI.TabBar.prototype._finishExpandingTabsAfterClose.removeStyles):
(WI.TabBar.prototype._handleClick):
(WI.TabBar.prototype._handleMouseMoved):
(WI.TabBar.prototype._handleMouseUp):
(WI.TabBar.prototype._handleMouseLeave):
(WI.TabBar.prototype._handleContextMenu):
(WI.TabBar.prototype.get saveableTabCount): Deleted.
(WI.TabBar.layout.forceItemHidden): Deleted.
* UserInterface/Views/TabBar.css:
(.tab-bar):
(body:matches(.window-inactive, .window-docked-inactive) .tab-bar): Added.
(.tab-bar > .border): Added.
(.tab-bar > .border.top): Added.
(.tab-bar > .border.bottom): Added.
(body.docked.bottom .tab-bar > .border.top): Added.
(body:matches(.window-inactive, .window-docked-inactive) .tab-bar > .border): Added.
(@media (-webkit-max-device-pixel-ratio: 1) body.docked:matches(.right, .left):not(.window-docked-inactive) .tab-bar > .border.top): Added.
(@media (-webkit-min-device-pixel-ratio: 2) body.docked:matches(.right, .left):not(.window-docked-inactive) .tab-bar > .border.top): Added.
(.tab-bar > .tabs > .item):
(.tab-bar > .tabs > .item:not(.disabled).selected):
(.tab-bar > .tabs:not(.animating) > .item:not(.selected, .disabled):hover):
(body:matches(.window-inactive, .window-docked-inactive) .tab-bar > .tabs > .item):
(.tab-bar > .navigation-bar): Added.
(.tab-bar > .navigation-bar > .item.group > .item): Added.
(.tab-bar > .navigation-bar > .item.group > .item:nth-child(1 of :not(.hidden))): Added.
(.tab-bar > .navigation-bar > .item.group > .item:nth-last-child(1 of :not(.hidden))): Added.
(.tab-bar > .navigation-bar .item.divider): Added.
(body:matches(.window-inactive, .window-docked-inactive) .tab-bar > .navigation-bar > .item.divider): Added.
(.tab-bar > .tabs): Added.
(body:matches(.window-inactive, .window-docked-inactive) .tab-bar > .tabs > .item): Added.
(.tab-bar > .tabs.dragging-tab > .item.selected, .tab-bar > .tabs.static-layout:not(.animating.inserting-tab):not(.dragging-tab) > .item:nth-last-child(1 of :not(.pinned)), .tab-bar > .tabs.animating.closing-tab > .item.selected): Added.
(body:matches(.window-inactive, .window-docked-inactive) .tab-bar > .tabs.dragging-tab > .item.selected, body:matches(.window-inactive, .window-docked-inactive) .tab-bar > .tabs.static-layout:not(.animating.inserting-tab):not(.dragging-tab) > .item:nth-last-child(1 of :not(.pinned)), body:matches(.window-inactive, .window-docked-inactive) .tab-bar > .tabs.animating.closing-tab > .item.selected): Added.
(@media (prefers-color-scheme: dark) body.docked.bottom .tab-bar > .border.top): Added.
(@media (prefers-color-scheme: dark) .tab-bar > .tabs > .item:not(.disabled).selected):
(body:not(.window-inactive) .tab-bar.single-tab > .item.default-tab:hover > .close): Deleted.
(.tab-bar.single-tab > .item.default-tab > .close): Deleted.
(body[dir=ltr].window-inactive .tab-bar > .item): Deleted.
(body[dir=rtl].window-inactive .tab-bar > .item): Deleted.
NOTE: elided renaming CSS changes.
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype.reset):
(WI.NetworkTableContentView.prototype.tablePopulateCell):
(WI.NetworkTableContentView.prototype._changeCollection):
(WI.NetworkTableContentView.prototype.initialLayout):
(WI.NetworkTableContentView.prototype.processHAR):
(WI.NetworkTableContentView.prototype._processPendingEntries):
(WI.NetworkTableContentView.prototype._updateEntryForResource):
(WI.NetworkTableContentView.prototype._mainResourceDidChange):
(WI.NetworkTableContentView.prototype._handleResourceSizeDidChange): Added.
(WI.NetworkTableContentView.prototype._resourceTransferSizeDidChange):
(WI.NetworkTableContentView.prototype._handleResourceAdded):
(WI.NetworkTableContentView.prototype._handleFrameWasAdded):
(WI.NetworkTableContentView.prototype._entryForResource):
(WI.NetworkTableContentView.prototype._updateStatistics): Added.
(WI.NetworkTableContentView.prototype._updateStatistic): Added.
(WI.NetworkTableContentView.prototype._startUpdatingLoadTimeStatistic): Added.
(WI.NetworkTableContentView.prototype._stopUpdatingLoadTimeStatistic): Added.
(WI.NetworkTableContentView.prototype._updateLoadTimeStatistic): Added.
* UserInterface/Views/NetworkTableContentView.css:
(.network-table > .statistics): Added.
(.network-table > .statistics > .statistic): Added.
(.network-table > .statistics > .statistic[hidden]): Added.
(.network-table > .statistics > .statistic > .icon): Added.
(.network-table > .statistics > .statistic > .text): Added.
(@media (prefers-color-scheme: dark) .network-table > .statistics > .statistic.domain-count > .icon): Added.
Add a fixed row below the network table that contains statistics information based on the
current shown collection (e.g. live data vs HAR):
- number of domains
- number of resources
- total resource size
- total transfer size
- number of redirects
- time to load
Slightly dim entries for previous sessions if Preserve Log is checked, since the statistics
data is calculated from the current session.
NOTE: elided renaming CSS changes.
* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype.addTabForContentView):
(WI.TabBrowser.prototype.closeTabForContentView):
(WI.TabBrowser.prototype._tabBarItemSelected):
(WI.TabBrowser.prototype._tabBarItemRemoved):
* UserInterface/Views/TabContentView.js:
(WI.TabContentView.shouldPinTab): Added.
* UserInterface/Views/AuditTabContentView.js:
(WI.AuditTabContentView):
(WI.AuditTabContentView.tabInfo):
* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView):
(WI.CanvasTabContentView.tabInfo):
* UserInterface/Views/ConsoleTabContentView.js:
(WI.ConsoleTabContentView):
(WI.ConsoleTabContentView.tabInfo):
* UserInterface/Views/ContentBrowserTabContentView.js:
(WI.ContentBrowserTabContentView):
* UserInterface/Views/ElementsTabContentView.js:
(WI.ElementsTabContentView):
(WI.ElementsTabContentView.tabInfo):
* UserInterface/Views/LayersTabContentView.js:
(WI.LayersTabContentView):
(WI.LayersTabContentView.tabInfo):
* UserInterface/Views/NetworkTabContentView.js:
(WI.NetworkTabContentView):
(WI.NetworkTabContentView.tabInfo):
* UserInterface/Views/SearchTabContentView.js:
(WI.SearchTabContentView):
(WI.SearchTabContentView.tabInfo):
(WI.SearchTabContentView.shouldPinTab): Added.
(WI.SearchTabContentView.shouldSaveTab): Added.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView):
(WI.SettingsTabContentView.tabInfo):
(WI.SettingsTabContentView.shouldPinTab): Added.
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
* UserInterface/Views/SourcesTabContentView.js:
(WI.SourcesTabContentView):
(WI.SourcesTabContentView.tabInfo):
(WI.SourcesTabContentView.prototype._handleDebuggerPaused): Added.
(WI.SourcesTabContentView.prototype._handleDebuggerResumed): Added.
* UserInterface/Views/StorageTabContentView.js:
(WI.StorageTabContentView):
(WI.StorageTabContentView.tabInfo):
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
(WI.TimelineTabContentView.tabInfo):
* UserInterface/Views/TabBarItem.js:
(WI.TabBarItem):
(WI.TabBarItem.prototype.get element):
(WI.TabBarItem.prototype.get representedObject):
(WI.TabBarItem.prototype.set disabled):
(WI.TabBarItem.prototype.get hidden): Added.
(WI.TabBarItem.prototype.set hidden): Added.
(WI.TabBarItem.prototype.set representedObject): Deleted.
(WI.TabBarItem.prototype.get isDefaultTab): Deleted.
(WI.TabBarItem.prototype.set isDefaultTab): Deleted.
* UserInterface/Views/GeneralTabBarItem.js:
(WI.GeneralTabBarItem.fromTabContentView): Added.
(WI.GeneralTabBarItem.fromTabInfo): Deleted.
* UserInterface/Views/PinnedTabBarItem.js:
(WI.PinnedTabBarItem):
(WI.PinnedTabBarItem.fromTabContentView): Added.
(WI.PinnedTabBarItem.titleDidChange):
(WI.PinnedTabBarItem.fromTabInfo): Deleted.
(WI.PinnedTabBarItem.prototype.titleDidChange): Deleted.
(WI.PinnedTabBarItem.prototype._handleContextMenuEvent): Deleted.
Simplify how tab bar items are created.
* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype.get sizesToFit):
(WI.NavigationBar.prototype.addNavigationItem):
(WI.NavigationBar.prototype.insertNavigationItem):
* UserInterface/Views/SizesToFitNavigationBar.js: Removed.
* UserInterface/Views/Sidebar.js:
(WI.Sidebar):
Support marking `sizesToFit` during construction, instead of having to make a subclass.
* UserInterface/Views/ButtonNavigationItem.js:
(WI.ButtonNavigationItem):
(WI.ButtonNavigationItem.prototype.get imageType): Added.
(WI.ButtonNavigationItem.prototype.set imageType): Added.
(WI.ButtonNavigationItem.prototype._update):
* UserInterface/Views/ButtonNavigationItem.css:
(.tab-bar > .navigation-bar .item.button.image-and-text > span): Added.
(.navigation-bar .item.button > img): Added.
(.navigation-bar .item.button.disabled > img): Added.
(body:matches(.window-inactive, .window-docked-inactive) .navigation-bar .item.button > img): Added.
(body:matches(.window-inactive, .window-docked-inactive) .navigation-bar .item.button.disabled > img): Added.
(@media (prefers-color-scheme: dark) .navigation-bar .item.button.disabled > img): Added.
Allow `WI.ButtonNavigationItem` to use an `<img>` instead of an `<svg>` for it's image. This
is to work around a compositing bug <https://webkit.org/b/207022>.
* UserInterface/Views/GroupNavigationItem.js:
(WI.GroupNavigationItem.prototype.get hidden): Added.
(WI.GroupNavigationItem.prototype.set hidden): Added.
(WI.GroupNavigationItem.prototype.get additionalClassNames): Added.
Add a special case where this item is considered `hidden` if all sub-items are also `hidden`.
* UserInterface/Views/Variables.css:
(:root):
(body:matches(.window-inactive, .window-docked-inactive)): Added.
(body:matches(.window-inactive, .window-docked-inactive) *): Added.
(body:not(.docked)): Added.
(@media (prefers-color-scheme: dark) :root):
(@media (prefers-color-scheme: dark) body:matches(.window-inactive, .window-docked-inactive)): Added.
(@media (prefers-color-scheme: dark) body:matches(.window-inactive, .window-docked-inactive) *): Added.
(body.window-inactive): Deleted.
(body.window-inactive *): Deleted.
(@media (prefers-color-scheme: dark) body.window-inactive): Deleted.
(@media (prefers-color-scheme: dark) body.window-inactive *): Deleted.
Replace `--toolbar-height` with `--undocked-title-area-height`, which is set when docked.
* UserInterface/Views/DividerNavigationItem.css:
(.navigation-bar .item.divider):
(@media (prefers-color-scheme: dark)):
Simplify the CSS in order to better support being used in the tab bar.
* UserInterface/Views/FlexibleSpaceNavigationItem.css:
(.navigation-bar .item.flexible-space):
(.navigation-bar .item.flexible-space.align-start > .item):
(.navigation-bar .item.flexible-space.align-end > .item):
(:matches(.navigation-bar, .toolbar) .item.flexible-space): Deleted.
(:matches(.navigation-bar, .toolbar) .item.flexible-space.align-start > .item): Deleted.
(:matches(.navigation-bar, .toolbar) .item.flexible-space.align-end > .item): Deleted.
Remove toolbar styles.
* UserInterface/Controllers/ConsoleManager.js:
(WI.ConsoleManager):
(WI.ConsoleManager.prototype.get warningCount): Added.
(WI.ConsoleManager.prototype.get errorCount): Added.
(WI.ConsoleManager.prototype.messageWasAdded):
(WI.ConsoleManager.prototype.messagesCleared):
(WI.ConsoleManager.prototype.messageRepeatCountUpdated):
(WI.ConsoleManager.prototype._incrementMessageLevelCount): Added.
(WI.ConsoleManager.prototype._delayedMessagesCleared):
Keep track of the count of warnings and errors so that they can be used to determine when to
show Console button navigation items in the tab bar.
* UserInterface/Views/DOMTreeContentView.css:
(body:not(.window-inactive, .window-docked-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, .hovered) .status-image.breakpoint): Added.
(body:not(.window-inactive, .window-docked-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, .hovered) .status-image.breakpoint.subtree): Added.
(body:not(.window-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, .hovered) .status-image.breakpoint): Deleted.
(body:not(.window-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, .hovered) .status-image.breakpoint.subtree): Deleted.
* UserInterface/Views/RenderingFrameTimelineOverviewGraph.css:
(body:matches(.window-inactive, .window-docked-inactive) .timeline-overview-graph.rendering-frame > .frame-marker): Added.
(body.window-inactive .timeline-overview-graph.rendering-frame > .frame-marker): Deleted.
* UserInterface/Views/TimelineOverview.css:
(.timeline-overview > .tree-outline.timelines .item.selected + .item, body:matches(.window-inactive, .window-docked-inactive) .timeline-overview > .tree-outline.timelines .item.selected + .item): Added.
(@media (prefers-color-scheme: dark) .timeline-overview > .tree-outline.timelines .item.selected + .item, body:matches(.window-inactive, .window-docked-inactive) .timeline-overview > .tree-outline.timelines .item.selected + .item): Added.
(.timeline-overview > .tree-outline.timelines .item.selected + .item, body.window-inactive .timeline-overview > .tree-outline.timelines .item.selected + .item): Deleted.
(@media (prefers-color-scheme: dark) .timeline-overview > .tree-outline.timelines .item.selected + .item, body.window-inactive .timeline-overview > .tree-outline.timelines .item.selected + .item): Deleted.
* UserInterface/Views/TimelineRecordFrame.css:
(body:matches(.window-inactive, .window-docked-inactive) .timeline-record-frame.selected): Added.
(body.window-inactive .timeline-record-frame.selected): Deleted.
* UserInterface/Views/TimelineRuler.css:
(body:matches(.window-inactive, .window-docked-inactive) .timeline-ruler > .header > .divider): Added.
(body.window-inactive .timeline-ruler > .header > .divider): Deleted.
Add selectors for `.window-docked-inactive` everywhere that `.window-inactive` exists.
* UserInterface/Base/Setting.js:
Remove new tab bar experimental setting.
* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):
(WI.runBootstrapOperations.applyDumpMessagesState):
(WI.runBootstrapOperations.updateDebugUI):
* UserInterface/Images/Origin.svg:
Add `id="root"` so this can be used with `WI.ImageUtilities.useSVGSymbol`.
* UserInterface/Main.html:
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ActivateButtonToolbarItem.js: Removed.
* UserInterface/Views/ButtonToolbarItem.js: Removed.
* UserInterface/Views/ButtonToolbarItem.css: Removed.
* UserInterface/Views/ControlToolbarItem.js: Removed.
* UserInterface/Views/ControlToolbarItem.css: Removed.
* UserInterface/Views/Toolbar.js: Removed.
* UserInterface/Views/Toolbar.css: Removed.
Remove toolbar related code now that it has been merged into the tab bar.
* UserInterface/Models/DebuggerDashboard.js: Removed.
* UserInterface/Models/DefaultDashboard.js: Removed.
* UserInterface/Views/DashboardContainerView.js: Removed.
* UserInterface/Views/DashboardContainerView.css: Removed.
* UserInterface/Views/DashboardView.js: Removed.
* UserInterface/Views/DebuggerDashboardView.js: Removed.
* UserInterface/Views/DebuggerDashboardView.css: Removed.
* UserInterface/Views/DefaultDashboardView.js: Removed.
* UserInterface/Views/DefaultDashboardView.css: Removed.
Remove dashboard related code now that it has been merged into the tab bar.
* UserInterface/Views/LegacyTabBar.js: Removed.
* UserInterface/Views/NewTabContentView.js: Removed.
* UserInterface/Views/NewTabContentView.css: Removed.
* UserInterface/Images/NewTab.svg: Removed.
* UserInterface/Images/NewTabPlus.svg: Removed.
* UserInterface/Images/SearchResults.svg: Removed.
Remove the lebacy tab bar in favor of the new tab bar.
2020-01-29 Devin Rousso <drousso@apple.com>
Web Inspector: add instrumentation for showing existing Web Animations
https://bugs.webkit.org/show_bug.cgi?id=205434
<rdar://problem/28328087>
Reviewed by Brian Burg.
* UserInterface/Controllers/AnimationManager.js: Added.
(WI.AnimationManager):
(WI.AnimationManager.prototype.get domains):
(WI.AnimationManager.prototype.activateExtraDomain):
(WI.AnimationManager.prototype.initializeTarget):
(WI.AnimationManager.prototype.get animationCollection):
(WI.AnimationManager.prototype.get supported):
(WI.AnimationManager.prototype.enable):
(WI.AnimationManager.prototype.disable):
(WI.AnimationManager.prototype.animationCreated):
(WI.AnimationManager.prototype.effectChanged):
(WI.AnimationManager.prototype.targetChanged):
(WI.AnimationManager.prototype.animationDestroyed):
(WI.AnimationManager.prototype._handleMainResourceDidChange):
* UserInterface/Protocol/AnimationObserver.js:
(WI.AnimationObserver.prototype.animationCreated): Added.
(WI.AnimationObserver.prototype.effectChanged): Added.
(WI.AnimationObserver.prototype.targetChanged): Added.
(WI.AnimationObserver.prototype.animationDestroyed): Added.
* UserInterface/Models/AnimationCollection.js: Added.
(WI.AnimationCollection):
(WI.AnimationCollection.prototype.get animationType):
(WI.AnimationCollection.prototype.get displayName):
(WI.AnimationCollection.prototype.objectIsRequiredType):
(WI.AnimationCollection.prototype.animationCollectionForType):
(WI.AnimationCollection.prototype.itemAdded):
(WI.AnimationCollection.prototype.itemRemoved):
(WI.AnimationCollection.prototype.itemsCleared):
Similar to `WI.ResourceCollection`, create a subclass of `WI.Collection` that maintains it's
own sub-`WI.AnimationCollection`s for each type of `WI.Animation.Type`.
* UserInterface/Models/Animation.js: Added.
(WI.Animation):
(WI.Animation.fromPayload):
(WI.Animation.displayNameForAnimationType):
(WI.Animation.displayNameForPlaybackDirection):
(WI.Animation.displayNameForFillMode):
(WI.Animation.resetUniqueDisplayNameNumbers):
(WI.Animation.prototype.get animationId):
(WI.Animation.prototype.get backtrace):
(WI.Animation.prototype.get animationType):
(WI.Animation.prototype.get startDelay):
(WI.Animation.prototype.get endDelay):
(WI.Animation.prototype.get iterationCount):
(WI.Animation.prototype.get iterationStart):
(WI.Animation.prototype.get iterationDuration):
(WI.Animation.prototype.get timingFunction):
(WI.Animation.prototype.get playbackDirection):
(WI.Animation.prototype.get fillMode):
(WI.Animation.prototype.get keyframes):
(WI.Animation.prototype.get displayName):
(WI.Animation.prototype.requestEffectTarget):
(WI.Animation.prototype.effectChanged):
(WI.Animation.prototype.targetChanged):
(WI.Animation.prototype._updateEffect):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.resolveAnimation): Added.
* UserInterface/Views/GraphicsTabContentView.js: Renamed from Source/WebInspectorUI/UserInterface/Views/CanvasTabContentView.js.
(WI.GraphicsTabContentView):
(WI.GraphicsTabContentView.tabInfo):
(WI.GraphicsTabContentView.isTabAllowed):
(WI.GraphicsTabContentView.prototype.get type):
(WI.GraphicsTabContentView.prototype.showRepresentedObject): Added.
(WI.GraphicsTabContentView.prototype.canShowRepresentedObject):
(WI.GraphicsTabContentView.prototype.closed):
(WI.GraphicsTabContentView.prototype.attached):
(WI.GraphicsTabContentView.prototype.detached):
(WI.GraphicsTabContentView.prototype.initialLayout): Added.
(WI.GraphicsTabContentView.prototype._handleOverviewTreeOutlineSelectionDidChange): Added.
* UserInterface/Views/GraphicsTabContentView.css: Renamed from Source/WebInspectorUI/UserInterface/Views/CanvasTabContentView.css.
Rename the Canvas Tab to Graphics Tab and display four sections:
- Canvases
- Web Animations
- CSS Animations
- CSS Transitions
* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel.prototype.canShowRepresentedObject):
Only appear if a `WI.Canvas` or `WI.Recording` is selected.
* UserInterface/Views/GraphicsOverviewContentView.js: Added.
(WI.GraphicsOverviewContentView):
(WI.GraphicsOverviewContentView.prototype.get supplementalRepresentedObjects):
(WI.GraphicsOverviewContentView.prototype.get navigationItems):
(WI.GraphicsOverviewContentView.prototype.attached):
(WI.GraphicsOverviewContentView.prototype.detached):
(WI.GraphicsOverviewContentView.prototype.initialLayout):
(WI.GraphicsOverviewContentView.prototype.dropZoneShouldAppearForDragEvent):
(WI.GraphicsOverviewContentView.prototype.dropZoneHandleDrop):
(WI.GraphicsOverviewContentView.prototype._handleRefreshButtonClicked):
(WI.GraphicsOverviewContentView.prototype._handleShowGridButtonClicked):
(WI.GraphicsOverviewContentView.prototype._handleShowImageGridSettingChanged):
(WI.GraphicsOverviewContentView.prototype._handleImportButtonNavigationItemClicked):
(WI.GraphicsOverviewContentView.prototype._handleOverviewViewSelectedItemChanged):
(WI.GraphicsOverviewContentView.prototype._handleOverviewViewSupplementalRepresentedObjectsDidChange):
(WI.GraphicsOverviewContentView.prototype._handleClick):
* UserInterface/Views/GraphicsOverviewContentView.css: Added.
(.content-view.graphics-overview):
(.content-view.graphics-overview > section):
(.content-view.graphics-overview > section:not(:first-child)):
(.content-view.graphics-overview > section > .header):
(.content-view.graphics-overview > section:not(:first-of-type) > .header):
(.content-view.graphics-overview > section > .header > h1):
(.content-view.graphics-overview > section > .header > .navigation-bar):
(.content-view.graphics-overview > .content-view.canvas-overview):
(@media (prefers-color-scheme: light) .content-view.graphics-overview):
(@media (prefers-color-scheme: light) .content-view.graphics-overview > section > .header):
Add sticky headers for each of the sections described above.
* UserInterface/Views/AnimationCollectionContentView.js: Added.
(WI.AnimationCollectionContentView):
(WI.AnimationCollectionContentView.prototype.handleRefreshButtonClicked):
(WI.AnimationCollectionContentView.prototype.contentViewAdded):
(WI.AnimationCollectionContentView.prototype.contentViewRemoved):
(WI.AnimationCollectionContentView.prototype.detached):
(WI.AnimationCollectionContentView.prototype._handleContentViewMouseEnter):
(WI.AnimationCollectionContentView.prototype._handleContentViewMouseLeave):
* UserInterface/Views/AnimationCollectionContentView.css: Added.
(.content-view.animation-collection):
* UserInterface/Views/AnimationContentView.js: Added.
(WI.AnimationContentView):
(WI.AnimationContentView.get previewHeight):
(WI.AnimationContentView.prototype.handleRefreshButtonClicked):
(WI.AnimationContentView.prototype.initialLayout):
(WI.AnimationContentView.prototype.layout):
(WI.AnimationContentView.prototype.sizeDidChange):
(WI.AnimationContentView.prototype.attached):
(WI.AnimationContentView.prototype.detached):
(WI.AnimationContentView.prototype._refreshSubtitle):
(WI.AnimationContentView.prototype._refreshPreview.addTitle):
(WI.AnimationContentView.prototype._refreshPreview):
(WI.AnimationContentView.prototype._handleEffectChanged):
(WI.AnimationContentView.prototype._handleTargetChanged):
(WI.AnimationContentView.prototype._populateAnimationTargetButtonContextMenu):
* UserInterface/Views/AnimationContentView.css: Added.
(.content-view.animation):
(.content-view.animation.selected):
(.content-view.animation > header):
(.content-view.animation > header > .titles):
(.content-view.animation > header > .titles > .title):
(.content-view.animation > header > .titles > .subtitle):
(.content-view.animation > header > .titles > .subtitle:not(:empty)::before):
(.content-view.animation > header > .navigation-bar):
(.content-view.animation:hover > header > .navigation-bar):
(.content-view.animation > .preview):
(.content-view.animation > .preview > svg):
(body[dir=rtl] .content-view.animation > .preview > svg):
(.content-view.animation > .preview > svg rect):
(.content-view.animation > .preview > svg > .delay line):
(.content-view.animation > .preview > svg > .active path):
(.content-view.animation > .preview > svg > .active circle):
(.content-view.animation > .preview > svg > .active line):
(.content-view.animation > .preview > span):
(@media (prefers-color-scheme: dark) .content-view.animation > header > .titles > .title):
(@media (prefers-color-scheme: dark) .content-view.animation > header > .titles > .subtitle):
(@media (prefers-color-scheme: dark) .content-view.animation > .preview):
Visualize the start/end delay and keyframes of the given animation as a series of bezier
curves separated by markers.
* UserInterface/Views/AnimationDetailsSidebarPanel.js: Added.
(WI.AnimationDetailsSidebarPanel):
(WI.AnimationDetailsSidebarPanel.prototype.inspect):
(WI.AnimationDetailsSidebarPanel.prototype.get animation):
(WI.AnimationDetailsSidebarPanel.prototype.set animation):
(WI.AnimationDetailsSidebarPanel.prototype.initialLayout):
(WI.AnimationDetailsSidebarPanel.prototype.layout):
(WI.AnimationDetailsSidebarPanel.prototype._refreshIdentitySection):
(WI.AnimationDetailsSidebarPanel.prototype._refreshEffectSection):
(WI.AnimationDetailsSidebarPanel.prototype._refreshBacktraceSection):
(WI.AnimationDetailsSidebarPanel.prototype._handleAnimationEffectChanged):
(WI.AnimationDetailsSidebarPanel.prototype._handleAnimationTargetChanged):
(WI.AnimationDetailsSidebarPanel.prototype._handleDetailsSectionCollapsedStateChanged):
* UserInterface/Views/AnimationDetailsSidebarPanel.css: Added.
(.sidebar > .panel.details.animation > .content > .details-section.animation-keyframes .header > .subtitle):
(.sidebar > .panel.details.animation > .content > .details-section.animation-keyframes .details-section):
(.sidebar > .panel.details.animation > .content > .details-section.animation-keyframes .details-section .row.styles):
(.sidebar > .panel.details.animation > .content > .details-section.animation-keyframes .details-section .row.styles .CodeMirror):
(.sidebar > .panel.details.animation > .content > .details-section.animation-keyframes .details-section):
Show collected information about the selected animation, its effect, and its target.
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager):
(WI.CanvasManager.prototype.get canvasCollection): Added.
(WI.CanvasManager.prototype.disable):
(WI.CanvasManager.prototype.canvasAdded):
(WI.CanvasManager.prototype.canvasRemoved):
(WI.CanvasManager.prototype._saveRecordings): Added.
(WI.CanvasManager.prototype._mainResourceDidChange):
(WI.CanvasManager.prototype.get canvases): Deleted.
(WI.CanvasManager.prototype._removeCanvas): Deleted.
Rather than have the `WI.CanvasTabContentView` mainain the `WI.CanvasCollection` and have to
listen for events from the `WI.CanvasManager`, just have the `WI.CanvasManager` hold on to
it instead and provide a getter for it.
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView):
(WI.CanvasOverviewContentView.prototype.get navigationItems):
(WI.CanvasOverviewContentView.prototype.handleRefreshButtonClicked):
(WI.CanvasOverviewContentView.prototype.contentViewAdded):
(WI.CanvasOverviewContentView.prototype.contentViewRemoved):
(WI.CanvasOverviewContentView.prototype.attached):
(WI.CanvasOverviewContentView.prototype.detached):
(WI.CanvasOverviewContentView.prototype._addSavedRecording):
(WI.CanvasOverviewContentView.prototype.hidden): Deleted.
(WI.CanvasOverviewContentView.prototype.get _itemMargin): Deleted.
(WI.CanvasOverviewContentView.prototype._refreshPreviews): Deleted.
(WI.CanvasOverviewContentView.prototype._updateNavigationItems): Deleted.
(WI.CanvasOverviewContentView.prototype._showGridButtonClicked): Deleted.
(WI.CanvasOverviewContentView.prototype._updateShowImageGrid): Deleted.
* UserInterface/Views/CanvasOverviewContentView.css:
(.content-view.canvas-overview):
(.content-view.canvas-overview > .content-view.canvas):
(@media (prefers-color-scheme: dark) .content-view.canvas-overview): Deleted.
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView):
(WI.CanvasContentView.prototype.handleRefreshButtonClicked): Added.
(WI.CanvasContentView.prototype.dropZoneShouldAppearForDragEvent): Added.
(WI.CanvasContentView.prototype.dropZoneHandleDrop): Added.
(WI.CanvasContentView.prototype.initialLayout):
(WI.CanvasContentView.prototype.attached):
(WI.CanvasContentView.prototype._populateCanvasElementButtonContextMenu):
(WI.CanvasContentView.prototype.shown): Deleted.
Move the "Log Canvas Context" to be the first item in the canvas element button context menu.
Drive-by: add a `WI.DropZoneView` for when recording JSON files are dragged on top.
* UserInterface/Views/CanvasContentView.css:
Drive-by: drop `:not(.tab)` from all selectors since the Canvas Tab doesn't exist anymore.
* UserInterface/Views/CollectionContentView.js:
(WI.CollectionContentView):
(WI.CollectionContentView.prototype.get selectedItem): Added.
(WI.CollectionContentView.prototype.set selectedItem): Added.
(WI.CollectionContentView.prototype.addContentViewForItem):
(WI.CollectionContentView.prototype.removeContentViewForItem):
(WI.CollectionContentView.prototype.showContentPlaceholder):
(WI.CollectionContentView.prototype.initialLayout):
(WI.CollectionContentView.prototype._selectItem):
(WI.CollectionContentView.prototype._handleClick): Added.
(WI.CollectionContentView.prototype.setSelectedItem): Deleted.
* UserInterface/Views/CollectionContentView.css:
(.content-view.collection > .placeholder:not(.message-text-view)): Added.
(.content-view.collection .resource.image img): Deleted.
(.content-view.collection .resource.image img:hover): Deleted.
When selection is enabled, clicking outside of any of the content views should dismiss the
current selection. Clients should also be able to get the currently selected item.
* UserInterface/Views/DetailsSectionSimpleRow.js:
(WI.DetailsSectionSimpleRow.prototype.set value):
Ensure that `0` is considered as a valid value.
* UserInterface/Base/Main.js:
(WI.loaded):
(WI.contentLoaded):
(WI.tabContentViewClassForRepresentedObject):
* UserInterface/Views/ContentView.js:
(WI.ContentView.createFromRepresentedObject):
(WI.ContentView.isViewable):
Allow `WI.Animation` to be viewable.
* UserInterface/Views/Main.css:
(.navigation-item-help): Added.
(.navigation-item-help > .navigation-bar): Added.
(.navigation-item-help > .navigation-bar > .item): Added.
(.message-text-view .navigation-item-help): Deleted.
(.message-text-view .navigation-item-help .navigation-bar): Deleted.
(.message-text-view .navigation-item-help .navigation-bar > .item): Deleted.
Allow `WI.createNavigationItemHelp` to be used independently of `WI.createMessageTextView`.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.nodeForId):
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.animationTrackingUpdated):
* UserInterface/Models/AuditTestCaseResult.js:
(WI.AuditTestCaseResult.async fromPayload):
Add a fallback so callers don't need to.
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView):
* UserInterface/Views/ResourceCollectionContentView.css:
(.content-view.resource-collection > .resource.image img): Added.
(.content-view.resource-collection > .resource.image img:hover): Added.
Drive-by: move these styles to the right file and make them more specific.
* UserInterface/Models/Canvas.js:
(WI.Canvas.displayNameForContextType):
* UserInterface/Models/Recording.js:
(WI.Recording.displayNameForRecordingType): Added.
Drive-by: fix localized strings.
* UserInterface/Views/RecordingContentView.css:
Drive-by: drop `:not(.tab)` from all selectors since the Recording Tab doesn't exist anymore.
* UserInterface/Main.html:
* UserInterface/Images/Graphics.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/Canvas.svg.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WI.loaded):
* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.expectEmpty): Added.
(TestHarness.prototype.expectNotEmpty): Added.
(TestHarness.prototype._expectationMessageFormat):
(TestHarness.prototype._expectedValueFormat):
Add utility function for checking whether the given value is empty:
- Array `length === 0`
- String `length === 0`
- Set `size === 0`
- Map `size === 0`
- Object `isEmptyObject`
Any other type will automatically fail, as non-objects can't be "empty" (e.g. `42`).
2020-01-27 Devin Rousso <drousso@apple.com>
Web Inspector: don't use `:matches(:before, :after)` after r255059
https://bugs.webkit.org/show_bug.cgi?id=206848
Reviewed by Antti Koivisto.
* UserInterface/Views/SpringEditor.css:
(.spring-editor > .spring-timing::before, .spring-editor > .spring-timing::after): Added.
(.spring-editor > .spring-timing:matches(::before, ::after)): Deleted.
2020-01-27 Devin Rousso <drousso@apple.com>
Web Inspector: unable to evaluate in the isolated world of content scripts injected by safari app extensions
https://bugs.webkit.org/show_bug.cgi?id=206110
<rdar://problem/16945643>
Reviewed by Timothy Hatcher, Joseph Pecoraro, and Brian Burg.
In addition to evaluating in subframe execution contexts, add the ability for Web Inspector
to evaluate in non-normal isolated worlds.
* UserInterface/Models/ExecutionContext.js:
(WI.ExecutionContext):
(WI.ExecutionContext.typeFromPayload): Added.
(WI.ExecutionContext.prototype.get type): Added.
(WI.ExecutionContext.prototype.get isPageContext): Deleted.
* UserInterface/Models/ExecutionContextList.js:
(WI.ExecutionContextList.prototype.add):
* UserInterface/Models/Frame.js:
(WI.Frame.prototype.addExecutionContext):
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.executionContextCreated):
The `Normal` execution context (of which there should only be one) is considered the "page"
execution context.
* UserInterface/Protocol/DirectBackendTarget.js:
(WI.DirectBackendTarget):
* UserInterface/Protocol/PageTarget.js:
(WI.PageTarget):
* UserInterface/Protocol/WorkerTarget.js:
(WI.WorkerTarget):
Default to a `Normal` execution context.
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole):
(WI.QuickConsole.prototype._displayNameForExecutionContext): Added.
(WI.QuickConsole.prototype._resolveDesiredActiveExecutionContext): Added.
(WI.QuickConsole.prototype._setActiveExecutionContext): Added.
(WI.QuickConsole.prototype._updateActiveExecutionContextDisplay): Added.
(WI.QuickConsole.prototype._populateActiveExecutionContextNavigationItemContextMenu): Added.
(WI.QuickConsole.prototype._handleConsoleSavedResultAliasSettingChanged): Added.
(WI.QuickConsole.prototype._handleEngineeringShowInternalExecutionContextsSettingChanged): Added.
(WI.QuickConsole.prototype._handleFramePageExecutionContextChanged): Added.
(WI.QuickConsole.prototype._handleFrameExecutionContextsCleared): Added.
(WI.QuickConsole.prototype._handleDebuggerActiveCallFrameDidChange): Added.
(WI.QuickConsole.prototype._handleActiveExecutionContextChanged): Added.
(WI.QuickConsole.prototype._handleTransitionPageTarget): Added.
(WI.QuickConsole.prototype._handleTargetRemoved): Added.
(WI.QuickConsole.prototype._handleInspectedNodeChanged): Added.
(WI.QuickConsole.prototype._updateStyles):
(WI.QuickConsole.prototype.get navigationBar): Deleted.
(WI.QuickConsole.prototype._pageTargetTransitioned): Deleted.
(WI.QuickConsole.prototype._initializeMainExecutionContextPathComponent): Deleted.
(WI.QuickConsole.prototype.layout): Deleted.
(WI.QuickConsole.prototype._preferredNameForFrame): Deleted.
(WI.QuickConsole.prototype._selectExecutionContext): Deleted.
(WI.QuickConsole.prototype._updateAutomaticExecutionContextPathComponentTooltip): Deleted.
(WI.QuickConsole.prototype._executionContextPathComponentsToDisplay): Deleted.
(WI.QuickConsole.prototype._rebuildExecutionContextPathComponents): Deleted.
(WI.QuickConsole.prototype._framePageExecutionContextsChanged): Deleted.
(WI.QuickConsole.prototype._frameExecutionContextsCleared): Deleted.
(WI.QuickConsole.prototype._activeExecutionContextChanged): Deleted.
(WI.QuickConsole.prototype._createExecutionContextPathComponent): Deleted.
(WI.QuickConsole.prototype._compareExecutionContextPathComponents): Deleted.
(WI.QuickConsole.prototype._insertOtherExecutionContextPathComponent): Deleted.
(WI.QuickConsole.prototype._removeOtherExecutionContextPathComponent): Deleted.
(WI.QuickConsole.prototype._insertExecutionContextPathComponentForFrame): Deleted.
(WI.QuickConsole.prototype._removeExecutionContextPathComponentForFrame): Deleted.
(WI.QuickConsole.prototype._targetAdded): Deleted.
(WI.QuickConsole.prototype._targetRemoved): Deleted.
(WI.QuickConsole.prototype._pathComponentSelected): Deleted.
(WI.QuickConsole.prototype._pathComponentClicked): Deleted.
(WI.QuickConsole.prototype._debuggerActiveCallFrameDidChange): Deleted.
* UserInterface/Views/QuickConsole.css:
(.quick-console > .console-prompt):
(.quick-console > .navigation-bar):
(.quick-console > .navigation-bar .active-execution-context): Added.
(.quick-console > .navigation-bar .active-execution-context > .selector-arrows): Added.
(.quick-console > .navigation-bar .active-execution-context:not(.automatic)): Added.
(.quick-console > .navigation-bar .active-execution-context:not(.automatic) > .selector-arrows): Added.
(.quick-console .execution-context): Deleted.
(.quick-console > .navigation-bar > .hierarchical-path .execution-context): Deleted.
(.quick-console > .navigation-bar > .hierarchical-path .execution-context .separator): Deleted.
(.quick-console > .navigation-bar > .hierarchical-path:not(.automatic-execution-context)): Deleted.
(.quick-console > .navigation-bar > .hierarchical-path:not(.automatic-execution-context) .execution-context): Deleted.
(.quick-console > .navigation-bar > .hierarchical-path:not(.automatic-execution-context) .execution-context .selector-arrows): Deleted.
Replace the `WI.HierarchicalPathNavigationItem` with a plain `WI.NavigationItem` that shows
a `WI.ContextMenu` with all valid execution contexts organized as follows:
Auto - <display name for execution context of inspected DOM node>
----------
Main Frame Normal Execution Context
All User Exection Contexts for the Main Frame
All Internal Exection Contexts for the Main Frame (with the engineering setting)
Frames
Frame Normal Execution Context
All User Exection Contexts for the Frame
All Internal Exection Contexts for the Frame (with the engineering setting)
...
Workers
Worker Execution Context
...
Everything is checkmark selectable other than the separator, "Frames", and "Workers".
* UserInterface/Controllers/RuntimeManager.js:
(WI.RuntimeManager):
(WI.RuntimeManager.prototype._frameExecutionContextsCleared): Deleted.
Let the UI (`WI.QuickConsole`) decide when to automatically update the active execution
context when a frame is removed that owned the active execution context.
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager.prototype.get workerTargets): Added.
(WI.TargetManager.prototype._terminatePageTarget):
Convenience function for getting the list of worker targets.
* UserInterface/Views/GroupNavigationItem.js:
(WI.GroupNavigationItem.prototype.update):
(WI.GroupNavigationItem.prototype.didAttach):
Update the items whenever the group updates.
* UserInterface/Main.html:
* UserInterface/Views/SizesToFitNavigationBar.js: Renamed from Source/WebInspectorUI/UserInterface/Views/QuickConsoleNavigationBar.js.
(WI.SizesToFitNavigationBar):
(WI.SizesToFitNavigationBar.prototype.get sizesToFit):
Rename to allow for other use cases.
* UserInterface/Views/ContextMenu.js:
(WI.ContextSubMenuItem.prototype.appendHeader): Added.
Convenience method for creating a disabled item.
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createEngineeringSettingsView):
Create an engineering setting that controls whether `Internal` execution contexts are shown.
* UserInterface/Test/InspectorProtocol.js:
(InspectorProtocol.addEventListener):
(InspectorProtocol.removeEventListener): Added.
* Localizations/en.lproj/localizedStrings.js:
2020-01-21 Keith Rollin <krollin@apple.com>
Fix tvOS values in SUPPORTED_PLATFORMS
https://bugs.webkit.org/show_bug.cgi?id=206435
<rdar://problem/58674587>
Reviewed by Alexey Proskuryakov.
A number of targets in WebKit have 'tvos' and 'tvsimulator' in
SUPPORTED_PLATFORMS. The correct values are 'appletvos' and
'appletvsimulator'. These should be updated to the correct ones as the
wrong values prevent the tvOS run destination from being usable in the
UI to build for tvOS.
* Configurations/Base.xcconfig:
2020-01-17 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Unchecking Enable Preview Features on Engineering and Preview builds does not affect WI.arePreviewFeaturesEnabled()
https://bugs.webkit.org/show_bug.cgi?id=204026
Reviewed by Brian Burg.
Make `WI.arePreviewFeaturesEnabled()` return false when Enable Preview Features is unchecked.
* UserInterface/Base/Setting.js:
(WI.canShowPreviewFeatures):
(WI.arePreviewFeaturesEnabled):
(WI.isTechnologyPreviewBuild): Deleted.
(WI.canShowPreviewFeatures): Added.
* UserInterface/Views/SettingsTabContentView.js:
2020-01-16 Devin Rousso <drousso@apple.com>
Web Inspector: add links to reference pages
https://bugs.webkit.org/show_bug.cgi?id=206309
Reviewed by Timothy Hatcher.
* UserInterface/Base/Main.js:
(WI._handleDeviceSettingsToolbarButtonClicked):
(WI.createReferencePageLink): Added.
* UserInterface/Views/Main.css:
(.reference-page-link): Added.
(.reference-page-link:active): Added.
(@media (-webkit-device-pixel-ratio: 1) .reference-page-link): Added.
(@media (prefers-color-scheme: dark) .reference-page-link): Added.
(@media (prefers-color-scheme: dark) .reference-page-link:active): Added.
(.device-settings-content):
(.device-settings-content > table): Added.
(.device-settings-content > table > tr > td:first-child): Added.
(.device-settings-content > .reference-page-link-container): Added.
(body[dir=ltr] .device-settings-content > .reference-page-link-container): Added.
(body[dir=rtl] .device-settings-content > .reference-page-link-container): Added.
(.device-settings-content > tr > td:first-child): Deleted.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.async createBootstrapScript):
* UserInterface/Controllers/BreakpointPopoverController.js:
(WI.BreakpointPopoverController.prototype._createPopoverContent):
(WI.BreakpointPopoverController.prototype._popoverActionsCreateAddActionButton):
* UserInterface/Views/BreakpointPopoverController.css:
(.popover .edit-breakpoint-popover-content > table > tr > td.options): Added.
(.popover .edit-breakpoint-popover-content > table > tr > td.options > .reference-page-link-container): Added.
(body[dir=ltr] .popover .edit-breakpoint-popover-content > table > tr > td.options > .reference-page-link-container): Added.
(body[dir=rtl] .popover .edit-breakpoint-popover-content > table > tr > td.options > .reference-page-link-container): Added.
(body[dir=ltr] .popover .edit-breakpoint-popover-content .reference-page-link-container): Added.
(body[dir=rtl] .popover .edit-breakpoint-popover-content .reference-page-link-container): Added.
* UserInterface/Views/EventBreakpointPopover.js:
(WI.EventBreakpointPopover.prototype.show):
* UserInterface/Views/EventBreakpointPopover.css:
(.popover .event-breakpoint-content .reference-page-link-container): Added.
* UserInterface/Views/URLBreakpointPopover.js:
(WI.URLBreakpointPopover.prototype.show):
* UserInterface/Views/URLBreakpointPopover.css:
(.popover .url-breakpoint-content .reference-page-link-container): Added.
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover.prototype.show):
* UserInterface/Views/LocalResourceOverridePopover.css:
(.popover .local-resource-override-popover-content .reference-page-link-container): Added.
(body[dir=ltr] .popover .local-resource-override-popover-content .reference-page-link-container): Added.
(body[dir=rtl] .popover .local-resource-override-popover-content .reference-page-link-container): Added.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype.initialLayout):
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
(WI.SettingsTabContentView.prototype._createElementsSettingsView):
(WI.SettingsTabContentView.prototype._createSourcesSettingsView):
(WI.SettingsTabContentView.prototype._createConsoleSettingsView):
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
(WI.SettingsTabContentView.prototype._createReferenceLink): Added.
* UserInterface/Views/SettingsTabContentView.css:
(.content-view.tab.settings): Added.
(.content-view.tab.settings .navigation-bar): Added.
(.content-view.tab.settings .navigation-bar.invisible): Added.
(.content-view.tab.settings .navigation-bar .item.radio.button.text-only): Added.
(.content-view.tab.settings .navigation-bar .item.radio.button.text-only:before): Added.
(.content-view.tab.settings .navigation-bar .item.radio.button.text-only.selected): Added.
(.content-view.tab.settings > .settings-view): Added.
(.content-view.tab.settings > .settings-view > .separator): Added.
(.content-view.tab.settings > .settings-view > .container): Added.
(.content-view.tab.settings > .settings-view > .container.hidden): Added.
(.content-view.tab.settings > .settings-view > .container-centered): Added.
(.content-view.tab.settings > .settings-view > .container button): Added.
(.content-view.tab.settings > .settings-view > .container > .title): Added.
(.content-view.tab.settings > .settings-view > .container > .editor-group): Added.
(.content-view.tab.settings > .settings-view > .container > .editor-group > .editor): Added.
(.content-view.tab.settings > .settings-view > .container > .editor-group > .editor:first-child > *): Added.
(.content-view.tab.settings > .settings-view > .container > .editor-group > .editor input): Added.
(.content-view.tab.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]): Added.
(.content-view.tab.settings > .settings-view > .container > .editor-group > .editor select): Added.
(.content-view.tab.settings > .settings-view > .container > .editor-group > .editor input[type="number"]): Added.
(.content-view.tab.settings > .settings-view > .container > .editor-group > .editor input[type="text"]): Added.
(.content-view.tab.settings > .settings-view > .container.reference): Added.
(.content-view.tab.settings > .settings-view > .container.reference > .reference-page-link): Added.
(.content-view.tab.settings > .settings-view > .container.reference > .reference-page-link > .go-to-arrow): Added.
(.content-view.settings .navigation-bar): Deleted.
(.content-view.settings .navigation-bar.invisible): Deleted.
(.content-view.settings .navigation-bar .item.radio.button.text-only): Deleted.
(.content-view.settings .navigation-bar .item.radio.button.text-only:before): Deleted.
(.content-view.settings .navigation-bar .item.radio.button.text-only.selected): Deleted.
(.content-view.settings > .settings-view): Deleted.
(.content-view.settings > .settings-view > .separator): Deleted.
(.content-view.settings > .settings-view > .container): Deleted.
(.content-view.settings > .settings-view > .container.hidden): Deleted.
(.content-view.settings > .settings-view > .container-centered): Deleted.
(.content-view.settings > .settings-view > .container button): Deleted.
(.content-view.settings > .settings-view > .container > .title): Deleted.
(.content-view.settings > .settings-view > .container > .editor-group): Deleted.
(.content-view.settings > .settings-view > .container > .editor-group > .editor): Deleted.
(.content-view.settings > .settings-view > .container > .editor-group > .editor:first-child > *): Deleted.
(.content-view.settings > .settings-view > .container > .editor-group > .editor input): Deleted.
(.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]): Deleted.
(.content-view.settings > .settings-view > .container > .editor-group > .editor select): Deleted.
(.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="number"]): Deleted.
(.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="text"]): Deleted.
(@media (prefers-color-scheme: dark) .content-view.settings .navigation-bar): Deleted.
(@media (prefers-color-scheme: dark) .content-view.settings .navigation-bar .item.radio.button.text-only.selected): Deleted.
* UserInterface/Views/BlackboxSettingsView.js:
(WI.BlackboxSettingsView.prototype.initialLayout):
* UserInterface/Views/BlackboxSettingsView.css:
(.settings-view.blackbox > table > tbody td.url): Added.
(.settings-view.blackbox > table > tbody td.url > .CodeMirror):
* Localizations/en.lproj/localizedStrings.js:
2020-01-16 Devin Rousso <drousso@apple.com>
Web Inspector: show the device settings menu when Web Inspector's debug mode is enabled
https://bugs.webkit.org/show_bug.cgi?id=206311
Reviewed by Brian Burg.
This only has an effect when Web Inspector is opened and the debug mode is enabled. If so,
the device settings toolbar icon will appear regardless of whether the inspected target is
a remote device or not. Disabling debug mode will not immediately remove the device settings
toolbar icon, but it will not reappear when Web Inspector is next opened (to allow for taking
screenshots and other such things).
* UserInterface/Base/Main.js:
(WI.contentLoaded):
2020-01-16 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r251487): Web Inspector: selected color in color picker has wrong lightness
https://bugs.webkit.org/show_bug.cgi?id=206202
Reviewed by Devin Rousso.
Currently, tintedColor setter has two code paths:
- rgb2hsv convertion if the color is defined using color(...) syntax.
- HSL to HSV convertion for any other color.
The latter was defined in the view, was untested, and incorrect.
This patch uses WI.Color.rgb2hsv convertion for all colors. This method is
already covered by tests.
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare.prototype.set tintedColor):
2020-01-16 David Kilzer <ddkilzer@apple.com>
Enable -Wconditional-uninitialized in WebInspectorUI, WebKitLegacy, WebKit projects
<https://webkit.org/b/206270>
<rdar://problem/58589767>
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
(WARNING_CFLAGS): Add -Wconditional-uninitialized switch.
2020-01-15 Devin Rousso <drousso@apple.com>
Web Inspector: collapsing a virtualized folder in a `WI.TreeOutline` doesn't updated the DOM
https://bugs.webkit.org/show_bug.cgi?id=206302
Reviewed by Timothy Hatcher.
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._updateVirtualizedElements):
When collapsing a currently visible `WI.TreeElement`, it will still be in the cached set of
visible and attached `WI.TreeElement`s, meaning that `_updateVirtualizedElements` will early
return since it thinks that the same `WI.TreeElement` are being shown. Add another check to
ensure that it only thinks that if the same number of `WI.TreeElement` are visible.
2020-01-13 Devin Rousso <drousso@apple.com>
Web Inspector: "Enable Local Override" and "Delete Local Override" are displayed twice in the contextual menu
https://bugs.webkit.org/show_bug.cgi?id=206184
<rdar://problem/58409880>
Reviewed by Brian Burg.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* UserInterface/Views/LocalResourceOverrideTreeElement.js:
(WI.LocalResourceOverrideTreeElement.prototype.populateContextMenu):
Add an expando flag that can be set by `WI.LocalResourceOverrideTreeElement` to ensure that
the local override context menu items aren't added again by `WI.ResourceTreeElement`.
2020-01-09 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: suggest "color()" when defining color in CSS value
https://bugs.webkit.org/show_bug.cgi?id=205976
Reviewed by Devin Rousso.
* UserInterface/Models/CSSKeywordCompletions.js:
2020-01-08 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: not all injected scripts and style sheets are from extensions
https://bugs.webkit.org/show_bug.cgi?id=205955
Reviewed by Brian Burg.
* UserInterface/Base/Utilities.js:
(isWebKitExtensionScheme): Added.
* UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet.prototype.get injected):
* .eslintrc:
Move the logic for detecting an extension injected resource to its own function.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject):
(WI.SourcesNavigationSidebarPanel.prototype._addStyleSheet):
(WI.SourcesNavigationSidebarPanel.prototype._addScript):
Only show the Anonymous Style Sheets folder once the user tries to show a style sheet that
would be in it.
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype.didPresentDialog):
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
(WI.OpenResourceDialog.prototype._handleStyleSheetAdded):
(WI.OpenResourceDialog.prototype._handleStyleSheetRemoved):
Ignore anonymous scripts, and allow injected style sheets to be added after presenting.
2020-01-08 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Show RGBA input fields for p3 color picker
https://bugs.webkit.org/show_bug.cgi?id=203928
<rdar://problem/56963805>
Reviewed by Brian Burg.
Display numeric input fields for colors defined via `color(...)` CSS syntax.
* UserInterface/Controllers/CodeMirrorColorEditingController.js:
(WI.CodeMirrorColorEditingController.prototype.popoverWillPresent):
Remove unnecessary WI.ColorPicker.Event.FormatChanged event.
* UserInterface/Views/ColorPicker.css:
(.color-picker > .color-inputs > div + div):
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker):
Don't append inputs of all possible color formats to DOM on instantiation.
(WI.ColorPicker.prototype.set color):
(WI.ColorPicker.prototype.set enableColorComponentInputs):
(WI.ColorPicker.prototype._updateColor):
(WI.ColorPicker.prototype._updateColorGamut):
(WI.ColorPicker.prototype._createColorInputsIfNeeded):
(WI.ColorPicker.prototype._showColorComponentInputs):
(WI.ColorPicker.prototype._handleColorInputsContainerInput):
* UserInterface/Views/InlineSwatch.js:
Remove unnecessary WI.ColorPicker.Event.FormatChanged event.
2020-01-08 Devin Rousso <drousso@apple.com>
REGRESSION: (r254186) [ Mac ] inspector/css/add-rule.html is failing
https://bugs.webkit.org/show_bug.cgi?id=205938
<rdar://problem/58413597>
Reviewed by Brian Burg.
* UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet.prototype.get injected):
`scheme` can be `null`, so check that it exists before calling `String.prototype` functions.
2020-01-07 Devin Rousso <drousso@apple.com>
Web Inspector: unable to edit or view the source of style sheets injected by safari app extensions
https://bugs.webkit.org/show_bug.cgi?id=205900
<rdar://problem/57898773>
Reviewed by Timothy Hatcher.
Remove the restrictions around `CSS.StyleSheetOrigin.User` style sheets, thereby allowing
Web Inspector to get the source information that is necessary to show the "resource" in the
Sources Tab.
* UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet.prototype.get displayName):
(WI.CSSStyleSheet.prototype.get injected): Added.
(WI.CSSStyleSheet.prototype.get anonymous): Added.
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._parseRulePayload):
* UserInterface/Models/CSSRule.js:
(WI.CSSRule):
(WI.CSSRule.prototype.get editable):
(WI.CSSRule.prototype._selectorResolved):
Attempt to create a source code location for any style sheet with a source range, not just
for the Inspector Style Sheet.
* UserInterface/Views/CSSStyleSheetTreeElement.js:
(WI.CSSStyleSheetTreeElement):
Instead of hardcoding "Inspector Style Sheet", use the associated `WI.CSSStyleSheet`'s info.
* UserInterface/Views/FrameTreeElement.js:
(WI.FrameTreeElement):
(WI.FrameTreeElement.prototype.onattach):
(WI.FrameTreeElement.prototype.ondetach):
(WI.FrameTreeElement.prototype._styleSheetAdded):
(WI.FrameTreeElement.prototype._styleSheetRemoved): Added.
Ensure that only non-injected non-anonymous style sheets are shown under frames.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._addResource):
(WI.SourcesNavigationSidebarPanel.prototype._addStyleSheet): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
(WI.SourcesNavigationSidebarPanel.prototype._handleCSSStyleSheetAdded): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleCSSStyleSheetRemoved): Added.
Add "Extension Style Sheets", "Extra Style Sheets", and "Anonymous Style Sheets" folders,
just like for scripts, with a similar logic as to when style sheets are added to each.
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog):
(WI.OpenResourceDialog.prototype.representedObjectIsValid): Added.
(WI.OpenResourceDialog.prototype._populateResourceTreeOutline):
(WI.OpenResourceDialog.prototype._populateResourceTreeOutline.createTreeElement):
(WI.OpenResourceDialog.prototype.didDismissDialog):
(WI.OpenResourceDialog.prototype.didPresentDialog):
(WI.OpenResourceDialog.prototype._removeResource): Added.
(WI.OpenResourceDialog.prototype._resourceWasRemoved): Added.
(WI.OpenResourceDialog.prototype._scriptAdded):
(WI.OpenResourceDialog.prototype._scriptRemoved): Added.
(WI.OpenResourceDialog.prototype._handleStyleSheetAdded): Added.
(WI.OpenResourceDialog.prototype._handleStyleSheetRemoved): Added.
Add any non-injected non-anonymous style sheets when populating the list of resources.
Drive-by: remove listings for any resources that are removed from the inspected page.
* UserInterface/Views/ResourceTreeElement.js:
(WI.ResourceTreeElement.compareResourceTreeElements):
(WI.ResourceTreeElement.compareResourceTreeElements.resolvedType): Added.
Support comparisons against non-resource tree elements.
* Localizations/en.lproj/localizedStrings.js:
2020-01-07 Devin Rousso <drousso@apple.com>
REGRESSION: [ Mac Debug ] inspector/page/setBootstrapScript-main-frame.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=205807
<rdar://problem/58344669>
Reviewed by Dean Jackson.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.async createBootstrapScript):
(WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange):
Ensure that `Page.setBootstrapScript` is called when restoring the bootstrap script from the
IndexedDB storage. Otherwise, in situations like when Web Inspector is first opened, we will
show the Inspector Bootstrap Script in the UI, but not actually set it on the inspected page.
2020-01-06 Yury Semikhatsky <yurys@chromium.org>
REGRESSION: [ Mac wk2 ] http/tests/inspector/target/provisional-load-cancels-previous-load.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=205473
<rdar://problem/58093690>
The failure was due to attempts to add output to the test page which could be not fully
loaded after navigation. To make it deterministic it is now possible to keep provisional
navigation paused and to defer output until the test page is ready.
Reviewed by Brian Burg.
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.initialize):
(WI.Target.prototype._resumeIfPaused): extracted resume logic in a method that
can be overridden in the tests.
* UserInterface/Test/FrontendTestHarness.js:
(FrontendTestHarness.prototype.deferOutputUntilTestPageIsReloaded): allow to pause
output when navigation is started via protocol commands rather than the test harness.
2020-01-06 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Color picker: make it keyboard accessible
https://bugs.webkit.org/show_bug.cgi?id=205572
<rdar://problem/58169943>
Reviewed by Brian Burg.
For the color square, make up, down, left, and right keys move the crosshair.
For the hue and opacity sliders:
- Pressing up and down keys should adjust the value by 1%.
- When holding Shift, up and down keys adjust the value by 10%.
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype.focus):
* UserInterface/Views/ColorSquare.css:
(.color-square):
Match the border of the hue and opacity sliders.
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare):
Make the color square focusable.
(WI.ColorSquare.prototype._handleMousedown):
(WI.ColorSquare.prototype._handleKeyDown):
* UserInterface/Views/InlineSwatch.js:
* UserInterface/Views/Slider.css:
(.slider:focus):
* UserInterface/Views/Slider.js:
(WI.Slider):
(WI.Slider.prototype._handleMousedown):
Drive-by: right clicking the slider shouldn't move the thumb.
(WI.Slider.prototype._handleKeyDown):
2020-01-06 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r218839): Web Inspector: Color picker: pressing Esc should hide color picker
https://bugs.webkit.org/show_bug.cgi?id=205570
<rdar://problem/58169820>
Reviewed by Brian Burg.
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole.prototype.set keyboardShortcutDisabled):
(WI.QuickConsole.prototype._toggleOrFocus):
Restore keyboardShortcutDisabled setter, which was removed in r218839 without any explanation.
2020-01-06 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: unable to see recording actions for WebGL canvases that have lots of shader programs
https://bugs.webkit.org/show_bug.cgi?id=205659
Reviewed by Brian Burg.
Limit the height of the canvas and shader program tree a recording is selected.
* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel.prototype._updateRecordingScopeBar):
* UserInterface/Views/CanvasSidebarPanel.css:
(.sidebar > .panel.navigation.canvas.showing-recording > .content > .tree-outline.canvas): Added.
2019-12-21 Brian Burg <bburg@apple.com>
Web Inspector: add InspectedTargetTypes diagnostic event and related hooks
https://bugs.webkit.org/show_bug.cgi?id=205174
<rdar://problem/57887953>
Reviewed by Devin Rousso.
This change adds a new diagnostic recorder that reports information about
inspected targets and their type / version information.
* UserInterface/Base/DebuggableType.js:
(WI.DebuggableType.fromString):
Move the static parsing factory method to DebuggableType class.
* UserInterface/Main.html: Add new files.
* UserInterface/Base/Main.js:
(WI.contentLoaded): Add new diagnostic recorder.
* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.activateDomain):
Adapt to InspectorFrontendHost changes.
* UserInterface/Test/TestAppController.js:
(WI.TestAppController):
* UserInterface/Controllers/AppController.js:
(WI.AppController):
Adapt to InspectorFrontendHost changes.
2019-12-20 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Gradient editor: opacity slider is too close to the right edge of the popover
https://bugs.webkit.org/show_bug.cgi?id=203643
<rdar://problem/56762879>
Reviewed by Devin Rousso.
Replace absolute positioning in the color picker with static layout.
* UserInterface/Views/ColorPicker.css:
(.color-picker .wrapper):
(.color-picker :matches(.color-square, .slider)):
(.color-picker .slider):
(.color-picker .hue):
(@media (color-gamut: p3) .color-picker.gamut-p3 > .hue):
(.color-picker > .color-inputs):
(.color-picker > .color-inputs > div):
(.color-picker > .color-inputs > div:not([hidden]) + div):
The 1st visible div should have no left margin even if it's preceded by a hidden div.
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker):
(WI.ColorPicker.prototype._updateOpacitySlider):
* UserInterface/Views/GradientEditor.css:
(.gradient-editor.editing-color):
(.gradient-editor > .color-picker .slider):
* UserInterface/Views/GradientEditor.js:
(WI.GradientEditor):
* UserInterface/Views/Slider.css:
(.slider):
(.slider > img):
(body[dir=ltr] .slider > img):
(body[dir=rtl] .slider > img):
* UserInterface/Views/Slider.js:
(WI.Slider):
(WI.Slider.prototype.set value):
(WI.Slider.prototype.set knobY):
(WI.Slider.prototype.get maxY):
(WI.Slider.prototype.recalculateKnobY):
(WI.Slider.prototype._handleMousedown):
(WI.Slider.prototype._handleMousemove):
* UserInterface/Views/Variables.css:
(:root):
Convert WI.Slider to be vertical by default. WI.Slider used to define a hozirontal slider.
It is only used by the color picker, where it's vertical. The slider was rotated with CSS
transformation. This made it problematic to use in the static layout.
2019-12-20 Brian Burg <bburg@apple.com>
Web Inspector: convert some InspectorFrontendHost methods to getters
https://bugs.webkit.org/show_bug.cgi?id=205475
Reviewed by Devin Rousso.
No reason for these to be method calls, so expose as getters / attributes instead.
* UserInterface/Base/LoadLocalizedStrings.js:
* UserInterface/Base/Main.js:
* UserInterface/Base/ObjectStore.js:
(WI.ObjectStore.get _databaseName):
* UserInterface/Base/Platform.js:
* UserInterface/Base/Setting.js:
(WI.Setting._localStorageKey):
* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):
* UserInterface/Protocol/LoadInspectorBackendCommands.js:
2019-12-19 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Enable p3 color picker by default
https://bugs.webkit.org/show_bug.cgi?id=203931
<rdar://problem/56965236>
Reviewed by Devin Rousso.
* UserInterface/Base/Setting.js:
* UserInterface/Views/InlineSwatch.js:
2019-12-19 Devin Rousso <drousso@apple.com>
Web Inspector: Console: the clear console button is hidden at smaller widths
https://bugs.webkit.org/show_bug.cgi?id=205438
Reviewed by Brian Burg.
Ever since r242604, we no longer "need" to show the text filter bar or message type scope
bar since new messages will show a warning banner that there's an active filter. Instead, we
should prefer showing the navigation items that control functionality that cannot be reached
anywhere else (visually), such as clearing the console or evaluating as a user gesture.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView):
Make the text find banner and type scope bar both low priority, the preserve log and
evaluate as user gesture toggles normal priority, and the clear log high priority.
2019-12-19 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: exiting edit mode with the same selection as before entering edit mode doesn't reselect
https://bugs.webkit.org/show_bug.cgi?id=205435
Reviewed by Brian Burg.
* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype.initialLayout):
Set `allowsRepeatSelection` so that selecting the previously selected tree element after
leaving edit mode will actually work.
2019-12-19 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: bezier keywords don't show a swatch
https://bugs.webkit.org/show_bug.cgi?id=205436
Reviewed by Brian Burg.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):
Check if the current token is a direct match with one of the timing function keywords.
2019-12-19 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: importing a result with DOM nodes that don't match the inspected page appear as empty lines
https://bugs.webkit.org/show_bug.cgi?id=205437
Reviewed by Brian Burg.
* UserInterface/Views/AuditTestCaseContentView.js:
(WI.AuditTestCaseContentView.prototype.layout):
Call `refresh` on the `CodeMirror` instance after a timeout to give it a chance to be added
to the DOM tree.
2019-12-18 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: restrict showing paint flashing and compositing borders to the Web Inspector session
https://bugs.webkit.org/show_bug.cgi?id=205201
Reviewed by Timothy Hatcher.
We often get bugs from users who turn on paint flashing or compositing borders, close Web
Inspector, reopen Web Inspector, and are then surprised when the page flashes red or these
borders exist all over the page.
Given that the dark mode and print styles toggles are limited to the Web Inspector session,
we should make these have the same behavior.
* UserInterface/Base/Main.js:
(WI.initializeTarget):
* UserInterface/Base/Setting.js:
* UserInterface/Controllers/LayerTreeManager.js:
(WI.LayerTreeManager): Added.
(WI.LayerTreeManager.prototype.initializeTarget):
(WI.LayerTreeManager.supportsShowingPaintRects): Added.
(WI.LayerTreeManager.supportsVisibleCompositingBorders): Added.
(WI.LayerTreeManager.prototype.get showPaintRects): Added.
(WI.LayerTreeManager.prototype.set showPaintRects): Added.
(WI.LayerTreeManager.prototype.get compositingBordersVisible): Added.
(WI.LayerTreeManager.prototype.set compositingBordersVisible): Added.
(WI.LayerTreeManager.prototype.updateCompositingBordersVisibleFromPageIfNeeded): Added.
Use `WI.LayerTreeManager` to control the state of paint flashing and compositing borders, as
they're both related to the concept of layers.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype.shown):
(WI.DOMTreeContentView.prototype.closed):
(WI.DOMTreeContentView.prototype.attached): Added.
(WI.DOMTreeContentView.prototype.detached): Added.
(WI.DOMTreeContentView.prototype._handleCompositingBordersVisibleChanged): Added.
(WI.DOMTreeContentView.prototype._handleCompositingBordersButtonClicked): Added.
(WI.DOMTreeContentView.prototype._handleShowPaintRectsChanged): Added.
(WI.DOMTreeContentView.prototype._handlePaingFlashingButtonClicked): Added.
(WI.DOMTreeContentView.prototype._toggleCompositingBorders): Deleted.
(WI.DOMTreeContentView.prototype._togglePaintFlashing): Deleted.
(WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings): Deleted.
(WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged): Deleted.
* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype.shown):
(WI.Layers3DContentView.prototype.hidden):
(WI.Layers3DContentView.prototype.attached): Added.
(WI.Layers3DContentView.prototype.detached): Added.
(WI.Layers3DContentView.prototype._handleCompositingBordersVisibleChanged): Added.
(WI.Layers3DContentView.prototype._handleCompositingBordersButtonClicked): Added.
(WI.Layers3DContentView.prototype._handleShowPaintRectsChanged): Added.
(WI.Layers3DContentView.prototype._handlePaingFlashingButtonClicked): Added.
(WI.Layers3DContentView.prototype.closed): Deleted.
(WI.Layers3DContentView.prototype._showPaintRectsSettingChanged): Deleted.
(WI.Layers3DContentView.prototype._togglePaintFlashing): Deleted.
(WI.Layers3DContentView.prototype._updateCompositingBordersButtonState): Deleted.
(WI.Layers3DContentView.prototype._toggleCompositingBorders): Deleted.
2019-12-18 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: Runtime.enable reports duplicates (non existent) contexts
https://bugs.webkit.org/show_bug.cgi?id=204859
Reviewed by Devin Rousso.
Assert that all contexts added to the list are unique.
* UserInterface/Models/ExecutionContextList.js:
(WI.ExecutionContextList.prototype.add):
2019-12-18 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: remove the "Show/Hide Shadow DOM" navigation item
https://bugs.webkit.org/show_bug.cgi?id=205199
Reviewed by Timothy Hatcher.
There's really no good reason to hide shadow DOM, especially for non-user-agent shadow trees.
The user has full control over whether to expand/collapse shadow trees (and their hosts), so
having a setting that entirely removes the shadow trees from view throughout Web Inspector
seems overkill.
* UserInterface/Base/Setting.js:
* UserInterface/Models/DOMNode.js:
(WI.DOMNode):
(WI.DOMNode.prototype.get nextSibling):
(WI.DOMNode.prototype.get previousSibling):
(WI.DOMNode.prototype.get children):
(WI.DOMNode.prototype.get childNodeCount):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype.get navigationItems):
(WI.DOMTreeContentView.prototype.closed):
(WI.DOMTreeContentView.prototype._showShadowDOMSettingChanged): Deleted.
(WI.DOMTreeContentView.prototype._toggleShowsShadowDOMSetting): Deleted.
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.close):
(WI.DOMTreeOutline.prototype._revealAndSelectNode):
(WI.DOMTreeOutline.prototype._showShadowDOMSettingChanged): Deleted.
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WI.LayerTreeDetailsSidebarPanel.prototype.initialLayout):
(WI.LayerTreeDetailsSidebarPanel.prototype._updateDisplayWithLayers):
(WI.LayerTreeDetailsSidebarPanel.prototype._showShadowDOMSettingChanged): Deleted.
* UserInterface/Images/ShadowDOM.svg: Removed.
* Localizations/en.lproj/localizedStrings.js:
2019-12-11 Brian Burg <bburg@apple.com>
Web Inspector: add TabNavigation diagnostic event and related hooks
https://bugs.webkit.org/show_bug.cgi?id=205138
<rdar://problem/57855456>
Reviewed by Devin Rousso.
This patch adds a new recorder for the TabNavigation diagnostic event.
The bulk of this patch is to find all callsites that can possibly change the active
tab and annotate them with the type of interaction (tab click, link click,
keyboard shortcut, inspect, and others). This patch was developed through
trial and error by logging the diagnostic events and debugging any scenarios
where a tab navigation is not correctly annotated with the initiating interaction.
* UserInterface/Main.html: Add new file.
* UserInterface/Base/Main.js:
(WI.contentLoaded): Register new recorder.
(WI._handleSettingsKeyboardShortcut): Annotate as keyboard shortcut.
- Add options argument to most WI.show*Tab functions, and forward to the underlying
TabBrowser or TabBar calls. This allows initiatorHint to be used in these cases.
- Add other annotations to linkifyElement
* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype.showTabForContentView):
(WI.TabBrowser.prototype._tabBarItemSelected):
- Try to infer an initiator for the tab navigation from TabBrowser API arguments or from TabBar's event.
- Add an enum with TabNavigationInitiator values.
* UserInterface/Base/DOMUtilities.js:
Clickable element links should be reported as link clicks. Add an annotation
so that it isn't reported as "Inspect" (due to going through DOMManager.inspectElement).
* UserInterface/Controllers/CallFrameTreeController.js:
(WI.CallFrameTreeController):
(WI.CallFrameTreeController.prototype._showSourceCodeLocation):
This is mainly used by Canvas tab. Annotate call frame links as link clicks.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.inspectElement):
Accept an options argument. This is used to forward the initiatorHint to
the listener of this event, WI._domNodeWasInspected, so it can forward the
initiatorHint further on.
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setTimelineProfilingEnabled):
(InspectorFrontendAPI.showConsole):
(InspectorFrontendAPI.showResources):
(InspectorFrontendAPI.showTimelines):
(InspectorFrontendAPI.showMainResourceForFrame):
Annotate these as FrontendAPI calls. Mainly used by Develop menu items in Safari.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
(WI.appendContextMenuItemsForURL):
Annotate as context menu.
* UserInterface/Views/DOMNodeTreeElement.js:
(WI.DOMNodeTreeElement):
(WI.DOMNodeTreeElement.prototype.populateContextMenu):
Annotate as context menu.
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._buildTagDOM):
* UserInterface/Views/DefaultDashboardView.js:
(WI.DefaultDashboardView.prototype._resourcesItemWasClicked):
(WI.DefaultDashboardView.prototype._networkItemWasClicked):
(WI.DefaultDashboardView.prototype._timelineItemWasClicked):
(WI.DefaultDashboardView.prototype._consoleItemWasClicked):
Annotate as dashboard.
* UserInterface/Views/LegacyTabBar.js:
(WI.LegacyTabBar.prototype.set selectedTabBarItem):
Include the inferred initiator in the event that is dispatched.
(WI.LegacyTabBar.prototype.selectTabBarItemWithInitiator):
Added. This is a convenience method that temporarily sets the
initiator before invoking the setter (which reads the initator).
(WI.LegacyTabBar.prototype._handleMouseDown):
(WI.LegacyTabBar.prototype._handleClick):
(WI.LegacyTabBar.prototype._handleNewTabClick):
Treat these as "tab clicks".
* UserInterface/Views/TabBar.js:
(WI.TabBar.prototype.set selectedTabBarItem):
(WI.TabBar.prototype.selectTabBarItemWithInitiator):
(WI.TabBar.prototype._handleMouseDown):
(WI.TabBar.prototype._handleClick):
Changes from LegacyTabBar have been copied to this version, as it's a
drop-in replacement.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._showConsoleTab):
Treat the console chevron as a "button click".
* UserInterface/Views/NewTabContentView.js:
(WI.NewTabContentView.prototype._createNewTabWithType):
Treat each tab button as a "button click".
* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement.prototype.populateContextMenu):
Annotate as context menu.
* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WI.ResourceTimelineDataGridNode.prototype._dataGridNodeGoToArrowClicked):
Annotate as link click.
* UserInterface/Views/SearchResultTreeElement.js:
(WI.SearchResultTreeElement):
(WI.SearchResultTreeElement.prototype.populateContextMenu):
Annotate as context menu.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
Annotate as context menu.
(WI.SourceCodeTextEditor.prototype._showPopoverForObject.):
(WI.SourceCodeTextEditor.prototype._showPopoverForObject):
Annotate elements in popover as link click.
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement):
(WI.SourceCodeTreeElement.prototype._handleToggleBlackboxedImageElementClicked):
Annotate as context menu.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu):
Annotate as context menu.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._setupJumpToSymbol):
Annotate as link click.
2019-12-15 Emilio Cobos Álvarez <emilio@crisal.io>
Remove -webkit-marquee.
https://bugs.webkit.org/show_bug.cgi?id=117769
Reviewed by Simon Fraser.
* UserInterface/Models/CSSKeywordCompletions.js:
2019-12-12 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: Error: Can't make a ContentView for an unknown representedObject of type: CallFrame
https://bugs.webkit.org/show_bug.cgi?id=204823
Reviewed by Devin Rousso.
If no type is stored in the cookie matching by type should fail.
* UserInterface/Views/NavigationSidebarPanel.js:
(WI.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie.treeElementMatchesCookie):
(WI.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
2019-12-12 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251227): Uncaught Exception: undefined is not an object (evaluating 'target.DOMAgent.setInspectModeEnabled')
https://bugs.webkit.org/show_bug.cgi?id=205148
Reviewed by Joseph Pecoraro.
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setTimelineProfilingEnabled):
(InspectorFrontendAPI.setElementSelectionEnabled):
If there are no targets available yet (`WI.targetsAvailable()`), then wait for targets to
be available (`WI.whenTargetsAvailable()`) before performing the intended logic, as the
`InspectorFrontendAPI` only waits for the backend connection to be established before
dispatching, meaning that there may not be a page target yet. Other `InspectorFrontendAPI`
functions don't need to be changed because they don't cause commands to be invoked.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.set inspectModeEnabled):
Drive-by: don't assume that inspect mode is disabled if an error is thrown.
* UserInterface/Base/Main.js:
Drive-by: remove duplicate function `WI._toggleInspectMode` as it already exists.
2019-12-11 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Console: unable to switch execution contexts
https://bugs.webkit.org/show_bug.cgi?id=205102
<rdar://problem/57748393>
Reviewed by Brian Burg.
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole):
Wait to initialize the main execution context path component until we actually have a main
execution context.
(WI.QuickConsole.prototype._pageTargetTransitioned):
Remove unnecessary duplicate early return.
(WI.QuickConsole.prototype._initializeMainExecutionContextPathComponent):
Restore the link to the next path component if the main execution context path component is
recreated when there already exist other execution contexts.
(WI.QuickConsole.prototype._selectExecutionContext):
Remove unnecessary assertion.
(WI.QuickConsole.prototype._removeExecutionContextPathComponentForFrame):
When the execution context of the main frame changes, recreate the main execution context
path component so it has the right `representedObject`.
* UserInterface/Views/HierarchicalPathNavigationItem.js:
(WI.HierarchicalPathNavigationItem.prototype.update):
Only hide the tooltip if we're not `sizeToFit` as otherwise we never unhide it due to an
early return (`sizeToFit` just makes everything visible).
2019-12-11 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: hovering over an invalid value while holding ⌘ doesn't change the color of the text
https://bugs.webkit.org/show_bug.cgi?id=205039
Reviewed by Brian Burg.
Only apply a `color` or `-webkit-text-decoration-color` when either the ⌘ key is not pressed
or if the mouse is not actively hovering over the node when the ⌘ is pressed.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .name:not(.editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .name:not(:hover, .editing)): Added.
(.spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value): Added.
(body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(.editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(:hover, .editing)): Added.
(.spreadsheet-style-declaration-editor .property.disabled):
(.spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > *:not(.name, .value-container), .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > .value-container > *:not(.value), body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > :matches(.name, value-container):not(.editing), body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > .value-container > value:not(.editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > :matches(.name, value-container):not(:hover, .editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > .value-container > .value:not(:hover, .editing)): Added.
(.spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > *:not(.name, .value-container), .spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > .value-container > *:not(.value), body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > :matches(.name, .value-container):not(.editing), body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > .value-container > .value:not(.editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > :matches(.name, .value-container):not(:hover, .editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > .value-container > .value:not(:hover, .editing)): Added.
(body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property.invalid-value:not(.disabled) > .content > .value:not(.editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property.invalid-value:not(.disabled) > .content > .value:not(:hover, .editing)): Added.
(body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(.editing) .token-link, body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(:hover, .editing) .token-link): Added.
(body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(.editing) .token-string, body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(:hover, .editing) .token-string): Added.
(body.meta-key-pressed .spreadsheet-css-declaration:not(.locked) > .spreadsheet-style-declaration-editor > .property > .content :matches(.name, .value):not(.editing):hover): Added.
(body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(.editing) .token-comment, body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(:hover, .editing) .token-comment): Added.
(.spreadsheet-style-declaration-editor .property:not(.disabled) .name): Deleted.
(.spreadsheet-style-declaration-editor .property:not(.disabled) .value): Deleted.
(.spreadsheet-style-declaration-editor .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) .content > *): Deleted.
(.spreadsheet-style-declaration-editor .property.invalid-name:not(.disabled) .content > *): Deleted.
(.spreadsheet-style-declaration-editor .property.invalid-value:not(.disabled) .content .value): Deleted.
(.spreadsheet-style-declaration-editor .property:not(.disabled) .token-link): Deleted.
(.spreadsheet-style-declaration-editor .property:not(.disabled) .token-string): Deleted.
(.meta-key-pressed .spreadsheet-css-declaration:not(.locked) :matches(.name, .value):not(.editing):hover): Deleted.
(.spreadsheet-style-declaration-editor .property:not(.disabled) .token-comment): Deleted.
2019-12-11 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r253173): Console: evaluating a command should automatically scroll to it's result
https://bugs.webkit.org/show_bug.cgi?id=205105
Reviewed by Brian Burg.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView):
(WI.LogContentView.prototype.get scrollableElements):
(WI.LogContentView.prototype._updateMessagesSelection):
(WI.LogContentView.prototype._highlightSearchMatchAtIndex):
(WI.LogContentView.prototype.layout): Deleted.
(WI.LogContentView.prototype._ensureMessageIsVisible): Deleted.
(WI.LogContentView.prototype._positionForMessage): Deleted.
Now that this uses `display: flex;`, the actual scrollable element is the `messagesElement`,
so use that instead when manually setting the `scrollTop`. Use `scrollIntoViewIfNeeded` when
revealing search results instead of any custom scroll offset calculations.
* UserInterface/Views/LogContentView.css:
(.content-view.log > .hidden-messages-banner):
Drive-by: ensure that the hidden messages banner doesn't shrink.
2019-12-11 Devin Rousso <drousso@apple.com>
Web Inspector: simplify the text of the script blackboxing context menu item
https://bugs.webkit.org/show_bug.cgi?id=205099
Reviewed by Brian Burg.
"Blackbox script to ignore it when debugging" is a bit too long for a context menu item.
We should use something simpler, like "Blackbox Script".
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* Localizations/en.lproj/localizedStrings.js:
2019-12-11 Devin Rousso <drousso@apple.com>
Web Inspector: replace all "Remove" context menu items with "Delete" to be consistent
https://bugs.webkit.org/show_bug.cgi?id=205098
Reviewed by Brian Burg.
* UserInterface/Views/BlackboxSettingsView.js:
(WI.BlackboxSettingsView.prototype._addRow):
* UserInterface/Views/BootstrapScriptTreeElement.js:
(WI.BootstrapScriptTreeElement.prototype.populateContextMenu):
* UserInterface/Views/BreakpointActionView.js:
(WI.BreakpointActionView):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
Drive-by: if a local override exists for the given source code, add an item for
enabling/disabling and deleting it.
* UserInterface/Views/LocalResourceOverrideTreeElement.js:
(WI.LocalResourceOverrideTreeElement.prototype.populateContextMenu):
* UserInterface/Views/ProbeSetDetailsSection.js:
(WI.ProbeSetDetailsSection):
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView):
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WI.ScopeChainDetailsSidebarPanel.prototype._objectTreeElementAddContextMenuItems):
* Localizations/en.lproj/localizedStrings.js:
2019-12-11 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: Missing frame for given frameId (on techcrunch.com)
https://bugs.webkit.org/show_bug.cgi?id=205130
<rdar://problem/57847699>
Reviewed by Timothy Hatcher.
* UserInterface/Controllers/ApplicationCacheManager.js:
(WI.ApplicationCacheManager.prototype._manifestForFrameLoaded):
A frame can go away between `ApplicationCache.getManifestForFrame` being called and the
response being received, so don't re-throw the error if the frontend no longer has a
matching `WI.Frame` for the given `frameId`.
2019-12-10 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251038): Elements: Computed: implicit shorthands are not shown when "Prefer Shorthands" is enabled
https://bugs.webkit.org/show_bug.cgi?id=205035
<rdar://problem/57773470>
Reviewed by Brian Burg.
The computed style treats most shorthand properties as "implicit", meaning that if "Prefer
Shorthands" is enabled, we won't show the shorthand properties unless "Show All" is also
enabled. The frontend can fix this by checking to see if there are any non-implicit longhand
values for each shorthand value, and therefore decide not to hide the "implicit" shorthand.
* UserInterface/Views/ComputedStyleSection.js:
(WI.ComputedStyleSection.prototype.get propertiesToRender):
(WI.ComputedStyleSection.prototype.get propertiesToRender.hasNonImplicitLonghand): Added.
Drive-by: filter the list of properties to render before sorting them for performance.
2019-12-10 Devin Rousso <drousso@apple.com>
REGRESSION(r252523): Web Inspector: Styles: semicolon is wrongly positioned in multiline values
https://bugs.webkit.org/show_bug.cgi?id=205034
<rdar://problem/57772846>
Reviewed by Brian Burg.
Wrap the value node in another `<span class="value-container">` so that the semicolon can be
included as part of the `display: inline-block;` when there are multiple lines in the value.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.update):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor .property:not(.disabled).has-newline .value-container): Added.
(.spreadsheet-style-declaration-editor .property:not(.disabled).has-newline .value): Deleted.
2019-12-10 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: there is a double border between the last rule and the class list area or filter area
https://bugs.webkit.org/show_bug.cgi?id=205040
Reviewed by Brian Burg.
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style.style-rules > .content ~ :matches(.options-container, .class-list-container)): Added.
(.sidebar > .panel.details.css-style > .content ~ .options-container):
Use a CSS transform to move the class list area and filter area up when the Styles panel is
selected in the details sidebar of the Elements Tab.
2019-12-10 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r253167): Elements: class list toggle doesn't stay sticky to the bottom of the sidebar
https://bugs.webkit.org/show_bug.cgi?id=205033
Reviewed by Brian Burg.
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style > .content):
Ensure that the main content of the sidebar panel takes up as much space as possible.
2019-12-10 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: this._objectTree.resetPropertyPath is not a function. (In 'this._objectTree.resetPropertyPath()', 'this._objectTree.resetPropertyPath' is undefined)
https://bugs.webkit.org/show_bug.cgi?id=205026
Reviewed by Brian Burg.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.clearSessionState):
The `_objectTree` can also be an `WI.ErrorObjectView`, which doesn't have a property path.
2019-12-06 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: Missing node for given nodeId
https://bugs.webkit.org/show_bug.cgi?id=204519
Reviewed by Timothy Hatcher.
When a DOM node is removed from the main DOM tree, the `InspectorDOMAgent` invalidates the
`DOM.NodeId` that was previously assigned to that DOM node, meaning that any future commands
sent by the frontend with that `DOM.NodeId` will fail.
Add logic to mark `WI.DOMNode` as being `destroyed` when this happens so the frontend can
decide to not invoke any commands with that `DOM.NodeId`.
Many functions have also switched to expecting a `WI.DOMNode` instead of a `DOM.NodeId` or
have been moved to `WI.DOMNode.prototype` in order to also be able to use `destroyed`.
This issue will eventually be mitigated by <https://webkit.org/b/189687>.
* UserInterface/Models/DOMNode.js:
(WI.DOMNode):
(WI.DOMNode.prototype.get destroyed): Added.
(WI.DOMNode.prototype.get attached):
(WI.DOMNode.prototype.markDestroyed): Added.
(WI.DOMNode.prototype.setNodeName):
(WI.DOMNode.prototype.setNodeValue):
(WI.DOMNode.prototype.setAttribute):
(WI.DOMNode.prototype.setAttributeValue):
(WI.DOMNode.prototype.querySelector): Added.
(WI.DOMNode.prototype.querySelectorAll): Added.
(WI.DOMNode.prototype.highlight): Added.
(WI.DOMNode.prototype.getOuterHTML):
(WI.DOMNode.prototype.setOuterHTML):
(WI.DOMNode.prototype.removeNode):
(WI.DOMNode.prototype.getEventListeners):
* UserInterface/Base/DOMUtilities.js:
(WI.bindInteractionsForNodeToElement):
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.buildHighlightConfig):
(WI.DOMManager.wrapClientCallback):
(WI.DOMManager.prototype._loadNodeAttributes):
(WI.DOMManager.prototype._setDocument):
(WI.DOMManager.prototype._unbind):
(WI.DOMManager.prototype.highlightDOMNodeList):
(WI.DOMManager.prototype.highlightSelector):
(WI.DOMManager.prototype.hideDOMNodeHighlight):
(WI.DOMManager.prototype.highlightDOMNodeForTwoSeconds):
(WI.DOMManager.prototype.set inspectModeEnabled):
(WI.DOMManager.prototype.setInspectedNode):
(WI.DOMManager.prototype.setEventListenerDisabled):
(WI.DOMManager.prototype._wrapClientCallback): Deleted.
(WI.DOMManager.prototype.querySelector): Deleted.
(WI.DOMManager.prototype.querySelectorAll): Deleted.
(WI.DOMManager.prototype.highlightDOMNode): Deleted.
(WI.DOMManager.prototype._buildHighlightConfig): Deleted.
* UserInterface/Models/AuditTestCaseResult.js:
(WI.AuditTestCaseResult.async fromPayload):
* UserInterface/Models/MediaTimelineRecord.js:
(WI.MediaTimelineRecord.async fromJSON):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.resolveNode):
* UserInterface/Views/BoxModelDetailsSectionRow.js:
(WI.BoxModelDetailsSectionRow.prototype._highlightDOMNode):
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._contentViewMouseEnter):
* UserInterface/Views/CanvasTreeElement.js:
(WI.CanvasTreeElement.prototype._handleMouseOver):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype.layout):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype._domTreeSelectionDidChange):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.get editable):
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
* UserInterface/Views/DOMTreeElementPathComponent.js:
(WI.DOMTreeElementPathComponent.prototype.mouseOver):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.get editable):
(WI.DOMTreeOutline.prototype.populateContextMenu):
(WI.DOMTreeOutline.prototype._onmousemove):
(WI.DOMTreeOutline.prototype._ondragstart):
(WI.DOMTreeOutline.prototype._ondragover):
(WI.DOMTreeOutline.prototype._ondragleave):
(WI.DOMTreeOutline.prototype._ondragend):
(WI.DOMTreeOutline.prototype._hideElements):
* UserInterface/Views/FormattedValue.js:
(WI.FormattedValue.createElementForNodePreview):
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype.layout):
* UserInterface/Views/LayerDetailsSidebarPanel.js:
(WI.LayerDetailsSidebarPanel.prototype._dataGridMouseMove):
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WI.LayerTreeDetailsSidebarPanel.prototype.layout):
(WI.LayerTreeDetailsSidebarPanel.prototype._highlightSelectedNode):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._highlightNodesWithSelector):
2019-12-06 Devin Rousso <drousso@apple.com>
Web Inspector: saving a file with the url "/" suggest the name "Untitled"
https://bugs.webkit.org/show_bug.cgi?id=204910
Reviewed by Timothy Hatcher.
* UserInterface/Base/FileUtilities.js:
(WI.FileUtilities.save):
Allow callers to specify a `suggestedName` that is used if possible.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
(WI.appendContextMenuItemsForDOMNode):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype.get saveData):
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView.prototype.get saveData):
If the path of the selected source code is just "/", set the `suggestedName` to "index" and
use an extension derived from the MIME type (if able).
* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype.export):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._handleContextMenu):
* UserInterface/Views/HeapSnapshotContentView.js:
(WI.HeapSnapshotContentView.prototype._exportSnapshot):
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.get saveData):
(WI.LogContentView.prototype._handleContextMenuEvent):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._exportHAR):
* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView.prototype._exportRecording):
(WI.RecordingContentView.prototype._exportReduction):
* UserInterface/Views/ScriptContentView.js:
(WI.ScriptContentView.prototype.get saveData):
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView.prototype.get saveData):
* UserInterface/Views/TextContentView.js:
(WI.TextContentView.prototype.get saveData):
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView.prototype._exportTimelineRecording):
* UserInterface/Debug/ProtocolTrace.js:
(WI.ProtocolTrace.prototype.get saveData):
Prefer `suggestedName` vs `WI.FileUtilities.inspectorURLForFilename`, which is now always
called inside `WI.FileUtilities.save` anyways.
2019-12-06 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r252652): Local Overrides: creating a local override for a resource loaded before Web Inspector was opened shows NaN for the Status Code
https://bugs.webkit.org/show_bug.cgi?id=204965
Reviewed by Joseph Pecoraro.
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover.prototype.show):
Make sure to update the object that holds the resource's original data in addition to the
object that holds the current edited values.
Drive-by: update the popover once all of the `CodeMirror`s have updated to hide scrollbars.
2019-11-25 Brian Burg <bburg@apple.com>
Web Inspector: TabActivity diagnostic event should sample the active tab uniformly
https://bugs.webkit.org/show_bug.cgi?id=204531
Reviewed by Devin Rousso.
Rewrite this class to use a uniform sampling approach. Every n seconds, a timer fires and
samples what the current tab is. If the last user interaction happened up to n seconds ago,
report a TabActivity diagnostic event. Keeping with the previous implementation, samples
are taken every n=60 seconds.
To account for bias in the initial sample when Web Inspector is open, wait m seconds for
the first sample. This accounts for the time between opening Web Inspector and choosing the
desired tab. In my testing, m=10 is enough time to load Web Inspector and switch
immediately to a different tab. In that case, the initial tab would not be sampled as the
active tab even if the last user interaction (clicking tab bar) happened while the initial
tab was displayed. If the recorder's setup() method is called some time after Web Inspector is
opened, then the initial delay will shrink to ensure at least 10s has elapsed since the frontend
finished loading.
* UserInterface/Base/Main.js:
(WI.contentLoaded): Keep a timestamp of when the frontend finished loading.
* UserInterface/Controllers/TabActivityDiagnosticEventRecorder.js:
(WI.TabActivityDiagnosticEventRecorder):
(WI.TabActivityDiagnosticEventRecorder.prototype.setup):
(WI.TabActivityDiagnosticEventRecorder.prototype.teardown):
(WI.TabActivityDiagnosticEventRecorder.prototype._startInitialDelayBeforeSamplingTimer):
(WI.TabActivityDiagnosticEventRecorder.prototype._stopInitialDelayBeforeSamplingTimer):
(WI.TabActivityDiagnosticEventRecorder.prototype._startEventSamplingTimer):
(WI.TabActivityDiagnosticEventRecorder.prototype._stopEventSamplingTimer):
(WI.TabActivityDiagnosticEventRecorder.prototype._sampleCurrentTabActivity):
(WI.TabActivityDiagnosticEventRecorder.prototype._didObserveUserInteraction):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowFocus):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowBlur):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowKeyDown):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowMouseDown):
(WI.TabActivityDiagnosticEventRecorder.prototype._didInteractWithTabContent): Deleted.
(WI.TabActivityDiagnosticEventRecorder.prototype._clearTabActivityTimeout): Deleted.
(WI.TabActivityDiagnosticEventRecorder.prototype._beginTabActivityTimeout): Deleted.
(WI.TabActivityDiagnosticEventRecorder.prototype._stopTrackingTabActivity): Deleted.
(WI.TabActivityDiagnosticEventRecorder.prototype._handleTabBrowserSelectedTabContentViewDidChange): Deleted.
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r242604): Console: unread indicator overlaps selection background of previous scope bar item
https://bugs.webkit.org/show_bug.cgi?id=204630
Reviewed by Timothy Hatcher.
When a new message is added that is immediately filtered, such as from an existing filter or
previously selected scope bar items, rather than show a blinking circle next to the level of
the new message in the scope bar (which doesn't cover the case where there's a filter and
was often hard to notice), add a dismissable warning banner explaning that the message had
been filtered with a button to clear all filters.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView):
(WI.LogContentView.prototype.didAppendConsoleMessageView):
(WI.LogContentView.prototype._previousMessageRepeatCountUpdated):
(WI.LogContentView.prototype._logCleared):
(WI.LogContentView.prototype._messageSourceBarSelectionDidChange):
(WI.LogContentView.prototype._scopeBarSelectionDidChange):
(WI.LogContentView.prototype._filterMessageElements):
(WI.LogContentView.prototype._showHiddenMessagesBannerIfNeeded): Added.
(WI.LogContentView.prototype._markScopeBarItemUnread): Deleted.
(WI.LogContentView.prototype._markScopeBarItemForMessageLevelUnread): Deleted.
* UserInterface/Views/LogContentView.css:
(.content-view.log):
(.content-view.log > .hidden-messages-banner): Added.
(.content-view.log > .hidden-messages-banner > button): Added.
(.content-view.log > .hidden-messages-banner > .dismiss): Added.
(body[dir=ltr] .content-view.log > .hidden-messages-banner > .dismiss): Added.
(body[dir=rtl] .content-view.log > .hidden-messages-banner > .dismiss): Added.
(.console-messages):
(.log-scope-bar > li:not(.unread) > .indicator): Deleted.
(.log-scope-bar > li.unread > .indicator): Deleted.
(.log-scope-bar > li.unread:hover > .indicator): Deleted.
(.log-scope-bar > li.unread.evaluations > .indicator): Deleted.
(.log-scope-bar > li.unread.errors > .indicator): Deleted.
(.log-scope-bar > li.unread.warnings > .indicator): Deleted.
(.log-scope-bar > li.unread.logs > .indicator): Deleted.
(@keyframes unread-background-pulse): Deleted.
* UserInterface/Views/FindBanner.js:
(WI.FindBanner):
(WI.FindBanner.prototype.clearAndBlur): Added.
(WI.FindBanner.prototype._clearAndBlur): Deleted.
Expose a public way to clear the find banner.
* Localizations/en.lproj/localizedStrings.js:
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: add WI.EngineeringSetting and WI.DebugSetting to avoid callsite checking
https://bugs.webkit.org/show_bug.cgi?id=204785
Reviewed by Timothy Hatcher.
* UserInterface/Base/Setting.js:
(WI.Setting.prototype.get defaultValue): Added.
(WI.EngineeringSetting.prototype.get value): Added.
(WI.EngineeringSetting.prototype.set value): Added.
(WI.DebugSetting.prototype.get value): Added.
(WI.DebugSetting.prototype.set value): Added.
(WI.Setting.prototype.get valueRespectingDebugUIAvailability): Deleted.
Only get/set the `_value` if the `WI.isEngineeringBuild`/`WI.isDebugUIEnabled()`.
* UserInterface/Base/Main.js:
(WI.resolvedLayoutDirection):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.update):
* UserInterface/Proxies/HeapSnapshotEdgeProxy.js:
(WI.HeapSnapshotEdgeProxy.prototype.isPrivateSymbol):
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.supportsEditingUserAgentShadowTrees):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.get knownNonResourceScripts):
(WI.DebuggerManager.prototype.debuggerDidPause):
(WI.DebuggerManager.prototype.scriptDidParse):
* UserInterface/Controllers/DiagnosticController.js:
(WI.DiagnosticController):
(WI.DiagnosticController.prototype._debugAutoLogDiagnosticEventsSettingDidChange):
(WI.DiagnosticController.prototype._updateRecorderStates):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendLocationLink):
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
* UserInterface/Views/StackTraceView.js:
(WI.StackTraceView):
* UserInterface/Views/View.js:
(WI.View.prototype._layoutSubtree):
* UserInterface/Debug/UncaughtExceptionReporter.js:
(handleUncaughtExceptionRecord):
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Console: copying an evaluation result shouldn't include the saved variable index
https://bugs.webkit.org/show_bug.cgi?id=204906
Reviewed by Timothy Hatcher.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.toClipboardString):
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: the Classes toggle is drawn on top of other content with no other way of scrolling to it
https://bugs.webkit.org/show_bug.cgi?id=204690
Reviewed by Timothy Hatcher.
Use a vertical flexbox for the contents of sidebar panels instead of absolute positioning so
that the variable height Classes "drawer" can have it's own scroll area and doesn't take up
any space from the rest of the panel's contents.
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype.initialLayout):
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style > .content):
(.sidebar > .panel.details.css-style > .content ~ :matches(.options-container, .class-list-container)):
(.sidebar > .panel.details.css-style > .content ~ .options-container):
(.sidebar > .panel.details.css-style > .content ~ .class-list-container):
(.sidebar > .panel.details.css-style > .content.has-filter-bar): Deleted.
* UserInterface/Views/Sidebar.css:
(.sidebar > .panel):
(.sidebar > .panel.selected): Deleted.
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Search: there should be some default content when there is no search string
https://bugs.webkit.org/show_bug.cgi?id=204631
Reviewed by Timothy Hatcher.
It's very odd to switch to the Search Tab and find it completely empty, especially if you've
never used it before.
Add basic "No Search String" and "No Search Results" text with a clickable help navigation
item that reveals and focuses the sidebar search input.
* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype.showDefaultContentView): Added.
(WI.SearchSidebarPanel.prototype.performSearch):
(WI.SearchSidebarPanel.prototype._handleDefaultContentViewSearchNavigationItemClicked): Added.
* Localizations/en.lproj/localizedStrings.js:
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: move the "Add Breakpoint" context menu to be next to the blackboxing context menu item
https://bugs.webkit.org/show_bug.cgi?id=204833
Reviewed by Timothy Hatcher.
Both items are related to JavaScript debugging, so they should be closer together.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Support search on IndexedDB stores and indexes
https://bugs.webkit.org/show_bug.cgi?id=129208
<rdar://problem/16142046>
Reviewed by Timothy Hatcher.
Add filter bars to the navigation bars for `IndexedDB`, `LocalStorage`, and `SessionStorage`.
* UserInterface/Views/StorageTabContentView.js:
(WI.StorageTabContentView.prototype.get canHandleFindEvent): Added.
(WI.StorageTabContentView.prototype.handleFindEvent): Added.
* UserInterface/Views/DOMStorageContentView.js:
(WI.DOMStorageContentView):
(WI.DOMStorageContentView.prototype.get navigationItems): Added.
(WI.DOMStorageContentView.prototype.get canFocusFilterBar): Added.
(WI.DOMStorageContentView.prototype.focusFilterBar): Added.
(WI.DOMStorageContentView.prototype._handleFilterBarFilterDidChange): Added.
* UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
(WI.IndexedDatabaseObjectStoreContentView):
(WI.IndexedDatabaseObjectStoreContentView.prototype.get navigationItems):
(WI.IndexedDatabaseObjectStoreContentView.prototype.get canFocusFilterBar): Added.
(WI.IndexedDatabaseObjectStoreContentView.prototype.focusFilterBar): Added.
(WI.IndexedDatabaseObjectStoreContentView.prototype.dataGridMatchNodeAgainstCustomFilters): Added.
(WI.IndexedDatabaseObjectStoreContentView.prototype._handleFilterBarFilterDidChange): Added.
Check against the `textContent` of each cell for a given `WI.DataGridNode` to see if it
matches the filter text as all of the pieces of data are `WI.RemoteObject`s.
* UserInterface/Views/FilterBar.css:
(.filter-bar):
* UserInterface/Views/NetworkTableContentView.css:
(.content-view.network .navigation-bar .filter-bar): Deleted.
Remove the `background-color` to let it match the background content.
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Network: pressing ⌘F when no network item is selected should focus the filter bar
https://bugs.webkit.org/show_bug.cgi?id=204862
Reviewed by Timothy Hatcher.
* UserInterface/Views/NetworkTabContentView.js:
(WI.NetworkTabContentView.prototype.get canHandleFindEvent): Added.
(WI.NetworkTabContentView.prototype.handleFindEvent): Added.
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.get canFocusFilterBar): Added.
(WI.NetworkTableContentView.prototype.focusFilterBar): Added.
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Quick Console: pressing ⌘F shows a second find banner
https://bugs.webkit.org/show_bug.cgi?id=204861
Reviewed by Timothy Hatcher.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.get supportsCustomFindBanner):
2019-12-05 Simon Fraser <simon.fraser@apple.com>
Fix inspector/css test assertions after r253158
https://bugs.webkit.org/show_bug.cgi?id=204924
Reviewed by Devin Rousso.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.displayNameForPseudoId):
2019-12-04 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: allow inspector to pause provisional page load and restore its state
https://bugs.webkit.org/show_bug.cgi?id=204170
Reviewed by Devin Rousso.
All new targets are now automatically paused on start. For such provisional targets target
manager will run regular initilization code (enable agents etc.) and then resume loading of
the target. Responses and events from the target are defferred until the target is committed
and becomes current main target. When the target manager receives event that the provisional
target has been committed all accumulated protocol messages are replayed and going forward all
new missages will be dispatched as usual.
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager):
(WI.TargetManager.prototype.targetCreated):
(WI.TargetManager.prototype.didCommitProvisionalTarget):
(WI.TargetManager.prototype.targetDestroyed):
(WI.TargetManager.prototype.dispatchMessageFromTarget):
(WI.TargetManager.prototype._createTarget):
(WI.TargetManager.prototype._checkAndHandlePageTargetTransition):
(WI.TargetManager.prototype._checkAndHandlePageTargetTermination):
* UserInterface/Protocol/Connection.js:
(InspectorBackend.Connection):
(InspectorBackend.Connection.prototype.addProvisionalMessage):
(InspectorBackend.Connection.prototype.dispatchProvisionalMessages):
* UserInterface/Protocol/MultiplexingBackendTarget.js:
(WI.MultiplexingBackendTarget.prototype.initialize):
* UserInterface/Protocol/PageTarget.js:
(WI.PageTarget):
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.initialize):
(WI.Target.prototype.get isProvisional):
(WI.Target.prototype.get isPaused):
(WI.Target.prototype.didCommitProvisionalTarget):
* UserInterface/Protocol/WorkerTarget.js:
2019-12-03 Devin Rousso <drousso@apple.com>
Web Inspector: prefer non-blackboxed scripts when showing a source code location link
https://bugs.webkit.org/show_bug.cgi?id=204811
Reviewed by Timothy Hatcher.
* UserInterface/Models/StackTrace.js:
(WI.StackTrace.prototype.get firstNonNativeNonAnonymousNotBlackboxedCallFrame): Added.
(WI.StackTrace.prototype.get firstNonNativeCallFrame): Deleted.
(WI.StackTrace.prototype.get firstNonNativeNonAnonymousCallFrame): Deleted.
Include logic to skip call frames that are blackboxed, unless there are no non-blackboxed
call frames, in which case fall back to the first non-native non-anonymous call frame.
Drive-by: remove unused function.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
(WI.ConsoleMessageView.prototype.clearSessionState): Added.
(WI.ConsoleMessageView.prototype._appendLocationLink):
(WI.ConsoleMessageView.prototype._handleDebuggerBlackboxChanged): Added.
(WI.ConsoleMessageView.prototype.clearSavedVariableState): Deleted.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._sessionStarted):
(WI.LogContentView.prototype._logCleared):
Listen for changes to the debugger blackbox to re-render the location link.
* UserInterface/Views/StackTraceView.js:
(WI.StackTraceView):
* UserInterface/Views/CallFrameView.js:
(WI.CallFrameView):
* UserInterface/Views/CallFrameView.css:
(.call-frame.blackboxed > .title, .call-frame.blackboxed:not(:hover, :focus) > .subtitle): Added.
Add a constructor option to control whether blackboxed frames are indicated visually.
2019-12-03 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'navigationItem.parentNavigationBar')
https://bugs.webkit.org/show_bug.cgi?id=204830
Reviewed by Timothy Hatcher.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._mainResourceDidChange):
When the main resource changes, make sure to clear the `_forcedAppearance` member variable.
This way, when the main `WI.DOMTreeContentView` reloads, it isn't left in an unknown state.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype._defaultAppearanceDidChange):
(WI.DOMTreeContentView.prototype._toggleAppearance):
Always create the Force Appearance navigation item, rather than destroying and recreating it
each time the page navigates. Instead, just update the tooltip (which was all that really
changed) whenever the default appearance changes. Depending on the timing of events during a
page navigation, `_forceAppearanceButtonNavigationItem` could be `null`.
* UserInterface/Views/ActivateButtonNavigationItem.js:
(WI.ActivateButtonNavigationItem.prototype.set defaultToolTip): Added.
(WI.ActivateButtonNavigationItem.prototype.set activatedToolTip): Added.
Allow the various tooltips to be updated after creation.
2019-12-03 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: stopping time marker is permanently removed when the current recording is cleared
https://bugs.webkit.org/show_bug.cgi?id=204827
Reviewed by Timothy Hatcher.
* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview.prototype._recordingReset):
Re-add the marker (and ensure that it's hidden) when the active recording is reset.
2019-12-02 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Provide UI to convert between sRGB and p3 color spaces
https://bugs.webkit.org/show_bug.cgi?id=203534
<rdar://problem/56688523>
Reviewed by Devin Rousso.
Add context menus:
- "Convert to sRGB" and "Clamp to sRGB" for p3 colors, such as `color(display-p3 0 1 0)`.
- "Convert to Display-P3" for sRGB colors, such as `rgb(0, 255, 0)`.
Shift-clicking the color swatch of sRGB colors now goes through the color function syntax as well.
Shift-clicking the color swatch of Display-P3 colors converts the color to sRGB when it can be lossless.
When the convertion cannot be lossless, Web Inspector beeps.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Utilities.js:
* UserInterface/Models/Color.js:
(WI.Color):
Introduce `_normalizedRGB` property, which stores rgb values from 0 to 1.
Previously, `_rgba` stored values from 0 to 1 for color function format, and from 0 to 255 otherwise.
That required format checks before every `rgb` value access and resulted in silent errors when
the values were in the wrong format.
Store alpha as a separate property to simplify format conversion. Previously, alpha was duplicated between `_rgba` and `_hsla`.
(WI.Color.displayP3toSRGB):
(WI.Color.srgbToDisplayP3): Added.
(WI.Color.prototype.nextFormat):
(WI.Color.prototype.get rgb):
(WI.Color.prototype.get hsl):
(WI.Color.prototype.get normalizedRGB):
(WI.Color.prototype.get rgba):
(WI.Color.prototype.get hsla):
(WI.Color.prototype.get normalizedRGBA):
(WI.Color.prototype.get gamut):
(WI.Color.prototype.set gamut):
(WI.Color.prototype.copy):
(WI.Color.prototype.isKeyword):
(WI.Color.prototype.isOutsideSRGB): Added.
(WI.Color.prototype.canBeSerializedAsShortHEX):
(WI.Color.prototype._toKeywordString):
(WI.Color.prototype._toShortHEXString):
(WI.Color.prototype._toHEXString):
(WI.Color.prototype._toShortHEXAlphaString):
(WI.Color.prototype._toHEXAlphaString):
(WI.Color.prototype._toRGBString):
(WI.Color.prototype._toRGBAString):
(WI.Color.prototype._toFunctionString):
Limit the values to 4 decimals.
(WI.Color.prototype._toHSLString):
(WI.Color.prototype._toHSLAString):
(WI.Color.prototype._hslToRGB):
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype._updateColor):
(WI.ColorPicker.prototype._updateOpacitySlider):
* UserInterface/Views/ColorSquare.css:
(.color-square > .svg-root):
(.color-square > .svg-root > .srgb-edge):
(.color-square > .srgb-label):
(.color-square > .srgb-label:hover):
(.color-square > .srgb-label:hover + .svg-root > .srgb-edge):
(@media (-webkit-device-pixel-ratio: 1)):
(.color-square > .srgb-edge):
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare.prototype.set tintedColor):
(WI.ColorSquare.prototype._drawSRGBOutline):
(WI.ColorSquare):
* UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch):
(WI.InlineSwatch.prototype._updateSwatch):
(WI.InlineSwatch.prototype._allowShiftClickColor): Added.
(WI.InlineSwatch.prototype._handleContextMenuEvent):
2019-12-02 Devin Rousso <drousso@apple.com>
Web Inspector: Console: the saved result value is still shown after page reload
https://bugs.webkit.org/show_bug.cgi?id=204532
Reviewed by Brian Burg.
Add additional plumbing to remove any `.console-saved-variable` elements whenever a new
session is created, as well as reset the base of the property path to `this`.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._sessionStarted):
(WI.LogContentView.prototype._logCleared):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.clearSavedVariableState): Added.
(WI.ConsoleMessageView.prototype.removeEventListeners): Deleted.
* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView.prototype.resetPropertyPath): Added.
2019-11-22 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'target.PageAgent.getCompositingBordersVisible')
https://bugs.webkit.org/show_bug.cgi?id=204473
Reviewed by Brian Burg.
Change the definition of `WI.targetsAvailable` and `WI.whenTargetsAvailable` to instead
resolve based on when a page target is created, not the backend target, as the latter can
be a multiplexing target which only has a `Target` domain.
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager.prototype._initializeBackendTarget):
(WI.TargetManager.prototype._initializePageTarget):
* UserInterface/Base/Main.js:
(WI.loaded):
(WI.contentLoaded):
(WI.targetsAvailable):
(WI.whenTargetsAvailable):
* UserInterface/Test/Test.js:
(WI.loaded):
(WI.contentLoaded):
(WI.targetsAvailable):
(WI.whenTargetsAvailable):
* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype.performSearch):
Only wait for targets if inspecting a web debuggable, as non-web debuggables don't have a
different page target vs the backend target (which is guaranteed to exist anyways).
2019-11-22 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251227): dashboard no longer shows page weight
https://bugs.webkit.org/show_bug.cgi?id=204528
Reviewed by Brian Burg.
`WI.contentLoaded` adds the debuggable type as a class to the `<body>`. In r251227, the
"web" debuggable type was split into "page" and "web-page". Update the few selectors that
used the debuggable type to show/hide parts of the UI.
* UserInterface/Views/DashboardContainerView.css:
(body:matches(.page, .web-page) .toolbar .dashboard-container): Added.
(body:not(.page, .web-page) .toolbar .dashboard-container): Added.
(body.web .toolbar .dashboard-container): Deleted.
(body:not(.web) .toolbar .dashboard-container): Deleted.
* UserInterface/Views/DefaultDashboardView.css:
(body:matches(.page, .web-page) .toolbar.collapsed .dashboard.default > :matches(.resourcesSize, .time, .logs)): Added.
(body:not(.page, .web-page) .toolbar .dashboard.default > :matches(.resourcesCount, .resourcesSize, .time)): Added.
(body.web .toolbar.collapsed .dashboard.default > :matches(.resourcesSize, .time, .logs)): Deleted.
(body:not(.web) .toolbar .dashboard.default > :matches(.resourcesCount, .resourcesSize, .time)): Deleted.
2019-11-20 Brian Burg <bburg@apple.com>
Web Inspector: add support for new kinds of diagnostic events
https://bugs.webkit.org/show_bug.cgi?id=204430
Reviewed by Devin Rousso.
This patch restructures the existing DiagnosticController to support multiple
self-contained event recorders. The first such recorder is for the TabActivity
diagnostic event. More will be added later.
Add two engineering settings: one which auto-logs diagnostic events to Inspector^2 console,
and another which forces DiagnosticController to be active or inactive regardless of
whether a diagnostic logging delegate is actually installed. This is for manual testing.
This patch does not introduce any functionality changes to diagnostic event collection.
The TabActivityDiagnosticeventRecorder still needs some changes for it to sample correctly.
New Test: inspector/unit-tests/diagnostic-controller.html
* UserInterface/Base/Main.js:
(WI.contentLoaded):
* UserInterface/Controllers/DiagnosticController.js:
(WI.DiagnosticController):
(WI.DiagnosticController.prototype.set diagnosticLoggingAvailable):
(WI.DiagnosticController.prototype.addRecorder):
(WI.DiagnosticController.prototype.logDiagnosticEvent):
(WI.DiagnosticController.prototype._debugEnableDiagnosticLoggingSettingDidChange):
(WI.DiagnosticController.prototype._debugAutoLogDiagnosticEventsSettingDidChange):
(WI.DiagnosticController.prototype._updateRecorderStates):
(WI.DiagnosticController.supportsDiagnosticLogging): Deleted.
(WI.DiagnosticController.prototype.logDiagnosticMessage): Deleted.
(WI.DiagnosticController.prototype._didInteractWithTabContent): Deleted.
(WI.DiagnosticController.prototype._clearTabActivityTimeout): Deleted.
(WI.DiagnosticController.prototype._beginTabActivityTimeout): Deleted.
(WI.DiagnosticController.prototype._stopTrackingTabActivity): Deleted.
(WI.DiagnosticController.prototype._handleWindowFocus): Deleted.
(WI.DiagnosticController.prototype._handleWindowBlur): Deleted.
(WI.DiagnosticController.prototype._handleWindowKeyDown): Deleted.
(WI.DiagnosticController.prototype._handleWindowMouseDown): Deleted.
(WI.DiagnosticController.prototype._handleTabBrowserSelectedTabContentViewDidChange): Deleted.
Restructure DiagnosticController to be dumber. It holds on to a list of recorders and
turns them on and off. All event logging goes through one funnel method, which does not
use InspectorFrontendHost at all when running a Web Inspector layout test.
* UserInterface/Controllers/DiagnosticEventRecorder.js: Added.
(WI.DiagnosticEventRecorder):
(WI.DiagnosticEventRecorder.prototype.get name):
(WI.DiagnosticEventRecorder.prototype.get active):
(WI.DiagnosticEventRecorder.prototype.set active):
(WI.DiagnosticEventRecorder.prototype.setup):
(WI.DiagnosticEventRecorder.prototype.teardown):
Add base class for all individual diagnostic event recorders.
* UserInterface/Controllers/TabActivityDiagnosticEventRecorder.js: Copied from Source/WebInspectorUI/UserInterface/Controllers/DiagnosticController.js.
(WI.TabActivityDiagnosticEventRecorder):
(WI.TabActivityDiagnosticEventRecorder.prototype.setup):
(WI.TabActivityDiagnosticEventRecorder.prototype.teardown):
(WI.TabActivityDiagnosticEventRecorder.prototype.handleEvent):
(WI.TabActivityDiagnosticEventRecorder.prototype._didInteractWithTabContent):
(WI.TabActivityDiagnosticEventRecorder.prototype._clearTabActivityTimeout):
(WI.TabActivityDiagnosticEventRecorder.prototype._beginTabActivityTimeout):
(WI.TabActivityDiagnosticEventRecorder.prototype._stopTrackingTabActivity):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowFocus):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowBlur):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowKeyDown):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowMouseDown):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleTabBrowserSelectedTabContentViewDidChange):
Move all user activity tracking to here. Restructure so that the recorder can be
turned on and off (this adds/removes its listeners and timers).
* UserInterface/Main.html: Add new files.
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setDiagnosticLoggingAvailable):
Adjust the name, as WI.diagnosticController is no longer underscore-prefixed.
* UserInterface/Base/Setting.js:
Add new settings. Add getter 'valueRespectingDebugUIAvailability' which only
returns default values for Debug/Engineering settings if DebugUI is not enabled.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createDebugSettingsView):
Add new settings to Settings Tab UI.
2019-11-21 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Outline sRGB-safe areas on P3 color picker
https://bugs.webkit.org/show_bug.cgi?id=203533
<rdar://problem/56688057>
Reviewed by Brian Burg.
Visualize the edge of sRGB gamut as a white line.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/Color.js:
(WI.Color.displayP3toSRGB.multiplyMatrixByVector):
(WI.Color.displayP3toSRGB):
(WI.Color._toLinearLight):
(WI.Color._gammaCorrect):
Use equations from CSS Color Module Level 4.
* UserInterface/Views/ColorSquare.css:
(.color-square):
(.color-square > .crosshair):
Place the crosshair above the sRGB edge line.
(.color-square .svg-root):
(.color-square .srgb-edge):
(.color-square .srgb-label):
(.color-square .srgb-label:hover):
(.color-square .srgb-label:hover + .svg-root > .srgb-edge):
(@media (-webkit-device-pixel-ratio: 1)):
Make the optical weight of the line on non-retina screens the same as on retina screens.
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare):
(WI.ColorSquare.prototype.set tintedColor):
(WI.ColorSquare.prototype._updateBaseColor):
(WI.ColorSquare.prototype._drawSRGBOutline):
2019-11-21 Devin Rousso <drousso@apple.com>
Web Inspector: call frames from blackboxed scripts should be visually distinct
https://bugs.webkit.org/show_bug.cgi?id=204424
Reviewed by Timothy Hatcher.
Seeing "Deferred pause from blackboxed script" in the Pause Reason does indicate that
something in the Call Stack was blackboxed, but it doesn't clarify what was blackboxed.
Given that the debugger effectively ignores blackboxed scripts, we should distinguish call
frames that were ignored so that it's clear how the current pause location was reached.
* UserInterface/Views/CallFrameTreeElement.js:
(WI.CallFrameTreeElement):
(WI.CallFrameTreeElement.prototype.onattach):
* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline .item.call-frame.blackboxed:not(.selected)): Added.
Make blackboxed call frames 50% opaque when not selected. Add additional explanatory text to
the end of the tooltip when hovering blackboxed call frame tree elements.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState):
Update tooltip/contextmenu text to include "blacboxing" so functionality is clearer.
* UserInterface/Models/SourceCodeLocation.js:
(WI.SourceCodeLocation.prototype.populateLiveDisplayLocationTooltip):
Allow a suffix to be added to the end of the live location.
* Localizations/en.lproj/localizedStrings.js:
2019-11-20 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: REGRESSION(r250618): main resource view is empty when pausing on inline 'debugger' statement
https://bugs.webkit.org/show_bug.cgi?id=204086
Reviewed by Devin Rousso.
SourceCodeRevision.currentRevision doesn't create new revisions under the hood anymore.
This allows to avoid undesirable side effects when e.g. text editor tries to read current
content of the SourceCode which results in a new revision (with empty content).
New method editableRevision is introduced for applying changes to the resource while
keeping original content revision intact.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges):
(WI.CSSManager.prototype._resourceContentDidChange):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype.get currentRevision):
(WI.SourceCode.prototype.get editableRevision):
(WI.SourceCode.prototype.get content):
(WI.SourceCode.prototype.revisionContentDidChange):
* UserInterface/Views/FontResourceContentView.js:
(WI.FontResourceContentView.prototype.dropZoneHandleDrop):
* UserInterface/Views/ImageResourceContentView.js:
(WI.ImageResourceContentView.prototype.dropZoneHandleDrop):
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView.prototype._contentAvailable):
(WI.ResourceContentView.prototype._handleImportLocalResourceOverride):
* UserInterface/Views/ScriptContentView.js:
(WI.ScriptContentView.prototype._handleTextEditorContentDidChange):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._textEditorContentDidChange):
2019-11-19 Devin Rousso <drousso@apple.com>
Web Inspector: Local Overrides: the placeholder for the MIME type, status code, and status text is the same as the placeholder URL
https://bugs.webkit.org/show_bug.cgi?id=204330
Reviewed by Joseph Pecoraro.
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover.prototype.get serializedData):
(WI.LocalResourceOverridePopover.prototype.show):
(WI.LocalResourceOverridePopover.prototype._createEditor):
* UserInterface/Views/LocalResourceOverridePopover.css:
(.popover .local-resource-override-popover-content .data-grid tr.header-content-type > :matches(.name-column, .value-column)): Added.
Replace the hardcoded `placeholder` with an optional `options` object that can include a
`placeholder` value, allowing each caller to customize what is shown. Disallow selecting the
"Content-Type" header since it's automatically populated, even if there is no set value for
the MIME type or URL (e.g. inferred from placeholders).
Drive-by: if a `CodeMirror` has no value, attempt to use it's placeholder instead.
Drive-by: replace generic `dataGrid` with more specific `this._headersDataGrid`, which is
more clear given how many `WI.DataGrid` are created by this class.
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.get selectable):
(WI.PlaceholderDataGridNode):
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.createSortableDataGrid):
* UserInterface/Views/DOMStorageContentView.js:
(WI.DOMStorageContentView.prototype.itemAdded):
(WI.DOMStorageContentView.prototype._populate):
* UserInterface/Views/EditableDataGridNode.js:
(WI.EditableDataGridNode): Deleted.
* UserInterface/Views/HeapSnapshotClassDataGridNode.js:
(WI.HeapSnapshotClassDataGridNode):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode):
* UserInterface/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js:
(WI.HeapSnapshotInstanceFetchMoreDataGridNode):
* UserInterface/Views/ProfileDataGridNode.js:
(WI.ProfileDataGridNode):
* UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
(WI.RecordingStateDetailsSidebarPanel):
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WI.ResourceDetailsSidebarPanel.prototype._createNameValueDataGrid.addDataGridNode):
* UserInterface/Views/TimelineDataGridNode.js:
(WI.TimelineDataGridNode):
Rework constructor of `WI.DataGridNode` to accept an `options`-style object as its second
parameter, instead of separate parameters for each configurable property. Now that this is
able to be done via a single parameter, add support for marking a `WI.DataGridNode` as not
being selectable.
2019-11-19 Brian Burg <bburg@apple.com>
[Cocoa] Add _WKInspector SPI to set diagnostic logging delegate for a local Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=204323
Reviewed by Devin Rousso.
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setDiagnosticLoggingAvailable):
Add a stub FrontendAPI method to be filled in later.
2019-11-18 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: copying multiple DOM nodes should copy more than just the last selected node
https://bugs.webkit.org/show_bug.cgi?id=204266
Reviewed by Brian Burg.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.async handleCopyEvent): Added.
(WI.DOMTreeContentView.prototype.handleCopyEvent): Deleted.
Call `DOM.getOuterHTML` for each selected DOM node and join the results with newlines.
* UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.getOuterHTML):
(WI.DOMNode.prototype.copyNode): Deleted.
(WI.DOMNode.prototype.copyNode.copy): Deleted.
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
(WI.DOMTreeElement.prototype._copyHTML): Deleted.
Simplify API surface.
2019-11-18 Devin Rousso <drousso@apple.com>
Web Inspector: Local Resource Overrides: allow substitution based on a url pattern
https://bugs.webkit.org/show_bug.cgi?id=202375
Reviewed by Brian Burg.
Often, websites will load content with a timestamp-based URL query parameter for
cache-busting or logging purposes. If a developer is trying to override these resources (or
is trying to have an existing override also match these resources), they'd need to edit the
local override's URL to match in addition to editing the resource that loads it (e.g. change
the <script> in an HTML file), which can sometimes be tricky of the content is dynamically
loaded (e.g. an XHR with a non-hardcoded URL).
Allowing for local overrides to be set using a regular expression pattern would help resolve
this limitation.
* UserInterface/Models/LocalResourceOverride.js:
(WI.LocalResourceOverride):
(WI.LocalResourceOverride.create):
(WI.LocalResourceOverride.fromJSON):
(WI.LocalResourceOverride.prototype.toJSON):
(WI.LocalResourceOverride.prototype.get isCaseSensitive): Added.
(WI.LocalResourceOverride.prototype.get isRegex): Added.
(WI.LocalResourceOverride.prototype.matches): Added.
(WI.LocalResourceOverride.prototype.saveIdentityToCookie):
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
(WI.NetworkManager.prototype.initializeTarget):
(WI.NetworkManager.prototype.get localResourceOverrides):
(WI.NetworkManager.prototype.addLocalResourceOverride):
(WI.NetworkManager.prototype.removeLocalResourceOverride):
(WI.NetworkManager.prototype.localResourceOverrideForURL):
(WI.NetworkManager.prototype.responseIntercepted):
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover):
(WI.LocalResourceOverridePopover.prototype.get serializedData):
(WI.LocalResourceOverridePopover.prototype.show):
(WI.LocalResourceOverridePopover.prototype._createEditor):
* UserInterface/Views/LocalResourceOverrideTreeElement.js:
(WI.LocalResourceOverrideTreeElement.prototype.get mainTitleText): Added.
(WI.LocalResourceOverrideTreeElement.prototype.onattach):
(WI.LocalResourceOverrideTreeElement.prototype.ondetach):
(WI.LocalResourceOverrideTreeElement.prototype.populateContextMenu):
(WI.LocalResourceOverrideTreeElement.prototype.willDismissPopover):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._willDismissLocalOverridePopover):
2019-11-15 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: support multiline CSS property values
https://bugs.webkit.org/show_bug.cgi?id=203754
<rdar://problem/56819044>
Reviewed by Brian Burg.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.update):
(WI.CSSProperty.prototype._updateStyleText):
When the property is updated from the backend, find the first newline inside the value and
preserve the indent string so it can be re-added when updating the backend.
* UserInterface/Views/SpreadsheetTextField.js:
(WI.SpreadsheetTextField.prototype._handleKeyDown):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor .property:not(.disabled) .value):
(.spreadsheet-style-declaration-editor .property:not(.disabled).has-newline .value): Added.
(.spreadsheet-style-declaration-editor .property:not(.disabled).has-newline .semicolon): Added.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.updateStatus):
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldAllowsNewlines): Added.
(WI.SpreadsheetStyleProperty.prototype._handleValueChange):
Support shift-enter when editing a CSS property's value to insert a newline.
2019-11-15 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: move the "Local Override..." creation context menu item from the Breakpoints section options menu to the Create Resource menu
https://bugs.webkit.org/show_bug.cgi?id=204178
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._willDismissLocalOverridePopover):
(WI.SourcesNavigationSidebarPanel.prototype._addLocalOverride):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateResourceContextMenu):
If the Local Overrides section isn't already visible, show it. Use the Local Overrides title
as the anchor for the configuration popover. If there are no existing Local Overrides, show
placeholder "No Overrides" text temporarily.
* UserInterface/Views/EventBreakpointPopover.js:
(WI.EventBreakpointPopover.prototype._showSuggestionsView):
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover.prototype._presentOverTargetElement):
* UserInterface/Views/URLBreakpointPopover.js:
(WI.URLBreakpointPopover.prototype._presentOverTargetElement):
Add some padding around the popover's anchor so the arrow doesn't overlap it.
* Localizations/en.lproj/localizedStrings.js:
2019-11-15 Devin Rousso <drousso@apple.com>
Web Inspector: Local Overrides: add context menu item to reveal the local override when a resource is loaded from it
https://bugs.webkit.org/show_bug.cgi?id=204206
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* Localizations/en.lproj/localizedStrings.js:
2019-11-15 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: "Style Sheet" appears twice in the resource type scope bar
https://bugs.webkit.org/show_bug.cgi?id=204172
Reviewed by Joseph Pecoraro.
* UserInterface/Models/Resource.js:
(WI.Resource):
(WI.Resource.prototype.updateForResponse):
Remove compatibility `WI.Resource.Type.Stylesheet` (which previously existed since the
protocol values for `Page.ResourceType` match the keys) and instead add compatibility cases
at the necessary callsites.
2019-11-13 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: "aqua" and "fuchsia" aren't detected as colors
https://bugs.webkit.org/show_bug.cgi?id=204085
Reviewed by Devin Rousso.
* UserInterface/Models/Color.js:
2019-11-13 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: Invalid type of argument 'eventName' for command 'DOMDebugger.setEventBreakpoint' call. It must be 'string' but it is 'object'.
https://bugs.webkit.org/show_bug.cgi?id=204176
Reviewed by Timothy Hatcher.
* UserInterface/Views/EventBreakpointPopover.js:
(WI.EventBreakpointPopover.prototype.dismiss):
Only create the `WI.EventBreakpoint` if the <input> has a value.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.addEventBreakpoint):
(WI.DOMDebuggerManager.prototype.addURLBreakpoint):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._willDismissEventBreakpointPopover):
(WI.SourcesNavigationSidebarPanel.prototype._willDismissURLBreakpointPopover):
Drive-by: if the configuration isn't valid (e.g. no breakpoint) or the breakpoint already
exists, beep.
2019-11-12 Devin Rousso <drousso@apple.com>
Web Inspector: Local Overrides: drop zone overlay doesn't take up the full content area
https://bugs.webkit.org/show_bug.cgi?id=204093
Reviewed by Joseph Pecoraro.
* UserInterface/Views/FontResourceContentView.css:
(.content-view.resource.font > :matches(.local-resource-override-label-view, .local-resource-override-warning-view):not([hidden]) ~ .drop-zone): Added.
(.content-view.resource.font > .drop-zone): Deleted.
* UserInterface/Views/ImageResourceContentView.css:
(.content-view.resource.image > :matches(.local-resource-override-label-view, .local-resource-override-warning-view):not([hidden]) ~ .drop-zone): Added.
(.content-view.resource.image > .drop-zone): Deleted.
2019-11-12 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: create/update local override drop zone shown in image collection view
https://bugs.webkit.org/show_bug.cgi?id=204097
Reviewed by Joseph Pecoraro.
* UserInterface/Views/CollectionContentView.js:
(WI.CollectionContentView):
(WI.CollectionContentView.prototype.get contentViewConstructorOptions): Added.
(WI.CollectionContentView.prototype.addContentViewForItem):
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView.prototype.get contentViewConstructorOptions): Added.
Provide a way to pass options when instantiating the content view from the constructor.
* UserInterface/Views/ImageResourceContentView.js:
(WI.ImageResourceContentView.prototype.contentAvailable):
Support an optional object parameter that can be used to disable the `WI.DropZone`.
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251958): console prompt is automatically focused when page is reloaded
https://bugs.webkit.org/show_bug.cgi?id=203932
Reviewed by Timothy Hatcher.
* UserInterface/Base/Main.js:
(WI._restoreCookieForOpenTabs):
Only attempt to autofocus when Web Inspector is first opened.
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r250087): inspector/model/remote-object.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=202934
<rdar://problem/56270900>
Reviewed by Timothy Hatcher.
* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView.addShowMoreIfNeeded):
Drive-by: ensure that the indeterminate progress spinner is added after the last button.
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r249451): missing "Reveal in DOM Tree" on nodes logged to the console
https://bugs.webkit.org/show_bug.cgi?id=203836
Reviewed by Timothy Hatcher.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
DOM trees in the console are marked as being non-editable, which is intended to prevent
modifications (e.g. changing an attribute) from being made in the console as the DOM tree
there is not hooked up to the associated DOM agent. In r249451 however, this guard was over
expanded to include non-editing actions, like "Reveal in DOM Tree" and DOM breakpoints.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._handleContextMenuEvent):
Drive-by: add a separator before "Copy Selected" so it doesn't end up in the same group as
any "Collapse All" from a `WI.TreeOutline`.
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: Local Resource Overrides: automatically show a file picker when attempting to create an override for non-text resources
https://bugs.webkit.org/show_bug.cgi?id=203917
Reviewed by Timothy Hatcher.
Since there's no way to edit non-text resources (e.g. images, fonts, etc.) in Web Inspector,
when creating a local override for non-text resources, default to showing a file picker and
creating a local override from the content and MIME type of whatever file is chosen.
Still provide a way (shift-click) to create a local override for non-text resources from the
resource's contents, as that can be useful if the user just wants to change some headers.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.async createLocalResourceOverride):
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView):
(WI.ResourceContentView.prototype.get createLocalResourceOverrideTooltip): Added.
(WI.ResourceContentView.prototype.requestLocalResourceOverrideInitialContent): Added.
(WI.ResourceContentView.prototype.async _getContentForLocalResourceOverrideFromFile): Added.
(WI.ResourceContentView.prototype._handleCreateLocalResourceOverride):
(WI.ResourceContentView.prototype._handleImportLocalResourceOverride):
(WI.ResourceContentView.prototype.localResourceOverrideInitialContent): Deleted.
(WI.ResourceContentView.prototype.async _handleCreateLocalResourceOverride): Deleted.
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype.get createLocalResourceOverrideTooltip): Added.
(WI.TextResourceContentView.prototype.requestLocalResourceOverrideInitialContent): Added.
(WI.TextResourceContentView.prototype.localResourceOverrideInitialContent): Deleted.
* Localizations/en.lproj/localizedStrings.js:
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: add a marker for when a stop was requested
https://bugs.webkit.org/show_bug.cgi?id=203935
Reviewed by Timothy Hatcher.
After r244195, the Web Inspector frontend doesn't stop updating the current time marker
until after it receives all of the corresponding `*.trackingComplete` events. This means
that sometimes, the current time marker can move far past the time at which the stop was
requested, such as if there's a blocking script.
We should indicate where the stop was requested, as that is often right after a particular
issue is reproduced during a timeline recording, rather than have the user try to figure out
where they stopped.
Only keep a marker for the last stop request, and hide the marker once capturing resumes.
It's still useful to have the current time marker continue updating, as we should show all
the information we have about captured things, such as blocking scripts.
* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview):
(WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged):
* UserInterface/Models/TimelineMarker.js:
* UserInterface/Views/TimelineRuler.js:
(WI.TimelineRuler.prototype.addMarker):
* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .markers > .marker.stopping-time): Added.
(.timeline-ruler > .markers > .marker.current-time):
(.timeline-ruler > .markers > .marker:matches(.stopping-time, .current-time)::after): Added.
(@media (prefers-color-scheme: dark) .timeline-ruler > .markers > .marker.stopping-time): Added.
(.timeline-ruler > .markers > .marker.current-time::after): Deleted.
Make the current time marker always on top (`z-index`).
* Localizations/en.lproj/localizedStrings.js:
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251958): automatic console prompt focusing prevents any "space" shortcuts from working
https://bugs.webkit.org/show_bug.cgi?id=203939
Reviewed by Timothy Hatcher.
* UserInterface/Base/Main.js:
(WI.isShowingTimelineTab): Added.
(WI.isShowingAuditTab): Added.
(WI._restoreCookieForOpenTabs):
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: Unable to get object details - GlobalObject
https://bugs.webkit.org/show_bug.cgi?id=203930
<rdar://problem/56960937>
In r248286, calls to `Heap.snapshot`, `Heap.getPreview`, and `Heap.getRemoteObject` were
moved to the `WI.HeapManager` instead of being inside view code. During this move, extra
`WI.reportInternalError` calls were added, which wasn't entirely correct as it is fully
possible (and expected) that any of these commands are invoked with old heap snapshot nodes
that may no longer exist. As such, calling any error an "internal error" isn't strictly
correct, and instead should just be a log. Also, the frontend code that calls these commands
is able to handle errors, again because it is expected.
Reviewed by Brian Burg.
* UserInterface/Controllers/HeapManager.js:
(WI.HeapManager.prototype.snapshot):
(WI.HeapManager.prototype.getPreview):
(WI.HeapManager.prototype.getRemoteObject):
2019-11-06 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Display color picker for p3 colors
https://bugs.webkit.org/show_bug.cgi?id=203436
<rdar://problem/56635062>
Reviewed by Brian Burg.
For p3 colors, display ColorSquare with display-p3 gamut.
Continue showing ColorSquare with sRGB gamut by default.
* UserInterface/Base/Setting.js:
* UserInterface/Models/Color.js:
(WI.Color):
(WI.Color.rgb2hsv):
(WI.Color.hsv2rgb.fraction):
(WI.Color.hsv2rgb):
(WI.Color.prototype.get hsla):
(WI.Color.prototype.isKeyword):
* UserInterface/Views/ColorPicker.css:
(.color-picker > .hue):
(@media (color-gamut: p3)):
(.color-picker.gamut-p3 > .hue):
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype._updateColor):
(WI.ColorPicker.prototype._updateOpacitySlider):
(WI.ColorPicker.prototype._handleFormatChange):
Introduce `gamut` parameter. Previously, the only available `gamut` was sRGB.
* UserInterface/Views/ColorSquare.css:
(.color-square > .crosshair):
Update the crosshair style to look better for both light and dark backgrounds.
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare):
(WI.ColorSquare.prototype.get tintedColor):
(WI.ColorSquare.prototype.set tintedColor):
(WI.ColorSquare.prototype._setCrosshairPosition):
(WI.ColorSquare.prototype._updateBaseColor):
(WI.ColorSquare.prototype._updateCrosshairBackground):
* UserInterface/Views/InlineSwatch.js:
Make p3 color picker a preview (e.g. STP-only) feature.
2019-11-05 Ross Kirsling <ross.kirsling@sony.com>
Web Inspector: Layers: enable tab by default
https://bugs.webkit.org/show_bug.cgi?id=203833
Reviewed by Timothy Hatcher.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
* UserInterface/Views/ContextMenuUtilities.js:
* UserInterface/Views/LayersTabContentView.js:
(WI.LayersTabContentView.isTabAllowed):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2019-11-04 Devin Rousso <drousso@apple.com>
Web Inspector: "Toggle Visibility" does not work for element inside Shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=202218
<rdar://problem/55713078>
Reviewed by Brian Burg.
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.toggleElementVisibility.inspectedPage_node_injectStyleAndToggleClass):
If the node is inside a shadow tree, store the `<style>` inside the shadow root instead of
always using `document.head`.
2019-11-02 Devin Rousso <drousso@apple.com>
Web Inspector: Add diagnostic logging for frontend feature usage
https://bugs.webkit.org/show_bug.cgi?id=203579
<rdar://problem/56717410>
Reviewed by Brian Burg.
Add a `DiagnosticController` class for reporting Web Inspector telemetry.
The controller initially measures a single "TabActivity" data point,
which logs the active tab during the specified time interval (one minute).
If the UI is not active during the time interval, no logging takes place.
The UI is considered to be active if mouse/keyboard interaction occurs
during the time interval, or the selected `TabContentView` changes.
Original patch by Matt Baker <mattbaker@apple.com>.
* UserInterface/Controllers/DiagnosticController.js: Added.
(WI.DiagnosticController):
(WI.DiagnosticController.supportsDiagnosticLogging):
(WI.DiagnosticController.prototype.logDiagnosticMessage):
(WI.DiagnosticController.prototype._didInteractWithTabContent):
(WI.DiagnosticController.prototype._clearTabActivityTimeout):
(WI.DiagnosticController.prototype._beginTabActivityTimeout):
(WI.DiagnosticController.prototype._stopTrackingTabActivity):
(WI.DiagnosticController.prototype._handleWindowFocus):
(WI.DiagnosticController.prototype._handleWindowBlur):
(WI.DiagnosticController.prototype._handleWindowKeyDown):
(WI.DiagnosticController.prototype._handleWindowMouseDown):
(WI.DiagnosticController.prototype._handleTabBrowserSelectedTabContentViewDidChange):
* UserInterface/Main.html:
* UserInterface/Base/Main.js:
(WI.contentLoaded):
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: switching tabs should re-focus the previously focused element
https://bugs.webkit.org/show_bug.cgi?id=203744
Reviewed by Brian Burg.
* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype._tabBarItemSelected):
(WI.TabBrowser.prototype._saveFocusedNodeForTabContentView): Added.
(WI.TabBrowser.prototype._restoreFocusedNodeForTabContentView): Added.
Store the `document.activeElement` on the `WI.TabContentView` and `.focus()` it after we're
done showing the newly selected tab, but only if there isn't already something focused.
* UserInterface/Views/TabBar.js:
(WI.TabBar.prototype.set selectedTabBarItem):
* UserInterface/Views/LegacyTabBar.js:
(WI.LegacyTabBar.prototype.set selectedTabBarItem):
Include the previously selected tab bar item when dispatching selection change events.
* UserInterface/Views/ContentBrowserTabContentView.js:
(WI.ContentBrowserTabContentView.prototype._revealAndSelectRepresentedObject):
Don't omit focus when revealing represented objects.
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: add a timeline that shows information about any recorded CSS animation/transition
https://bugs.webkit.org/show_bug.cgi?id=203651
<rdar://problem/56128726>
Reviewed by Brian Burg.
Unlike all other forms of Web Animations, CSS animations/transitions, are _not_ created by
JavaScript, and therefore can seemingly appear out of nowhere. This patch expands the Media
timeline to be the Media & Animations timeline, which tracks when CSS animations/transitions
are created, started, delayed, iterated, canceled, or finished.
* UserInterface/Protocol/AnimationObserver.js: Added.
(WI.AnimationObserver.prototype.trackingStart):
(WI.AnimationObserver.prototype.trackingUpdate):
(WI.AnimationObserver.prototype.trackingComplete):
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.get AnimationAgent): Added.
* UserInterface/Main.html:
* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WI.loaded):
Add an Animation domain for handling the tracking of CSS Web Animations.
* UserInterface/Models/MediaInstrument.js:
(WI.MediaInstrument.prototype.startInstrumentation):
(WI.MediaInstrument.prototype.stopInstrumentation):
(WI.MediaInstrument):
* UserInterface/Models/MediaTimeline.js: Added.
(WI.MediaTimeline.prototype.recordForTrackingAnimationId):
(WI.MediaTimeline.prototype.recordForMediaElementEvents):
(WI.MediaTimeline.prototype.reset):
(WI.MediaTimeline.prototype.addRecord):
* UserInterface/Models/MediaTimelineRecord.js:
(WI.MediaTimelineRecord):
(WI.MediaTimelineRecord.async fromJSON):
(WI.MediaTimelineRecord.prototype.toJSON):
(WI.MediaTimelineRecord.prototype.get trackingAnimationId): Added.
(WI.MediaTimelineRecord.prototype.get timestamps): Added.
(WI.MediaTimelineRecord.prototype.get activeStartTime): Added.
(WI.MediaTimelineRecord.prototype.get updatesDynamically): Added.
(WI.MediaTimelineRecord.prototype.get usesActiveStartTime): Added.
(WI.MediaTimelineRecord.prototype.get displayName):
(WI.MediaTimelineRecord.prototype.get subtitle): Added.
(WI.MediaTimelineRecord.prototype.saveIdentityToCookie):
(WI.MediaTimelineRecord.prototype.updateProgress): Added.
(WI.MediaTimelineRecord.prototype.addDOMEvent): Added.
(WI.MediaTimelineRecord.prototype.powerEfficientPlaybackStateChanged): Added.
(WI.MediaTimelineRecord.prototype._updateTimes): Added.
(WI.MediaTimelineRecord.fromJSON): Deleted.
(WI.MediaTimelineRecord.prototype.get domEvent): Deleted.
(WI.MediaTimelineRecord.prototype.get isPowerEfficient): Deleted.
* UserInterface/Models/Timeline.js:
(WI.Timeline.create):
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager):
(WI.TimelineManager.prototype.async processJSON):
(WI.TimelineManager.prototype.animationTrackingStarted): Added.
(WI.TimelineManager.prototype.animationTrackingUpdated): Added.
(WI.TimelineManager.prototype.animationTrackingCompleted): Added.
(WI.TimelineManager.prototype._updateAutoCaptureInstruments):
(WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
(WI.TimelineManager.prototype._handleDOMNodePowerEfficientPlaybackStateChanged):
Start/Stop tracking animations based on whether the Media & Animations timeline is enabled.
* UserInterface/Views/MediaTimelineOverviewGraph.js:
(WI.MediaTimelineOverviewGraph):
(WI.MediaTimelineOverviewGraph.get maximumRowCount): Added.
(WI.MediaTimelineOverviewGraph.prototype.reset):
(WI.MediaTimelineOverviewGraph.prototype.layout):
(WI.MediaTimelineOverviewGraph.prototype.updateSelectedRecord):
(WI.MediaTimelineOverviewGraph.prototype._processRecord): Added.
(WI.MediaTimelineOverviewGraph.prototype._processRecord.compareByStartTime): Added.
(WI.MediaTimelineOverviewGraph.prototype._handleRecordAdded):
(WI.MediaTimelineOverviewGraph.prototype._handleTimesUpdated): Added.
(WI.MediaTimelineOverviewGraph.prototype.shown): Deleted.
(WI.MediaTimelineOverviewGraph.prototype.hidden): Deleted.
* UserInterface/Views/MediaTimelineOverviewGraph.css:
(.timeline-overview-graph.media): Added.
(.timeline-overview-graph.media > .graph-row): Added.
(.timeline-overview-graph.media > .graph-row > .timeline-record-bar): Added.
(.timeline-overview-graph.media > .graph-row > .timeline-record-bar:not(.unfinished) > .segment:not(.inactive)): Added.
(.timeline-overview-graph.media:nth-child(even) > .graph-row > .timeline-record-bar:not(.unfinished) > .segment:not(.inactive)): Added.
(.timeline-overview-graph.media > .timeline-record-bar): Deleted.
(.timeline-overview-graph.media > .timeline-record-bar > .segment): Deleted.
* UserInterface/Views/MediaTimelineView.js:
(WI.MediaTimelineView):
(WI.MediaTimelineView.prototype.shown): Added.
(WI.MediaTimelineView.prototype.hidden): Added.
(WI.MediaTimelineView.prototype.closed):
(WI.MediaTimelineView.prototype.reset):
(WI.MediaTimelineView.prototype.dataGridSortComparator):
(WI.MediaTimelineView.prototype.dataGridSortComparator.compareDOMNodes):
(WI.MediaTimelineView.prototype._processPendingRecords):
* UserInterface/Views/MediaTimelineDataGridNode.js:
(WI.MediaTimelineDataGridNode):
(WI.MediaTimelineDataGridNode.prototype.get data):
(WI.MediaTimelineDataGridNode.prototype.createCellContent):
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren): Added.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addReadySegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addDelaySegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addActiveSegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addFullScreenSegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addPowerEfficientPlaybackSegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addPausedSegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addPlayingSegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.filterableDataForColumn):
(WI.MediaTimelineDataGridNode.prototype._createNameCellDocumentFragment): Added.
(WI.MediaTimelineDataGridNode.prototype.iconClassNames): Deleted.
* UserInterface/Views/TimelineRecordBar.js:
(WI.TimelineRecordBar):
(WI.TimelineRecordBar.prototype.refresh):
(WI.TimelineRecordBar.prototype._handleClick):
* UserInterface/Views/TimelineRecordBar.css:
(.timeline-record-bar):
(.timeline-record-bar > :matches(img, .segment)):
(.timeline-record-bar > img):
(.timeline-record-bar > .segment):
(body[dir=ltr] .timeline-record-bar > .segment):
(body[dir=ltr] .timeline-record-bar > .segment:first-of-type):
(body[dir=ltr] .timeline-record-bar > .segment:last-of-type):
(body[dir=rtl] .timeline-record-bar > .segment):
(body[dir=rtl] .timeline-record-bar > .segment:first-of-type):
(body[dir=rtl] .timeline-record-bar > .segment:last-of-type):
(.timeline-record-bar > .segment:not(:last-of-type)):
(.timeline-record-bar.selected > .segment):
(.timeline-record-bar > .segment.inactive,):
(.timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(:focus .selected .timeline-record-bar:not(.has-custom-children) > .segment):
(:focus .selected .timeline-record-bar:not(.has-custom-children) > .segment.inactive):
(:focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(.timeline-record-bar.timeline-record-type-network > .segment):
(.timeline-record-bar.timeline-record-type-network > .segment.inactive):
(.timeline-record-bar.timeline-record-type-layout > .segment):
(.timeline-record-bar.timeline-record-type-layout.paint > .segment,):
(.timeline-record-bar.timeline-record-type-script > .segment):
(.timeline-record-bar.timeline-record-type-script.garbage-collected > .segment,):
(.timeline-record-bar.timeline-record-type-media > .segment):
(.timeline-record-bar.has-custom-children.timeline-record-type-media > .segment):
(.timeline-record-bar.has-custom-children.timeline-record-type-media > .segment.css-animation-ready):
(.timeline-record-bar.has-custom-children.timeline-record-type-media > .segment:matches(.css-animation-delay, .media-element-paused)):
(.timeline-record-bar.has-custom-children.timeline-record-type-media.media-element > .segment):
(.timeline-record-bar.has-custom-children.timeline-record-type-media.media-element > .segment.media-element-full-screen):
(.timeline-record-bar.has-custom-children.timeline-record-type-media.media-element > .segment.media-element-power-efficient-playback):
(body[dir=ltr] .timeline-record-bar > .segment.inactive,): Deleted.
(body[dir=ltr] .timeline-record-bar.has-inactive-segment > .segment:not(.inactive),): Deleted.
(:focus .selected .timeline-record-bar > .segment): Deleted.
(:focus .selected .timeline-record-bar > .segment.inactive): Deleted.
(body[dir=ltr] :focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)): Deleted.
(body[dir=rtl] :focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)): Deleted.
Allow timeline record bars to be customized through a delegate callback. If provided, it
will be used instead of any default content. It is expected to return an array of objects,
each having a `startTime` number, `classNames` array, and `title` string. It can also have a
`endTime` number and an `image` string. If `endTime` is `NaN`, the record is unfinished. If
`image` is provided, an `<img>` will be used instead of a segment, allowing for markers.
* UserInterface/Views/TimelineDataGridNode.js:
(WI.TimelineDataGridNode.prototype.createCellContent):
Add a default fallback for `WI.DOMNode` values.
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.displayNameForTimelineType):
(WI.TimelineTabContentView.iconClassNameForRecord):
(WI.TimelineTabContentView.displayNameForRecord):
* UserInterface/Views/TimelineRecordTreeElement.js:
* UserInterface/Views/TimelineIcons.css:
(.animation-frame-record .icon):
(.css-animation-record .icon): Added.
(.css-transition-record .icon): Added.
(.media-element-record .icon): Added.
(.animation-record .icon): Deleted.
(.dom-event-record .icon): Deleted.
(.dom-event-record.fullscreen .icon): Deleted.
(.power-efficient-playback-state-changed-record .icon): Deleted.
* UserInterface/Images/DOMEventFullscreen.svg: Removed.
* UserInterface/Images/EventCancel.svg: Added.
* UserInterface/Images/EventIteration.svg: Added.
* UserInterface/Images/EventPause.svg:
* UserInterface/Images/EventPlay.svg:
* UserInterface/Images/EventProcessing.svg:
* UserInterface/Images/EventStop.svg:
* UserInterface/Images/PowerEfficientPlaybackStateChanged.svg: Removed.
* UserInterface/Images/TimelineRecordAnimationFrame.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/TimelineRecordAnimation.svg.
* UserInterface/Images/TimelineRecordCSSAnimation.svg: Added.
* UserInterface/Images/TimelineRecordCSSTransition.svg: Added.
* UserInterface/Images/TimelineRecordMediaElement.svg: Added.
Add new media icons.
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.async import): Added.
(WI.TimelineRecording.import): Deleted.
* UserInterface/Models/TimelineRecord.js:
* UserInterface/Models/CPUTimelineRecord.js:
* UserInterface/Models/HeapAllocationsTimelineRecord.js:
(WI.HeapAllocationsTimelineRecord.async fromJSON): Added.
(WI.HeapAllocationsTimelineRecord.fromJSON): Deleted.
* UserInterface/Models/LayoutTimelineRecord.js:
* UserInterface/Models/MemoryTimelineRecord.js:
* UserInterface/Models/RenderingFrameTimelineRecord.js:
* UserInterface/Models/ResourceTimelineRecord.js:
* UserInterface/Models/ScriptTimelineRecord.js:
Make the importing of timeline records `async` so we can attempt to rehydrate the DOM nodes
of any media records (as well as wait for heap snapshots).
* UserInterface/Models/DOMNode.js:
(WI.DOMNode):
(WI.DOMNode.prototype.isMediaElement): Added.
(WI.DOMNode.prototype._shouldListenForEventListeners): Deleted.
* Localizations/en.lproj/localizedStrings.js:
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: default to focusing the console prompt if no other content is focused after opening Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=203743
Reviewed by Eric Carlson and Brian Burg.
* UserInterface/Base/Main.js:
(WI.isContentAreaFocused): Added.
(WI.isConsoleFocused):
(WI._focusChanged):
(WI._restoreCookieForOpenTabs):
2019-11-01 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Display color swatches for p3 colors
https://bugs.webkit.org/show_bug.cgi?id=203439
<rdar://problem/56637250>
Reviewed by Devin Rousso.
Detect `color(display-p3 0 1 0)` as a color in the style editor.
* UserInterface/Models/Color.js:
(WI.Color):
(WI.Color.fromString):
(WI.Color.prototype.copy):
(WI.Color.prototype.toString):
(WI.Color.prototype.isKeyword):
(WI.Color.prototype._toFunctionString):
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r249831): content view is empty if a breakpoint is hit in the main resource
https://bugs.webkit.org/show_bug.cgi?id=203722
<rdar://problem/56802409>
Reviewed by Joseph Pecoraro.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype.get currentRevision):
(WI.SourceCode.prototype.revisionContentDidChange):
(WI.SourceCode.prototype._initializeCurrentRevisionIfNeeded):
(WI.SourceCode.prototype._processContent):
Don't wait to lazily clone the `originalRevision` and use it as the `currentRevision`. Some
listeners expect the `currentRevision` to already be set by the time this happens, so as
soon as the original revision's content is changed, clone it into the `currentRevision`.
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: tab isn't visible after removal of Debugger Tab and Resources Tab
https://bugs.webkit.org/show_bug.cgi?id=203719
<rdar://problem/56802389>
Reviewed by Timothy Hatcher.
* UserInterface/Base/Main.js:
(WI.loaded):
If the Debugger Tab identifier or Resources Tab identifier still exists in the list of open
tabs, remove both and replace the first one with the Sources Tab identifier.
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: make the default content of the Inspector Bootstrap Script a comment that explains how it works
https://bugs.webkit.org/show_bug.cgi?id=203704
Reviewed by Timothy Hatcher.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.async createBootstrapScript):
* Localizations/en.lproj/localizedStrings.js:
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: Blackbox: hide icon is missing
https://bugs.webkit.org/show_bug.cgi?id=203727
Reviewed by Timothy Hatcher.
* UserInterface/Images/Hide.svg:
`WI.ImageUtilities.useSVGSymbol` links directly to a specific part of the SVG resource based
on an `id` attribute (default to `#root` if not otherwise given). As a result, any `<style>`
that are not a child of that specific part won't be included, meaning that any CSS variables
used for controlling colors won't exist. Adding a fallback value to the `var()` for these
cases allows a specific part to be used without needing any surrounding styles.
* UserInterface/Views/BlackboxSettingsView.css:
(.settings-view.blackbox > p > .toggle-script-blackbox):
Slightly adjust the size and vertical alignment to better match the surrounding text.
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: enable line wrapping by default
https://bugs.webkit.org/show_bug.cgi?id=203726
Reviewed by Timothy Hatcher.
* UserInterface/Base/Setting.js:
2019-10-31 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Color picker: incorrect saturation when selecting color on color square
https://bugs.webkit.org/show_bug.cgi?id=203695
<rdar://problem/56793697>
Reviewed by Matt Baker.
The saturation component in HSV does NOT equal the saturation component in HSL.
Use the proper HSV to HSL conversion.
* UserInterface/Models/Color.js:
(WI.Color.hsv2hsl): Added.
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare.prototype.get tintedColor):
(WI.ColorSquare.prototype.get _lightness): Deleted.
2019-10-31 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251038): Elements: Computed: variables are shown in the Properties section instead of in the Variables section
https://bugs.webkit.org/show_bug.cgi?id=203668
Reviewed by Matt Baker.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
* UserInterface/Views/ComputedStyleSection.js:
(WI.ComputedStyleSection):
(WI.ComputedStyleSection.prototype.set propertyVisibilityMode): Added.
(WI.ComputedStyleSection.prototype.get propertiesToRender):
Reintroduce the `propertyVisibilityMode` concept to `WI.ComputedStyleSection` so that the
Computed details panel can prevent CSS variables from being shown in the Properites section.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.get propertiesToRender):
Replace `variable` getter with `isVariable` to match r251038.
2019-10-31 Devin Rousso <drousso@apple.com>
Web Inspector: DOMDebugger: Node Removed breakpoints should fire whenever the node is removed from the main DOM tree, not just when it's removed from it's parent
https://bugs.webkit.org/show_bug.cgi?id=203349
Reviewed by Matt Baker.
Replace `targetNode` (which was a `Runtime.RemoteObject`) with a `targetNodeId` (which is a
`DOM.NodeId`) when dispatching `DOMDebugger` pauses. Additionally, include the ancestor's
`DOM.NodeId` as the `targetNodeId` whenever an ancestor is removed that has a descendant
with a node removed DOM breakpoint.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
* Localizations/en.lproj/localizedStrings.js:
2019-10-31 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: CONSOLE ERROR Shown panel style-rules must be visible
https://bugs.webkit.org/show_bug.cgi?id=203377
Reviewed by Devin Rousso.
Fix assertion failure when opening elements panel with hidden details sidebar.
* UserInterface/Views/ContentBrowserTabContentView.js:
(WI.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels):
* UserInterface/Views/Sidebar.js:
(WI.Sidebar.prototype.set selectedSidebarPanel): Only call shown() if the Sidebar
is not collapsed. It will anyway be called when the Sidebar is expanded.
2019-10-30 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: track WI.Script unique display name numbers per Page target
https://bugs.webkit.org/show_bug.cgi?id=203427
Reviewed by Devin Rousso.
WI.Script now keeps track of last unique numbers via a static weak map keyed by
the Script's root target. So whenever new Page target is created all its scripts
will get unique display numbers from a new namespace.
Parent target is now passed to each target constructor and allow to find host
page target for nested targets. Among other things WorkerConnection and
TargetConnection use parentTarget for dispatching events instead of creating
extra copy of the same data that is already stored in Target.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.globalObjectCleared):
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager.prototype.targetCreated):
(WI.TargetManager.prototype.didCommitProvisionalTarget):
(WI.TargetManager.prototype.targetDestroyed):
(WI.TargetManager.prototype.dispatchMessageFromTarget):
(WI.TargetManager.prototype._connectToTarget):
(WI.TargetManager.prototype._createTarget):
* UserInterface/Controllers/WorkerManager.js:
(WI.WorkerManager.prototype.workerCreated):
* UserInterface/Models/Script.js:
(WI.Script):
(WI.Script.prototype.get displayName):
(WI.Script.prototype._nextUniqueDisplayNameNumber):
(WI.Script.prototype._nextUniqueConsoleDisplayNameNumber):
(WI.Script.prototype._uniqueDisplayNameNumbersForRootTarget):
* UserInterface/Protocol/Connection.js:
(InspectorBackend.WorkerConnection.prototype.sendMessageToBackend):
(InspectorBackend.WorkerConnection):
(InspectorBackend.TargetConnection.prototype.sendMessageToBackend):
(InspectorBackend.TargetConnection):
* UserInterface/Protocol/DirectBackendTarget.js:
(WI.DirectBackendTarget):
* UserInterface/Protocol/MultiplexingBackendTarget.js:
(WI.MultiplexingBackendTarget):
* UserInterface/Protocol/PageTarget.js:
(WI.PageTarget):
* UserInterface/Protocol/Target.js:
(WI.Target):
(WI.Target.prototype.get parentTarget):
(WI.Target.prototype.get rootTarget):
* UserInterface/Protocol/WorkerTarget.js:
(WI.WorkerTarget):
2019-10-30 Eike Rathke <erack@redhat.com>
Covscan: remove stray semicolon
https://bugs.webkit.org/show_bug.cgi?id=203622
Reviewed by Devin Rousso.
* UserInterface/Views/CheckboxNavigationItem.js:
(WI.CheckboxNavigationItem.prototype.set label):
2019-10-29 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Opacity slider background doesn't update when when hue slider moves
https://bugs.webkit.org/show_bug.cgi?id=203593
<rdar://problem/56723629>
Reviewed by Matt Baker.
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype.set color):
(WI.ColorPicker.prototype.colorSquareColorDidChange):
Remove unused function arguments.
(WI.ColorPicker.prototype.sliderValueDidChange):
Update the background of the opacity slider when the hue slider changes.
(WI.ColorPicker.prototype._updateOpacitySlider): Renamed from _updateSliders.
Drive-by: replace `var` with `let`.
2019-10-28 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Right-clicking in color picker should not select color
https://bugs.webkit.org/show_bug.cgi?id=203434
Reviewed by Devin Rousso.
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare.prototype._handleMousedown):
2019-10-28 Antoine Quint <graouts@apple.com>
CSS Transitions and CSS Animations properties should treat unitless 0 as an invalid value for times
https://bugs.webkit.org/show_bug.cgi?id=203484
Reviewed by Antti Koivisto.
Use 0s instead of 0 in places where unitless times were used but shouldn't have been.
* UserInterface/Views/FindBanner.css:
(.no-find-banner-transition:matches(.find-banner, .supports-find-banner)):
* UserInterface/Views/TabBar.css:
(.tab-bar > .item > .close):
2019-10-25 Devin Rousso <drousso@apple.com>
Web Inspector: Styles: un-experimentalize showing rule icons
https://bugs.webkit.org/show_bug.cgi?id=203308
Reviewed by Joseph Pecoraro.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
2019-10-24 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: assertion failure at GeneralStyleDetailsSidebarPanel.js:34:23
https://bugs.webkit.org/show_bug.cgi?id=203376
Reviewed by Devin Rousso.
Use class's prototype instead of class itself when doing instanceof check.
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel):
2019-10-24 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: CONSOLE ERROR removeEventListener cannot remove blackboxed-urls-changed because it doesn't exist.
https://bugs.webkit.org/show_bug.cgi?id=203372
Reviewed by Devin Rousso.
Avoid console errors when opening source panel.
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype._updateSourceCode): Only remove listener if it has
been added before.
2019-10-23 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way to inject "bootstrap" JavaScript into the page as the first script executed
https://bugs.webkit.org/show_bug.cgi?id=195847
<rdar://problem/48950551>
Reviewed by Joseph Pecoraro.
When debugging webpages, it's often useful to be able to swizzle various functions in order
to add extra logs for when they're called (e.g. `Event.prototype.preventDefault`). Sometimes
this can be difficult, such as if the page saves a copy of the function and references that
instead, in which case it would be helpful to have a way to guarantee that the swizzled code
is the first thing evaluated after the context is created.
This change adds support for that concept, which has been named Inspector Bootstrap Script.
Once created, it will be injected as the first user script to every new global object that
is created afterwards. Modifications to the Inspector Bootstrap Script take effect for all
new global objects created _after_ the modification happened.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
(WI.NetworkManager.supportsBootstrapScript): Added.
(WI.NetworkManager.get bootstrapScriptURL): Added.
(WI.NetworkManager.get bootstrapScriptSourceObjectStoreKey): Added.
(WI.NetworkManager.prototype.initializeTarget):
(WI.NetworkManager.prototype.get bootstrapScript): Added.
(WI.NetworkManager.prototype.get bootstrapScriptEnabled): Added.
(WI.NetworkManager.prototype.set bootstrapScriptEnabled): Added.
(WI.NetworkManager.prototype.async createBootstrapScript): Added.
(WI.NetworkManager.prototype.destroyBootstrapScript): Added.
(WI.NetworkManager.prototype._processServiceWorkerConfiguration):
(WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange): Added.
* UserInterface/Models/LocalScript.js:
(WI.LocalScript):
(WI.LocalScript.prototype.get editable): Added.
(WI.LocalScript.prototype.get supportsScriptBlackboxing): Added.
(WI.LocalScript.prototype.requestContentFromBackend):
(WI.LocalScript.prototype.handleCurrentRevisionContentChange): Added.
* UserInterface/Views/ScriptContentView.js:
(WI.ScriptContentView):
(WI.ScriptContentView.prototype._contentWillPopulate):
(WI.ScriptContentView.prototype._contentDidPopulate):
(WI.ScriptContentView.prototype._handleTextEditorContentDidChange): Added.
Support editing of `WI.LocalScript` that are specifically marked as such.
* UserInterface/Models/Script.js:
(WI.Script):
(WI.Script.prototype.get displayName):
(WI.Script.prototype.get displayURL):
(WI.Script.prototype.isMainResource):
(WI.Script.prototype._resolveResource):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.customPerformSearch):
(WI.SourceCodeTextEditor.prototype._createTypeTokenAnnotator):
(WI.SourceCodeTextEditor.prototype._createBasicBlockAnnotator):
Allow a `WI.Script` to not have an associated `WI.Target`, specifically for `WI.LocalScript`.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject):
(WI.SourcesNavigationSidebarPanel.prototype.createContentTreeOutline):
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._addLocalOverride): Added.
(WI.SourcesNavigationSidebarPanel.prototype._removeResourceOverride): Added.
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateResourceContextMenu):
(WI.SourcesNavigationSidebarPanel.prototype._handleBootstrapScriptCreated): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleBootstrapScriptDestroyed): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleLocalResourceOverrideAdded):
(WI.SourcesNavigationSidebarPanel.prototype._handleLocalResourceOverrideRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
(WI.SourcesNavigationSidebarPanel.prototype._addLocalResourceOverride): Removed.
(WI.SourcesNavigationSidebarPanel.prototype._removeLocalResourceOverride): Removed.
Add an item in the create resource context menu for creating/focusing the bootstrap script.
* UserInterface/Views/ScriptTreeElement.js:
(WI.ScriptTreeElement):
* UserInterface/Views/BootstrapScriptTreeElement.js: Added.
(WI.BootstrapScriptTreeElement):
(WI.BootstrapScriptTreeElement.prototype.onattach):
(WI.BootstrapScriptTreeElement.prototype.ondetach):
(WI.BootstrapScriptTreeElement.prototype.ondelete):
(WI.BootstrapScriptTreeElement.prototype.onspace):
(WI.BootstrapScriptTreeElement.prototype.canSelectOnMouseDown):
(WI.BootstrapScriptTreeElement.prototype.populateContextMenu):
(WI.BootstrapScriptTreeElement.prototype.updateStatus):
(WI.BootstrapScriptTreeElement.prototype._handleNetworkManagerBootstrapScriptToggled):
* UserInterface/Views/BootstrapScriptTreeElement.css: Added.
(.item.script.bootstrap .status > input[type="checkbox"]):
* UserInterface/Views/LocalResourceOverrideTreeElement.css:
(.item.resource.override .status > input[type="checkbox"]): Added.
(.item.resource.override .status > div): Removed.
Don't show the full bootstrap script URL. Instead, show "Inspector Bootstrap Script".
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype.didPresentDialog):
Show the bootstrap script in the open resource dialog.
* UserInterface/Base/Utilities.js:
(isWebInspectorBootstrapScript): Added.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.scriptDidFail):
* UserInterface/Base/ObjectStore.js:
(WI.ObjectStore.static _open):
(WI.ObjectStore.prototype.async get): Added.
Add a generalized object store that can be used for one-off values that need the larger
storage capacity of `IndexedDB`.
* .eslintrc:
* Localizations/en.lproj/localizedStrings.js:
2019-10-23 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: notify inspector when provisional page is created, committed and destroyed
https://bugs.webkit.org/show_bug.cgi?id=202704
Reviewed by Devin Rousso.
Updated frontend code to understand provisional targets. For now there are
no changes frontend behavior, it will wait for the provisional target to commit
and will not send any commands to it before that.
* UserInterface/Base/Main.js: Moved a bunch of methods shared between Main.js and Test.js
to TargetManager.js to keep them in sync.
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager):
(WI.TargetManager.prototype.removeTarget):
(WI.TargetManager.prototype.createMultiplexingBackendTarget):
(WI.TargetManager.prototype.createDirectBackendTarget):
(WI.TargetManager.prototype.targetCreated):
(WI.TargetManager.prototype.didCommitProvisionalTarget):
(WI.TargetManager.prototype.targetDestroyed):
(WI.TargetManager.prototype.dispatchMessageFromTarget):
(WI.TargetManager.prototype._checkAndHandlePageTargetTransition):
(WI.TargetManager.prototype._checkAndHandlePageTargetTermination):
(WI.TargetManager.prototype._initializeBackendTarget):
(WI.TargetManager.prototype._initializePageTarget):
(WI.TargetManager.prototype._transitionPageTarget):
(WI.TargetManager.prototype._terminatePageTarget):
(WI.TargetManager.prototype._resetMainExecutionContext):
(WI.TargetManager.prototype._redirectGlobalAgentsToConnection):
* UserInterface/Protocol/Connection.js:
(InspectorBackend.WorkerConnection.sendMessageToBackend):
(InspectorBackend.WorkerConnection):
(InspectorBackend.TargetConnection.sendMessageToBackend):
(InspectorBackend.TargetConnection):
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.destroy): Mark target as destroyed to distinguish expected command errors from
genuine failures.
(WI.Target.prototype.isDestroyed):
* UserInterface/Protocol/TargetObserver.js: Since the front-end doesn't
send commands to the provisional targets yet, it has to ignore all activities
related to provisional pages. For that reason we need two sets to keep track of
- provisional pages that were destroyed and never committed
- old pages which were replaced by committed page and for which following targetDestroyed
event should be ignored
Better support for provisional targets will be added to frontend in a separate change.
(WI.TargetObserver):
(WI.TargetObserver.prototype.targetCreated):
(WI.TargetObserver.prototype.didCommitProvisionalTarget): For now convert the event into a subsequence
of targetDestroyed/targetCreated events which matches previous behavior.
(WI.TargetObserver.prototype.targetDestroyed):
(WI.TargetObserver.prototype.dispatchMessageFromTarget):
* UserInterface/Test/Test.js:
(WI.transitionPageTarget):
(WI.terminatePageTarget):
2019-10-23 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Replace color wheel with square HSB color picker
https://bugs.webkit.org/show_bug.cgi?id=203169
<rdar://problem/56449832>
Reviewed by Devin Rousso.
Replace the color wheel with a square HSB color picker.
The square HSB color picker provides more precision for choosing saturation,
and it's more familiar to most web developers.
* UserInterface/Main.html:
* UserInterface/Views/ColorPicker.css:
(.color-picker):
(.color-picker > .hue):
(body[dir=ltr] .color-picker > .hue):
(body[dir=rtl] .color-picker > .hue):
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker):
(WI.ColorPicker.prototype.get colorSquare):
(WI.ColorPicker.prototype.set color):
(WI.ColorPicker.prototype.colorSquareColorDidChange):
(WI.ColorPicker.prototype.sliderValueDidChange):
(WI.ColorPicker.prototype._updateColor):
(WI.ColorPicker.prototype._updateSliders):
Add a hue slider. The new color picker has the hue slider instead of the brightness slider.
* UserInterface/Views/ColorSquare.css: Renamed from Source/WebInspectorUI/UserInterface/Views/ColorWheel.css.
(.color-square):
(.color-square > .saturation-gradient):
(.color-square > .lightness-gradient):
(.color-square > .fill):
(.color-square > .crosshair):
* UserInterface/Views/ColorSquare.js: Added.
(WI.ColorSquare):
(WI.ColorSquare.prototype.get element):
(WI.ColorSquare.prototype.set dimension):
(WI.ColorSquare.prototype.get hue):
(WI.ColorSquare.prototype.set hue):
(WI.ColorSquare.prototype.get tintedColor):
(WI.ColorSquare.prototype.set tintedColor):
(WI.ColorSquare.prototype.get rawColor):
(WI.ColorSquare.prototype.handleEvent):
(WI.ColorSquare.prototype.get _saturation):
(WI.ColorSquare.prototype.get _brightness):
(WI.ColorSquare.prototype.get _lightness):
(WI.ColorSquare.prototype._handleMousedown):
(WI.ColorSquare.prototype._handleMousemove):
(WI.ColorSquare.prototype._handleMouseup):
(WI.ColorSquare.prototype._updateColorForMouseEvent):
(WI.ColorSquare.prototype._setCrosshairPosition):
(WI.ColorSquare.prototype._updateBaseColor):
* UserInterface/Views/ColorWheel.js: Removed.
* UserInterface/Views/GradientEditor.js:
(WI.GradientEditor):
2019-10-23 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: frontend tests should clear output before resending results
https://bugs.webkit.org/show_bug.cgi?id=203262
Reviewed by Devin Rousso.
Inspector front-end tests will clear output log before resending teset results. This avoids
race between InspectorTest.testPageDidLoad event and TestPage.addResult calls that may have
already be sent to the new page after navigation. The latter events otherwise would be added
twice.
* UserInterface/Test/FrontendTestHarness.js:
(FrontendTestHarness):
(FrontendTestHarness.prototype.testPageDidLoad):
(FrontendTestHarness.prototype.reloadPage):
(FrontendTestHarness.prototype.reportUnhandledRejection):
(FrontendTestHarness.prototype.reportUncaughtException):
(FrontendTestHarness.prototype._resendResults): Don't resend the results when the page is loaded
first time.
2019-10-22 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: keep the function/object name sticky in the object preview popover
https://bugs.webkit.org/show_bug.cgi?id=203259
Reviewed by Matt Baker.
* UserInterface/Views/SourceCodeTextEditor.css:
(.popover .debugger-popover-content):
(.popover .debugger-popover-content.expandable): Added.
(.popover .debugger-popover-content > .title):
(.popover .debugger-popover-content > .body):
(.popover .debugger-popover-content.formatted): Added.
(.popover .expandable): Deleted.
Use flexbox to ensure that only the function/object body is scrollable.
Adjust the min/max width/height to take less space for smaller objects.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._showPopoverWithFormattedValue):
Wrap formatted values in a `<div>` so we can apply special styling to them.
2019-10-22 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: content of function definition popover sometimes cut off
https://bugs.webkit.org/show_bug.cgi?id=203258
Reviewed by Matt Baker.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
2019-10-22 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Sources: when editing style sheets, the content is sometimes suddenly replaced with the original content of the resource
https://bugs.webkit.org/show_bug.cgi?id=203235
Reviewed by Timothy Hatcher.
Each `WI.CSSStyleSheet` manages it's own state about when it should ignore events from the
backend telling it that it was modified, such as if the frontend caused the update. In these
cases, the `WI.CSSStyleSheet` itself was early-returning, but the `WI.CSSManager` wasn't,
meaning that the `WI.CSSManager` would then override the content even though the specific
`WI.CSSStyleSheet` knows that its content shouldn't update. To compound this issue, the
`WI.CSSManager` updates any `WI.CSSStyleSheet` using a `Throttler`, so any updates would be
further delayed (first by the protocol travel time) by this, leading to the timing based
intermittent issue. `WI.CSSStyleSheet` already exposes when it should be updated or not via
`WI.CSSStyleSheet.prototype.noteContentDidChange`. Rather than have `WI.CSSManager` just
call that function, it should examine the returned boolean to see if it should continue to
process the update, or if the `WI.CSSStyleSheet` knows that it should be ignored.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype.styleSheetChanged):
2019-10-21 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251227): Uncaught Exception: undefined is not an object (evaluating 'agent.enable')
https://bugs.webkit.org/show_bug.cgi?id=203208
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/AppController.js:
(WI.AppController.prototype.activateExtraDomains):
2019-10-21 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Provide a flag for technology preview builds
https://bugs.webkit.org/show_bug.cgi?id=203164
<rdar://problem/56202164>
Reviewed by Devin Rousso.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Test/Test.js:
* UserInterface/Base/Main.js:
* UserInterface/Base/Setting.js:
(WI.isTechnologyPreviewBuild):
(WI.arePreviewFeaturesEnabled):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
In non-TechnologyPreview builds, if there are Preview Features provide a
setting switch that can be used to match the TechnologyPreview features.
2019-10-21 Devin Rousso <drousso@apple.com>
Web Inspector: replace all uses of `window.*Agent` with a target-specific call
https://bugs.webkit.org/show_bug.cgi?id=201149
Reviewed by Matt Baker.
Most of these were changed in r251227, but a few appear to have slipped through the cracks.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.debuggerDidResume):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._createTypeTokenAnnotator):
(WI.SourceCodeTextEditor.prototype._createBasicBlockAnnotator):
2019-10-18 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: allow WebKit engineers to edit UserAgent shadow trees
https://bugs.webkit.org/show_bug.cgi?id=203159
Reviewed by Brian Burg.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.initializeTarget):
(WI.DOMManager.supportsEditingUserAgentShadowTrees): Added.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.get editable):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.get editable):
(WI.DOMTreeElement.prototype._startEditingTarget):
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel):
(WI.GeneralStyleDetailsSidebarPanel.prototype._showPanel):
(WI.GeneralStyleDetailsSidebarPanel.prototype._handleNodeChanged): Added.
* UserInterface/Views/StyleDetailsPanel.js:
(WI.StyleDetailsPanel.prototype.get supportsNewRule): Added.
(WI.StyleDetailsPanel.prototype.markAsNeedsRefresh):
(WI.StyleDetailsPanel.prototype.refresh):
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.get supportsNewRule): Added.
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.newRuleButtonClicked):
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.newRuleButtonContextMenu):
Don't show the "Add Rule" button if the selected node is inside a UserAgent shadow tree.
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createEngineeringSettingsView):
2019-10-18 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: $0 is shown for the wrong node when selecting elements in a user agent shadow tree
https://bugs.webkit.org/show_bug.cgi?id=203155
Reviewed by Matt Baker.
Rather than naively using the last selected node (from `WI.TreeOutline`), we should wait
to see if the inspected page's DOM agent allows the selected node to be used as the
inspected node, and if so then to show the `$0`.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.setInspectedNode):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype._handleInspectedNodeChanged): Added.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li.inspected-node > span::after): Added.
(.tree-outline.dom:focus li.inspected-node.selected > span::after): Added.
(.tree-outline.dom.show-last-selected li.last-selected > span::after): Deleted.
(.tree-outline.dom.show-last-selected:focus li.last-selected > span::after): Deleted.
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
2019-10-18 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251254): Elements: forced pseudo-class indicator isn't visible for selected nodes
https://bugs.webkit.org/show_bug.cgi?id=203158
Reviewed by Matt Baker.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li > :not(.selection-area)): Added.
(.tree-outline.dom li > span): Deleted.
2019-10-17 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: selection shouldn't be dimmed by shadow trees
https://bugs.webkit.org/show_bug.cgi?id=203057
Reviewed by Joseph Pecoraro.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li .selection-area):
(.tree-outline.dom li > span): Added.
Don't force the `.selection-area` to be behind (`z-index: -1;`) the rest of the content, as
that also puts it behind any `background-color`. Instead, we should make all the content in
every `WI.DOMTreeElement` be above (`z-index: 1;`) the rest of the content, including the
`.selection-area` and any parent's `background-color`.
2019-10-17 Devin Rousso <drousso@apple.com>
Web Inspector: Network: updates when toggling resource caching should be sent to every connected target
https://bugs.webkit.org/show_bug.cgi?id=203025
Reviewed by Joseph Pecoraro.
* UserInterface/Base/Main.js:
(WI._resourceCachingDisabledSettingChanged):
2019-10-17 Devin Rousso <drousso@apple.com>
Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
https://bugs.webkit.org/show_bug.cgi?id=200384
<rdar://problem/53850352>
Reviewed by Joseph Pecoraro.
`InspectorBackend.domains.${domain}` isn't a truly valid way to feature check, as it
indicates what's supported by the WebKit framework underlying whatever's currently being
inspected, not what the current inspection target supports.
As an example, inspecting an iOS `JSContext` will still show `InspectorBackend.domains.DOM`
as the `DOMAgent` is supported by WebKit, even though `JSContext`s have no concept of the
DOM. In this example, however, `window.DOMAgent` would NOT exist, as the `availability`
check for the `DOM` domain wouldn't pass, meaning that the agent never gets connected.
In order to do proper feature checking, `InspectorBackend.domains` needs to be accurate
depending on the debuggable type. Furthermore, each target underneath that debuggable needs
to be able to "choose" what commands/events are supported based on that target's type.
This patch modifies how InspectorBackendCommands.js ties into `InspectorBackend`. Rather
than directly creating an `InspectorBackend.Agent` for each domain, we now create more of a
"blueprint" of the domain, and wait to actually create an `InspectorBackend.Agent` until we
have a `WI.Target` (and therefore an `InspectorBackend.Connection`). Each "concept" of the
protocol now directly maps to an object.
- InspectorBackend.Domain
- InspectorBackend.Command
- InspectorBackend.Event
- InspectorBackend.Dispatcher
When a `WI.Target` is created, it gets the list of `InspectorBackend.Domain` that support
that `WI.Target`'s type (specified in the protocol JSON files) and generates an
`InspectorBackend.Agent` for each, which in turn generates an `InspectorBackend.Callable`
for each supported `InspectorBackend.Command` and instantiates `InspectorBackend.Dispatcher`.
Activating a `InspectorBackend.Domain` means it's visible for `InspectorBackend` feature
checking. This must be done this way for older ITML backends that will still appear as
"JSContext" targets and therefore go through the "extra domains" path. Ideally, the process
of registering a domain should be enough to activate it. <https://webkit.org/b/201150>
Feature checking can now only be done via `hasDomain`, `hasCommand`, and `hasEvent` on
`InspectorBackend` or a specific `WI.Target`, and there are different implications for each:
- `InspectorBackend.hasDomain(DOM)` asks whether the `DOM` domain is supported by the
current debuggable, but says nothing about whether any `WI.Target` support `DOM`.
- `target.hasDomain("DOM")` asks whether the given `target` supports `DOM`, which is
limited by `InspectorBackend.hasDomain("DOM")`.
Now that `InspectorBackend.Agent` is only created by a `WI.Target`, it's no longer valid to
write `window.DOMAgent`, as there is no "global" agent. All protocol logic _must_ go through
a `WI.Target`. <https://webkit.org/b/201149>
Debuggable Types:
- JavaScript (JSC::JSGlobalObject)
- Page (WebCore::Page)
- ServiceWorker (WebCore::ServiceWorkerThreadProxy)
- WebPage (WebKit::WebPageProxy)
Target Types:
- JavaScript (direct connection)
- Page (multi-target connection to any Worker)
- ServiceWorker (direct connection)
- WebPage (multi-target connection to 1+ Page)
- Worker (direct connection, only available for Page debuggables)
* UserInterface/Base/DebuggableType.js:
* UserInterface/Base/TargetType.js: Copied from Source/WebInspectorUI/UserInterface/Base/DebuggableType.js.
* UserInterface/Protocol/Connection.js:
* UserInterface/Protocol/InspectorBackend.js:
* UserInterface/Protocol/ApplicationCacheObserver.js:
* UserInterface/Protocol/CPUProfilerObserver.js:
* UserInterface/Protocol/CSSObserver.js:
* UserInterface/Protocol/CanvasObserver.js:
* UserInterface/Protocol/ConsoleObserver.js:
* UserInterface/Protocol/DOMObserver.js:
* UserInterface/Protocol/DOMStorageObserver.js:
* UserInterface/Protocol/DatabaseObserver.js:
* UserInterface/Protocol/DebuggerObserver.js:
* UserInterface/Protocol/HeapObserver.js:
* UserInterface/Protocol/InspectorObserver.js:
* UserInterface/Protocol/LayerTreeObserver.js:
* UserInterface/Protocol/MemoryObserver.js:
* UserInterface/Protocol/NetworkObserver.js:
* UserInterface/Protocol/PageObserver.js:
* UserInterface/Protocol/RuntimeObserver.js:
* UserInterface/Protocol/ScriptProfilerObserver.js:
* UserInterface/Protocol/TargetObserver.js:
* UserInterface/Protocol/TimelineObserver.js:
* UserInterface/Protocol/WorkerObserver.js:
All observers now extend from `InspectorBackend.Dispatcher` and have a separate instance for
each `InspectorBackend.Agent`, each having their own `_target`.
* UserInterface/Protocol/Target.js:
* UserInterface/Protocol/DirectBackendTarget.js:
* UserInterface/Protocol/JavaScriptContextTarget.js: Removed.
* UserInterface/Protocol/MultiplexingBackendTarget.js:
* UserInterface/Protocol/PageTarget.js:
* UserInterface/Protocol/WorkerTarget.js:
Agents are now created per-target instead of copied from the "global" list. This means that
agents can have a different set of commands/events depending on the associated target.
* UserInterface/Base/Main.js:
* UserInterface/Base/Utilities.js:
* UserInterface/Controllers/AppController.js:
* UserInterface/Controllers/AppControllerBase.js:
* UserInterface/Controllers/ApplicationCacheManager.js:
* UserInterface/Controllers/AuditManager.js:
* UserInterface/Controllers/BreakpointPopoverController.js:
* UserInterface/Controllers/CSSManager.js:
* UserInterface/Controllers/CanvasManager.js:
* UserInterface/Controllers/ConsoleManager.js:
* UserInterface/Controllers/DOMDebuggerManager.js:
* UserInterface/Controllers/DOMManager.js:
* UserInterface/Controllers/DOMStorageManager.js:
* UserInterface/Controllers/DatabaseManager.js:
* UserInterface/Controllers/DebuggerManager.js:
* UserInterface/Controllers/HeapManager.js:
* UserInterface/Controllers/IndexedDBManager.js:
* UserInterface/Controllers/JavaScriptLogViewController.js:
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
* UserInterface/Controllers/LayerTreeManager.js:
* UserInterface/Controllers/MemoryManager.js:
* UserInterface/Controllers/NetworkManager.js:
* UserInterface/Controllers/RuntimeManager.js:
* UserInterface/Controllers/TargetManager.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Controllers/WorkerManager.js:
* UserInterface/Main.html:
* UserInterface/Models/AuditTestBase.js:
* UserInterface/Models/AuditTestCase.js:
* UserInterface/Models/AuditTestCaseResult.js:
* UserInterface/Models/CPUInstrument.js:
* UserInterface/Models/CPUTimelineRecord.js:
* UserInterface/Models/CSSCompletions.js:
* UserInterface/Models/CSSStyleSheet.js:
* UserInterface/Models/Canvas.js:
* UserInterface/Models/DOMNode.js:
* UserInterface/Models/DOMNodeStyles.js:
* UserInterface/Models/DOMStorageObject.js:
* UserInterface/Models/DOMTree.js:
* UserInterface/Models/DatabaseObject.js:
* UserInterface/Models/FPSInstrument.js:
* UserInterface/Models/GarbageCollection.js:
* UserInterface/Models/HeapAllocationsInstrument.js:
* UserInterface/Models/Instrument.js:
* UserInterface/Models/MediaInstrument.js:
* UserInterface/Models/MemoryInstrument.js:
* UserInterface/Models/MemoryPressureEvent.js:
* UserInterface/Models/MemoryTimelineRecord.js:
* UserInterface/Models/Recording.js:
* UserInterface/Models/Resource.js:
* UserInterface/Models/ScriptInstrument.js:
* UserInterface/Models/ScriptSyntaxTree.js:
* UserInterface/Models/ScriptTimelineRecord.js:
* UserInterface/Models/ShaderProgram.js:
* UserInterface/Models/SourceMapResource.js:
* UserInterface/Models/TimelineRecording.js:
* UserInterface/Protocol/RemoteObject.js:
* UserInterface/Test.html:
* UserInterface/Test/FrontendTestHarness.js:
* UserInterface/Test/Test.js:
* UserInterface/Test/TestAppController.js:
* UserInterface/Views/AuditNavigationSidebarPanel.js:
* UserInterface/Views/AuditTabContentView.js:
* UserInterface/Views/CanvasTabContentView.js:
* UserInterface/Views/ContextMenuUtilities.js:
* UserInterface/Views/CookieStorageContentView.js:
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
* UserInterface/Views/DOMTreeContentView.js:
* UserInterface/Views/ElementsTabContentView.js:
* UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
* UserInterface/Views/Layers3DContentView.js:
* UserInterface/Views/LayersTabContentView.js:
* UserInterface/Views/LayoutTimelineView.js:
* UserInterface/Views/LogContentView.js:
* UserInterface/Views/NetworkTabContentView.js:
* UserInterface/Views/NetworkTableContentView.js:
* UserInterface/Views/NetworkTimelineView.js:
* UserInterface/Views/ObjectTreeView.js:
* UserInterface/Views/QuickConsole.js:
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
* UserInterface/Views/ScriptClusterTimelineView.js:
* UserInterface/Views/ScriptDetailsTimelineView.js:
* UserInterface/Views/ScriptTreeElement.js:
* UserInterface/Views/SearchSidebarPanel.js:
* UserInterface/Views/SearchTabContentView.js:
* UserInterface/Views/SettingsTabContentView.js:
* UserInterface/Views/SourceCodeTextEditor.js:
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
* UserInterface/Views/SpreadsheetStyleProperty.js:
* UserInterface/Views/StorageTabContentView.js:
* UserInterface/Views/TimelineRecordingContentView.js:
* UserInterface/Views/TimelineTabContentView.js:
* UserInterface/Views/Toolbar.js:
* UserInterface/Views/WebSocketContentView.js:
* UserInterface/Views/WorkerTreeElement.js:
Replace all instances of `window.DomainAgent` with `target.DomainAgent`, where `target` is
either derived from an associated model object or `WI.assumingMainTarget()`.
Split the `WI.DebuggableType.Web` debuggable type into `WI.DebuggableType.Page` (WebCore::Page)
and `WI.DebuggableType.WebPage` (WebKit::WebPageProxy).
* UserInterface/Protocol/Legacy/*:
* Versions/*:
Update protocol files for older versions of iOS.
* .eslintrc:
* Localizations/en.lproj/localizedStrings.js:
2019-10-15 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: prevent source mapped resources from being blackboxed
https://bugs.webkit.org/show_bug.cgi?id=203007
Reviewed by Matt Baker.
Since source mapped resources are entirely a frontend concept, it doesn't make sense to
allow them to be blackboxed.
* UserInterface/Models/SourceMapResource.js:
(WI.SourceMapResource.prototype.get supportsScriptBlackboxing):
2019-10-15 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Convert CSSRule selectorText setter to setSelectorText method because it's asynchronous
https://bugs.webkit.org/show_bug.cgi?id=202840
Reviewed by Matt Baker.
* UserInterface/Models/CSSRule.js:
(WI.CSSRule.prototype.setSelectorText):
(WI.CSSRule.prototype._selectorRejected):
(WI.CSSRule.prototype._selectorResolved):
Remove WI.CSSRule.Event.SelectorChanged event and since it wasn't used anywhere else.
(WI.CSSRule):
(WI.CSSRule.prototype.set selectorText): Deleted.
(WI.CSSRule.prototype.setSelectorText): Added.
(WI.CSSRule.prototype._selectorRejected): Deleted.
(WI.CSSRule.Event.SelectorChanged): Deleted.
Remove `{valid: ...}` object since it wasn't used.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidCommit):
2019-10-15 Devin Rousso <drousso@apple.com>
Web Inspector: Local Resource Overrides: automatically create an image/font local override when dragging content over a non-overridden resource
https://bugs.webkit.org/show_bug.cgi?id=202957
Reviewed by Joseph Pecoraro.
Since non-text resources aren't editable, some users of local resource overrides kept trying
to drag image/font files over the actual resource content view (not the local override),
which didn't do anything. Rather than having to click "Create Local Override" and then do a
drag/drop, we should support the "shorter" workflow of drag/drop over the actual resource.
* UserInterface/Base/FileUtilities.js:
(WI.FileUtilities.import): Added.
(WI.FileUtilities.importText):
(WI.FileUtilities.importJSON):
(WI.FileUtilities.importData): Added.
(WI.FileUtilities.async readText):
(WI.FileUtilities.async readJSON):
(WI.FileUtilities.async readData): Added.
(WI.FileUtilities.async _read): Added.
Create utility functions for importing non-text content as data.
Drive-by: fix a bug in the `import*` functions where the `callback` would be bound on the
first call, meaning that since the `<input>` was cached for all calls, we'd only
ever use the first `callback` in subsequent calls.
* UserInterface/Views/DropZoneView.js:
(WI.DropZoneView):
(WI.DropZoneView.prototype.set text): Added.
Support the text content of the drop zone changing after it's initialized.
* UserInterface/Views/FontResourceContentView.js:
(WI.FontResourceContentView):
(WI.FontResourceContentView.prototype.contentAvailable):
(WI.FontResourceContentView.prototype.dropZoneHandleDragEnter): Added.
(WI.FontResourceContentView.prototype.dropZoneHandleDrop):
(WI.FontResourceContentView.prototype._handleLocalResourceContentDidChange): Added.
* UserInterface/Views/ImageResourceContentView.js:
(WI.ImageResourceContentView):
(WI.ImageResourceContentView.prototype.contentAvailable):
(WI.ImageResourceContentView.prototype.dropZoneHandleDragEnter): Added.
(WI.ImageResourceContentView.prototype.dropZoneHandleDrop):
(WI.ImageResourceContentView.prototype._handleLocalResourceContentDidChange): Added.
Support drag/drop on non-override image/font content views, which will create/update the
local resource override for that resource.
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView):
(WI.ResourceContentView.prototype.get navigationItems):
(WI.ResourceContentView.prototype._handleImportLocalResourceOverride): Added.
When viewing a local resource override, add an "Import" navigation item for non-drag/drop
updating of the contents of the local resource override. This is also exposed for text-based
local resource overrides, since drag/drop inserts the contents of the file (if it's text),
which attempts to determine whether the dropped file is text or data based on the MIME type.
* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype._handleImportButtonNavigationItemClicked):
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._handleImportButtonNavigationItemClicked):
* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel.prototype._handleImportButtonNavigationItemClicked):
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._importHAR):
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView.prototype._importButtonNavigationItemClicked):
Explicitly allow multiple files to be imported at the same time.
* UserInterface/Base/BlobUtilities.js:
(WI.BlobUtilities.blobForContent):
Drive-by: remove extra `base64Encoded` argument when calling `decodeBase64ToBlob`, which
caused SVG-based image local resource overrides to show a broken image when
closing and reopening Web Inspector.
* Localizations/en.lproj/localizedStrings.js:
2019-10-14 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r250991): Sources: local resource overrides should be enabled when not in tests
https://bugs.webkit.org/show_bug.cgi?id=202944
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
2019-10-11 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: support pattern blackboxing
https://bugs.webkit.org/show_bug.cgi?id=198855
Reviewed by Timothy Hatcher.
Allow scripts to be blackboxed based on URL patterns (in addition to individual URLs) which
can be extremely useful when trying to step through unminified library/framework code.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.prototype.blackboxTypeForSourceCode): Added.
(WI.DebuggerManager.prototype.get blackboxPatterns): Added.
(WI.DebuggerManager.prototype.setShouldBlackboxScript):
(WI.DebuggerManager.prototype.setShouldBlackboxPattern): Added.
(WI.DebuggerManager.prototype.isScriptBlackboxed): Deleted.
Provide a separate path for setting URL pattern blackboxes, rather than an exact/given URL.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView):
(WI.SettingsTabContentView.prototype.selectBlackboxPattern): Added.
(WI.SettingsTabContentView.prototype.initialLayout):
(WI.SettingsTabContentView.prototype._createSourcesSettingsView):
* UserInterface/Views/BlackboxSettingsView.js: Added.
(WI.BlackboxSettingsView):
(WI.BlackboxSettingsView.prototype.selectBlackboxPattern):
(WI.BlackboxSettingsView.prototype.initialLayout):
(WI.BlackboxSettingsView.prototype._addRow):
* UserInterface/Views/BlackboxSettingsView.css: Added.
(.settings-view.blackbox > :matches(p, table)):
(.settings-view.blackbox > p):
(.settings-view.blackbox > * + p):
(.settings-view.blackbox > p:last-child):
(.settings-view.blackbox > p > .toggle-script-blackbox):
(.settings-view.blackbox > table):
(.settings-view.blackbox > table > thead th):
(.settings-view.blackbox > table > tbody td):
(.settings-view.blackbox > table > tbody td:not(.remove-blackbox)):
(.settings-view.blackbox > table :matches(th, td).url):
(.settings-view.blackbox > table > tbody td.url > .CodeMirror):
(.settings-view.blackbox > table :matches(th, td):matches(.case-sensitive, .remove-blackbox)):
(.settings-view.blackbox > table > tbody > tr:not(:hover) > td.remove-blackbox):
(.settings-view.blackbox > table > tbody td.remove-blackbox > .remove-blackbox-button):
Add a "Blackbox" pane that contains an editable table of pattern blackboxes, each having its
own row (code mirror for the URL regular expression and a checkbox for case sensitivity).
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype.updateStatus):
(WI.SourceCodeTreeElement.prototype._updateSourceCode):
(WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState):
(WI.SourceCodeTreeElement.prototype._handleToggleBlackboxedImageElementClicked):
* UserInterface/Views/SourceCodeTreeElement.css:
(.tree-outline .item .status > .toggle-script-blackbox, .tree-outline:focus .item.selected .status > .toggle-script-blackbox.pattern-blackboxed): Added.
(.tree-outline .item .status > .toggle-script-blackbox.pattern-blackboxed): Added.
(.tree-outline .item .status > .toggle-script-blackbox): Added.
(.tree-outline .item .status > .toggle-script-blackbox:not(.pattern-blackboxed)): Added.
(.tree-outline .item .status > .toggle-script-blackbox:not(.url-blackboxed, .pattern-blackboxed)): Added.
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackbox, .tree-outline .item:not(:hover) .status > .toggle-script-blackbox:not(.pattern-blackboxed, .url-blackboxed)): Added.
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackbox): Added.
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackbox.pattern-blackboxed): Added.
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackbox:not(.pattern-blackboxed)): Added.
(.tree-outline .item .status > .toggle-script-blackboxed): Deleted.
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackboxed, .tree-outline .item:not(:hover) .status > .toggle-script-blackboxed:not(.blackboxed)): Deleted.
(.tree-outline:focus .item.selected .status > .toggle-script-blackboxed): Deleted.
(.tree-outline .item .status > .toggle-script-blackboxed.blackboxed): Deleted.
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackboxed): Deleted.
* UserInterface/Views/ShaderProgramTreeElement.css:
(.tree-outline .item.shader-program .status > img):
(.tree-outline .item.shader-program:not(:hover, .disabled) .status > img): Added.
(.tree-outline .item.shader-program:not(.disabled) .status > img): Added.
(@media (prefers-color-scheme: dark) .tree-outline .item.shader-program .status > img):
(.tree-outline .item.shader-program:not(:hover, .selected, .disabled) .status > img): Deleted.
(.tree-outline:focus .item.shader-program.selected .status > img): Deleted.
(.tree-outline .item.shader-program.disabled .status > img): Deleted.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* UserInterface/Images/Hide.svg:
Use a slightly different style for the blackbox icon if the source code's URL matches a
blackbox pattern. Clicking on the blackbox icon in this state will show the Settings Tab.
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI._handleSettingsKeyboardShortcut): Added.
(WI.showSettingsTab): Added.
(WI._showSettingsTab): Deleted.
* Localizations/en.lproj/localizedStrings.js:
2019-10-11 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Computed: show shorthand properties in addition to longhand ones
https://bugs.webkit.org/show_bug.cgi?id=200554
Reviewed by Matt Baker.
Replace the "Show All [ ]" checkbox header option in the "Properties" section with a filter
icon that controls both "Show All" and "Prefer Shorthands", the latter of which will cause
any longhand properties to be hidden and their respective shorthands to be shown.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty):
(WI.CSSProperty.prototype.update):
(WI.CSSProperty.prototype.get isVariable): Added.
(WI.CSSProperty.prototype.get isShorthand): Added.
(WI.CSSProperty.prototype.get shorthandPropertyNames): Added.
(WI.CSSProperty.prototype.get variable): Deleted.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel):
(WI.ComputedStyleDetailsPanel.prototype.applyFilter):
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
(WI.ComputedStyleDetailsPanel.prototype._computedStyleShowAllCheckboxValueChanged): Deleted.
* UserInterface/Views/ComputedStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style > .content > .computed > .details-section): Added.
(.sidebar > .panel.details.css-style > .content > .computed > .details-section > .content): Added.
(.sidebar > .panel.details.css-style > .content > .computed .spreadsheet-style-declaration-editor): Added.
(.sidebar > .panel.details.css-style > .content > .computed .property): Added.
(.sidebar > .panel.details.css-style > .content > .computed .property .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .property:not(:hover) .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables)): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property .go-to-arrow): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property:not(:hover) .go-to-arrow): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) > .content): Deleted.
* UserInterface/Views/ComputedStyleSection.js:
(WI.ComputedStyleSection):
(WI.ComputedStyleSection.prototype.set showsShorthandsInsteadOfLonghands): Added.
(WI.ComputedStyleSection.prototype.get propertiesToRender):
(WI.ComputedStyleSection.prototype.set propertyVisibilityMode): Deleted.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.update):
(WI.SpreadsheetStyleProperty.prototype._replaceSpecialTokens):
* Localizations/en.lproj/localizedStrings.js:
2019-10-10 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Local Resource Overrides: UI for overriding image and font resource content
https://bugs.webkit.org/show_bug.cgi?id=202016
<rdar://problem/55541475>
Reviewed by Devin Rousso.
Extend SourceCodeRevision to be a (content, base64Encoded, mimeType) tuple and
make clients update the revision content more explicitly (`updateRevisionContent`).
This also includes `blobContent` as a more explicit way to get the content as
a Blob, which may not always be desired.
Switch LocalResource use the originalRevision / currentRevision instead of
keeping its own localContent / localContentIsBase64Encoded properties.
Introduce a `DropZoneView` to simplify handling of presenting a drop zone
over a specific element. And use it for the ImageResourceContentView for local
resource overrides to accept new content.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New strings and resources.
* .eslintrc:
* UserInterface/Base/BlobUtilities.js: Added.
(WI.BlobUtilities.blobForContent):
(WI.BlobUtilities.decodeBase64ToBlob):
(WI.BlobUtilities.textToBlob):
(WI.BlobUtilities.blobAsText):
(WI.BlobUtilities):
* UserInterface/Base/FileUtilities.js:
(WI.FileUtilities.async.readDataURL):
(WI.FileUtilities):
* UserInterface/Base/MIMETypeUtilities.js:
(WI.fileExtensionForFilename):
(WI.fileExtensionForURL):
* UserInterface/Base/Utilities.js:
Move around or introduce some minor utilities.
* UserInterface/Models/SourceCodeRevision.js:
(WI.SourceCodeRevision):
(WI.SourceCodeRevision.prototype.get sourceCode):
(WI.SourceCodeRevision.prototype.get content):
(WI.SourceCodeRevision.prototype.get base64Encoded):
(WI.SourceCodeRevision.prototype.get mimeType):
(WI.SourceCodeRevision.prototype.get blobContent):
(WI.SourceCodeRevision.prototype.updateRevisionContent):
(WI.SourceCodeRevision.prototype.copy):
(WI.SourceCodeRevision.prototype.set content): Deleted.
Data is now a (content, base64Encoded, mimeType) tuple.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.responseIntercepted):
(WI.NetworkManager.prototype._handleResourceContentDidChange):
(WI.NetworkManager.prototype._persistLocalResourceOverrideSoonAfterContentChange): Deleted.
This is now a unified resource content change path without anything special for
local resource overrides.
* UserInterface/Models/LocalResource.js:
(WI.LocalResource.prototype.toJSON):
(WI.LocalResource.prototype.requestContentFromBackend):
(WI.LocalResource.prototype.handleCurrentRevisionContentChange):
(WI.LocalResource):
(WI.LocalResource.prototype.get localContent): Deleted.
(WI.LocalResource.prototype.get localContentIsBase64Encoded): Deleted.
(WI.LocalResource.prototype.hasContent): Deleted.
(WI.LocalResource.prototype.setContent): Deleted.
(WI.LocalResource.prototype.updateOverrideContent): Deleted.
Use originalRevision / currentRevision as appropriate.
* UserInterface/Views/DropZoneView.css: Added.
(.drop-zone):
(.drop-zone.visible):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/DropZoneView.js: Added.
(WI.DropZoneView):
(WI.DropZoneView.prototype.get delegate):
(WI.DropZoneView.prototype.get targetElement):
(WI.DropZoneView.prototype.set targetElement):
(WI.DropZoneView.prototype.initialLayout):
(WI.DropZoneView.prototype._startActiveDrag):
(WI.DropZoneView.prototype._stopActiveDrag):
(WI.DropZoneView.prototype._handleDragEnter):
(WI.DropZoneView.prototype._handleDragLeave):
(WI.DropZoneView.prototype._handleDragOver):
(WI.DropZoneView.prototype._handleDrop):
Simplified handling of a drop zone.
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView.prototype.removeLoadingIndicator):
More safely remove children and subviews.
(WI.ResourceContentView):
(WI.ResourceContentView.prototype.get resource):
(WI.ResourceContentView.prototype.get navigationItems):
(WI.ResourceContentView.prototype.localResourceOverrideInitialContent):
(WI.ResourceContentView.prototype.closed):
(WI.ResourceContentView.prototype.removeLoadingIndicator):
(WI.ResourceContentView.prototype._contentAvailable):
(WI.ResourceContentView.prototype._issueWasAdded):
(WI.ResourceContentView.prototype.async._handleCreateLocalResourceOverride):
(WI.ResourceContentView.prototype._handleRemoveLocalResourceOverride):
(WI.ResourceContentView.prototype._handleLocalResourceOverrideChanged):
(WI.ResourceContentView.prototype._mouseWasClicked):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView):
(WI.TextResourceContentView.prototype.get navigationItems):
(WI.TextResourceContentView.prototype.localResourceOverrideInitialContent):
(WI.TextResourceContentView.prototype._contentWillPopulate):
(WI.TextResourceContentView.prototype._contentDidPopulate):
(WI.TextResourceContentView.prototype._textEditorContentDidChange):
(WI.TextResourceContentView.prototype._shouldBeEditable):
(WI.TextResourceContentView.prototype.async._handleCreateLocalResourceOverride): Deleted.
(WI.TextResourceContentView.prototype._handleRemoveLocalResourceOverride): Deleted.
(WI.TextResourceContentView.prototype._handleLocalResourceOverrideChanged): Deleted.
Extract generalized local resource override properties into the ResourceContentView base class.
* UserInterface/Views/FontResourceContentView.css:
(.content-view.resource.font):
(.content-view.resource.font > .drop-zone):
(.content-view.resource.font > .preview-container):
(.content-view.resource.font .preview):
* UserInterface/Views/FontResourceContentView.js:
(WI.FontResourceContentView):
(WI.FontResourceContentView.prototype.contentAvailable):
(WI.FontResourceContentView.prototype.shown):
(WI.FontResourceContentView.prototype.hidden):
(WI.FontResourceContentView.prototype.closed):
(WI.FontResourceContentView.prototype.layout):
(WI.FontResourceContentView.prototype._updatePreviewElement.createMetricElement):
(WI.FontResourceContentView.prototype._updatePreviewElement):
(WI.FontResourceContentView.prototype.dropZoneShouldAppearForDragEvent):
(WI.FontResourceContentView.prototype.dropZoneHandleDrop):
Create a drop zone that will update the font local resource override content.
* UserInterface/Views/ImageResourceContentView.css:
(.content-view.resource.image):
(.content-view.resource.image > .drop-zone):
(.content-view.resource.image > .img-container):
(.content-view.resource.image img):
* UserInterface/Views/ImageResourceContentView.js:
(WI.ImageResourceContentView):
(WI.ImageResourceContentView.prototype.get navigationItems):
(WI.ImageResourceContentView.prototype.contentAvailable):
(WI.ImageResourceContentView.prototype.closed):
(WI.ImageResourceContentView.prototype.dropZoneShouldAppearForDragEvent):
(WI.ImageResourceContentView.prototype.dropZoneHandleDrop):
Create a drop zone that will update the image local resource override content.
* UserInterface/Models/Script.js:
(WI.Script.prototype.get mimeType):
Seems like this should have a default value given there may not be a resource.
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover.prototype.show):
Better handling here, since the utilities expects a number not a string.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.createObjectURL):
* UserInterface/Views/LocalResourceOverrideTreeElement.js:
(WI.LocalResourceOverrideTreeElement.prototype.willDismissPopover):
Use currentRevision more appropriately.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype._processContent):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._textEditorContentDidChange):
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges):
(WI.CSSManager.prototype._resourceContentDidChange):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
Update revision content more explicitly.
2019-10-10 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: enable tab by default
https://bugs.webkit.org/show_bug.cgi?id=202341
Reviewed by Joseph Pecoraro.
The experimental Sources Tab has progressed enough that it can be enabled by default. There
are some new features that are only available in the Sources Tab that are also ready to be
used (e.g. local resource overrides).
* UserInterface/Main.html:
* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Base/Setting.js:
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.showResources):
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
(WI.NetworkManager.supportsLocalResourceOverrides):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForURL):
* UserInterface/Views/DefaultDashboardView.js:
(WI.DefaultDashboardView.prototype._resourcesItemWasClicked):
* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement.prototype.populateContextMenu):
* UserInterface/Views/SearchResultTreeElement.js:
(WI.SearchResultTreeElement.prototype.populateContextMenu):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu):
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/SourcesTabContentView.js:
(WI.SourcesTabContentView.isTabAllowed): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.css: Removed.
* UserInterface/Views/DebuggerSidebarPanel.js: Removed.
* UserInterface/Views/DebuggerTabContentView.js: Removed.
* UserInterface/Views/ResourceSidebarPanel.css: Removed.
* UserInterface/Views/ResourceSidebarPanel.js: Removed.
* UserInterface/Views/ResourcesTabContentView.js: Removed.
Remove the experimental setting, as well as code for the Resources Tab and the Debugger Tab.
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
2019-10-09 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r250948): Web Inspector: Styles: CSS selector becomes gray after stopping editing without modifying it
https://bugs.webkit.org/show_bug.cgi?id=202781
Reviewed by Matt Baker.
When not editing, CSS selectors that match the selected node are highlighted (black in the light mode,
white in the dark mode). When editing starts, span elements that provide highlighting get removed.
When editing stops, active selectors should get highlighted.
r250948 stopped calling `_renderSelector` when selector wasn't modified.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidCommit):
* UserInterface/Views/SpreadsheetSelectorField.js:
(WI.SpreadsheetSelectorField.prototype._handleBlur):
2019-10-09 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Modifying CSS selector by pressing Enter or Tab causes 2 CSS.setRuleSelector backend calls
https://bugs.webkit.org/show_bug.cgi?id=202769
<rdar://problem/56132166>
Reviewed by Matt Baker.
Previously, spreadsheetSelectorFieldDidChange would get called twice:
1. On Enter or Tab key press.
2. On blur event.
With this patch, it only gets called on blur event.
* UserInterface/Models/CSSRule.js:
(WI.CSSRule.prototype.set selectorText):
Remove dead code. Calling `_selectorResolved(true)` would cause an uncaught exception.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidChange): Removed.
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidCommit): Added.
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldWillNavigate): Added.
Split spreadsheetSelectorFieldDidChange into spreadsheetSelectorFieldDidCommit and spreadsheetSelectorFieldWillNavigate.
* UserInterface/Views/SpreadsheetSelectorField.js:
(WI.SpreadsheetSelectorField):
(WI.SpreadsheetSelectorField.prototype.startEditing):
(WI.SpreadsheetSelectorField.prototype.stopEditing):
(WI.SpreadsheetSelectorField.prototype._handleBlur):
(WI.SpreadsheetSelectorField.prototype._handleKeyDown):
Add `_valueBeforeEditing` to check if the value was modified before the blur event.
Similar logic exists in SpreadsheetTextField.
2019-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: modifications to shader modules can be shared between vertex/fragment shaders
https://bugs.webkit.org/show_bug.cgi?id=202031
Reviewed by Dean Jackson.
If the vertex and fragment shaders share the same source module for a WebGPU shader pipeline,
only display a single editable content view for that shader pipeline in the Canvas Tab.
* UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram):
(WI.ShaderProgram.prototype.get sharesVertexFragmentShader): Added.
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.programCreated):
* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.programCreated):
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
(WI.ShaderProgramContentView.prototype.shown):
(WI.ShaderProgramContentView.prototype.hidden):
(WI.ShaderProgramContentView.prototype._refreshContent):
* UserInterface/Views/ShaderProgramContentView.css:
(.content-view.shader-program > .shader.compute, .content-view.shader-program > .shader.vertex.shares-vertex-fragment-shader): Added.
(body[dir=ltr] .content-view.shader-program > .shader.vertex:not(.shares-vertex-fragment-shader), body[dir=rtl] .content-view.shader-program > .shader.fragment): Added.
(body[dir=ltr] .content-view.shader-program > .shader.fragment, body[dir=rtl] .content-view.shader-program > .shader.vertex:not(.shares-vertex-fragment-shader)): Added.
(.content-view.shader-program > .shader.compute): Deleted.
(body[dir=ltr] .content-view.shader-program > .shader.vertex, body[dir=rtl] .content-view.shader-program > .shader.fragment): Deleted.
(body[dir=ltr] .content-view.shader-program > .shader.fragment, body[dir=rtl] .content-view.shader-program > .shader.vertex): Deleted.
* UserInterface/Views/CodeMirrorAdditions.js:
Replace the vertex/fragment specific MIME types with a more general "render" MIME type.
* Localizations/en.lproj/localizedStrings.js:
2019-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: make it more obvious that the cards in the overview are clickable
https://bugs.webkit.org/show_bug.cgi?id=202680
Reviewed by Matt Baker.
Add a slight darkening (or lightening when in dark mode) of the background behind the
content preview in the overview.
* UserInterface/Views/CanvasOverviewContentView.css:
(.content-view.canvas-overview .content-view.canvas):
(.content-view.canvas-overview .content-view.canvas, .content-view.canvas-overview .content-view.canvas > .preview > img): Added.
(.content-view.canvas-overview .content-view.canvas.recording-active > .progress-view, .content-view.canvas-overview .content-view.canvas > .preview):
(.content-view.canvas-overview .content-view.canvas.recording-active > .progress-view:hover, .content-view.canvas-overview .content-view.canvas > .preview:hover): Added.
(@media (prefers-color-scheme: dark) .content-view.canvas-overview .content-view.canvas, .content-view.canvas-overview .content-view.canvas > .preview > img): Added.
(@media (prefers-color-scheme: dark) .content-view.canvas-overview .content-view.canvas.recording-active > .progress-view:hover, .content-view.canvas-overview .content-view.canvas > .preview:hover): Added.
2019-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: don't show an empty preview for WebGPU devices
https://bugs.webkit.org/show_bug.cgi?id=202679
Reviewed by Matt Baker.
`HTMLCanvasElement.prototype.toDataURL` hasn't been hooked up for `GPUCanvasContext` yet, so
calling `Canvas.requestContent` with a `WebGPUDevice` won't give us any good results.
As such, the Web Inspector frontend should show something slightly more actionable, such as
a more generic non-error "No Preview Available" message.
* UserInterface/Models/Canvas.js:
(WI.Canvas.supportsRequestContentForContextType): Added.
(WI.Canvas.prototype.requestContent):
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype._showError):
2019-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: unable to click on overview path component when jumping directly to a shader
https://bugs.webkit.org/show_bug.cgi?id=202682
Reviewed by Matt Baker.
* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView):
The `WI.TreeOutline` used for the hierarchical path components is actually held by the
Canvas Tab, not the Canvas navigation sidebar panel. As a result, if the hierarchical path
is changed by anything other than the hierarchical path itself (e.g. a selection in the
navigation sidebar, or clicking on the [gl] shader or [o_o] recording buttons in the
overview preview tile), the selection state of the `WI.TreeOutline` can get out of sync. In
this case, the `WI.TreeOutline` still thinks that "Overview" is selected because the change
in content view was triggered by something unrelated to the `WI.TreeOutline` (see above for
specific examples). The simple solution is to just allow repeat selection, as this is only
an issue here because the canvas navigation sidebar isn't always visible, as well as to
allow the "Overview" to be listed as the root path item.
* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel.prototype.updateRepresentedObjects):
If a `WI.Canvas` is one of the current represented objects, attempt to select it, even if
it matches the currently shown `WI.Canvas`. This covers the situation where the `WI.Canvas`
is selected via its hierarchical path component, ensuring that the selected item in the
navigation sidebar always matches the hierarchical path components.
2019-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: the navigation sidebar icon isn't inverted in dark mode
https://bugs.webkit.org/show_bug.cgi?id=202681
Reviewed by Matt Baker.
* UserInterface/Views/CanvasSidebarPanel.css:
(@media (prefers-color-scheme: dark) .sidebar > .panel.navigation.canvas > .content > .tree-outline .item.canvas .icon): Added.
* UserInterface/Views/CanvasTabContentView.css:
(@media (prefers-color-scheme: dark) .content-view.tab.canvas .navigation-bar > .item .canvas-overview .icon):
Drive-by: slightly darken the Canvas Overview hierarchical path component icon so it better
matches the colors of the nearby canvas icons.
2019-10-07 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: enable the image transparency grid by default and create a checkbox for it
https://bugs.webkit.org/show_bug.cgi?id=202678
Reviewed by Matt Baker.
* UserInterface/Base/Setting.js:
Enable the "Show transparency grid" setting by default.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createSourcesSettingsView):
Add a checkbox for "Show transparency grid" in the "Sources" pane.
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView):
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView):
* UserInterface/Views/ImageResourceContentView.js:
(WI.ImageResourceContentView):
* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView):
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView):
* Localizations/en.lproj/localizedStrings.js:
Unify the tooltip string for all of the "Show transparency grid" navigation items.
2019-10-07 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: don't allow blackboxing of scripts that aren't finished loading or failed to load
https://bugs.webkit.org/show_bug.cgi?id=202376
Reviewed by Matt Baker.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.get supportsScriptBlackboxing):
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype.updateStatus):
2019-10-02 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Styles: for rules that don't match selected node, property values always show as invalid
https://bugs.webkit.org/show_bug.cgi?id=201571
Reviewed by Matt Baker.
The gist of the bug:
- WI.CSSProperty is instantiated with `valid` false.
- CSSAgent.getMatchedStylesForNode never updates WI.CSSProperty instances because
the edited style does not in fact match the selected DOM node. A valid CSS property
is shown as invalid.
To resolve this, WI.CSSProperty instances are now updated after editing
in the callback of `CSSAgent.setStyleText`.
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype.changeStyleText):
(WI.DOMNodeStyles.prototype._parseStyleDeclarationPayload):
Don't store `style` in `this._stylesMap` of WI.DOMNodeStyles when the style doesn't match the selected node.
2019-10-02 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r250149): changing CSS via the Styles details sidebar panel doesn't update the associated resource
https://bugs.webkit.org/show_bug.cgi?id=202446
Reviewed by Joseph Pecoraro.
When updating the text of a `WI.CSSProperty` (or the selector of a `WI.CSSRule`) is updated,
Web Inspector will update the backend style sheet, which will notify the `WI.CSSManager` of
the change, without ever going through the associated `WI.SourceCode`. `WI.CSSManager` then
updates the content of the `WI.SourceCode` to reflect these changes, but at that point the
`WI.SourceCode` hadn't yet "moved" it's `currentRevision` forward of it's `originalRevision`
which means it would get overridden the first time the `WI.SourceCode` updates itself.
Modify `WI.SourceCode` such that every path to get the `currentRevision` ensures that it is
"moved" forward before the `WI.SourceCodeRevision` value is returned.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype.get currentRevision):
(WI.SourceCode.prototype.get content):
(WI.SourceCode.prototype.revisionContentDidChange):
(WI.SourceCode.prototype._initializeCurrentRevisionIfNeeded): Added.
(WI.SourceCode.prototype._processContent):
2019-10-01 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: clicking on a breakpoint changes the path components to not match the script's path
https://bugs.webkit.org/show_bug.cgi?id=196450
<rdar://problem/49488100>
Reviewed by Matt Baker.
When selecting any tree element that isn't in the resources tree outline, attempt to find
the corresponding tree element in the resources tree outline and silently select that as
well so that the hierarchical path component shows the right breadcrumb trail.
If the tree element is for a `WI.Script` which has a corresponding `WI.Resource`, use the
`WI.Resource` instead.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
2019-09-30 Devin Rousso <drousso@apple.com>
Web Inspector: JS Formatter: unexpected newlines added inside template string expression
https://bugs.webkit.org/show_bug.cgi?id=202374
Reviewed by Joseph Pecoraro.
Wrap every "add newline" with a check to see if the current node is inside a template
literal node. If so (and we aren't forcibly adding a newline), prevent the newline from
being added.
* UserInterface/Workers/Formatter/JSFormatter.js:
(JSFormatter.prototype._appendNewline): Added.
(JSFormatter.prototype._insertNewlinesBeforeToken):
(JSFormatter.prototype._insertComment):
(JSFormatter.prototype._insertSameLineTrailingComments):
(JSFormatter.prototype._insertCommentsAndNewlines):
(JSFormatter.prototype._before):
(JSFormatter.prototype._after):
(JSFormatter.prototype._handleTokenAtNode):
(JSFormatter.prototype._exitNode):
(JSFormatter.prototype._afterProgram):
2019-09-30 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: shader type header is white in dark mode
https://bugs.webkit.org/show_bug.cgi?id=202253
Reviewed by Matt Baker.
* UserInterface/Views/ShaderProgramContentView.css:
(.content-view.shader-program > .shader > header > .shader-type):
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header > .shader-type): Added.
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header): Deleted.
(.content-view.shader-program > .shader > header > *): Deleted.
2019-09-26 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Include LocalResourceOverrides in the Open Resource dialog
https://bugs.webkit.org/show_bug.cgi?id=202023
Reviewed by Devin Rousso.
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
Also walk the extraScriptCollection. Some Worker resource loads never
fully become resources.
(WI.OpenResourceDialog.prototype.didPresentDialog):
(WI.OpenResourceDialog.prototype._addLocalResourceOverrides):
Include local resource override resources.
(WI.OpenResourceDialog.prototype._populateResourceTreeOutline):
* Localizations/en.lproj/localizedStrings.js:
Include a subtitle for local resource overrides.
* UserInterface/Views/OpenResourceDialog.css:
(.open-resource-dialog .tree-outline.large .item .titles .subtitle):
Improved subtitle styling.
2019-09-25 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: REGRESSION: Elements detail sidebar sometimes starts collapsed
https://bugs.webkit.org/show_bug.cgi?id=202057
<rdar://problem/55572345>
Reviewed by Devin Rousso.
* UserInterface/Views/ElementsTabContentView.js:
(WI.ElementsTabContentView.prototype.get detailsSidebarExpandedByDefault):
Default the Elements tab detail sidebar to be shown, not collapsed.
* UserInterface/Views/TabContentView.js:
(WI.TabContentView):
(WI.TabContentView.prototype.get detailsSidebarExpandedByDefault):
Allow classes to specify whether or not their detail sidebar should
be expanded by default.
2019-09-25 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'WI.showDebugUISetting.addEventListener')
https://bugs.webkit.org/show_bug.cgi?id=202220
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype.initialLayout):
2019-09-23 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: WebGPU compute shaders aren't syntax highlighted
https://bugs.webkit.org/show_bug.cgi?id=202030
Reviewed by Joseph Pecoraro.
* UserInterface/Views/CodeMirrorAdditions.js:
`CodeMirror.defineMIME` expects a "spec" object, which can't just be another MIME type.
Instead, get the "spec" of the defined "x-shader/x-vertex" and "x-shader/x-fragment" modes
and use that when defining MIMEs for the WebGPU shader pipeline modes.
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
Get the `contextType` off of the shader's canvas, which is where it actually lives.
2019-09-23 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: show WebGPU shader pipelines
https://bugs.webkit.org/show_bug.cgi?id=201675
<rdar://problem/55543450>
Reviewed by Joseph Pecoraro.
Show WebGPU shader pipelines ("programs") underneath each corresponding WebGPU device.
Allow editing of attached shader modules for each WebGPU shader pipeline, but don't allow
highlighting/disabling, as WebGPU pipelines don't have those capabilities/concepts yet.
* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.programCreated):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.programCreated):
* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.nextShaderProgramDisplayNumberForProgramType): Added.
(WI.Canvas.prototype.nextShaderProgramDisplayNumber): Deleted.
* UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram):
(WI.ShaderProgram.contextTypeSupportsProgramType): Added.
(WI.ShaderProgram.programTypeSupportsShaderType): Added.
(WI.ShaderProgram.prototype.get programType): Added.
(WI.ShaderProgram.prototype.get displayName):
(WI.ShaderProgram.prototype.set disabled):
(WI.ShaderProgram.prototype.requestShaderSource):
(WI.ShaderProgram.prototype.updateShader):
(WI.ShaderProgram.prototype.showHighlight):
(WI.ShaderProgram.prototype.hideHighlight):
(WI.ShaderProgram.prototype.requestVertexShaderSource): Deleted.
(WI.ShaderProgram.prototype.requestFragmentShaderSource): Deleted.
(WI.ShaderProgram.prototype.updateVertexShader): Deleted.
(WI.ShaderProgram.prototype.updateFragmentShader): Deleted.
(WI.ShaderProgram.prototype._requestShaderSource): Deleted.
(WI.ShaderProgram.prototype._updateShader): Deleted.
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
(WI.ShaderProgramContentView.prototype.get navigationItems): Added.
(WI.ShaderProgramContentView.prototype.shown):
(WI.ShaderProgramContentView.prototype.hidden):
(WI.ShaderProgramContentView.prototype.get saveData):
(WI.ShaderProgramContentView.prototype._refreshContent):
(WI.ShaderProgramContentView.prototype._updateShader):
(WI.ShaderProgramContentView.prototype._contentDidChange):
* UserInterface/Views/ShaderProgramContentView.css:
(.content-view.shader-program > .shader): Added.
(.content-view.shader-program > .shader.compute): Added.
(body[dir=ltr] .content-view.shader-program > .shader.vertex,): Added.
(body[dir=ltr] .content-view.shader-program > .shader.fragment,): Added.
(.content-view.shader-program > .shader + .shader): Added.
(.content-view.shader-program > .shader > header > *): Added.
(.content-view.shader-program > .shader > header > .shader-type): Added.
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header): Added.
(.content-view.shader-program > .text-editor.shader): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.vertex,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.fragment,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(body[dir=rtl] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(.content-view.shader-program > .text-editor.shader > .type-title): Deleted.
(.content-view.shader-program > .text-editor.shader > .CodeMirror): Deleted.
* UserInterface/Views/CodeMirrorAdditions.js:
* UserInterface/Views/ShaderProgramTreeElement.js:
(WI.ShaderProgramTreeElement):
(WI.ShaderProgramTreeElement.prototype.onattach):
(WI.ShaderProgramTreeElement.prototype.ondetach):
(WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
(WI.ShaderProgramTreeElement.prototype.populateContextMenu):
* Localizations/en.lproj/localizedStrings.js:
2019-09-23 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Improve the Uncaught Exception View file a bug link
https://bugs.webkit.org/show_bug.cgi?id=201717
Reviewed by Devin Rousso.
* UserInterface/Debug/UncaughtExceptionReporter.js:
Allow the link to be clicked. Use openInNewTab on click to also
bring the new tab to the foreground. Also update the content.
2019-09-20 Devin Rousso <drousso@apple.com>
Web Inspector: HTML Formatter - better indentation/newline handling for self closing tags
https://bugs.webkit.org/show_bug.cgi?id=202036
Reviewed by Joseph Pecoraro.
* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.prototype._before):
2019-09-20 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove BranchManager in favor of just using currentRevision
https://bugs.webkit.org/show_bug.cgi?id=202000
Reviewed by Devin Rousso.
Remove BranchManager. The Branch concept never got fleshed out, and would
likely be too complex for the average case. Local Overrides are simpler.
In the interest of expanding Local Overrides to more content lets simply
by removing Branches.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Controllers/BranchManager.js: Removed.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges):
(WI.CSSManager.prototype._resourceContentDidChange):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
* UserInterface/Main.html:
* UserInterface/Models/Branch.js: Removed.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype._processContent):
(WI.SourceCode):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._textEditorContentDidChange):
2019-09-20 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r250114.
Broke ~16 webgpu/ tests on Mojave wk2
Reverted changeset:
"Web Inspector: Canvas: show WebGPU shader pipelines"
https://bugs.webkit.org/show_bug.cgi?id=201675
https://trac.webkit.org/changeset/250114
2019-09-19 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: searching in overrides doesn't work
https://bugs.webkit.org/show_bug.cgi?id=202020
Reviewed by Devin Rousso.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.customPerformSearch):
Do not go to agents for a local resource. Search locally in the TextEditor.
2019-09-19 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: show WebGPU shader pipelines
https://bugs.webkit.org/show_bug.cgi?id=201675
Reviewed by Joseph Pecoraro.
Show WebGPU shader pipelines ("programs") underneath each corresponding WebGPU device.
Allow editing of attached shader modules for each WebGPU shader pipeline, but don't allow
highlighting/disabling, as WebGPU pipelines don't have those capabilities/concepts yet.
* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.programCreated):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.programCreated):
* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.nextShaderProgramDisplayNumberForProgramType): Added.
(WI.Canvas.prototype.nextShaderProgramDisplayNumber): Deleted.
* UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram):
(WI.ShaderProgram.contextTypeSupportsProgramType): Added.
(WI.ShaderProgram.programTypeSupportsShaderType): Added.
(WI.ShaderProgram.prototype.get programType): Added.
(WI.ShaderProgram.prototype.get displayName):
(WI.ShaderProgram.prototype.set disabled):
(WI.ShaderProgram.prototype.requestShaderSource):
(WI.ShaderProgram.prototype.updateShader):
(WI.ShaderProgram.prototype.showHighlight):
(WI.ShaderProgram.prototype.hideHighlight):
(WI.ShaderProgram.prototype.requestVertexShaderSource): Deleted.
(WI.ShaderProgram.prototype.requestFragmentShaderSource): Deleted.
(WI.ShaderProgram.prototype.updateVertexShader): Deleted.
(WI.ShaderProgram.prototype.updateFragmentShader): Deleted.
(WI.ShaderProgram.prototype._requestShaderSource): Deleted.
(WI.ShaderProgram.prototype._updateShader): Deleted.
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
(WI.ShaderProgramContentView.prototype.get navigationItems): Added.
(WI.ShaderProgramContentView.prototype.shown):
(WI.ShaderProgramContentView.prototype.hidden):
(WI.ShaderProgramContentView.prototype.get saveData):
(WI.ShaderProgramContentView.prototype._refreshContent):
(WI.ShaderProgramContentView.prototype._updateShader):
(WI.ShaderProgramContentView.prototype._contentDidChange):
* UserInterface/Views/ShaderProgramContentView.css:
(.content-view.shader-program > .shader): Added.
(.content-view.shader-program > .shader.compute): Added.
(body[dir=ltr] .content-view.shader-program > .shader.vertex,): Added.
(body[dir=ltr] .content-view.shader-program > .shader.fragment,): Added.
(.content-view.shader-program > .shader + .shader): Added.
(.content-view.shader-program > .shader > header > *): Added.
(.content-view.shader-program > .shader > header > .shader-type): Added.
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header): Added.
(.content-view.shader-program > .text-editor.shader): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.vertex,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.fragment,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(body[dir=rtl] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(.content-view.shader-program > .text-editor.shader > .type-title): Deleted.
(.content-view.shader-program > .text-editor.shader > .CodeMirror): Deleted.
* UserInterface/Views/CodeMirrorAdditions.js:
* UserInterface/Views/ShaderProgramTreeElement.js:
(WI.ShaderProgramTreeElement):
(WI.ShaderProgramTreeElement.prototype.onattach):
(WI.ShaderProgramTreeElement.prototype.ondetach):
(WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
(WI.ShaderProgramTreeElement.prototype.populateContextMenu):
* Localizations/en.lproj/localizedStrings.js:
2019-09-18 Devin Rousso <drousso@apple.com>
Web Inspector: Better handling for large arrays and collections in Object Trees
https://bugs.webkit.org/show_bug.cgi?id=143589
<rdar://problem/16135388>
Reviewed by Joseph Pecoraro.
Adds two buttons before the "Prototype" item in expanded object/collection previews:
- Show %d More
- Show All (%d More)
The default `fetchCount` increment is `100`. The first button will only be shown if there
are more than `100` items remaining (haven't been shown).
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.getPropertyDescriptors):
(WI.RemoteObject.prototype.getDisplayablePropertyDescriptors):
(WI.RemoteObject.prototype.getCollectionEntries):
(WI.RemoteObject.prototype.getOwnPropertyDescriptor.wrappedCallback):
(WI.RemoteObject.prototype._getProperties): Added.
(WI.RemoteObject.prototype._getDisplayableProperties): Added.
* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView):
(WI.ObjectTreeView.showMoreFetchCount): Added.
(WI.ObjectTreeView.addShowMoreIfNeeded): Added.
(WI.ObjectTreeView.prototype.update):
(WI.ObjectTreeView.prototype._updateChildren):
(WI.ObjectTreeView.prototype._updateEntries):
(WI.ObjectTreeView.prototype._updateProperties):
* UserInterface/Views/ObjectTreeView.css:
(.tree-outline.object li > button[disabled] + .indeterminate-progress-spinner): Added.
Avoid duplicating the button creation logic in `WI.ObjectTreePropertyTreeElement` by using a
`static` function. This expects the existence of and requires access to "private" values.
* UserInterface/Views/ObjectTreePropertyTreeElement.js:
(WI.ObjectTreePropertyTreeElement):
(WI.ObjectTreePropertyTreeElement.prototype.onpopulate):
(WI.ObjectTreePropertyTreeElement.prototype._updateChildren):
(WI.ObjectTreePropertyTreeElement.prototype._updateEntries):
(WI.ObjectTreePropertyTreeElement.prototype._updateProperties):
(WI.ObjectTreePropertyTreeElement.prototype._updateChildrenInternal): Deleted.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedArrayPropertyNames): Deleted.
* UserInterface/Controllers/RuntimeManager.js:
(WI.RuntimeManager.prototype.getPropertiesForRemoteObject): Deleted.
Remove unused function.
* Localizations/en.lproj/localizedStrings.js:
2019-09-18 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: console assertion when pressing up/down in empty console log view
https://bugs.webkit.org/show_bug.cgi?id=201948
Reviewed by Devin Rousso.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._upArrowWasPressed):
(WI.LogContentView.prototype._downArrowWasPressed):
Ensure that a message exists before calling `_updateMessagesSelection`, which
would assert if given a bad message. Additionally, only perform preventDefault
when selecting a message. This allows us to fall back to a system beep if
this key event does nothing.
2019-09-17 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: HTML Formatter - better handling for HTML specific tag cases (<p>/<li>)
https://bugs.webkit.org/show_bug.cgi?id=201757
<rdar://problem/55409987>
Reviewed by Devin Rousso.
* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.prototype._after):
Handle a closing tag with different text than the opening tag.
* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js:
(HTMLTreeBuilderFormatter.prototype._pushParserNodeTopLevel):
(HTMLTreeBuilderFormatter.prototype._pushParserNodeStack):
(HTMLTreeBuilderFormatter.prototype._implicitlyCloseHTMLNodesForOpenTag):
(HTMLTreeBuilderFormatter.prototype._implicitlyCloseTagNamesInsideParentTagNames):
(HTMLTreeBuilderFormatter.prototype._indexOfStackNodeMatchingTagNames):
Generalize the implicit closing a bit. Allow open tags to implicitly
close certain other open tags in the stack.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: HTML Formatter - XML mode
https://bugs.webkit.org/show_bug.cgi?id=201758
Reviewed by Devin Rousso.
* Tools/HTMLFormatter/index.html:
* Tools/SourceMaps/index.html:
Update Tools to more easily test XML.
* UserInterface/Proxies/FormatterWorkerProxy.js:
(WI.FormatterWorkerProxy.prototype.formatXML):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.hasFormatter):
(WI.TextEditor.prototype._startWorkerPrettyPrint):
Allow formatting XML content.
* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatHTML):
(FormatterWorker.prototype.formatXML):
Expose "formatXML".
* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.let.dom):
(HTMLFormatter):
(HTMLFormatter.prototype._shouldHaveNoChildren):
(HTMLFormatter.prototype._before):
(HTMLFormatter.prototype._after):
* UserInterface/Workers/Formatter/HTMLParser.js:
(HTMLParser.prototype.parseDocument):
* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js:
(HTMLTreeBuilderFormatter.prototype._isEmptyNode):
Give the HTMLFormatter and related classes an XML mode that
has less of the smarts of XML.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: HTML Formatting: Handle infinite loop for incomplete script data
https://bugs.webkit.org/show_bug.cgi?id=201769
Reviewed by Devin Rousso.
* UserInterface/Workers/Formatter/HTMLParser.js:
(HTMLParser):
Handle EOF in the script data's loop.
Better handle EOF at the end of text data.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Improve auto completion typing performance by avoiding global forced layouts
https://bugs.webkit.org/show_bug.cgi?id=201735
Reviewed by Devin Rousso.
* UserInterface/Views/Main.css:
(#layout-measurement-container):
* UserInterface/Base/Main.js:
(WI.measureElement):
Provide a helper for measuring an element in a hidden container
that helps avoid more global layout.
* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView.prototype.show):
Use measure element to avoid a global forced layout.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Tighter autocomplete bubbles
https://bugs.webkit.org/show_bug.cgi?id=201742
Reviewed by Timothy Hatcher.
* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView.prototype.show):
Eliminate the trailing space. Use bounding client rect to get
fractional widths and raise the value so we are at an even number.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
REGRESSION: Web Inspector: Layout Timeline View does not show popover for initiator data
https://bugs.webkit.org/show_bug.cgi?id=201732
<rdar://problem/55312339>
Reviewed by Devin Rousso.
* UserInterface/Views/LayoutTimelineDataGrid.js:
(WI.LayoutTimelineDataGrid.prototype.callFramePopoverAnchorElement):
(WI.LayoutTimelineDataGrid.prototype.shouldShowCallFramePopover):
The column name was incorrect.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Uncaught Exception: null is not an object (evaluating 'Object.keys(propertyNames)​')​ (at JavaScriptRuntimeCompletionProvider.js:​244:​57)​
https://bugs.webkit.org/show_bug.cgi?id=201729
Reviewed by Devin Rousso.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded):
Don't clear the completion object group until all ongoing requests have completed.
Percision for the lifetime of the object group objects is not important, but we
surely don't want to delete an object too soon.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Formatter: Pretty Print HTML resources (including inline <script>/<style>)
https://bugs.webkit.org/show_bug.cgi?id=201535
<rdar://problem/29119232>
Reviewed by Devin Rousso.
Introduce HTMLFormatter, HTMLParser, and HTMLTreeBuilderFormatter.
- HTMLParser tokenizes HTML content and passes it to a tree builder.
- HTMLTreeBuilderFormatter uses those tokens to create a formatted dom tree of fake nodes.
- HTMLFormatter then builds formatted content and a FormatterSourceMap from that DOM tree.
The output of HTMLFormatter is intended to just modify whitespace. So it won't be a
100% compatible DOM, but will be useful for debugging and reading inline <style>
and <script>, which is a more common debugging scenario. It also maintains original
author attribute quotations or lack therefore, because again it tries to only
change whitespace. A separate tree builder could be used for tidying content.
This introduces a few tools for working with formatting:
- Tools/HTMLFormatter - debug the parser, tree builder, and output format
- Tools/SourceMaps - debug formatted content and source mappings
This also:
- renames "EsprimaFormatter" to "JSFormatter"
- eliminates an extra trailing newline in CSSFormatter output
* Tools/HTMLFormatter/HTMLTreeBuilderDebug.js: Added.
* Tools/HTMLFormatter/index.html: Added.
* Tools/HTMLFormatter/styles.css: Added.
Tool for debugging the HTML formatter components.
* Tools/SourceMaps/.gitignore: Added.
* Tools/SourceMaps/index.html: Added.
* Tools/SourceMaps/setup.sh: Added.
* Tools/SourceMaps/styles.css: Added.
Tool for debugging Formatter generated Source Maps.
* Tools/JSFormatter/JSFormatterDebug.js: Renamed from Source/WebInspectorUI/Tools/Formatting/EsprimaFormatterDebug.js.
* Tools/JSFormatter/codemirror-additions.css: Renamed from Source/WebInspectorUI/Tools/Formatting/codemirror-additions.css.
* Tools/JSFormatter/index.html: Renamed from Source/WebInspectorUI/Tools/Formatting/index.html.
Renamed this tool. EsprimaFormatter => JSFormatter.
* UserInterface/Controllers/FormatterSourceMap.js:
(WI.FormatterSourceMap.prototype.originalPositionToFormattedPosition):
(WI.FormatterSourceMap.prototype.formattedPositionToOriginalPosition):
New APIs used by tools and tests for translating "position" offsets and not line/columns.
* UserInterface/Workers/Formatter/JSFormatter.js: Renamed from Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js.
(JSFormatter):
* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter):
Allow using a supplied builder, which is useful when formatting
inline content from HTMLFormatter (<style> / <script>).
* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype.get indentString):
(FormatterContentBuilder.prototype.get originalContent):
(FormatterContentBuilder.prototype.get indentLevel):
(FormatterContentBuilder.prototype.get originalOffset):
(FormatterContentBuilder.prototype.set originalOffset):
(FormatterContentBuilder.prototype.appendNonToken):
(FormatterContentBuilder.prototype.appendToken):
(FormatterContentBuilder.prototype.appendTokenWithPossibleNewlines):
(FormatterContentBuilder.prototype.appendMapping):
(FormatterContentBuilder.prototype.indentToLevel):
(FormatterContentBuilder.prototype.finish):
Provide API for getting / setting the original offset and indent level.
This is useful when the HTMLFormatter runs the CSSFormatter/JSFormatter
in a nested context (<style> / <script>). Add a few more APIs for
conveniences when appending tokens or important positions.
* UserInterface/Workers/Formatter/HTMLParser.js: Added.
(HTMLParser.prototype.parseDocument):
(HTMLParser.prototype._isEOF):
(HTMLParser.prototype._peek):
(HTMLParser.prototype._peekCharacterRegex):
(HTMLParser.prototype._peekString):
(HTMLParser.prototype._peekCaseInsensitiveString):
(HTMLParser.prototype._consumeWhitespace):
(HTMLParser.prototype._consumeUntilString):
(HTMLParser.prototype._consumeUntilRegex):
(HTMLParser.prototype._consumeDoubleQuotedString):
(HTMLParser):
Tokenize HTML content into nodes.
* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js: Added.
(HTMLTreeBuilderFormatter.prototype.get dom):
(HTMLTreeBuilderFormatter.prototype.begin):
(HTMLTreeBuilderFormatter.prototype.pushParserNode):
(HTMLTreeBuilderFormatter.prototype.end):
(HTMLTreeBuilderFormatter.prototype._pushParserNodeTopLevel):
(HTMLTreeBuilderFormatter.prototype._pushParserNodeStack):
(HTMLTreeBuilderFormatter.prototype._isEmptyNode):
(HTMLTreeBuilderFormatter.prototype._buildDOMNodeFromOpenTag):
(HTMLTreeBuilderFormatter.prototype._buildErrorNodeFromCloseTag):
(HTMLTreeBuilderFormatter.prototype._buildSimpleNodeFromParserNode):
(HTMLTreeBuilderFormatter):
Build a simple DOM tree from parser nodes.
* UserInterface/Workers/Formatter/HTMLFormatter.js: Added.
(HTMLFormatter.let.dom):
(HTMLFormatter):
(HTMLFormatter.prototype.get success):
(HTMLFormatter.prototype.get formattedText):
(HTMLFormatter.prototype.get sourceMapData):
(HTMLFormatter.prototype._walk):
(HTMLFormatter.prototype._walkChildren):
(HTMLFormatter.prototype._isNodeSelfClosing):
(HTMLFormatter.prototype._shouldHaveInlineContent):
(HTMLFormatter.prototype._hasMultipleNewLines):
(HTMLFormatter.prototype._buildAttributeString):
(HTMLFormatter.prototype._before):
(HTMLFormatter.prototype._after):
(HTMLFormatter.prototype._formatWithNestedFormatter):
(HTMLFormatter.prototype._formatScript):
(HTMLFormatter.prototype._formatStyle):
Output pretty printed text from a HTMLTreeBuilderFormatter dom tree.
* UserInterface/Proxies/FormatterWorkerProxy.js:
(WI.FormatterWorkerProxy.prototype.formatHTML):
* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatJavaScript):
(FormatterWorker.prototype.formatCSS):
(FormatterWorker.prototype.formatHTML):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.hasFormatter):
(WI.TextEditor.prototype._canUseFormatterWorker):
(WI.TextEditor.prototype._startWorkerPrettyPrint):
Allow pretty printing HTML resources.
* UserInterface/Main.html:
* UserInterface/Test.html:
New resources.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: [Overrides] Command-Z doesn't undo changes after page reload
https://bugs.webkit.org/show_bug.cgi?id=201698
<rdar://problem/55276645>
Reviewed by Devin Rousso.
* UserInterface/Views/ContentViewContainer.js:
(WI.ContentViewContainer.prototype.closeAllContentViews):
Provide a filter to opt out of closing some content views.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._closeContentViewsFilter):
(WI.SourcesNavigationSidebarPanel.prototype._updateMainFrameTreeElement):
Avoid closing ContentViews for local resource overrides. This keeps the
SourceCodeTextEditor around and thus its undo/redo stack.
2019-09-12 Joseph Pecoraro <pecoraro@apple.com>
Uncaught Exception: TypeError: null is not an object (evaluating 'selectedTreeElement.representedObject')
https://bugs.webkit.org/show_bug.cgi?id=201716
<rdar://problem/55292615>
Reviewed by Devin Rousso.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
If a breakpoint was removed without a selection in the breakpoint tree outline
then there may be no selected tree element.
2019-09-11 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: REGRESSION: Inspector Timeline always starts at about 500ms mark on a reload
https://bugs.webkit.org/show_bug.cgi?id=200637
<rdar://problem/54218967>
Reviewed by Devin Rousso.
The Timeline was getting a startTime value from before the user started
the timeline recording because of artificial adjustments that were made
to CPUTimelineRecords. Ignore adjusted values when updating the Timeline's
start and end times.
* UserInterface/Models/Timeline.js:
(WI.Timeline.prototype._updateTimesIfNeeded):
Use unadjusted times, which should fall in the user started / stopped
timeline range.
* UserInterface/Models/TimelineRecord.js:
(WI.TimelineRecord.prototype.get unadjustedStartTime):
(WI.TimelineRecord.prototype.get unadjustedEndTime):
Default implementation uses startTime/endTime.
* UserInterface/Models/CPUTimelineRecord.js:
(WI.CPUTimelineRecord.prototype.get unadjustedStartTime):
* UserInterface/Models/MemoryTimelineRecord.js:
(WI.MemoryTimelineRecord.prototype.get unadjustedStartTime):
Each of these adjusted their startTime.
2019-09-11 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: REGRESSION: CPU: Overlay Markers for Thread views are off by 500ms
https://bugs.webkit.org/show_bug.cgi?id=201709
<rdar://problem/55289279>
Reviewed by Devin Rousso.
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.layout):
Use the CPUTimelineRecord's timestamp (same as the record's endTime) as the
point when the CPU sample is taken. This aligns with the rest of the UI that
assumes that the 500ms before the sample point leads up to the sample value.
2019-09-11 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Do not show override actions unless Sources tab is enabled
https://bugs.webkit.org/show_bug.cgi?id=201708
Reviewed by Devin Rousso.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.supportsLocalResourceOverrides):
2019-09-11 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: checkerboard has too much contrast in dark mode
https://bugs.webkit.org/show_bug.cgi?id=201670
Reviewed by Timothy Hatcher.
* UserInterface/Views/CanvasTabContentView.css:
(.content-view.canvas > .preview > img, .content-view.canvas .preview-container > canvas): Deleted.
Don't force a `background-color: white;` in dark mode.
2019-09-11 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Elements: don't show Changes panel when selecting text node
https://bugs.webkit.org/show_bug.cgi?id=201669
Reviewed by Joseph Pecoraro.
Show Changes panel only for elements regardless of "Show only for selected node" setting.
* UserInterface/Views/ChangesDetailsSidebarPanel.js:
(WI.ChangesDetailsSidebarPanel.prototype.supportsDOMNode):
(WI.ChangesDetailsSidebarPanel.prototype.inspect): Deleted.
2019-09-11 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: instrument WebGPUDevice instead of GPUCanvasContext
https://bugs.webkit.org/show_bug.cgi?id=201650
Reviewed by Joseph Pecoraro.
Most of the actual "work" done with Web GPU actually uses a `WebGPUDevice`.
A `GPUCanvasContext` is basically just a display "client" of the device, and isn't even
required (e.g. compute pipeline). We should treat the `GPUCanvasContext` almost like a
`-webkit-canvas` client of a `WebGPUDevice`.
* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.clientNodesChanged): Added.
(WI.CanvasObserver.prototype.cssCanvasClientNodesChanged):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.clientNodesChanged): Added.
(WI.CanvasManager.prototype.cssCanvasClientNodesChanged): Deleted.
* UserInterface/Models/Canvas.js:
(WI.Canvas.resetUniqueDisplayNameNumbers):
(WI.Canvas.prototype.get displayName):
(WI.Canvas.prototype.requestNode):
(WI.Canvas.prototype.requestClientNodes): Added.
(WI.Canvas.prototype.requestSize):
(WI.Canvas.prototype.clientNodesChanged): Added.
(WI.Canvas.prototype.requestCSSCanvasClientNodes): Deleted.
(WI.Canvas.prototype.cssCanvasClientNodesChanged): Deleted.
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.resolveCanvasContext):
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype.attached):
(WI.CanvasContentView.prototype._refreshPixelSize):
* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.set canvas):
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
(WI.CanvasDetailsSidebarPanel.prototype.layout):
(WI.CanvasDetailsSidebarPanel.prototype._refreshSourceSection):
(WI.CanvasDetailsSidebarPanel.prototype._refreshClientsSection): Added.
(WI.CanvasDetailsSidebarPanel.prototype._refreshCSSCanvasSection): Deleted.
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._contentViewMouseEnter):
* UserInterface/Views/CanvasTreeElement.js:
(WI.CanvasTreeElement.prototype._handleMouseOver):
* Localizations/en.lproj/localizedStrings.js:
2019-09-11 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r249753.
caused inspector/canvas/shaderProgram-add-remove-webgl.html to
crash on all Mac platforms.
Reverted changeset:
"Web Inspector: Canvas: instrument WebGPUDevice instead of
GPUCanvasContext"
https://bugs.webkit.org/show_bug.cgi?id=201650
https://trac.webkit.org/changeset/249753
2019-09-10 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: instrument WebGPUDevice instead of GPUCanvasContext
https://bugs.webkit.org/show_bug.cgi?id=201650
Reviewed by Joseph Pecoraro.
Most of the actual "work" done with Web GPU actually uses a `WebGPUDevice`.
A `GPUCanvasContext` is basically just a display "client" of the device, and isn't even
required (e.g. compute pipeline). We should treat the `GPUCanvasContext` almost like a
`-webkit-canvas` client of a `WebGPUDevice`.
* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.clientNodesChanged): Added.
(WI.CanvasObserver.prototype.cssCanvasClientNodesChanged):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.clientNodesChanged): Added.
(WI.CanvasManager.prototype.cssCanvasClientNodesChanged): Deleted.
* UserInterface/Models/Canvas.js:
(WI.Canvas.resetUniqueDisplayNameNumbers):
(WI.Canvas.prototype.get displayName):
(WI.Canvas.prototype.requestNode):
(WI.Canvas.prototype.requestClientNodes): Added.
(WI.Canvas.prototype.requestSize):
(WI.Canvas.prototype.clientNodesChanged): Added.
(WI.Canvas.prototype.requestCSSCanvasClientNodes): Deleted.
(WI.Canvas.prototype.cssCanvasClientNodesChanged): Deleted.
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.resolveCanvasContext):
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype.attached):
(WI.CanvasContentView.prototype._refreshPixelSize):
* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.set canvas):
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
(WI.CanvasDetailsSidebarPanel.prototype.layout):
(WI.CanvasDetailsSidebarPanel.prototype._refreshSourceSection):
(WI.CanvasDetailsSidebarPanel.prototype._refreshClientsSection): Added.
(WI.CanvasDetailsSidebarPanel.prototype._refreshCSSCanvasSection): Deleted.
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._contentViewMouseEnter):
* UserInterface/Views/CanvasTreeElement.js:
(WI.CanvasTreeElement.prototype._handleMouseOver):
* Localizations/en.lproj/localizedStrings.js:
2019-09-10 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove legacy CodeMirror based pretty printers
https://bugs.webkit.org/show_bug.cgi?id=201624
Reviewed by Devin Rousso.
* Tools/PrettyPrinting/FormatterDebug.js: Removed.
* Tools/PrettyPrinting/Utilities.js: Removed.
* Tools/PrettyPrinting/codemirror-additions.css: Removed.
* Tools/PrettyPrinting/index.html: Removed.
* Tools/PrettyPrinting/populate/apple.css: Removed.
* UserInterface/Controllers/Formatter.js: Removed.
* UserInterface/Main.html:
* UserInterface/Test.html:
* UserInterface/Views/CodeMirrorFormatters.js: Removed.
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.prettyPrint):
(WI.TextEditor.prototype._canUseFormatterWorker): Deleted.
(WI.TextEditor.prototype._startCodeMirrorPrettyPrint): Deleted.
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
2019-09-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Dark Mode: Overview Timeline View has jarring white box-shadows in dark mode
https://bugs.webkit.org/show_bug.cgi?id=201442
<rdar://problem/54999794>
Reviewed by Devin Rousso.
* UserInterface/Views/DataGrid.css:
(.data-grid:not(.variable-height-rows) table.data):
(.data-grid:not(.variable-height-rows) table.data.even-first-zebra-stripe):
(.data-grid.variable-height-rows.even-first-zebra-stripe table.data tr:nth-child(odd)):
(.data-grid.variable-height-rows.even-first-zebra-stripe table.data tr:nth-child(even)):
(.data-grid:not(.variable-height-rows) table.data.odd-first-zebra-stripe): Deleted.
(.data-grid.variable-height-rows.odd-first-zebra-stripe table.data tr:nth-child(odd)): Deleted.
(.data-grid.variable-height-rows.odd-first-zebra-stripe table.data tr:nth-child(even)): Deleted.
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype.updateVisibleRows):
* UserInterface/Views/Table.css:
(.table > .data-container > .data-list):
(.table > .data-container > .data-list.even-first-zebra-stripe):
(.table > .data-container > .data-list.odd-first-zebra-stripe): Deleted.
* UserInterface/Views/Table.js:
In the gradients "even" was mistakenly first. Fix these so that "odd" is first and the
unusual case would be having "even" first. This allows us to line up with `nth-of-type(even)`.
* UserInterface/Views/Main.css:
(:root):
(@media (prefers-color-scheme: dark)):
Flip even and odd so we maintain the same styles for gradients.
* UserInterface/Views/OverviewTimelineView.css:
(.timeline-view.overview > .data-grid tr):
(.timeline-view.overview > .data-grid tr:nth-child(even)):
(.timeline-view.overview > .data-grid tr.parent:not(.expanded) td.graph-column .timeline-record-bar:not(.has-inactive-segment) > .segment):
(.timeline-view.overview > .data-grid tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar:not(.has-inactive-segment) > .segment):
(.timeline-view.overview > .data-grid tr.parent:not(.expanded) td.graph-column .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(.timeline-view.overview > .data-grid tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(@media (prefers-color-scheme: dark)):
(WI.Table.prototype._updateVisibleRows):
* UserInterface/Views/Variables.css:
2019-09-06 Devin Rousso <drousso@apple.com>
Web Inspector: CSS Formatter: the closing } of nested @media aren't indented
https://bugs.webkit.org/show_bug.cgi?id=201560
Reviewed by Joseph Pecoraro.
* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype.removeLastNewline):
It's possible that there were multiple newlines in a row, so we should update `_startOfLine`
to be `true` if the previous line was empty.
2019-09-06 Devin Rousso <drousso@apple.com>
Web Inspector: CSS Formatter: links to CSS resources don't map to the right line after pretty printing if the line is after a multiline comment
https://bugs.webkit.org/show_bug.cgi?id=201559
Reviewed by Joseph Pecoraro.
Newlines in multiline comments weren't added as line endings, so they weren't considered
when a source code location updated after pretty printing.
* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter.prototype._format):
2019-09-06 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Better position for Sources tab when enabling the experimental setting
https://bugs.webkit.org/show_bug.cgi?id=201539
Reviewed by Devin Rousso.
* UserInterface/Views/SettingsTabContentView.js:
Place the Sources tab where the Debugger tab was.
2019-09-06 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Network: Error response headers summary has wrong color border
https://bugs.webkit.org/show_bug.cgi?id=201538
<rdar://problem/55104469>
Reviewed by Devin Rousso.
* UserInterface/Views/ResourceHeadersContentView.css:
(body[dir] .resource-headers > section.error > .details):
Re-apply an error style for resource-header sections.
2019-09-04 Devin Rousso <drousso@apple.com>
Web Inspector: unify the interaction of show/hide status icons in Sources and Canvas
https://bugs.webkit.org/show_bug.cgi?id=201470
Reviewed by Joseph Pecoraro.
Rather than "fading" the tree element's text when the underlying represented object is
disabled/blackboxed, we should just "fade" the icon. The "fade" shouldn't change when the
tree element is selected. The image of the status eye also shouldn't change depending on
whether the underlying represented object is disabled/blackboxed, as it being visible (even
if it's "faded") is already enough of an indicator.
It should also be possible to toggle the disabled/blackboxed state via the context menu.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* UserInterface/Views/SourceCodeTreeElement.css:
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackboxed, .tree-outline .item:not(:hover) .status > .toggle-script-blackboxed:not(.blackboxed)): Added.
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackboxed, .tree-outline .item:not(:hover, .selected) .status > .toggle-script-blackboxed:not(.blackboxed)): Deleted.
* UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram):
(WI.ShaderProgram.prototype.get disabled): Added.
(WI.ShaderProgram.prototype.set disabled): Added.
(WI.ShaderProgram.prototype.toggleDisabled): Deleted.
* UserInterface/Views/ShaderProgramTreeElement.js:
(WI.ShaderProgramTreeElement.prototype.onattach):
(WI.ShaderProgramTreeElement.prototype.ondetach): Added.
(WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
(WI.ShaderProgramTreeElement.prototype.populateContextMenu): Added.
(WI.ShaderProgramTreeElement.prototype._disabledImageElementClicked):
(WI.ShaderProgramTreeElement.prototype._handleShaderProgramDisabledChanged): Added.
* UserInterface/Views/ShaderProgramTreeElement.css:
(.tree-outline .item.shader-program .status > img): Added.
(.tree-outline .item.shader-program:not(:hover, .selected, .disabled) .status > img): Added.
(.tree-outline .item.shader-program.disabled .status > img): Added.
(@media (prefers-color-scheme: dark) .tree-outline .item.shader-program .status > img): Added.
(.item.shader-program .status > img): Deleted.
(.item.shader-program.disabled:hover .status > img): Deleted.
(.item.shader-program:not(:hover, .selected, .disabled) .status > img): Deleted.
(.item.shader-program.disabled > :not(.status)): Deleted.
(@media (prefers-color-scheme: dark) .item.shader-program .status > img): Deleted.
2019-09-04 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Local Overrides - Provide substitution content for resource loads (URL based)
https://bugs.webkit.org/show_bug.cgi?id=201262
<rdar://problem/13108764>
Reviewed by Devin Rousso.
This adds a new "Local Overrides" section to the Sources tab sidebar
which will allow users to provide their own resource content for text
resources. Users can clone a resource, and provide their own content
(by editing in Web Inspector) and new requests for those particular
URLs will get the substitute content.
Overrides are based on a particular URL (ignoring fragment). They
can override: status code, status text, response headers, content,
and MIME Type (Content-Type).
* Tools/CodeMirrorModes/index.html: Added.
* Tools/CodeMirrorModes/styles.css: Added.
Debug tool for CodeMirror editors and our custom CodeMirror modes.
* UserInterface/Main.html:
* UserInterface/Test.html:
* Localizations/en.lproj/localizedStrings.js:
New files and strings.
* UserInterface/Base/HTTPUtilities.js: Added.
(WI.httpStatusTextForStatusCode):
Translate between typical status codes and status text.
* UserInterface/Base/ObjectStore.js:
(WI.ObjectStore._open):
New persistent store for local resource overrides.
* UserInterface/Base/Main.js:
(WI.showLocalResourceOverride):
Convenience for showing an override file.
* UserInterface/Base/URLUtilities.js:
(parseURL):
Avoid uncaught exceptions with the URL constructor for common WebKit internal sourceURL strings.
(WI.urlWithoutFragment):
Strip a fragment from a URL.
* UserInterface/Controllers/HARBuilder.js:
(WI.HARBuilder.fetchType):
(WI.HARBuilder.responseSourceFromHARFetchType):
Handle new custom response types.
* UserInterface/Protocol/NetworkObserver.js:
(WI.NetworkObserver.prototype.responseIntercepted):
(WI.NetworkObserver):
New events.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
(WI.NetworkManager.supportsLocalResourceOverrides):
(WI.NetworkManager.prototype.initializeTarget):
(WI.NetworkManager.prototype.get localResourceOverrides):
(WI.NetworkManager.prototype.get interceptionEnabled):
(WI.NetworkManager.prototype.set interceptionEnabled):
(WI.NetworkManager.prototype.addLocalResourceOverride):
(WI.NetworkManager.prototype.removeLocalResourceOverride):
(WI.NetworkManager.prototype.localResourceOverrideForURL):
(WI.NetworkManager.prototype.canBeOverridden):
(WI.NetworkManager.prototype.responseIntercepted):
(WI.NetworkManager.prototype._handleResourceContentDidChange):
(WI.NetworkManager.prototype._persistLocalResourceOverrideSoonAfterContentChange):
(WI.NetworkManager.prototype._saveLocalResourceOverrides):
(WI.NetworkManager.prototype._extraDomainsActivated):
(WI.NetworkManager.prototype.localResourceForURL): Deleted.
Handle saving and restoring local resource overrides.
Handle responding to a `responseIntercepted` Network protocol event.
* UserInterface/Models/LocalResource.js:
(WI.LocalResource.fromJSON):
(WI.LocalResource.prototype.toJSON):
(WI.LocalResource.prototype.get localContent):
(WI.LocalResource.prototype.get localContentIsBase64Encoded):
(WI.LocalResource.prototype.isLocalResourceOverride):
(WI.LocalResource.prototype.updateOverrideContent):
Allow a LocalResource to identify itself as an "override".
* UserInterface/Models/LocalResourceOverride.js: Added.
(WI.LocalResourceOverride.prototype.create):
(WI.LocalResourceOverride.fromJSON):
(WI.LocalResourceOverride.prototype.toJSON):
(WI.LocalResourceOverride.prototype.get url):
(WI.LocalResourceOverride.prototype.get localResource):
(WI.LocalResourceOverride.prototype.get disabled):
(WI.LocalResourceOverride.prototype.set disabled):
(WI.LocalResourceOverride.prototype.saveIdentityToCookie):
(WI.LocalResourceOverride):
Model object for a LocalResourceOverride. This has LocalResource content
and an enabled/disabled state.
* UserInterface/Models/Resource.js:
(WI.Resource.classNamesForResource):
(WI.Resource.responseSourceFromPayload):
(WI.Resource.prototype.isLocalResourceOverride):
(WI.Resource.prototype.async.createLocalResourceOverride):
(WI.Resource.classNameForResource): Deleted.
Convenience functions and icon updates.
* UserInterface/Views/SourcesTabContentView.js:
(WI.SourcesTabContentView.prototype.canShowRepresentedObject):
* UserInterface/Views/ContentView.js:
(WI.ContentView.createFromRepresentedObject):
(WI.ContentView.resolvedRepresentedObjectForRepresentedObject):
(WI.ContentView.isViewable):
Handle new represented object type.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.createContentTreeOutline):
(WI.SourcesNavigationSidebarPanel.prototype.willDismissPopover):
(WI.SourcesNavigationSidebarPanel.prototype._willDismissLocalOverridePopover):
(WI.SourcesNavigationSidebarPanel.prototype._willDismissEventBreakpointPopover):
(WI.SourcesNavigationSidebarPanel.prototype._willDismissURLBreakpointPopover):
(WI.SourcesNavigationSidebarPanel.prototype._addLocalResourceOverride):
(WI.SourcesNavigationSidebarPanel.prototype._removeLocalResourceOverride):
(WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
(WI.SourcesNavigationSidebarPanel.prototype._handleLocalResourceOverrideAdded):
(WI.SourcesNavigationSidebarPanel.prototype._handleLocalResourceOverrideRemoved):
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > .warning-banner):
(.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container, .local-overrides)):
(.sidebar > .panel.navigation.sources > .content > .local-overrides):
(.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Deleted.
Hide and show Local Overrides section.
* UserInterface/Views/LocalResourceOverrideTreeElement.css:
(.item.resource.override .status > div):
* UserInterface/Views/LocalResourceOverrideTreeElement.js: Added.
(WI.LocalResourceOverrideTreeElement):
(WI.LocalResourceOverrideTreeElement.prototype.canSelectOnMouseDown):
(WI.LocalResourceOverrideTreeElement.prototype.populateContextMenu):
(WI.LocalResourceOverrideTreeElement.prototype.willDismissPopover):
TreeElement for a Local Resource Override.
* UserInterface/Views/CodeMirrorLocalOverrideURLMode.css:
(.cm-s-default .cm-local-override-url-bad-scheme):
(.cm-s-default .cm-local-override-url-fragment):
* UserInterface/Views/CodeMirrorLocalOverrideURLMode.js: Added.
(tokenBase):
(return.startState):
(return.token):
* UserInterface/Views/ContentBrowserTabContentView.js:
(WI.ContentBrowserTabContentView.prototype._revealAndSelectRepresentedObject):
* UserInterface/Views/ContextMenu.js:
(WI.ContextMenu.prototype._itemSelected):
(WI.ContextMenu):
Better debugging for exceptions in context menu handlers.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
(WI.appendContextMenuItemsForURL):
Context menu items for Local Resource Overrides.
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype.startEditingNode):
(WI.DataGrid.prototype._startEditingNodeAtColumnIndex):
(WI.DataGrid.prototype._startEditing):
(WI.DataGrid.prototype._contextMenuInDataTable):
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode):
(WI.DataGridNode.prototype.get editable):
(WI.DataGridNode.prototype.set editable):
Improve DataGrid editing functionality.
Allow a node to not be editable.
Allow adding a new node and starting to edit in one action.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype.treeElementForRepresentedObject):
Do not provide overrides in the Debugger tab.
* UserInterface/Views/LocalResourceOverrideLabelView.css:
(.local-resource-override-label-view):
(.local-resource-override-label-view > div):
(.local-resource-override-label-view > div > .label):
(.local-resource-override-label-view > div > .url):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/LocalResourceOverrideLabelView.js:
(WI.LocalResourceOverrideLabelView):
(WI.LocalResourceOverrideLabelView.prototype.initialLayout):
* UserInterface/Views/LocalResourceOverridePopover.css: Added.
(.popover .local-resource-override-popover-content):
(.popover .local-resource-override-popover-content > label.toggle):
(.popover .local-resource-override-popover-content > table):
(.popover .local-resource-override-popover-content > table > tr > th):
(.popover .local-resource-override-popover-content > table > tr > td):
(.popover .local-resource-override-popover-content .editor):
(.popover .local-resource-override-popover-content .editor > .CodeMirror):
(.popover .local-resource-override-popover-content .editor.url):
(.popover .local-resource-override-popover-content .editor.mime):
(.popover .local-resource-override-popover-content .editor.status):
(.popover .local-resource-override-popover-content .editor.status-text):
(.popover .local-resource-override-popover-content .add-header):
(@media (prefers-color-scheme: dark)):
New banner view for a local resource override itself.
Shows the URL being overriden.
* UserInterface/Views/LocalResourceOverrideWarningView.css:
(.local-resource-override-warning-view):
(.local-resource-override-warning-view[hidden]):
(.local-resource-override-warning-view > div):
(.local-resource-override-warning-view > div > button):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/LocalResourceOverrideWarningView.js: Added.
(WI.LocalResourceOverrideWarningView):
(WI.LocalResourceOverrideWarningView.prototype.attached):
(WI.LocalResourceOverrideWarningView.prototype.detached):
(WI.LocalResourceOverrideWarningView.prototype._updateContent):
(WI.LocalResourceOverrideWarningView.prototype._handleLocalResourceOverrideChanged):
* UserInterface/Views/NavigationSidebarPanel.js:
(WI.NavigationSidebarPanel.prototype.pruneStaleResourceTreeElements):
New banner view for a resource that has been overridden.
Allows jumping to the override itself.
* UserInterface/Views/LocalResourceOverridePopover.js: Added.
(WI.LocalResourceOverridePopover):
(WI.LocalResourceOverridePopover.prototype.get serializedData):
(WI.LocalResourceOverridePopover.prototype.show.addDataGridNodeForHeader):
(WI.LocalResourceOverridePopover.prototype.show):
(WI.LocalResourceOverridePopover.prototype._createEditor):
(WI.LocalResourceOverridePopover.prototype._defaultURL):
(WI.LocalResourceOverridePopover.prototype._presentOverTargetElement):
New popover for creating or editing a Local Resource Override.
* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype.performSearch):
Consider searching overrides.
* UserInterface/Views/Variables.css:
(:root):
* UserInterface/Views/SearchSidebarPanel.css:
(.sidebar > .panel.navigation.search.changed > .banner):
* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .warning-banner):
* UserInterface/Views/ConsoleMessageView.css:
(.console-warning-level):
Use a new variable for a common warning color.
* UserInterface/Images/NavigationItemNetworkOverride.svg: Added.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.canBeFormatted):
(WI.SourceCodeTextEditor.prototype.get _supportsDebugging):
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > .warning-banner):
(.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container, .local-overrides)):
(.sidebar > .panel.navigation.sources > .content > .local-overrides):
(.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Deleted.
* UserInterface/Views/TextEditor.css:
(.text-editor):
* UserInterface/Views/TextResourceContentView.css:
(.content-view.resource.text):
(.content-view.resource.text > .text-editor):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView):
(WI.TextResourceContentView.prototype.get navigationItems):
(WI.TextResourceContentView.prototype.closed):
(WI.TextResourceContentView.prototype._contentWillPopulate):
(WI.TextResourceContentView.prototype._contentDidPopulate):
(WI.TextResourceContentView.prototype.async._handleCreateLocalResourceOverride):
(WI.TextResourceContentView.prototype._handleRemoveLocalResourceOverride):
(WI.TextResourceContentView.prototype._handleLocalResourceOverrideChanged):
(WI.TextResourceContentView.prototype._textEditorContentDidChange):
(WI.TextResourceContentView.prototype._shouldBeEditable):
Allow Text resources to create a local resource override.
Support for Image resources will come separately.
* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView.prototype._responseSourceDisplayString):
Handle new response type.
* UserInterface/Controllers/CSSManager.js:
Avoid extra handling for Local Resource Overrides.
* UserInterface/Views/ResourceIcons.css:
(.resource-icon.override .icon):
* UserInterface/Views/ResourceSizesContentView.js:
(WI.ResourceSizesContentView.prototype.initialLayout):
* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WI.ResourceTimelineDataGridNode.prototype.iconClassNames):
* UserInterface/Views/ResourceTreeElement.js:
(WI.ResourceTreeElement.prototype._updateResource):
(WI.ResourceTreeElement.prototype._updateIcon):
(WI.ResourceTreeElement.prototype._responseReceived):
(WI.ResourceTreeElement):
* UserInterface/Views/TimelineDataGridNode.js:
(WI.TimelineDataGridNode.prototype.createCellContent):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._populateNameCell):
(WI.NetworkTableContentView.prototype._populateTransferSizeCell):
(WI.NetworkTableContentView.prototype._generateSortComparator):
Better Resource icons all over for overrides.
* UserInterface/Views/URLBreakpointPopover.js:
(WI.URLBreakpointPopover.prototype._createEditor):
Code cleanup.
2019-09-03 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way to view XML/HTML/SVG resource responses as a DOM tree
https://bugs.webkit.org/show_bug.cgi?id=201046
<rdar://problem/54446087>
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView):
(WI.ResourceClusterContentView.prototype.showRequest):
(WI.ResourceClusterContentView.prototype.showResponse):
(WI.ResourceClusterContentView.prototype.get customRequestDOMContentView): Added.
(WI.ResourceClusterContentView.prototype.get customRequestJSONContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseDOMContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseJSONContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseTextContentView): Added.
(WI.ResourceClusterContentView.prototype._createPathComponent): Added.
(WI.ResourceClusterContentView.prototype._canShowCustomRequestContentView):
(WI.ResourceClusterContentView.prototype._canShowCustomResponseContentView):
(WI.ResourceClusterContentView.prototype._contentViewForResourceType):
(WI.ResourceClusterContentView.prototype._pathComponentForContentView):
(WI.ResourceClusterContentView.prototype._identifierForContentView):
(WI.ResourceClusterContentView.prototype._showContentViewForIdentifier):
(WI.ResourceClusterContentView.prototype._resourceLoadingDidFinish):
(WI.ResourceClusterContentView.prototype._canUseDOMContentViewForContent): Added.
(WI.ResourceClusterContentView.prototype._normalizeMIMETypeForDOM): Added.
(WI.ResourceClusterContentView.prototype._tryEnableCustomRequestContentViews): Added.
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentViews): Added.
(WI.ResourceClusterContentView.createPathComponent): Deleted.
(WI.ResourceClusterContentView.prototype._tryEnableCustomRequestContentView): Deleted.
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView): Deleted.
* UserInterface/Base/Main.js:
(WI.showResourceRequest):
* UserInterface/Views/PathComponentIcons.css:
(.object-icon .icon): Added.
* UserInterface/Main.html:
* UserInterface/Views/SVGImageResourceClusterContentView.js: Removed.
Reworked to allow more than one custom request/response content view at the same time. As
such, merge the `WI.SVGImageResourceClusterContentView` into this class.
* UserInterface/Views/LocalRemoteObjectContentView.js: Added.
(WI.LocalRemoteObjectContentView):
(WI.LocalRemoteObjectContentView.prototype.get expression):
(WI.LocalRemoteObjectContentView.prototype.renderRemoteObject):
(WI.LocalRemoteObjectContentView.prototype.initialLayout):
(WI.LocalRemoteObjectContentView.prototype.attached):
(WI.LocalRemoteObjectContentView.prototype.closed):
* UserInterface/Views/LocalRemoteObjectContentView.css: Added.
(.content-view.local-remote-object):
* UserInterface/Views/LocalDOMContentView.js: Added.
(WI.LocalDOMContentView):
(WI.LocalDOMContentView.prototype.get expression):
(WI.LocalDOMContentView.prototype.renderRemoteObject):
* UserInterface/Views/LocalJSONContentView.js: Added.
(WI.LocalJSONContentView):
(WI.LocalJSONContentView.prototype.get expression):
(WI.LocalJSONContentView.prototype.renderRemoteObject):
* UserInterface/Views/JSONContentView.js: Removed.
* UserInterface/Views/JSONContentView.css: Removed.
Rework `WI.JSONContentView` into a more generic set of classes that render an object we send
to the inspected page for instrumentation.
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
(WI.DOMTreeOutline.prototype._onmousemove):
(WI.DOMTreeOutline.prototype._onmouseout):
(WI.DOMTreeOutline.prototype._ondragstart):
(WI.DOMTreeOutline.prototype._ondragover):
(WI.DOMTreeOutline.prototype._ondragleave):
(WI.DOMTreeOutline.prototype._ondragend):
(WI.DOMTreeOutline.prototype._hideElements):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
Ensure that interactions that would modify the DOM tree only happen when editable. If the
`WI.DOMTreeOutline` represents a "local" `WI.DOMNode` (one that's been sent to the inspected
page for instrumentation, and shouldn't be part of the main #document), don't allow any
editing actions to be performed.
* UserInterface/Views/TextContentView.js:
(WI.TextContentView):
Allow a `representedObject` object to be provided and used instead of the given `string`.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Images/Object.svg: Added.
2019-09-03 Devin Rousso <drousso@apple.com>
Web Inspector: implement blackboxing of script resources
https://bugs.webkit.org/show_bug.cgi?id=17240
<rdar://problem/5732847>
Reviewed by Joseph Pecoraro.
When a script is blackboxed and the debugger attempts to pause in that script, the pause
reason/data will be saved and execution will continue until it has left the blackboxed
script. Once outside, execution is paused with the saved reason/data.
This is especially useful when debugging issues using libraries/frameworks, as it allows the
developer to "skip" the internal logic of the library/framework and instead focus only on
how they're using it.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.supportsBlackboxingScripts): Added.
(WI.DebuggerManager.pauseReasonFromPayload): Added.
(WI.DebuggerManager.prototype.isScriptBlackboxed): Added.
(WI.DebuggerManager.prototype.setShouldBlackboxScript): Added.
(WI.DebuggerManager.prototype._pauseReasonFromPayload):
(WI.DebuggerManager.prototype._pauseReasonFromPayload): Deleted.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype.get isScript): Added.
(WI.SourceCode.prototype.get supportsScriptBlackboxing): Added.
* UserInterface/Models/Script.js:
(WI.Script.prototype.get isScript): Added.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.get isScript): Added.
Provide a more straightforward way of determining if a `WI.SourceCode` is a script.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._updatePauseReason):
(WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReason):
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
Display the original pause reason and breakpoint (if applicable) when pausing after leaving
a blackboxed script.
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype.canSelectOnMouseDown): Added.
(WI.SourceCodeTreeElement.prototype.updateStatus): Added.
(WI.SourceCodeTreeElement.prototype._updateSourceCode):
(WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState): Added.
(WI.SourceCodeTreeElement.prototype._handleToggleBlackboxedImageElementClick): Added.
* UserInterface/Views/SourceCodeTreeElement.css: Added.
(.tree-outline .item .status > .toggle-script-blackboxed):
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackboxed,):
(.tree-outline:focus .item.selected .status > .toggle-script-blackboxed):
(.tree-outline .item .status > .toggle-script-blackboxed.blackboxed):
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackboxed):
* UserInterface/Views/ResourceTreeElement.js:
(WI.ResourceTreeElement.prototype._updateResource):
(WI.ResourceTreeElement.prototype.updateStatus): Added.
(WI.ResourceTreeElement.prototype._updateStatus): Deleted.
Make sure that the loading indicator doesn't override the blackbox toggle.
* UserInterface/Base/Setting.js:
(WI.Setting.prototype.set value):
(WI.Setting.prototype.save): Added.
When modifying an array value, that doesn't go through `WI.Setting.prototype.set value`, so
we need a more "manual" way of saving the new value.
* UserInterface/Main.html:
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.newline): Added.
(TestHarness.prototype.expectException):
Add a special case for logging error message objects when running protocol tests.
2019-08-29 Keith Rollin <krollin@apple.com>
Update .xcconfig symbols to reflect the current set of past and future product versions.
https://bugs.webkit.org/show_bug.cgi?id=200720
<rdar://problem/54305032>
Reviewed by Alex Christensen.
Remove version symbols related to old OS's we no longer support,
ensure that version symbols are defined for OS's we do support.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:
2019-08-29 Devin Rousso <drousso@apple.com>
Web Inspector: DOMDebugger: support event breakpoints in Worker contexts
https://bugs.webkit.org/show_bug.cgi?id=200651
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
Add assertions when adding/removing DOM breakpoints or animation frame event breakpoints if
the target is a `WI.WorkerTarget`, as neither are supported by `Worker`s.
2019-08-29 Devin Rousso <drousso@apple.com>
Web Inspector: replace uses of `Array.prototype.concat` with `Array.prototype.push`
https://bugs.webkit.org/show_bug.cgi?id=201082
Reviewed by Joseph Pecoraro.
`x = x.concat(y)` is very slow, as `x` has to be fully copied in order to add `y` to it.
Introduce `Array.prototype.pushIterable`, which iterates the given `iterable` and adds each
item to the `this` array.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.get domBreakpoints):
(WI.DOMDebuggerManager.prototype.domBreakpointsInSubtree):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
* UserInterface/Models/CSSCompletions.js:
(WI.CSSCompletions):
* UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.forProperty):
(WI.CSSKeywordCompletions.forProperty.addKeywordsForName):
(WI.CSSKeywordCompletions.forFunction):
* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.recordingProgress):
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._updateStyleCascade):
(WI.DOMNodeStyles.prototype._collectStylesInCascadeOrder):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.prototype.get sourceCodeTimelines):
(WI.TimelineRecording.prototype.initializeCallingContextTrees):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype._getPropertyDescriptorsResolver):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
* UserInterface/Views/ContentBrowser.js:
(WI.ContentBrowser.prototype.get currentRepresentedObjects):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._visibleChildren):
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.get filterableData):
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
* UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
(WI.IndexedDatabaseObjectStoreContentView.prototype._fetchMoreData.processEntries):
* UserInterface/Views/NavigationItem.js:
(WI.NavigationItem.prototype.get _classNames):
* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView.prototype._updateProperties):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addResourcesForFrame):
* UserInterface/Views/OverviewTimelineView.js:
(WI.OverviewTimelineView.prototype._loadExistingRecords):
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView.prototype.get navigationItems):
* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView.prototype._perfomSearchOnKeyValuePairs):
* UserInterface/Views/ResourceSecurityContentView.js:
(WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs):
* UserInterface/Views/ScriptClusterTimelineView.js:
(WI.ScriptClusterTimelineView.prototype.get selectionPathComponents):
* UserInterface/Views/ScrubberNavigationItem.js:
(WI.ScrubberNavigationItem.prototype.get additionalClassNames):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._addGradientTokens):
(WI.SpreadsheetStyleProperty.prototype._addColorTokens.pushPossibleColorToken):
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):
(WI.SpreadsheetStyleProperty.prototype._addVariableTokens):
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selfOrDescendant):
* UserInterface/Views/View.js:
(WI.View._visitViewTreeForLayout):
2019-08-29 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION (r248873): Debugger: pressing delete on a breakpoint will also delete any resource/element parent immediately before it in the list
https://bugs.webkit.org/show_bug.cgi?id=200939
Reviewed by Joseph Pecoraro.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement.checkIfSelectionAdjustmentNeeded): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.this._breakpointsTreeOutline.ondelete.checkIfSelectionAdjustmentNeeded): Deleted.
When the `WI.TreeOutline`'s own `ondelete` is called, that means we must be handling a
delete that was _not_ handled by a `WI.TreeElement`. This means that the `selectedTreeElement`
has to be a resource/script, the `window` object, or one of the non-deletable breakpoints.
In the case of a non-deletable breakpoint, since they're never removed from their parent
`WI.TreeOutline`, we just shift the selection to the next selectable `WI.TreeElement`.
Otherwise, wait for the `WI.TreeOutline.Event.ElementRemoved` event to be fired, and adjust
the selection then based on whether the new `selectedTreeElement` is one of the "top" items,
namely the "All Exceptions", "Uncaught Exceptions", and "Assertion Failures" breakpoints.
* UserInterface/Views/BreakpointTreeElement.js:
(WI.BreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMNodeTreeElement.js:
(WI.DOMNodeTreeElement.prototype.ondelete):
* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement.prototype.ondelete):
Add `return true;` to let the parent `WI.TreeOutline` know that the delete event was handled.
This prevents the parent `WI.TreeOutline`'s own `ondelete` from being called, which would
cause a double-delete as there would be a different `selectedTreeElement`.
2019-08-29 Keith Rollin <krollin@apple.com>
Remove support for macOS < 10.13 (part 3)
https://bugs.webkit.org/show_bug.cgi?id=201224
<rdar://problem/54795934>
Reviewed by Darin Adler.
Remove symbols in WebKitTargetConditionals.xcconfig related to macOS
10.13, including WK_MACOS_1013 and WK_MACOS_BEFORE_1013, and suffixes
like _MACOS_SINCE_1013.
Also added some macOS target numbers.
* Configurations/WebKitTargetConditionals.xcconfig:
2019-08-29 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Import file pickers sometimes do not import
https://bugs.webkit.org/show_bug.cgi?id=201290
<rdar://problem/54826117>
Reviewed by Devin Rousso.
* UserInterface/Base/FileUtilities.js:
(WI.FileUtilities.importText):
(WI.FileUtilities.importJSON):
Keep the input element alive so it doesn't get garbage collected,
which makes the file chooser do nothing.
(WI.FileUtilities.save):
(WI.FileUtilities.async.readText):
Place read operations after event handlers are setup in case the
read operations can happen synchronously and events may not fire.
2019-08-28 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r249078): JavaScript autocomplete doesn't work when evaluating properties of values
https://bugs.webkit.org/show_bug.cgi?id=201226
Reviewed by Joseph Pecoraro.
r249078 modified `WI.JavaScriptRuntimeCompletionProvider` to use arrays of property names
instead of objects for completion, but a few code paths were missed.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNamesFromEvaluate):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedObjectPropertyNames): Added.
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedArrayPropertyNames):
* UserInterface/Models/CallFrame.js:
(WI.CallFrame.prototype.collectScopeChainVariableNames):
(WI.CallFrame.prototype.collectScopeChainVariableNames.propertiesCollected):
2019-08-27 Devin Rousso <drousso@apple.com>
Web Inspector: replace uses of added utility `Array.prototype.keySet` with an actual `Set`
https://bugs.webkit.org/show_bug.cgi?id=201194
Reviewed by Ross Kirsling.
They both have basically the same functionality, with one difference being that a `Set` can
work with arrays that have non-string values.
* UserInterface/Base/Utilities.js:
(Array.prototype.keySet): Deleted.
* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WI.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions):
(WI.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions.matchKeywords):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
2019-08-27 Devin Rousso <drousso@apple.com>
Web Inspector: change the styling of the special log "bubble" to match WI.ScopeBar
https://bugs.webkit.org/show_bug.cgi?id=201152
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ConsoleMessageView.css:
(.console-user-command.special-user-log > .console-message-body):
2019-08-26 Devin Rousso <drousso@apple.com>
Web Inspector: decrease horizontal padding of `WI.ScopeBar` to have more room
https://bugs.webkit.org/show_bug.cgi?id=201090
Reviewed by Joseph Pecoraro.
There's a lot of "wasted" padding space around each item that we could reuse (or "move") for
other navigation items.
* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item.scope-bar):
* UserInterface/Views/RadioButtonNavigationItem.css:
(.navigation-bar .item.radio.button.text-only):
* UserInterface/Views/ScopeBar.css:
(.scope-bar):
(body[dir=ltr] .scope-bar > li.multiple > select):
(body[dir=rtl] .scope-bar > li.multiple > select):
(.scope-bar > li.multiple > .arrows):
* UserInterface/Views/RadioButtonNavigationItem.js:
(WI.RadioButtonNavigationItem):
(WI.RadioButtonNavigationItem.prototype.update): Deleted.
There's no reason to forcibly set the `min-width` since all instances are just text.
* UserInterface/Views/AuditTestGroupContentView.js:
(WI.AuditTestGroupContentView.prototype.initialLayout):
* UserInterface/Views/AuditTestGroupContentView.css:
(.content-view.audit-test-group > header > nav:not(:empty):before): Deleted.
Remove the unnecessary "Showing: " prefix before the `WI.ScopeBar`.
* UserInterface/Views/ScopeRadioButtonNavigationItem.js: Removed.
* UserInterface/Views/ScopeRadioButtonNavigationItem.css: Removed.
These classes were never used.
* Localizations/en.lproj/localizedStrings.js:
2019-08-24 Devin Rousso <drousso@apple.com>
Web Inspector: "Copy Rule" menu item does not propagate comments properly
https://bugs.webkit.org/show_bug.cgi?id=201095
Reviewed by Joseph Pecoraro.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.commentOut):
(WI.CSSProperty.prototype.get formattedText):
Wrap the `text` in `/* ${text} */` if the `WI.CSSProperty` isn't `enabled` (e.g. commented out).
2019-08-23 Devin Rousso <drousso@apple.com>
Web Inspector: create additional command line api functions for other console methods
https://bugs.webkit.org/show_bug.cgi?id=200971
Reviewed by Joseph Pecoraro.
Expose all `console.*` functions in the command line API, since they're all already able to
be referenced via the `console` object.
Provide a simpler interface for other injected scripts to modify the command line API.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.prototype.get _commandLineAPIKeys): Added.
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.updateLastPropertyNames):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNames):
2019-08-23 Devin Rousso <drousso@apple.com>
Web Inspector: transparency checkerboard is too bright in dark mode
https://bugs.webkit.org/show_bug.cgi?id=201067
Reviewed by Joseph Pecoraro.
* UserInterface/Views/Main.css:
(@media (prefers-color-scheme: dark) :matches(img, canvas).show-grid):
* UserInterface/Views/ConsoleMessageView.css:
(.console-message-body > .show-grid):
2019-08-22 Devin Rousso <drousso@apple.com>
Web Inspector: Console: automatically select the "Evaluations" filter whenever running commands
https://bugs.webkit.org/show_bug.cgi?id=201060
Reviewed by Timothy Hatcher.
If the Console is actively being filtered (e.g. not "All"), it can be confusing to run a
command, only to not see any results. We should automatically enable the "Evaluations"
filter in addition to any other existing filters in these cases.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.didAppendConsoleMessageView):
* UserInterface/Views/ScopeBarItem.js:
(WI.ScopeBarItem.prototype.set selected):
(WI.ScopeBarItem.prototype.toggle): Added.
2019-08-22 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r248485): stack overflow when viewing a source map generated from inline content
https://bugs.webkit.org/show_bug.cgi?id=201042
<rdar://problem/54509750>
Reviewed by Antoine Quint.
In r248485, `WI.ResourceClusterContentView` was changed to `requestContent` whenever the
given resource finished loading (by listening for `WI.Resource.Event.LoadingDidFinish`).
Even though retrieving a source map's contents uses `Promise`s, in the case that the content
was inlined in the "original" source code, the code path would mark the source map as being
finished (which would fire a `WI.Resource.Event.LoadingDidFinish`) _before_ it could return
a `Promise`, which would've been cached (`WI.SourceCode.prototype.requestContent`) and
preventend any reentrancy.
Wrapping the inline code path in a `Promise.resolve()` gives the `WI.SourceCode` a chance to
cache the `Promise` before any events are fired.
* UserInterface/Models/SourceMapResource.js:
(WI.SourceMapResource.prototype.requestContentFromBackend):
2019-08-22 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: console.dir should expand objects
https://bugs.webkit.org/show_bug.cgi?id=152039
<rdar://problem/23816853>
Reviewed by Joseph Pecoraro.
Expand objects logged by console.dir but keep them collapsed when logged by console.log.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
2019-08-22 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Cleanup some unused code
https://bugs.webkit.org/show_bug.cgi?id=201041
Reviewed by Alex Christensen.
* UserInterface/Views/CPUUsageCombinedView.css:
(.cpu-usage-combined-view > .graph > .stacked-area-chart):
* UserInterface/Views/CPUUsageCombinedView.js:
(WI.CPUUsageCombinedView):
* UserInterface/Views/MediaTimelineOverviewGraph.js:
(WI.MediaTimelineOverviewGraph):
2019-08-22 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Provide an engineering option to log protocol traffic as text
https://bugs.webkit.org/show_bug.cgi?id=200969
Reviewed by Devin Rousso.
* UserInterface/Base/Setting.js:
* UserInterface/Protocol/LoggingProtocolTracer.js:
(WI.LoggingProtocolTracer.prototype._processEntry):
(WI.LoggingProtocolTracer):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createDebugSettingsView):
2019-08-21 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: RTL: DOM outline in Elements tab should be LTR
https://bugs.webkit.org/show_bug.cgi?id=200601
Reviewed by Timothy Hatcher.
Make DOM outlines in Console and Elements tab always LTR,
and unsure that Left and Right arrow keys continue working correctly.
* UserInterface/Base/Main.js:
(WI.resolveLayoutDirectionForElement): Added.
The existing WI.resolvedLayoutDirection function returns the value of the root DOM element.
The newly added resolveLayoutDirectionForElement function returns the correct value for any element,
including elements with `dir=ltr` inside of `<body dir=rtl>`.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded):
(.tree-outline.dom li:not(.editing)):
(.tree-outline.dom li.editing):
(.tree-outline.dom li .pseudo-class-indicator):
(.tree-outline.dom.single-node li):
(.tree-outline.dom li.parent):
(.tree-outline.dom li .html-tag.close):
(.tree-outline.dom li.parent::before):
(.tree-outline.dom li.parent.shadow::after):
Remove RTL logic.
* UserInterface/Views/DOMTreeOutline.js:
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._treeKeyDown):
Make Left and Right arrow keys work correctly for LTR DOM outlines inside of the global RTL.
2019-08-21 Devin Rousso <drousso@apple.com>
Web Inspector: Page: re-add enable/disable after r248454
https://bugs.webkit.org/show_bug.cgi?id=200947
Reviewed by Joseph Pecoraro.
We shouldn't design the agent system with only Web Inspector in mind. Other clients may want
to have different functionality, not being told about frames creation/updates/destruction.
In these cases, we should have graceful error message failures for other agents that rely on
the Page agent.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.initializeTarget):
2019-08-21 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: increase the filter bar's width when it's focused if a resource type filter is active
https://bugs.webkit.org/show_bug.cgi?id=200940
Reviewed by Joseph Pecoraro.
* UserInterface/Views/FilterBar.js:
(WI.FilterBar.prototype._handleFilterChanged):
(WI.FilterBar.prototype.get indicatingProgress): Deleted.
(WI.FilterBar.prototype.set indicatingProgress): Deleted.
(WI.FilterBar.prototype.get indicatingActive): Deleted.
(WI.FilterBar.prototype.set indicatingActive): Deleted.
If escape is pressed when the <input> is empty, unfocus (blur) the <input>.
Drive-by: remove unused/unnecessary functions.
* UserInterface/Views/FilterBar.css:
(.filter-bar > input[type="search"]):
(:matches(.filter-bar, .search-bar) > input[type="search"]): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:matches(:focus, :not(:placeholder-shown))): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]::-webkit-search-decoration): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]::-webkit-search-results-button): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]::placeholder): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:matches(:not(:focus), :placeholder-shown)::-webkit-search-cancel-button): Added.
(:matches(.filter-bar, .search-bar) > .navigation-bar + input[type="search"]): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:focus): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"] + :empty): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:focus ~ *): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Added.
(.filter-bar > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Deleted.
(.filter-bar > .navigation-bar + input[type="search"]): Deleted.
(.filter-bar > input[type="search"]::placeholder): Deleted.
(.filter-bar > input[type="search"]:focus): Deleted.
(.filter-bar > input[type="search"]::-webkit-search-decoration): Deleted.
(.filter-bar.active > input[type="search"]::-webkit-search-decoration): Deleted.
(.filter-bar.indicating-progress > input[type="search"]::-webkit-search-decoration): Deleted.
(.filter-bar > input[type="search"] + .navigation-bar:empty): Deleted.
When the <input> is `:focus`, hide the following `WI.NavigationBar` (if it's being used) so
that there's more room to show the filter text.
Drive-by: fix background, border, and text color styling when `:focus`.
* UserInterface/Views/SearchBar.css:
(.search-bar > input[type="search"]):
(.search-bar > input[type="search"]::placeholder): Deleted.
(.search-bar > input[type="search"]:focus): Deleted.
(.search-bar > input[type="search"]:not(:placeholder-shown)): Deleted.
(.search-bar > input[type="search"]:placeholder-shown::-webkit-search-cancel-button): Deleted.
(@media (prefers-color-scheme: dark)): Deleted.
(:matches(.search-bar, .filter-bar) > input[type="search"],): Deleted.
(:matches(.search-bar, .filter-bar) > input[type="search"]::placeholder): Deleted.
(:matches(.search-bar, .filter-bar) > input[type="search"]:focus): Deleted.
* UserInterface/Views/SearchSidebarPanel.css:
(.sidebar > .panel.navigation.search > .search-bar):
(.sidebar > .panel.navigation.search > .search-bar > input[type="search"]):
(.sidebar > .panel.navigation.search > .search-bar > .search-settings): Added.
(.sidebar > .panel.navigation.search > .search-bar > input[type="search"]::-webkit-search-results-button): Deleted.
* UserInterface/Views/Toolbar.css:
(.toolbar .search-bar > input[type="search"]::-webkit-textfield-decoration-container): Deleted.
Move shared styles to FilterBar.css as `WI.FilterBar` are more common.
* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark) :root):
Expose some CSS variables in light mode that were previously only defined in dark mode.
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._updateFilteredEntries):
(WI.NetworkTableContentView.prototype._updateURLFilterActiveIndicator): Deleted.
* UserInterface/Images/FilterFieldActiveGlyph.svg: Removed.
2019-08-21 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove unnecessary properties on SVGs
https://bugs.webkit.org/show_bug.cgi?id=200968
Reviewed by Devin Rousso.
* UserInterface/Images/EventPause.svg:
* UserInterface/Images/EventPlay.svg:
* UserInterface/Images/EventProcessing.svg:
* UserInterface/Images/EventStop.svg:
* UserInterface/Images/MediaInstrument.svg:
2019-08-20 Devin Rousso <drousso@apple.com>
Web Inspector: Implement `queryHolders` Command Line API
https://bugs.webkit.org/show_bug.cgi?id=200458
Reviewed by Joseph Pecoraro.
Call `queryHolders(object)` from the Console to return an array of objects that strongly
reference the given `object`. This could be very useful for finding JavaScript "leaks".
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
2019-08-20 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Address a few Esprima issues preventing pretty printing of resources
https://bugs.webkit.org/show_bug.cgi?id=200935
Reviewed by Timothy Hatcher.
Address a few Esprima issues:
Issue #1991 - Failure to parse template literal with destructuring assignment expression
https://github.com/jquery/esprima/issues/1991
Issue #1920 - Invalid Left Hand Side in for-in
https://github.com/jquery/esprima/issues/1920
* UserInterface/External/Esprima/esprima.js:
2019-08-20 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Update CodeMirror to support numeric separators in JavaScript numbers
https://bugs.webkit.org/show_bug.cgi?id=200942
Cherry-pick a few CodeMirror changes:
[javascript mode] Support numeric separators
https://github.com/codemirror/CodeMirror/commit/beab8ed123683416bfec934df73d13401ec086b5#diff-9812850bb71d31e8dd60b476abb2bae8
[javascript mode] fix tokenizing of underscore properties
https://github.com/codemirror/CodeMirror/commit/463ea2c34ab442c0cae1d9732305219ca9b04dfe#diff-9812850bb71d31e8dd60b476abb2bae8
Reviewed by Timothy Hatcher.
* UserInterface/External/CodeMirror/javascript.js:
2019-08-20 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: move the resource type scope bar to be next to the filter
https://bugs.webkit.org/show_bug.cgi?id=200891
Reviewed by Joseph Pecoraro.
It's odd to have UI for controlling the active filters in two different places. Move the
resource type `WI.ScopeBar` to the filter bar area, and "promote" the resource grouping mode
items from a context menu to an always visible `WI.ScopeBar` in the space left by the
resource type `WI.ScopeBar` (switching between grouping modes quickly is a useful workflow).
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.hasCustomFilters):
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeScopeBarSelectionChanged): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
(WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu.addOption): Deleted.
(WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .filter-bar .sources-resource-type-scope-bar.default-item-selected:not(:hover)): Added.
(.sidebar > .panel.navigation.sources > .filter-bar .sources-resource-type-scope-bar.default-item-selected:hover): Added.
* UserInterface/Views/FilterBar.js:
(WI.FilterBar.prototype.addFilterNavigationItem): Added.
(WI.FilterBar.prototype.addFilterBarButton):
* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item):
(.filter-bar > .navigation-bar > .item.button): Added.
(.filter-bar > .navigation-bar > .item.scope-bar): Added.
(.filter-bar > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Added.
Provide a way to add arbitrary `WI.NavigationItem` to the contained `WI.NavigationBar`.
Slightly adjust the spacing of the items (depending on their type) in the `WI.NavigationBar`
so they are all centered.
* UserInterface/Views/ScopeBar.css:
(.scope-bar):
(.scope-bar > li):
(.scope-bar > li::after):
(.scope-bar > li:not(.selected):hover): Added.
(body[dir=ltr] .scope-bar > li.multiple > select):
(body[dir=rtl] .scope-bar > li.multiple > select):
(.scope-bar > li:not(.selected):hover::after): Added.
Introduce CSS variables for `margin`, `padding`, and `opacity` that callers can override to
customize the appearance of the `WI.ScopeBar`.
* Localizations/en.lproj/localizedStrings.js:
2019-08-20 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Sources: Give Origins their own icon in the Sources sidebar
https://bugs.webkit.org/show_bug.cgi?id=200683
<rdar://problem/54269044>
Reviewed by Devin Rousso.
* UserInterface/Images/Origin.svg: Added.
* UserInterface/Main.html:
New resources.
* UserInterface/Views/FolderIcon.css:
(.origin-icon .icon):
Light and Dark appearances for Origin icons.
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/OriginTreeElement.js:
(WI.OriginTreeElement):
Very much like a folder with different classes.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
(WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
Use OriginTreeElement in a few places.
2019-08-20 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Support for JavaScript BigInt
https://bugs.webkit.org/show_bug.cgi?id=180731
<rdar://problem/36298748>
Reviewed by Devin Rousso.
* UserInterface/External/CodeMirror/javascript.js:
(expressionAllowed):
Cherry-pick BigInt JavaScript mode support from CodeMirror:
https://github.com/codemirror/CodeMirror/pull/5411
* UserInterface/Images/TypeBigInt.svg: Added.
* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/CodeMirrorAdditions.js:
* UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
(.cm-s-default .cm-number.cm-bigint,):
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property.bigint > .icon):
* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot .icon.bigint):
Style BigInt similiar but different from numbers but with
a [B] icon instead of [N].
* UserInterface/Views/FormattedValue.css:
(.formatted-bigint):
* UserInterface/Views/FormattedValue.js:
(WI.FormattedValue.hasSimpleDisplay):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
(WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
Simple value formatting for the new type.
* UserInterface/Models/TypeSet.js:
(WI.TypeSet):
(WI.TypeSet.prototype.get primitiveTypeNames):
* UserInterface/Views/TypeTokenView.css:
(.type-token-bigint):
* UserInterface/Views/TypeTokenView.js:
(WI.TypeTokenView.prototype._displayTypeName):
(WI.TypeTokenView):
New type handling for the Type profiler.
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject):
(WI.RemoteObject.createBigIntFromDescriptionString):
* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WI.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
BigInt values are not tied to a GlobalObject, so do some special casing
in the Heap output (like Strings) so we get a preview.
2019-08-20 Devin Rousso <drousso@apple.com>
Web Inspector: Use URL constructor to better handle all kinds of URLs
https://bugs.webkit.org/show_bug.cgi?id=165155
Reviewed by Joseph Pecoraro.
* UserInterface/Base/URLUtilities.js:
(parseURL):
2019-08-19 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: add a global breakpoint for pausing in the next microtask
https://bugs.webkit.org/show_bug.cgi?id=200652
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.prototype.get allMicrotasksBreakpoint): ADded.
(WI.DebuggerManager.prototype.isBreakpointSpecial):
(WI.DebuggerManager.prototype._pauseReasonFromPayload):
(WI.DebuggerManager.prototype._breakpointDisabledStateDidChange):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
(WI.DebuggerSidebarPanel.prototype._addBreakpoint):
(WI.DebuggerSidebarPanel.prototype._addTreeElement):
(WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
* UserInterface/Views/BreakpointTreeElement.css:
(.breakpoint-microtask-icon .icon): Added.
* UserInterface/Images/Microtask.svg: Added.
* UserInterface/Base/Setting.js:
* Localizations/en.lproj/localizedStrings.js:
2019-08-19 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r248682): Elements: Computed: go-to arrows in the Variables section are misaligned
https://bugs.webkit.org/show_bug.cgi?id=200841
Reviewed by Joseph Pecoraro.
The Variables section uses a different CSS class since it's identifier changed in r248682.
* UserInterface/Views/ComputedStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables)): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property:not(:hover) .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property .go-to-arrow): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property:hover .go-to-arrow): Deleted.
2019-08-19 Devin Rousso <drousso@apple.com>
Web Inspector: have more aggressive checks for dataURLs provided to `console.screenshot`
https://bugs.webkit.org/show_bug.cgi?id=200747
Reviewed by Joseph Pecoraro.
Always send any /data:*+/ strings to the frontend and have it render there. If that doesn't
work, have the frontend "spoof" an error message look and feel.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
* Localizations/en.lproj/localizedStrings.js:
2019-08-19 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: RTL: Network headers values should be preserved
https://bugs.webkit.org/show_bug.cgi?id=200873
Reviewed by Joseph Pecoraro.
Replace spans with bdi elements, which have `unicode-bidi: isolate` User Agent style.
This works well with both LTR and RTL values.
* UserInterface/Views/ResourceDetailsSection.js:
(WI.ResourceDetailsSection.prototype.appendKeyValuePair):
Drive-by: remove unnecessary if/else statement and use `append` instead.
2019-08-19 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Debugger: pressing delete when the all/uncaught exceptions breakpoint is selected should select the next tree element
https://bugs.webkit.org/show_bug.cgi?id=200876
Reviewed by Joseph Pecoraro.
Removing the `return true;` from the various `WI.TreeElement` breakpoint classes allows the
owner `WI.TreeOutline` to also handle the delete event. In the Debugger/Sources navigation
sidebar, the owner `WI.TreeOutline` checks to see if the currently selected `WI.TreeElement`
is one of the "top" items ("All Exceptions", "Uncaught Exceptions", "Assertion Failures")
and if so, select the next tree element (if able) instead of the previous one.
This is a preferred experience because the "top" items can only be disabled, not deleted, so
trying to delete them wouldn't actually change the selection. They should only ever be
selected if there's nothing else that can be selected.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement.checkIfSelectionAdjustmentNeeded): Added.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.checkIfSelectionAdjustmentNeeded): Added.
* UserInterface/Views/BreakpointTreeElement.js:
(WI.BreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMNodeTreeElement.js:
(WI.DOMNodeTreeElement.prototype.ondelete):
* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement.prototype.ondelete):
2019-08-19 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: don't show the All Requests breakpoint by default
https://bugs.webkit.org/show_bug.cgi?id=200892
Reviewed by Joseph Pecoraro.
* UserInterface/Base/Setting.js:
2019-08-17 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: gear icons moves to 2nd line when sidebar is narrow
https://bugs.webkit.org/show_bug.cgi?id=198017
Reviewed by Joseph Pecoraro.
* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar):
(WI.NavigationBar.prototype.layout):
(WI.NavigationBar.prototype.layout.forceItemHidden): Added.
(WI.NavigationBar.prototype.layout.isDivider): Added.
(WI.NavigationBar.prototype.layout.calculateVisibleItemWidth): Added.
(WI.NavigationBar.prototype.needsLayout): Deleted.
(WI.NavigationBar.prototype.sizeDidChange): Deleted.
(WI.NavigationBar.prototype._updateContent): Deleted.
(WI.NavigationBar.prototype._updateContent.forceItemHidden): Deleted.
(WI.NavigationBar.prototype._updateContent.isDivider): Deleted.
(WI.NavigationBar.prototype._updateContent.calculateVisibleItemWidth): Deleted.
Reset the cached `_minimumWidth` whenever updating in `layout()`.
* UserInterface/Views/NavigationItem.js:
(WI.NavigationItem.prototype.get width):
(WI.NavigationItem.prototype.update): Added.
(WI.NavigationItem.prototype.updateLayout): Deleted.
(WI.NavigationItem.prototype.get totalMargin): Added.
* UserInterface/Views/ButtonNavigationItem.js:
(WI.ButtonNavigationItem.prototype.get totalMargin): Added.
* UserInterface/Views/ButtonNavigationItem.css:
* UserInterface/Views/TextNavigationItem.js:
(WI.TextNavigationItem.prototype.get totalMargin): Added.
* UserInterface/Views/TextNavigationItem.css:
`Element.prototype.getBoundingClientRect` doesn't include the `margin` box of an element.
Rather than create a CSS variable and parse a computed style, save the total `margin` amount
to a getter that can then be added when computing the minimum width.
* UserInterface/Views/Sidebar.js:
(WI.Sidebar):
(WI.Sidebar.prototype._recalculateWidth):
* UserInterface/Views/FlexibleSpaceNavigationItem.js:
(WI.FlexibleSpaceNavigationItem.prototype.update): Added.
(WI.FlexibleSpaceNavigationItem.prototype.updateLayout): Deleted.
* UserInterface/Views/GroupNavigationItem.js:
(WI.GroupNavigationItem.prototype.update): Added.
(WI.GroupNavigationItem.prototype.updateLayout): Deleted.
* UserInterface/Views/HierarchicalPathNavigationItem.js:
(WI.HierarchicalPathNavigationItem.prototype.update): Added.
(WI.HierarchicalPathNavigationItem.prototype.updateLayout): Deleted.
* UserInterface/Views/RadioButtonNavigationItem.js:
(WI.RadioButtonNavigationItem.prototype.update): Added.
(WI.RadioButtonNavigationItem.prototype.updateLayout): Deleted.
Rename `updateLayout` to `update` so it doesn't clash with `WI.View` naming.
* UserInterface/Views/SidebarNavigationBar.js: Removed.
* UserInterface/Main.html:
* UserInterface/Views/NavigationBar.css:
(.navigation-bar .item): Added.
(.navigation-bar .item, .sidebar-navigation-bar > .holder .item): Deleted.
(.sidebar-navigation-bar): Deleted.
(.sidebar-navigation-bar .holder): Deleted.
Remove unnecessary class.
2019-08-16 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Syntax Highlight more CSS media queries
https://bugs.webkit.org/show_bug.cgi?id=200824
Reviewed by Devin Rousso.
* UserInterface/Views/CodeMirrorAdditions.js:
Special case CSS "error" tokenized values from CodeMirror inside @ rules
to treat some as properties.
2019-08-16 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: JavaScript formatting of single statement arrow function can be poor
https://bugs.webkit.org/show_bug.cgi?id=200800
Reviewed by Ross Kirsling.
* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._isLikelyToHaveNewline):
(EsprimaFormatter.prototype._handleTokenAtNode):
Better heuristic for single statement arrow functions.
2019-08-16 Devin Rousso <drousso@apple.com>
Web Inspector: there should be an opposite icon for Eye.svg when we want to hide things instead of showing them
https://bugs.webkit.org/show_bug.cgi?id=200736
Reviewed by Joseph Pecoraro.
We currently use Eye.svg for disabling, or turning "off", Shader Programs, but it's not very
clear that clicking on the eye (which looks like "show me this", not "hide this") will do
that. Furthermore, a greyed out version also isn't clear that the Shader Program is disabled,
instead making the user think that the disable toggle is somehow "not working".
The new hide icon is clearer, as it uses a strikethrough, rather than some shading/greying.
* UserInterface/Views/ShaderProgramTreeElement.css:
(.item.shader-program .status > img):
(.item.shader-program.disabled:matches:hover .status > img): Added.
(.item.shader-program.disabled > :not(.status)): Added.
(.item.shader-program.disabled > *): Deleted.
* UserInterface/Images/Hide.svg: Added.
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property .getter):
* UserInterface/Images/Show.svg: Renamed from UserInterface/Images/Eye.svg.
2019-08-16 Devin Rousso <drousso@apple.com>
Web Inspector: rename "Invalid Characters" to "Invisible Characters" for clarity
https://bugs.webkit.org/show_bug.cgi?id=200808
Reviewed by Joseph Pecoraro.
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
* UserInterface/Base/Main.js:
(setInvisibleCharacterClassName): Added.
(setInvalidCharacterClassName): Deleted.
* UserInterface/Views/CodeMirrorOverrides.css:
(.show-invisible-characters .CodeMirror .cm-invalidchar): Added.
(.show-invalid-characters .CodeMirror .cm-invalidchar): Deleted.
* Localizations/en.lproj/localizedStrings.js:
2019-08-16 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: RTL: Console should be always LTR
https://bugs.webkit.org/show_bug.cgi?id=200482
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ConsoleCommandView.js:
(WI.ConsoleCommandView.prototype.render):
* UserInterface/Views/ConsoleMessageView.css:
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
Make console messages always LTR.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._keyDown):
Since the console is always LTR now, we can remove code that flips left and right
arrow keys.
* UserInterface/Views/ObjectTreeView.css:
JS objects should always be LTR.
* UserInterface/Views/TreeElement.js:
Look at "direction" CSS property because Element's text direction can be LTR even
when `WI.resolvedLayoutDirection()` is RTL.
(WI.TreeElement.prototype.isEventWithinDisclosureTriangle):
* UserInterface/Views/TreeOutline.css:
(body[dir=ltr] .tree-outline .item :matches(.disclosure-button, .icon),):
(body[dir=rtl] [dir=ltr] .tree-outline .item .disclosure-button):
2019-08-16 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: setting a breakpoint on a specific listener should enable the event listener
https://bugs.webkit.org/show_bug.cgi?id=200551
Reviewed by Joseph Pecoraro.
* UserInterface/Views/EventListenerSectionGroup.js:
(WI.EventListenerSectionGroup):
2019-08-15 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Update Esprima to support modern JavaScript language features
https://bugs.webkit.org/show_bug.cgi?id=200796
Reviewed by Ross Kirsling.
Use a fork of Esprima to support modern JavaScript language features
while going through the process to upstream support:
ES2018 Feature: Async Iteration (for-await-of)
https://github.com/jquery/esprima/issues/1990
ES2019 Feature: Numeric Separator
https://github.com/jquery/esprima/issues/1989
ES2019 Feature: Optional catch binding
https://github.com/jquery/esprima/issues/1953
ES2020 Feature: BigInt
https://github.com/jquery/esprima/issues/1988
ESTree compatible AST changes are summarized as:
- CatchClause `param` property is now nullable
- ForOfStatement now has a boolean `await` property
- Literal can be a `"bigint"` type (works if the environment has BigInt or not)
The pretty printer only needed to have additional handling for `for-await-of`.
* UserInterface/External/Esprima/esprima.js:
New version. Typescript output expects a modern JavaScript environment
instead of just ES6.
* Tools/Formatting/index.html:
Update the formatting tool for easier use in case of errors.
* UserInterface/Models/ScriptSyntaxTree.js:
(WI.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.passOrFail):
Convenience for pass/fail with the same message based on a condition.
* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._handleTokenAtNode):
Ensure a space after `await` in `for await` syntax.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r244268): "Show Scope Chain on pause" setting has no effect
https://bugs.webkit.org/show_bug.cgi?id=200797
Reviewed by Joseph Pecoraro.
* UserInterface/Views/DebuggerTabContentView.js:
(WI.DebuggerTabContentView.prototype.showDetailsSidebarPanels):
* UserInterface/Views/SourcesTabContentView.js:
(WI.SourcesTabContentView.prototype.showDetailsSidebarPanels):
When the sidebar panel isn't visible `parentSidebar` is `null`. Use `WI.DetailsSidebar` instead.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'this._resource.initiatorSourceCodeLocation')
https://bugs.webkit.org/show_bug.cgi?id=200798
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WI.ResourceDetailsSidebarPanel.prototype.set resource):
(WI.ResourceDetailsSidebarPanel.prototype.layout):
Cancel the `Throttler` whenever the `_resource` is updated, as otherwise the `Throttler` may
fire later on with an unset `_resource`.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: provide a way to create an arbitrary Inspector Style Sheet
https://bugs.webkit.org/show_bug.cgi?id=200425
Reviewed by Joseph Pecoraro.
Right now, the only way to create an Inspector Style Sheet is by creating a new rule in the
Styles sidebar of the Elements Tab. This is unnecessarily restrictive, especially for those
who don't use the Elements tab.
Add a + button after the filter bar in the Navigation sidebar. Clicking on the + button will
show a menu with the following (more likely to be added later):
- Inspector Style Sheet
- Frames (if there are subframes)
- (name of subframe)
- Inspector Style Sheet
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject): Added.
(WI.SourcesNavigationSidebarPanel.prototype._filterByResourcesWithIssues): Added.
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._updateMainFrameTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addResource):
(WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateResourceContextMenu): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
(WI.SourcesNavigationSidebarPanel.prototype._handleFrameWasAdded): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleMainFrameDidChange): Deleted.
* UserInterface/Views/GeneralTreeElement.js:
(WI.GeneralTreeElement.prototype.createFoldersAsNeededForSubpath):
Drive-by: sort `WI.ResourceTreeElement`s alongside `WI.FolderTreeElement`s for easier readability.
* UserInterface/Views/FrameTreeElement.js:
(WI.FrameTreeElement.prototype.onpopulate):
Add all `inspectorStyleSheetsForFrame` instead of just the preferred one so that they all
are visible/selectable for editing.
* UserInterface/Views/FilterBar.js:
(WI.FilterBar):
* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item):
(.filter-bar > input[type="search"]):
(.filter-bar > .navigation-bar + input[type="search"]): Added.
(.filter-bar > input[type="search"] + .navigation-bar:empty): Added.
Move the position of the filter bar buttons to be after the filter bar itself, so that other
parents can add action items before the filter bar to keep a consistent positioning.
- to the left of the filter bar are action items (e.g. "+")
- the filter bar itself
- to the right of the filter bar are filter buttons (e.g. "filter by resoure with issue")
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.get frames):
Drive-by: use `Array.from`, instead of `[...map.values()]`.
* UserInterface/Models/Frame.js:
(WI.Frame.prototype.get url):
(WI.Frame.prototype.get urlComponents): Added.
* UserInterface/Base/URLUtilities.js.js:
(parseURL):
Calculate and include the `origin` string with the output.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype.preferredInspectorStyleSheetForFrame):
Remove `doNotCreateIfMissing` now that the last caller has been removed.
* Localizations/en.lproj/localizedStrings.js:
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: CodeMirror still inserts a tab even when "Prefer indent using" is set to "Spaces"
https://bugs.webkit.org/show_bug.cgi?id=200770
Reviewed by Ross Kirsling.
* UserInterface/Views/CodeMirrorAdditions.js:
Remap the `insertTab` command to use `insertSoftTab` when "Prefer indent using" is set to
"Spaces" so that CodeMirror inserts the number of spaces that would match a tab ("\t") being
inserted at the same spot.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: the "No Filter Results" message sits on top of all of the content, preventing any interaction
https://bugs.webkit.org/show_bug.cgi?id=200755
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > .resources-container): Added.
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container)): Added.
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .call-stack-container):
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .breakpoints-container):
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .resources-container): Added.
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources)): Deleted.
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .resources): Deleted.
Wrap the resources `WI.TreeOutline` in a <div> so the empty message placeholder that gets
inserted after it can be constrained to the size of the `WI.TreeOutline`.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: Layers: background of 3D area doesn't update when transitioning to/from Dark mode
https://bugs.webkit.org/show_bug.cgi?id=200775
Reviewed by Ross Kirsling.
* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView.prototype.initialLayout):
Add a `matchMedia` listener for `(prefers-color-scheme: dark)` and update the clear color
of the WebGL renderer whenever it changes.
* UserInterface/Views/ErrorObjectView.css:
(@media (prefers-color-scheme: dark)): Added.
(@media (prefers-dark-interface)): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(@media (prefers-color-scheme: dark)): Added.
(@media (prefers-dark-interface)): Deleted.
Drive-by: replace older `prefers-dark-interface` with modern `prefers-color-scheme: dark`.
2019-08-15 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Update Esprima to trunk (minor fixes)
https://bugs.webkit.org/show_bug.cgi?id=200691
<rdar://problem/54276170>
Rubber-stamped by Devin Rousso.
* UserInterface/External/Esprima/esprima.js:
Updated to jquery/esprima@5e55171feb5adbc2b1d28ef4b2628d5ea9af0848.
* UserInterface/Models/ScriptSyntaxTree.js:
(WI.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration.gatherIdentifiers):
(WI.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration):
(WI.ScriptSyntaxTree.prototype._recurse):
(WI.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
(WI.ScriptSyntaxTree):
* UserInterface/Workers/Formatter/ESTreeWalker.js:
(ESTreeWalker.prototype._walkChildren):
(ESTreeWalker):
* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._handleTokenAtNode):
- SpreadProperty => SpreadElement.
- RestProperty => RestElement.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: Content request failed.
https://bugs.webkit.org/show_bug.cgi?id=200704
<rdar://problem/54279372>
Reviewed by Brian Burg.
* UserInterface/Models/WebSocketResource.js:
(WI.WebSocketResource.prototype.requestContentFromBackend): Added.
Add an "assert not reached", as WebSocket resources don't really have "content", instead
having a list of send/receive frames.
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView):
Don't attempt to request the content of any `WI.WebSocketResource` for the reason above.
2019-08-14 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Computed: move the Box Model section to the top
https://bugs.webkit.org/show_bug.cgi?id=200555
Reviewed by Joseph Pecoraro.
For nodes that use a lot of different CSS properties, having the Box Model section all the
way at the bottom isn't as useful for taking a quick glance at the node's box model data.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
2019-08-14 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Computed: the collapsed state of the Variables section should be separate from the collapsed state of the Properties section
https://bugs.webkit.org/show_bug.cgi?id=200725
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
Use a different identifier string for the Variable section so it preserves its own collapsed
collapsed state independent of the Properties section.
2019-08-14 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Computed: the background of the Properties/Variables sections should match the Box Model section when expanded
https://bugs.webkit.org/show_bug.cgi?id=200724
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ComputedStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style > .content > .computed > .details-section:not(.collapsed) > :matches(.header, .content)): Added.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties): Added.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property:hover .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) > .content): Added.
(.details-section:matches(.computed-style-properties, .computed-style-box-model):not(.collapsed) > :matches(.header, .content)): Deleted.
(.computed-style-properties): Deleted.
(.computed-style-properties .property .go-to-arrow): Deleted.
(.computed-style-properties .property:hover .go-to-arrow): Deleted.
(.details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)): Deleted.
(.details-section.computed-style-properties > .content): Deleted.
(@media (prefers-color-scheme: dark)): Deleted.
Use more specific selectors to match overall Web Inspector style.
* UserInterface/Views/ComputedStyleSection.css:
(.computed-style-section .computed-property-item.expanded):
Darken the background of any expanded computed property in light mode.
2019-08-13 Joseph Pecoraro <pecoraro@apple.com>
Uncaught Exception: content.isJSON is not a function selecting image resource
https://bugs.webkit.org/show_bug.cgi?id=200680
Reviewed by Devin Rousso.
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype._canUseJSONContentViewForContent):
Protect against non-string data, such as Blob response content.
2019-08-13 Devin Rousso <drousso@apple.com>
Web Inspector: Styles: show @supports CSS groupings
https://bugs.webkit.org/show_bug.cgi?id=200419
<rdar://problem/53971948>
Reviewed by Joseph Pecoraro.
* UserInterface/Models/CSSGrouping.js: Renamed from Source/WebInspectorUI/UserInterface/Models/CSSMedia.js.
(WI.CSSGrouping):
(WI.CSSGrouping.prototype.get type):
(WI.CSSGrouping.prototype.get text):
(WI.CSSGrouping.prototype.get sourceCodeLocation):
(WI.CSSGrouping.prototype.get isMedia): Added.
(WI.CSSGrouping.prototype.get isSupports): Added.
(WI.CSSGrouping.prototype.get prefix): Added.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.get groupings): Added.
(WI.CSSStyleDeclaration.prototype.generateCSSRuleString):
(WI.CSSStyleDeclaration.prototype.get mediaList): Deleted.
* UserInterface/Models/CSSRule.js:
(WI.CSSRule):
(WI.CSSRule.prototype.get groupings): Added.
(WI.CSSRule.prototype.update):
(WI.CSSRule.prototype._selectorResolved):
(WI.CSSRule.prototype.get mediaList): Deleted.
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._parseRulePayload):
(WI.DOMNodeStyles.prototype.rulesForSelector): Deleted.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleEditorFilterApplied):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._createMediaHeader): Deleted.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration :matches(.header, .header-groupings)): Added.
(.spreadsheet-css-declaration :matches(.header, .header-groupings):first-child): Added.
(.spreadsheet-css-declaration .header-groupings > .grouping): Added.
(.spreadsheet-css-declaration :matches(.header, .header-media)): Deleted.
(.spreadsheet-css-declaration :matches(.header, .header-media):first-child): Deleted.
(.spreadsheet-css-declaration .media-label): Deleted.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.protocolGroupingTypeToEnum): Added.
(WI.CSSManager.protocolMediaSourceToEnum): Deleted.
* UserInterface/Main.html:
* UserInterface/Test.html:
2019-08-12 Devin Rousso <drousso@apple.com>
REGRESSION(r248391): Web Inspector: changing Layout Direction Debug setting no longer adds dir="ltr" to body element
https://bugs.webkit.org/show_bug.cgi?id=200564
Reviewed by Joseph Pecoraro.
`WI.resolvedLayoutDirection` was called before `WI.runBootstrapOperations`, which is what
instantiates `WI.showDebugUISetting`. Without it, `WI.resolvedLayoutDirection` will ignore
the value of `WI.settings.debugLayoutDirection` and instead use the system.
Moving the instantiation of `WI.showDebugUISetting` outside `WI.runBootstrapOperations`
allows the setting to be created when the Bootstrap.js script is loaded, rather than after
the `DOMContentLoaded` event is fired. This means that it's guaranteed to exist before any
interface/view code runs.
* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):
2019-08-12 Devin Rousso <drousso@apple.com>
Web Inspector: remove WI.DeprecatedRemoteObjectProperty
https://bugs.webkit.org/show_bug.cgi?id=200549
Reviewed by Joseph Pecoraro.
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.deprecatedGetOwnProperties): Deleted.
(WI.RemoteObject.prototype.deprecatedGetAllProperties): Deleted.
(WI.RemoteObject.prototype.deprecatedGetDisplayableProperties): Deleted.
(WI.RemoteObject.prototype._deprecatedGetProperties): Deleted.
(WI.RemoteObject.prototype._deprecatedGetPropertiesResolver): Deleted.
(WI.DeprecatedRemoteObjectProperty): Deleted.
(WI.DeprecatedRemoteObjectProperty.prototype.fromPrimitiveValue): Deleted.
* UserInterface/Models/CallFrame.js:
(WI.CallFrame.prototype.collectScopeChainVariableNames):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype._refreshProperties):
2019-08-12 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r248201): DOMDebugger: unable to add event breakpoint when All Events breakpoint is enabled
https://bugs.webkit.org/show_bug.cgi?id=200561
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.addEventBreakpoint):
(WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
2019-08-12 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: DOMDebugger: breakpoints are forcibly enabled when resolving DOM breakpoints for newly added nodes
https://bugs.webkit.org/show_bug.cgi?id=200639
Reviewed by Joseph Pecoraro.
Since DOM breakpoints revolve around a given DOM node, we attempt to restore DOM breakpoints
whenever new nodes are added by matching them to the path of the DOM breakpoint. When doing
so, we should be in a "temporarily restoring breakpoints" mode so that we don't forcibly
enable all breakpoints.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL):
(WI.DOMDebuggerManager.prototype._nodeInserted):
2019-08-12 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: add space between media query and style icon
https://bugs.webkit.org/show_bug.cgi?id=200623
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration .header:not(:first-child), .spreadsheet-css-declaration .header:not(.editing-selector) .selector, .spreadsheet-css-declaration.has-icon .header.editing-selector .selector): Added.
(.spreadsheet-css-declaration .header.editing-selector .selector): Deleted.
Ensure the selector field doesn't shift vertically when entering/exiting editing mode.
2019-08-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Address some ESLint warnings
https://bugs.webkit.org/show_bug.cgi?id=200598
Reviewed by Devin Rousso.
* UserInterface/Base/Utilities.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Models/DOMNodeStyles.js:
* UserInterface/Models/LayoutTimelineRecord.js:
* UserInterface/Models/ServerTimingEntry.js:
* UserInterface/Models/TimelineRecording.js:
* UserInterface/Protocol/RemoteObject.js:
* UserInterface/Test/FrontendTestHarness.js:
* UserInterface/Test/Test.js:
* UserInterface/Views/CPUTimelineView.js:
* UserInterface/Views/CPUUsageCombinedView.js:
* UserInterface/Views/ChangesDetailsSidebarPanel.js:
* UserInterface/Views/DOMTreeContentView.js:
* UserInterface/Views/DOMTreeElement.js:
* UserInterface/Views/DebuggerSidebarPanel.js:
* UserInterface/Views/NetworkTableContentView.js:
* UserInterface/Views/ResourceTimingBreakdownView.js:
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
* UserInterface/Views/TreeOutline.js:
2019-08-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Better organize manager / observer API groups
https://bugs.webkit.org/show_bug.cgi?id=200594
Reviewed by Devin Rousso.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.globalObjectCleared):
(WI.DebuggerManager.prototype.reset): Deleted.
Renamed.
* UserInterface/Protocol/DebuggerObserver.js:
(WI.DebuggerObserver.prototype.globalObjectCleared):
* UserInterface/Controllers/CSSManager.js:
* UserInterface/Controllers/CanvasManager.js:
* UserInterface/Controllers/ConsoleManager.js:
* UserInterface/Controllers/DOMManager.js:
* UserInterface/Controllers/DOMStorageManager.js:
* UserInterface/Controllers/LayerTreeManager.js:
* UserInterface/Controllers/NetworkManager.js:
* UserInterface/Controllers/TargetManager.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Controllers/WorkerManager.js:
2019-08-10 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r248454): WK1 inspector frontend client doesn't queue messages to the frontend before it's loaded
https://bugs.webkit.org/show_bug.cgi?id=200587
Reviewed by Joseph Pecoraro.
WK1 inspector sends messages to the frontend using `WebCore::InspectorClient::doDispatchMessageOnFrontendPage`,
which does not do any sort of queueing to wait until the frontend is loaded (`InspectorFrontendHost.loaded()`).
Now that we are sending messages immediately, we should always queue.
* UserInterface/Test/TestStub.js:
(InspectorFrontendAPI.dispatch): Added.
* UserInterface/Models/Frame.js:
(WI.Frame.prototype.markDOMContentReadyEvent):
(WI.Frame.prototype.markLoadEvent):
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
(WI.TimelineManager.prototype.pageLoadEventFired):
2019-08-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Node details sidebar sections have unclear delineation in Dark Mode
https://bugs.webkit.org/show_bug.cgi?id=200603
<rdar://problem/54146925>
Reviewed by Devin Rousso.
* UserInterface/Views/DetailsSection.css:
(@media (prefers-color-scheme: dark)):
(.details-section .details-section,):
Give a details section header a different color than a normal sidebar header.
2019-08-09 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r248480): Sources: the Pause Reason section takes the entire vertical space when there are few breakpoints/resources
https://bugs.webkit.org/show_bug.cgi?id=200597
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .pause-reason-container): Deleted.
Don't `flex-grow` or `flex-shrink` the Pause Reason section so it always displays its full
content. The rest of the sections can grow/shrink as needed.
2019-08-09 Devin Rousso <drousso@apple.com>
REGRESSION (Safari 6): Web Inspector: JSON may not be pretty printed if served as text/html
https://bugs.webkit.org/show_bug.cgi?id=122898
<rdar://problem/15241419>
Reviewed by Joseph Pecoraro.
Check the request/response data to see if it's JSON parsable. If so, allow the user to elect
to view the request/response as a JSON preview instead of raw (or pretty printed) text.
Prefer the JSON view wherever possible.
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView):
(WI.ResourceClusterContentView.prototype.get requestContentView):
(WI.ResourceClusterContentView.prototype.get customRequestContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseContentView):
(WI.ResourceClusterContentView.prototype.get selectionPathComponents):
(WI.ResourceClusterContentView.prototype.showRequest):
(WI.ResourceClusterContentView.prototype._canShowCustomRequestContentView): Added.
(WI.ResourceClusterContentView.prototype._canShowCustomResponseContentView):
(WI.ResourceClusterContentView.prototype._contentViewForResourceType):
(WI.ResourceClusterContentView.prototype._pathComponentForContentView):
(WI.ResourceClusterContentView.prototype._identifierForContentView):
(WI.ResourceClusterContentView.prototype._showContentViewForIdentifier):
(WI.ResourceClusterContentView.prototype._canUseJSONContentViewForContent): Added.
(WI.ResourceClusterContentView.prototype._tryEnableCustomRequestContentView): Added.
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView):
(WI.ResourceClusterContentView.prototype.saveToCookie): Deleted.
(WI.ResourceClusterContentView.prototype._customContentViewConstructorForResource): Deleted.
Since the current view is already saved in a `WI.Setting`, there's no need to save that
state to a cookie, as it'll be restored elsewhere.
* UserInterface/Base/Main.js:
(WI.showResourceRequest):
* UserInterface/Main.html:
* UserInterface/Views/JSONContentView.js: Added.
(WI.JSONContentView):
(WI.JSONContentView.prototype.initialLayout):
(WI.JSONContentView.prototype.attached):
(WI.JSONContentView.prototype.closed):
* UserInterface/Views/JSONContentView.css: Added.
(.content-view.json):
* Source/WebInspectorUI/UserInterface/Views/JSONResourceContentView.js: Deleted.
* Source/WebInspectorUI/UserInterface/Views/JSONResourceContentView.css: Deleted.
Create a more generic content view that shows a preview for the given JSON parsable string.
* UserInterface/Base/Utilities.js:
(String.prototype.isJSON): Added.
* UserInterface/Views/WebSocketDataGridNode.js:
(WI.WebSocketDataGridNode.prototype.appendContextMenuItems):
Utility function for checking if a string is JSON parsable.
* Localizations/en.lproj/localizedStrings.js:
2019-08-09 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: increase the vertical space allocated to the call stack when paused
https://bugs.webkit.org/show_bug.cgi?id=200236
Reviewed by Joseph Pecoraro.
Rather than uniformly constrict the height of the Call Stack and Breakpoints sections, they
should "flex" based on their importance, which can likely be derived from the current state.
This way, it's possible to see information from each section at the same time, but still
have enough space in each section to be able to do something useful.
When paused, the most useful data is the call stack, so give the Call Stack section the most
vertical space (the Pause Reason is also important, but it usually needs very little space).
When not paused, it's likely that the user cares more about the resources with breakpoints
than those without, so favor the Breakpoints section.
Each section will only expand to fit it's maximum content height.
If the inspector window becomes too short, remove the "flex" entirely and have all the
content be part of a single scroll area instead.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.createContentTreeOutline):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
(WI.SourcesNavigationSidebarPanel.prototype._handleCallStackElementAddedOrRemoved): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Added.
(.sidebar > .panel.navigation.sources > .content .details-section): Added.
(.sidebar > .panel.navigation.sources > .content .details-section.collapsed > .header > .options, .sidebar > .panel.navigation.sources > .content .details-section:not(.collapsed) > .content, .sidebar > .panel.navigation.sources > .content .details-section:not(.collapsed) > .content > .group): Added.
(.sidebar > .panel.navigation.sources > .content > .breakpoints-container .create-breakpoint): Added.
(.sidebar > .panel.navigation.sources > .content > .navigation-bar): Added.
(@media (min-height: 650px)): Added.
(.sidebar > .panel.navigation.sources > .content > .pause-reason-container): Added.
(.sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources)): Added.
(.sidebar > .panel.navigation.sources > .content > .call-stack-container): Added.
(.sidebar > .panel.navigation.sources > .content > .breakpoints-container): Added.
(.sidebar > .panel.navigation.sources > .content > .resources): Added.
(.sidebar > .panel.navigation.sources > .content > .breakpoints-container .tree-outline .item.event-target-window .icon): Added.
(.sidebar > .panel.navigation.sources > .content > .details-section): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section:matches(.paused-reason, .breakpoints).collapsed > .header > .options,): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.collapsed > .content): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section:matches(.pause-reason, .call-stack, .breakpoints) > .content,): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints) > .content): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints):not(.collapsed) > .content): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.call-stack): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints .create-breakpoint): Deleted.
(@media (min-height: 600px)): Deleted.
(.sidebar > .panel.navigation.sources > .content > .pause-reason): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints):not(.collapsed) > .content,): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints .tree-outline .item.event-target-window .icon): Deleted.
Wrap the Pause Reason, Call Stack, and Breakpoints `WI.DetailsSection`s in a container
element so that the styling of the sticky header doesn't get affected by the clamping of the
container's height.
* UserInterface/Views/DetailsSection.css:
(.details-section):
(.details-section > .header):
Create CSS variables for styles that will be overridden by the Sources navigation sidebar.
2019-08-08 Devin Rousso <drousso@apple.com>
Web Inspector: Page: don't allow the domain to be disabled
https://bugs.webkit.org/show_bug.cgi?id=200109
Reviewed by Brian Burg.
The `PageAgent` is relied on by many of the other agents, so much so that it doesn't make
sense to support the ability to "disable" (as well as "enable") the agent.
When the first frontend connects, we should treat the `PageAgent` as active and available.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.initializeTarget):
* Test/Test.js:
(WI.loaded):
(WI.initializeBackendTarget):
(WI.contentLoaded):
(WI.targetsAvailable): Added.
(WI.whenTargetsAvailable): Added.
* Test/TestStub.js:
Ensure that the backend always gets notified via `InspectorFrontendHost.loaded` so that
messages being sent to the frontend are batched.
2019-08-08 Devin Rousso <drousso@apple.com>
Web Inspector: rename `queryObjects` to `queryInstances` for clarity
https://bugs.webkit.org/show_bug.cgi?id=200520
Reviewed by Brian Burg.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
2019-08-07 Devin Rousso <drousso@apple.com>
Fix construction of `WI.EventBreakpoint` after r248201
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.setBreakpointForEventListener):
2019-08-07 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: add an Engineering pane to expose useful settings for other WebKit engineers
https://bugs.webkit.org/show_bug.cgi?id=200492
Reviewed by Joseph Pecoraro.
Other WebKit engineers might find being able to see internal objects or pause in internal
scripts useful, so we should allow them to do so without having to enable Web Inspector's
debug "mode".
A new "Engineering" pane is added to the Settings Tab:
- Debugging
- Show WebKit-internal scripts
- Pause in WebKit-internal scripts
- Heap Snapshot
- Show Internal Objects
- Show Private Symbols
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype.initialLayout):
(WI.SettingsTabContentView.prototype._createEngineeringSettingsView): Added.
(WI.SettingsTabContentView.prototype._createDebugSettingsView):
* UserInterface/Base/Main.js:
(WI.resolvedLayoutDirection):
(WI.setLayoutDirection):
* UserInterface/Base/Object.js:
* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass):
(InspectorBackendClass.prototype.set dumpInspectorProtocolMessages):
(InspectorBackendClass.prototype.get dumpInspectorProtocolMessages):
(InspectorBackendClass.prototype.set dumpInspectorTimeStats):
(InspectorBackendClass.prototype.get dumpInspectorTimeStats):
(InspectorBackendClass.prototype.set filterMultiplexingBackendInspectorProtocolMessages):
(InspectorBackendClass.prototype.get filterMultiplexingBackendInspectorProtocolMessages):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):
* UserInterface/Debug/UncaughtExceptionReporter.js:
(handleUncaughtExceptionRecord):
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.update):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.prototype.get knownNonResourceScripts):
(WI.DebuggerManager.prototype.debuggerDidPause):
(WI.DebuggerManager.prototype.scriptDidParse):
(WI.DebuggerManager.prototype._handleEngineeringShowInternalScriptsSettingChanged): Added.
(WI.DebuggerManager.prototype._handleEngineeringPauseForInternalScriptsSettingChanged): Added.
(WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange): Deleted.
(WI.DebuggerManager.prototype._debugUIEnabledDidChange): Deleted.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendLocationLink):
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
* UserInterface/Views/StackTraceView.js:
(WI.StackTraceView):
* UserInterface/Views/View.js:
(WI.View.prototype._layoutSubtree):
2019-08-07 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: RTL: content of Variables section should always be LTR
https://bugs.webkit.org/show_bug.cgi?id=200481
Reviewed by Devin Rousso.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
2019-08-07 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TimelineAgent already enabled
https://bugs.webkit.org/show_bug.cgi?id=200513
Reviewed by Joseph Pecoraro.
Update some incorrect compatibility comments from r248286.
* UserInterface/Protocol/InspectorFrontendAPI.js:
* UserInterface/Controllers/TimelineManager.js:
2019-08-06 Devin Rousso <drousso@apple.com>
Web Inspector: Show radius values in box model metrics view
https://bugs.webkit.org/show_bug.cgi?id=160993
<rdar://problem/27919035>
Reviewed by Brian Burg.
* UserInterface/Views/BoxModelDetailsSectionRow.js:
(WI.BoxModelDetailsSectionRow.prototype._getPropertyValue): Added.
(WI.BoxModelDetailsSectionRow.prototype._getPropertyValueAsPx):
(WI.BoxModelDetailsSectionRow.prototype._getBox):
(WI.BoxModelDetailsSectionRow.prototype._getComponentPrefix): Added.
(WI.BoxModelDetailsSectionRow.prototype._getComponentSuffix):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createBoxPartElement):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaElement):
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput):
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput.inspectedPage_node_toggleInlineStyleProperty):
* UserInterface/Views/BoxModelDetailsSectionRow.css:
(.details-section .row.box-model .box): Added.
(.details-section .row.box-model .box > .label): Added.
(.details-section .row.box-model .box.position): Added.
(.details-section .row.box-model .box.margin): Added.
(.details-section .row.box-model:not(.hovered) .box.margin, .details-section .row.box-model .box.margin.active): Added.
(.details-section .row.box-model .box.border): Added.
(.details-section .row.box-model:not(.hovered) .box.border, .details-section .row.box-model .box.border.active): Added.
(.details-section .row.box-model .box.border > .label): Added.
(.details-section .row.box-model .box.border.has-top-left-radius, .details-section .row.box-model .box.border.has-top-left-radius .box): Added.
(.details-section .row.box-model .box.border.has-top-right-radius, .details-section .row.box-model .box.border.has-top-right-radius .box): Added.
(.details-section .row.box-model .box.border.has-bottom-right-radius, .details-section .row.box-model .box.border.has-bottom-right-radius .box): Added.
(.details-section .row.box-model .box.border.has-bottom-left-radius, .details-section .row.box-model .box.border.has-bottom-left-radius .box): Added.
(.details-section .row.box-model .box.padding): Added.
(.details-section .row.box-model:not(.hovered) .box.padding, .details-section .row.box-model .box.padding.active): Added.
(.details-section .row.box-model .box.content): Added.
(.details-section .row.box-model:not(.hovered) .box.content, .details-section .row.box-model .box.content.active): Added.
(.details-section .row.box-model :matches(.top, .right, .bottom, .left)): Added.
(.details-section .row.box-model :matches(.top, .right, .bottom, .left):not(.editing), .details-section .row.box-model :matches(.top-left, .top-right, .bottom-right, .bottom-left)): Added.
(.details-section .row.box-model :matches(.top-left, .top-right, .bottom-right, .bottom-left)): Added.
(.details-section .row.box-model :matches(.top-left, .top-right)): Added.
(.details-section .row.box-model :matches(.bottom-left, .bottom-right):not(.editing)): Added.
(.details-section .row.box-model :matches(.bottom-left, .bottom-right).editing): Added.
(.details-section .row.box-model :matches(.top-left, .bottom-left):not(.editing)): Added.
(.details-section .row.box-model :matches(.top-left, .bottom-left).editing): Added.
(.details-section .row.box-model :matches(.top-right, .bottom-right):not(.editing)): Added.
(.details-section .row.box-model :matches(.top-right, .bottom-right).editing): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model:not(.hovered) .box:matches(.margin, .border, .padding, .content), .details-section .row.box-model .box.active:matches(.margin, .border, .padding, .content)): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box.margin): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box.border): Added.
(.details-section .row.box-model :matches(.position, .margin, .border, .padding, .content)): Deleted.
(.details-section .row.box-model .position): Deleted.
(.details-section .row.box-model .margin): Deleted.
(.details-section .row.box-model:not(.hovered) .margin, .details-section .row.box-model .margin.active): Deleted.
(.details-section .row.box-model .border): Deleted.
(.details-section .row.box-model:not(.hovered) .border, .details-section .row.box-model .border.active): Deleted.
(.details-section .row.box-model .padding): Deleted.
(.details-section .row.box-model:not(.hovered) .padding, .details-section .row.box-model .padding.active): Deleted.
(.details-section .row.box-model .content): Deleted.
(.details-section .row.box-model:not(.hovered) .content, .details-section .row.box-model .content.active): Deleted.
(.details-section .row.box-model :matches(.content span, .top, .right, .bottom, .left)): Deleted.
(.details-section .row.box-model :matches(.right, .left)): Deleted.
(.details-section .row.box-model:not(.hovered) :matches(.margin, .border, .padding, .content), .details-section .row.box-model .active:matches(.margin, .border, .padding, .content)): Deleted.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.update):
Ensure that the `_value` is updated whenever the `_rawValue` is updated.
2019-08-06 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r248289.
https://bugs.webkit.org/show_bug.cgi?id=200488
Broke internal builds (Requested by drousso on #webkit).
Reverted changeset:
"Web Inspector: Styles: show @supports CSS groupings"
https://bugs.webkit.org/show_bug.cgi?id=200419
https://trac.webkit.org/changeset/248289
2019-08-06 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: RTL: go-to arrows and expand triangles in Computed panel should match their context
https://bugs.webkit.org/show_bug.cgi?id=200449
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ComputedStyleSection.css:
(body[dir=rtl] .computed-style-section .computed-property-item .disclosure-button): Deleted.
* UserInterface/Views/Main.css:
(body[dir=rtl] [dir=ltr] .go-to-arrow): Added.
In the RTL mode, LTR "islands" should have their contents to be still LTR.
2019-08-05 Devin Rousso <drousso@apple.com>
Web Inspector: Styles: show @supports CSS groupings
https://bugs.webkit.org/show_bug.cgi?id=200419
Reviewed by Joseph Pecoraro.
* UserInterface/Models/CSSGrouping.js: Renamed from Source/WebInspectorUI/UserInterface/Models/CSSMedia.js.
(WI.CSSGrouping):
(WI.CSSGrouping.prototype.get type):
(WI.CSSGrouping.prototype.get text):
(WI.CSSGrouping.prototype.get sourceCodeLocation):
(WI.CSSGrouping.prototype.get isMedia): Added.
(WI.CSSGrouping.prototype.get isSupports): Added.
(WI.CSSGrouping.prototype.get prefix): Added.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.get groupings): Added.
(WI.CSSStyleDeclaration.prototype.generateCSSRuleString):
(WI.CSSStyleDeclaration.prototype.get mediaList): Deleted.
* UserInterface/Models/CSSRule.js:
(WI.CSSRule):
(WI.CSSRule.prototype.get groupings): Added.
(WI.CSSRule.prototype.update):
(WI.CSSRule.prototype._selectorResolved):
(WI.CSSRule.prototype.get mediaList): Deleted.
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._parseRulePayload):
(WI.DOMNodeStyles.prototype.rulesForSelector): Deleted.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleEditorFilterApplied):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._createMediaHeader): Deleted.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration :matches(.header, .header-groupings)): Added.
(.spreadsheet-css-declaration :matches(.header, .header-groupings):first-child): Added.
(.spreadsheet-css-declaration .header-groupings > .grouping): Added.
(.spreadsheet-css-declaration .header-groupings + .header > .selector > .icon): Added.
(.spreadsheet-css-declaration :matches(.header, .header-media)): Deleted.
(.spreadsheet-css-declaration :matches(.header, .header-media):first-child): Deleted.
(.spreadsheet-css-declaration .media-label): Deleted.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.protocolGroupingTypeToEnum): Added.
(WI.CSSManager.protocolMediaSourceToEnum): Deleted.
* UserInterface/Main.html:
* UserInterface/Test.html:
2019-08-05 Devin Rousso <drousso@apple.com>
Can't use $0, $1 etc when inspecting Google Docs pages because the content uses these for function names
https://bugs.webkit.org/show_bug.cgi?id=195834
Reviewed by Joseph Pecoraro.
Allow the user to alias saved results by providing a different prefix (e.g. "$") from within
Web Inspector. When changing the alias, all existing saved results will update to be
reference-able from the new alias.
* UserInterface/Controllers/RuntimeManager.js:
(WI.RuntimeManager):
(WI.RuntimeManager.preferredSavedResultPrefix): Added.
(WI.RuntimeManager.prototype.initializeTarget):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
* UserInterface/Base/Setting.js:
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI.contentLoaded.updateConsoleSavedResultPrefixCSSVariable): Added.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.toClipboardString):
(WI.ConsoleMessageView.prototype.removeEventListeners): Added.
(WI.ConsoleMessageView.prototype._appendSavedResultIndex):
(WI.ConsoleMessageView.prototype._appendSavedResultIndex.updateSavedVariableText): Added.
(WI.ConsoleMessageView.prototype._rootPropertyPathForObject):
(WI.ConsoleMessageView.prototype._rootPropertyPathForObject.prefixSavedResultIndex): Added.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._sessionStarted):
(WI.LogContentView.prototype._logCleared):
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom.show-last-selected li.last-selected > span::after):
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole):
(WI.QuickConsole.prototype.closed):
(WI.QuickConsole.prototype._updateAutomaticExecutionContextPathComponentTooltip): Added.
Listen for changes to the setting that holds the current saved result alias and update any
related UI accordingly.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createConsoleSettingsView):
* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="text"]): Added.
* UserInterface/Views/SettingsGroup.js:
(WI.SettingsGroup.prototype.addCustomEditor): Added.
Add an input to the Settings tab that controls the saved result prefix alias. Only allow
[a-zA-Z0-9_$] as values (but [0-9] cannot be used as the start).
* UserInterface/Models/PropertyPath.js:
(WI.PropertyPath.prototype.set pathComponent): Added.
Miscellaneous getters/setters.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.newline): Added.
Convenience function for adding newlines to test results.
2019-08-05 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: disable related agents when the tab is closed
https://bugs.webkit.org/show_bug.cgi?id=200118
Reviewed by Joseph Pecoraro.
Rework how `enable`/`disable` is used for timeline-related agents so that events are not sent
and data isn't kept alive when the Timelines tab isn't enabled.
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager):
(WI.TimelineManager.prototype.get domains): Added.
(WI.TimelineManager.prototype.activateExtraDomain): Added.
(WI.TimelineManager.prototype.initializeTarget):
(WI.TimelineManager.prototype.reset):
(WI.TimelineManager.prototype.set autoCaptureOnPageLoad):
(WI.TimelineManager.prototype.enable): Added.
(WI.TimelineManager.prototype.disable): Added.
(WI.TimelineManager.prototype.startCapturing):
(WI.TimelineManager.prototype.stopCapturing):
(WI.TimelineManager.prototype.async processJSON):
(WI.TimelineManager.prototype.capturingStarted):
(WI.TimelineManager.prototype.capturingStopped):
(WI.TimelineManager.prototype.autoCaptureStarted):
(WI.TimelineManager.prototype.eventRecorded):
(WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
(WI.TimelineManager.prototype.pageLoadEventFired):
(WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
(WI.TimelineManager.prototype.memoryTrackingUpdated):
(WI.TimelineManager.prototype.heapTrackingStarted):
(WI.TimelineManager.prototype.heapTrackingCompleted):
(WI.TimelineManager.prototype.heapSnapshotAdded):
(WI.TimelineManager.prototype._loadNewRecording):
(WI.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
(WI.TimelineManager.prototype._provisionalLoadStarted):
(WI.TimelineManager.prototype._mainResourceDidChange):
(WI.TimelineManager.prototype._resourceWasAdded):
(WI.TimelineManager.prototype._garbageCollected):
(WI.TimelineManager.prototype._memoryPressure):
(WI.TimelineManager.prototype.scriptProfilerTrackingUpdated):
(WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
(WI.TimelineManager.prototype._updateAutoCaptureInstruments):
(WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
(WI.TimelineManager.prototype._handleDOMNodePowerEfficientPlaybackStateChanged):
* UserInterface/Models/Instrument.js:
(WI.Instrument.startLegacyTimelineAgent):
(WI.Instrument.stopLegacyTimelineAgent):
* UserInterface/Controllers/HeapManager.js:
(WI.HeapManager): Added.
(WI.HeapManager.prototype.get domains): Added.
(WI.HeapManager.prototype.activateExtraDomain): Added.
(WI.HeapManager.prototype.initializeTarget):
(WI.HeapManager.prototype.enable): Added.
(WI.HeapManager.prototype.disable): Added.
(WI.HeapManager.prototype.snapshot): Added.
(WI.HeapManager.prototype.getPreview): Added.
(WI.HeapManager.prototype.getRemoteObject): Added.
(WI.HeapManager.prototype.garbageCollected):
* UserInterface/Controllers/MemoryManager.js:
(WI.MemoryManager): Added.
(WI.MemoryManager.prototype.get domains): Added.
(WI.MemoryManager.prototype.activateExtraDomain): Added.
(WI.MemoryManager.prototype.initializeTarget):
(WI.MemoryManager.prototype.enable): Added.
(WI.MemoryManager.prototype.disable): Added.
(WI.MemoryManager.prototype.memoryPressure):
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
(WI.TimelineTabContentView.prototype.closed):
* UserInterface/Models/HeapAllocationsInstrument.js:
(WI.HeapAllocationsInstrument):
(WI.HeapAllocationsInstrument.prototype._takeHeapSnapshot):
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
(WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
(WI.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
Go through the `HeapManager` for `HeapAgent` commands so it can better manage state.
* UserInterface/Test/Test.js:
(WI.contentLoaded):
2019-08-05 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: brotli-compressed resources have "Compressed: No" in Resources details sidebar
https://bugs.webkit.org/show_bug.cgi?id=200452
Reviewed by Joseph Pecoraro.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.get compressed):
Add "br" - Brotli content encoding.
2019-08-05 Devin Rousso <drousso@apple.com>
Web Inspector: Styles: variable swatch not shown for var() with a fallback
https://bugs.webkit.org/show_bug.cgi?id=200237
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
(WI.SpreadsheetStyleProperty.prototype._replaceSpecialTokens): Added.
(WI.SpreadsheetStyleProperty.prototype._addGradientTokens):
(WI.SpreadsheetStyleProperty.prototype._addColorTokens):
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):
(WI.SpreadsheetStyleProperty.prototype._addVariableTokens):
Check to see if there's a fallback value in the `var()` and tokenize it if there is. Mark
the property as invalid if the `var()` doesn't end up resolving to anything.
* UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch):
(WI.InlineSwatch.prototype.get value):
(WI.InlineSwatch.prototype._updateSwatch):
(WI.InlineSwatch.prototype._handleContextMenuEvent):
(WI.InlineSwatch.prototype._getNextValidHEXFormat.hexMatchesCurrentColor):
(WI.InlineSwatch.prototype._getNextValidHEXFormat):
Allow the `value` to be a function. In that case, use the getter `this.value` instead of the
value `this._value` directly so that the function is invoked.
This is needed for variable swatches because the fallback value could change after the
swatch has been created (e.g. another swatch in a CSS property value that just modifies the
text, rather than re-renders the entire CSS property value).
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.resolveVariableValue): Added.
Follow the variable chain until an ultimate value is reached.
* UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.isColorAwareProperty):
(WI.CSSKeywordCompletions.isTimingFunctionAwareProperty): Added.
Limit `cubic-bezier` and `spring` tokens to only be shown for timing function properties.
2019-08-05 Devin Rousso <drousso@apple.com>
Web Inspector: rename "Stylesheet" to "Style Sheet" to match spec text
https://bugs.webkit.org/show_bug.cgi?id=200422
Reviewed by Joseph Pecoraro.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceAdded):
(WI.CSSManager.prototype._resourceTypeDidChange):
(WI.CSSManager.prototype._clearStyleSheetsForResource):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
* UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet.prototype.get displayName):
* UserInterface/Models/CollectionTypes.js:
(WI.CSSStyleSheetCollection.prototype.get displayName):
* UserInterface/Models/Resource.js:
(WI.Resource.displayNameForType):
(WI.Resource.prototype.get syntheticMIMEType):
* UserInterface/Models/ResourceCollection.js:
(WI.ResourceCollection.prototype.objectIsRequiredType):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.shortDisplayNameForResourceType):
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype._contentViewForResourceType):
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._save):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu):
* UserInterface/Views/StyleOriginView.js:
(WI.StyleOriginView.prototype.update):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._shouldBeEditable):
* UserInterface/Views/CSSStyleSheetTreeElement.js:
(WI.CSSStyleSheetTreeElement):
* UserInterface/Views/ResourceIcons.css:
(:matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon): Added.
(.source-map-resource.resource-icon.resource-type-style-sheet .icon): Added.
(.large :matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon): Added.
(.large .source-map-resource.resource-icon.resource-type-style-sheet .icon): Added.
(:matches(.resource-icon.resource-type-stylesheet, .stylesheet-icon) .icon): Deleted.
(.source-map-resource.resource-icon.resource-type-stylesheet .icon): Deleted.
(.large :matches(.resource-icon.resource-type-stylesheet, .stylesheet-icon) .icon): Deleted.
(.large .source-map-resource.resource-icon.resource-type-stylesheet .icon): Deleted.
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: move psuedo-selector rules before inherited rules
https://bugs.webkit.org/show_bug.cgi?id=199950
Reviewed by Joseph Pecoraro.
Since pseudo-selector rules (usually) affect the selected element, or are related to its
content, it's more useful to have them near that element's rules instead of after all of
it's inherited rules.
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: add icons for various CSS rule types
https://bugs.webkit.org/show_bug.cgi?id=199946
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.displayNameForPseudoId):
Add hardcoded pseudo-selector identifiers for older backends.
* UserInterface/Models/CSSSelector.js:
(WI.CSSSelector.prototype.isPseudoSelector): Added.
(WI.CSSSelector.prototype.isPseudoElementSelector): Deleted.
There are more types of pseudo-selectors than just `:{before|after}`.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.generateCSSRuleString): Added.
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.spreadsheetCSSStyleDeclarationSectionAddNewRule): Added.
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
Provide a delegate method for adding a new rule, so the `WI.SpreadsheetRulesStyleDetailsPanel`
can know what selector to focus once the new rule gets added.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu): Added.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration .header.editing-selector .selector): Added.
(.spreadsheet-css-declaration .selector > .icon): Added.
(.spreadsheet-css-declaration .selector > .icon + *): Added.
(.spreadsheet-css-declaration .selector.style-attribute > span): Added.
When "mousedown" (or "contextmenu") on the icon, show a context menu with helpful actions:
- Copy Rule
- {Disable|Enable} Rule
- Duplicate Selector
- Add :{active|focus|hover|visited} Rule
- Create ::{before|after} Rule
- Reveal in {Resources Tab|Sources Tab|Stylesheet}
Drive-by: add an extra 0.5px of initial margin before the Style Attribute selector (which is
sans-serif) so it properly aligns with the other selectors (which are monospaced).
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor:empty): Added.
(.spreadsheet-style-declaration-editor.no-properties): Deleted.
Add some extra space when there's no inline style so it looks a bit less cramped.
* UserInterface/Main.html:
* UserInterface/Views/StyleRuleIcons.css: Added.
(.author-style-rule-icon .icon):
(.author-style-rule-icon.pseudo-selector .icon):
(.user-style-rule-icon .icon):
(.user-style-rule-icon.pseudo-selector .icon):
(.user-agent-style-rule-icon .icon):
(.user-agent-style-rule-icon.pseudo-selector .icon):
(.inspector-style-rule-icon .icon):
(.inspector-style-rule-icon.pseudo-selector .icon):
(.inherited-style-rule-icon .icon):
(.inherited-element-style-rule-icon .icon):
* UserInterface/Images/StyleRule.svg: Added.
* UserInterface/Images/StyleRuleInheritedElement.svg: Added.
* UserInterface/Images/StyleRulePseudo.svg: Added.
Add generic icon classes for style rule icons.
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
Add experimental setting.
* Localizations/en.lproj/localizedStrings.js:
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: DOM: add a special breakpoint for "All Events"
https://bugs.webkit.org/show_bug.cgi?id=200285
Reviewed by Joseph Pecoraro.
Similar to the existing "All Requests" breakpoint, there should be a way to set a breakpoint
that would pause for any DOM event, regardless of the event's name. This is useful for
situations where the event name isn't known, or where one simply want's to pause on the next
entry to the event loop.
Along these lines, make the "requestAnimationFrame", "setTimeout", and "setInterval"
event breakpoints into special breakpoints that can be added/removed via the create
breakpoint context menu. This simplifies the process for setting these breakpoints, and also
makes them more discoverable (most people wouldn't consider them to be "events").
* UserInterface/Models/EventBreakpoint.js:
(WI.EventBreakpoint):
(WI.EventBreakpoint.deserialize):
(WI.EventBreakpoint.prototype.saveIdentityToCookie):
(WI.EventBreakpoint.prototype.toJSON):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype._pauseReasonFromPayload):
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager):
(WI.DOMDebuggerManager.prototype.initializeTarget):
(WI.DOMDebuggerManager.supportsDOMBreakpoints): Added.
(WI.DOMDebuggerManager.supportsEventBreakpoints):
(WI.DOMDebuggerManager.supportsEventListenerBreakpoints): Added.
(WI.DOMDebuggerManager.supportsURLBreakpoints):
(WI.DOMDebuggerManager.supportsXHRBreakpoints): Added.
(WI.DOMDebuggerManager.supportsAllListenersBreakpoint): Added.
(WI.DOMDebuggerManager.prototype.get allAnimationFramesBreakpoint): Added.
(WI.DOMDebuggerManager.prototype.get allIntervalsBreakpoint): Added.
(WI.DOMDebuggerManager.prototype.get allListenersBreakpoint): Added.
(WI.DOMDebuggerManager.prototype.get allTimeoutsBreakpoint): Added.
(WI.DOMDebuggerManager.prototype.get listenerBreakpoints): Added.
(WI.DOMDebuggerManager.prototype.isBreakpointSpecial):
(WI.DOMDebuggerManager.prototype.listenerBreakpointForEventName): Added.
(WI.DOMDebuggerManager.prototype.addEventBreakpoint):
(WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
(WI.DOMDebuggerManager.prototype.addURLBreakpoint):
(WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
(WI.DOMDebuggerManager.prototype._updateURLBreakpoint):
(WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype.get eventBreakpoints): Deleted.
(WI.DOMDebuggerManager.prototype.eventBreakpointForTypeAndEventName): Deleted.
Add additional target compatibility checks.
* UserInterface/Views/EventBreakpointPopover.js:
(WI.EventBreakpointPopover.prototype.show):
(WI.EventBreakpointPopover.prototype.dismiss):
(WI.EventBreakpointPopover.prototype._handleTypeSelectChange): Deleted.
* UserInterface/Views/EventBreakpointPopover.css:
(.popover .event-breakpoint-content > input): Added.
(.popover .event-breakpoint-content > input::placeholder): Added.
(.popover .event-breakpoint-content > .event-type): Deleted.
(.popover .event-breakpoint-content > .event-type > input): Deleted.
(.popover .event-breakpoint-content > .event-type > input::placeholder): Deleted.
* UserInterface/Views/EventBreakpointTreeElement.css:
(.breakpoint.event.breakpoint-for-interval:not(.breakpoint-paused-icon) .icon): Added.
(.breakpoint.event.breakpoint-for-timeout:not(.breakpoint-paused-icon) .icon): Added.
(.breakpoint.event.breakpoint-for-timer:not(.breakpoint-paused-icon) .icon): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
(WI.DebuggerSidebarPanel.prototype._addBreakpoint):
(WI.DebuggerSidebarPanel.prototype._addTreeElement):
(WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu.addToggleForSpecialEventBreakpoint): Added.
(WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu.addToggleForSpecialEventBreakpoint): Added.
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
Add create breakpoint context menu items (also sort the breakpoints in this order):
- "All Animation Frames" => [A] All Animation Frames
- "All Timeouts" => [T] All Timeouts
- "All Intervals" => [I] All Intervals
- "All Events" => [E] All Events
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
* UserInterface/Base/Setting.js:
* UserInterface/Images/EventBreakpointInterval.svg: Added.
* UserInterface/Images/EventBreakpointTimeout.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/EventBreakpointTimer.svg.
* Localizations/en.lproj/localizedStrings.js:
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: Heap Snapshot Views should be searchable
https://bugs.webkit.org/show_bug.cgi?id=157582
<rdar://problem/26228629>
Reviewed by Joseph Pecoraro.
Without the ability to filter/search, it's far more difficult to find objects of interest.
Rather than spending time scrolling through the entire heap snapshot or sorting by "Name",
a simple filter/search (which also uses the global search settings) is almost instant.
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype.updateFilter): Addded.
(WI.HeapAllocationsTimelineView.prototype.get showsFilterBar): Deleted.
* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WI.HeapSnapshotClusterContentView.prototype.updateFilter): Added.
* UserInterface/Views/HeapSnapshotContentView.js:
(WI.HeapSnapshotContentView):
(WI.HeapSnapshotContentView.prototype.updateFilter): Added.
(WI.HeapSnapshotContentView.prototype.dataGridMatchNodeAgainstCustomFilters): Added.
(WI.HeapSnapshotContentView.prototype.dataGridMatchShouldPopulateWhenFilteringNode): Added.
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype._updateFilter.createIteratorForNodesToBeFiltered):
Don't attempt to populate each heap snapshot `WI.DataGridNode` when filtering, as that can
quickly exhaust memory due to the sheer size of a heap snapshot.
* UserInterface/Base/Main.js:
(WI._find):
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.prototype.get canHandleFindEvent): Added.
(WI.TimelineTabContentView.prototype.handleFindEvent): Added.
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView.prototype.get canFocusFilterBar): Added.
(WI.TimelineRecordingContentView.prototype.focusFilterBar): Added.
* UserInterface/Views/FilterBar.js:
(WI.FilterBar.prototype.focus): Added.
Allow the current tab to intercept the find shortcut and do something custom. In the case
of a `WI.TimelineTabContentView`, declare that it can handle the find event if the displayed
content view (`WI.TimelineRecordingContentView`) can focus it's filter bar. If so, when the
find shortcut is triggered, focus the filter bar.
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: CSS Formatter: comments with an escape character aren't formatted
https://bugs.webkit.org/show_bug.cgi?id=200168
Reviewed by Joseph Pecoraro.
Don't allow escaping of the "*" in CSS comments (e.g. `\*/`).
Add additional pretty printing rules for comments so that there's always some space between
them and the surrounding text. This ensures that they don't interfere with readability.
* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter.prototype._format):
* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype.get indented): Added.
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: Console: execution context picker doesn't update when switching to the inferred context from auto
https://bugs.webkit.org/show_bug.cgi?id=200279
Reviewed by Joseph Pecoraro.
The `representedObject` of the "auto" execution context path component is shared with that
execution context's actual path component, meaning that if the user switches from "auto" to
that execution context's path component, the underlying `representedObject` wouldn't change,
and therfore the `RuntimeManager.Event.ActiveExecutionContextChanged` wouldn't fire. In this
case, update the visible ("selected") execution context path component manually.
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole.prototype._selectExecutionContext):
(WI.QuickConsole.prototype._pathComponentSelected):
2019-08-02 Devin Rousso <drousso@apple.com>
Web Inspector: Console: all navigation items should be shown in the split console
https://bugs.webkit.org/show_bug.cgi?id=200280
Reviewed by Joseph Pecoraro.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView):
(WI.LogContentView.prototype.get navigationItems):
Adjust the `visibilityPriority` of each `navigationItems` so that the filter/scope bars are
kept visible for longer than the "Preserve Log"/"Emulate User Gesture" toggles.
* UserInterface/Views/FindBanner.js:
(WI.FindBanner):
* UserInterface/Views/FindBanner.css:
(.find-banner.console-find-banner > input[type="search"]):
(.find-banner.console-find-banner > :matches(input[type="search"], button)):
(.find-banner.console-find-banner > input[type="search"]:focus, .find-banner.console-find-banner > input[type="search"]:focus ~ button, .find-banner.console-find-banner > input[type="search"]:not(:placeholder-shown), .find-banner.console-find-banner > input[type="search"]:not(:placeholder-shown) ~ button ): Added.
(.find-banner.console-find-banner > input[type="search"]::placeholder): Deleted.
(.find-banner.console-find-banner > input[type="search"]:focus): Deleted.
(.find-banner.console-find-banner > input[type="search"]:not(:placeholder-shown)): Deleted.
(@media (prefers-color-scheme: dark) .find-banner.console-find-banner > input[type=search]:not(:placeholder-shown)): Deleted.
Make the `WI.FindBanner` blend in with the surrounding content when it's not focused or has
no content.
2019-08-02 Devin Rousso <drousso@apple.com>
Web Inspector: Storage: disable related agents when the tab is closed
https://bugs.webkit.org/show_bug.cgi?id=200117
Reviewed by Joseph Pecoraro.
Rework how `enable`/`disable` is used for storage-related agents so that events are not sent
and data isn't kept alive when the Storage tab isn't enabled.
* UserInterface/Controllers/ApplicationCacheManager.js:
(WI.ApplicationCacheManager):
(WI.ApplicationCacheManage.prototype.get domains): Added.
(WI.ApplicationCacheManage.prototype.activateExtraDomain): Added.
(WI.ApplicationCacheManager.prototype.initializeTarget):
(WI.ApplicationCacheManager.prototype.enable): Added.
(WI.ApplicationCacheManager.prototype.disable): Added.
(WI.ApplicationCacheManager.prototype.networkStateUpdated):
(WI.ApplicationCacheManager.prototype.applicationCacheStatusUpdated):
(WI.ApplicationCacheManager.prototype._reset): Added.
(WI.ApplicationCacheManager.prototype._mainResourceDidChange):
(WI.ApplicationCacheManager.prototype._manifestForFrameLoaded):
(WI.ApplicationCacheManager.prototype._framesWithManifestsLoaded):
(WI.ApplicationCacheManager.prototype.initialize): Deleted.
* UserInterface/Controllers/DOMStorageManager.js:
(WI.DOMStorageManager):
(WI.DOMStorageManager.prototype.get domains): Added.
(WI.DOMStorageManager.prototype.activateExtraDomain): Added.
(WI.DOMStorageManager.prototype.initializeTarget):
(WI.DOMStorageManager.prototype.enable): Added.
(WI.DOMStorageManager.prototype.disable): Added.
(WI.DOMStorageManager.prototype.itemsCleared):
(WI.DOMStorageManager.prototype.itemRemoved):
(WI.DOMStorageManager.prototype.itemAdded):
(WI.DOMStorageManager.prototype.itemUpdated):
(WI.DOMStorageManager.prototype.inspectDOMStorage):
(WI.DOMStorageManager.prototype._reset): Added.
(WI.DOMStorageManager.prototype._addDOMStorageIfNeeded):
(WI.DOMStorageManager.prototype._addCookieStorageIfNeeded):
(WI.DOMStorageManager.prototype._mainResourceDidChange):
(WI.DOMStorageManager.prototype.initialize): Deleted.
(WI.DOMStorageManager.prototype.domStorageWasAdded): Deleted.
* UserInterface/Controllers/DatabaseManager.js:
(WI.DatabaseManager):
(WI.DatabaseManager.prototype.get domains): Added.
(WI.DatabaseManager.prototype.activateExtraDomain): Added.
(WI.DatabaseManager.prototype.initializeTarget):
(WI.DatabaseManager.prototype.enable): Added.
(WI.DatabaseManager.prototype.disable): Added.
(WI.DatabaseManager.prototype.databaseWasAdded):
(WI.DatabaseManager.prototype.inspectDatabase):
(WI.DatabaseManager.prototype._reset): Added.
(WI.DatabaseManager.prototype._mainResourceDidChange):
(WI.DatabaseManager.prototype.initialize): Deleted.
* UserInterface/Controllers/IndexedDBManager.js:
(WI.IndexedDBManager):
(WI.IndexedDBManager.prototype.get domains): Added.
(WI.IndexedDBManager.prototype.activateExtraDomain): Added.
(WI.IndexedDBManager.prototype.initializeTarget):
(WI.IndexedDBManager.prototype.enable): Added.
(WI.IndexedDBManager.prototype.disable): Added.
(WI.IndexedDBManager.prototype.clearObjectStore):
(WI.IndexedDBManager.prototype._reset): Added.
(WI.IndexedDBManager.prototype._mainResourceDidChange):
(WI.IndexedDBManager.prototype.initialize): Deleted.
* UserInterface/Controllers/AppController.js:
(WI.AppController.prototype.activateExtraDomains):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.get domains): Added.
(WI.CanvasManager.prototype.activateExtraDomain): Added.
Only call `enable` on any extra agents if the domain is not controlled by a manager.
* UserInterface/Views/StorageTabContentView.js:
(WI.StorageTabContentView):
(WI.StorageTabContentView.static isTabAllowed):
(WI.StorageTabContentView.prototype.canShowRepresentedObject):
(WI.StorageTabContentView.prototype.closed): Added.
* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WI.loaded):
(WI.contentLoaded):
2019-08-02 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: Develop > Start Timeline Recording doesn't work when focused on a detached inspector window
https://bugs.webkit.org/show_bug.cgi?id=200125
<rdar://problem/53543008>
Reviewed by Brian Burg.
Always show the Timelines tab in Web Inspector whenever timeline recording starts/stops.
Notify the UIProcess whenever the timeline recording state changes.
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setTimelineProfilingEnabled):
2019-08-02 Devin Rousso <drousso@apple.com>
Web Inspector: "Inspector.initialized" happens before breakpoints are set
https://bugs.webkit.org/show_bug.cgi?id=200364
Reviewed by Joseph Pecoraro.
Allow managers to register a promise that will delay `Inspector.initialized`. This is needed
when restoring breakpoints so that "Automatically Show Web Inspector for JSContexts" can set
them before any scripts have evaluated, ensuring that no breakpoints are "skipped".
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.initialize):
(WI.Target.registerInitializationPromise): Added.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
2019-08-01 Devin Rousso <drousso@apple.com>
Unreviewed, remove `emulateUserGesture` parameter from `Debugger.evaluateOnCallFrame` for iOS 13
Rubber-stamped by Joseph Pecoraro.
* UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js:
* Versions/Inspector-iOS-13.0.json:
The iOS 13 protocol has already been decided, so these shouldn't have been added unless they
were cherry-picked in.
2019-07-31 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: support emulateUserGesture parameter in Debugger.evaluateOnCallFrame
https://bugs.webkit.org/show_bug.cgi?id=200272
Reviewed by Joseph Pecoraro.
When paused, evaluating in the console should still respect the "Emulate User Gesture" checkbox.
* UserInterface/Controllers/RuntimeManager.js:
(WI.RuntimeManager.prototype.evaluateInInspectedWindow):
* UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js:
* Versions/Inspector-iOS-13.0.json:
2019-07-31 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'issueMessage.sourceCodeLocation.sourceCode')
https://bugs.webkit.org/show_bug.cgi?id=200296
Reviewed by Joseph Pecoraro.
When fetching all `WI.IssueMessage`s for a given `WI.SourceCode`, the `WI.IssueMessage` may
be associated in a different way (e.g. by url, instead of `WI.SourceCodeLocation`). As such,
we should pass the `WI.SourceCode` along, and use it when adding the `WI.IssueTreeElement`.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._addIssuesForSourceCode):
(WI.DebuggerSidebarPanel.prototype._addIssue):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._addIssue):
(WI.SourcesNavigationSidebarPanel.prototype._addIssuesForSourceCode):
2019-07-31 Devin Rousso <drousso@apple.com>
Web Inspector: DOM: provide a way to disable/breakpoint all event listeners for a given DOM node or event type
https://bugs.webkit.org/show_bug.cgi?id=200233
Reviewed by Joseph Pecoraro.
Often, when trying to debug issues with DOM events, it's extremely tedious to have to go
through event listeners one by one and disable them (or set a breakpoint). This patch adds
a way of performing these "state modifications" in batch operations, based on the current
grouping method of the Event Listeners section.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.supportsDisablingEventListeners): Added.
(WI.DOMManager.supportsEventListenerBreakpoints): Added.
Common convenience functions for checking for protocol support.
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.createEventListenerSection):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.css:
(.sidebar > .panel.dom-node-details .details-section.dom-node-event-listeners .details-section.event-listener-section > .header > .event-listener-options): Added.
(.sidebar > .panel.dom-node-details .details-section.dom-node-event-listeners .details-section.event-listener-section:hover > .header > .event-listener-options): Added.
Add an options element that shows a context menu:
- "Disable Event Listeners"/"Enable Event Listeners"
- "Add Breakpoints"/"Delete Breakpoints"
Each action applies the corresponding state to all event listeners in that section.
* UserInterface/Views/EventListenerSectionGroup.js:
(WI.EventListenerSectionGroup):
(WI.EventListenerSectionGroup.prototype.get supportsStateModification): Added.
(WI.EventListenerSectionGroup.prototype.get isEventListenerDisabled): Added.
(WI.EventListenerSectionGroup.prototype.set isEventListenerDisabled): Added.
(WI.EventListenerSectionGroup.prototype.get hasEventListenerBreakpoint): Added.
(WI.EventListenerSectionGroup.prototype.set hasEventListenerBreakpoint): Added.
(WI.EventListenerSectionGroup.prototype._updateDisabledToggle): Added.
(WI.EventListenerSectionGroup.prototype._updateBreakpointToggle): Added.
(WI.EventListenerSectionGroup.prototype._createDisabledToggleRow): Deleted.
(WI.EventListenerSectionGroup.prototype._createBreakpointToggleRow): Deleted.
Expose a way to modify the event listener's state so that the UI (e.g. checkbox and title)
also get's updated.
* Localizations/en.lproj/localizedStrings.js:
2019-07-30 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Resources: Display outline around images when viewing image collections
https://bugs.webkit.org/show_bug.cgi?id=200212
Reviewed by Devin Rousso.
* UserInterface/Views/CollectionContentView.css:
(.content-view.collection .resource.image img):
(.content-view.collection .resource.image img:hover):
2019-07-29 Devin Rousso <drousso@apple.com>
Web Inspector: Resources: add a "Show Grid" navigation item for the Images collection
https://bugs.webkit.org/show_bug.cgi?id=200260
Reviewed by Joseph Pecoraro.
Each subview `WI.ImageResourceContentView` already listens for changes to the underlying
`WI.settings.showImageGrid` and adds the `.show-grid` class if enabled. As such, this change
just adds a `WI.ButtonNavigationItem` for toggling `WI.settings.showImageGrid` from the
Images "folder".
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView):
(WI.ResourceCollectionContentView.prototype.get navigationItems):
(WI.ResourceCollectionContentView.prototype.attached): Added.
(WI.ResourceCollectionContentView.prototype.detached): Added.
(WI.ResourceCollectionContentView.prototype._updateImageTypeScopeBar):
Drive-by: hide the image type `WI.ScopeBar` if there's only one type of image.
(WI.ResourceCollectionContentView.prototype._handleShowGridButtonClicked): Added.
(WI.ResourceCollectionContentView.prototype._handleShowImageGridSettingChanged): Added.
2019-07-29 Devin Rousso <drousso@apple.com>
Web Inspector: add -webkit-* keywords for *-height CSS properties
https://bugs.webkit.org/show_bug.cgi?id=200240
Reviewed by Joseph Pecoraro.
* UserInterface/Models/CSSKeywordCompletions.js:
* UserInterface/Views/Main.css:
(.message-text-view):
* UserInterface/Views/Toolbar.css:
(.toolbar .control-section):
(.toolbar .item-section):
Replace `-webkit-min-content` with `min-content`.
2019-07-26 Greg Doolittle <gr3g@apple.com>
Web Inspector: AXI: Audit: Typo of "some" as "somee"
https://bugs.webkit.org/show_bug.cgi?id=200166
Reviewed by Devin Rousso.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype._addDefaultTests):
(WI.AuditManager):
2019-07-24 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: no context menu items work when context menu clicking on "Add Breakpoint"
https://bugs.webkit.org/show_bug.cgi?id=199953
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.addMouseDownContextMenuHandlers): Added.
Create a helper function for managing elements that show a context menu on "mousedown".
* UserInterface/Base/SearchUtilities.js:
(WI.SearchUtilities.createSettingsButton):
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype.initialLayout):
(WI.CanvasContentView.prototype._populateCanvasElementButtonContextMenu): Added.
(WI.CanvasContentView.prototype._populateViewShaderButtonContextMenu): Added.
(WI.CanvasContentView.prototype._populateViewRecordingButtonContextMenu): Added.
(WI.CanvasContentView.prototype._handleCanvasElementButtonMouseDown): Deleted.
(WI.CanvasContentView.prototype._handleViewShaderButtonMouseDown): Deleted.
(WI.CanvasContentView.prototype._handleViewRecordingButtonMouseDown): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu): Added.
(WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointMouseDown): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu): Added.
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeMouseDown): Deleted.
(WI.SourcesNavigationSidebarPanel.prototype._handleCreateBreakpointMouseDown): Deleted.
* UserInterface/Views/TabBar.js:
(WI.TabBar):
(WI.TabBar.prototype._handleTabPickerTabContextMenu): Deleted.
* UserInterface/Views/LegacyTabBar.js:
(WI.LegacyTabBar):
(WI.LegacyTabBar.prototype._handleTabPickerTabContextMenu): Deleted.
Remove the "contextmenu" handler on the tab picker, as that's already used by the entire
tab bar to show/hide tabs.
2019-07-24 Devin Rousso <drousso@apple.com>
Web Inspector: print the target of `console.screenshot` last so the target is the closest item to the image
https://bugs.webkit.org/show_bug.cgi?id=199308
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
(WI.ConsoleMessageView.prototype._handleContextMenu):
* UserInterface/Views/ConsoleMessageView.css:
(.console-image > .console-message-body > :matches(hr, img)): Added.
(.console-image > .console-message-body > hr): Added.
(.console-image > .console-message-body > img): Added.
(.console-log-level.console-image::before): Added.
(.console-message-body > .console-image): Deleted.
(.console-log-level.console-image-container::before): Deleted.
Allow `ConsoleMessage.MessageType.Image` to be an `ConsoleMessage.MessageLevel.Error`, and
print the message (and extra parameters) in that case.
Drive-by: reorganize the switch-case so all paths have the same `default` case.
* Localizations/en.lproj/localizedStrings.js:
2019-07-23 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Styles: Command-X should cut selected properties
https://bugs.webkit.org/show_bug.cgi?id=199341
Reviewed by Devin Rousso.
Implement cutting of selected CSS properties in the style editor.
Unify cutting and copying logic wherever possible.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.placeTextCaretInFocusedProperty): Added.
Cut/copy events could only fire on SpreadsheetCSSStyleDeclarationEditor element if it
has selection inside of it. Placing text caret at the beginning of the focused property
ensures that.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy): Deleted.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._copySelectedProperties): Added.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._removeSelectedProperties): Added.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection):
* UserInterface/Views/SpreadsheetStyleProperty.js:
Remove old copying logic.
2019-07-23 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Display "Resource has no content" for about:blank iframes instead of an error
https://bugs.webkit.org/show_bug.cgi?id=198029
Reviewed by Devin Rousso.
Display "about:blank" in the middle of the content view when selecting "about:blank" resources.
Previoulsly, we showed a misleading "An error occurred trying to load the resource" error
message.
* UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet.prototype.requestContentFromBackend):
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.requestContentFromBackend):
* UserInterface/Models/Script.js:
(WI.Script.prototype.requestContentFromBackend):
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.generateSpecialContentForURL):
(WI.SourceCode.prototype._processContent):
(WI.SourceCode):
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView.prototype._contentAvailable):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._contentAvailable):
(WI.SourceCodeTextEditor.prototype._showMessage):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._contentDidPopulate):
Display empty text editor when it has no content instead of "Resource has no content" message.
2019-07-22 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: Breakpoint at specified location already exists.
https://bugs.webkit.org/show_bug.cgi?id=197034
<rdar://problem/50049004>
Reviewed by Joseph Pecoraro.
When "adjusting" a `WI.Breakpoint` (e.g. removing and then re-adding with a different
configuration), make sure to only re-add the `WI.Breakpoint` to the `WI.Target` it was just
removed from, rather to all `WI.targets`.
Since we iterate over `WI.targets` in both `WI.DebuggerManager.prototype._setBreakpoint` and
`WI.DebuggerManager.prototype._removeBreakpoint`, we ended up iterating `WI.targets` twice.
Each time the `WI.Breakpoint` is removed from a `WI.Target`, pass the `WI.Target` to the
`callback` given to `WI.DebuggerManager.prototype._removeBreakpoint`, so that the eventual
call to `WI.DebuggerManager.prototype._setBreakpoint` can reuse it as the `specificTarget`,
instead of iterating `WI.targets` (meaning we only iterate it once).
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.addBreakpoint):
(WI.DebuggerManager.prototype._removeBreakpoint.didRemoveBreakpoint):
(WI.DebuggerManager.prototype._breakpointDisplayLocationDidChange):
(WI.DebuggerManager.prototype._breakpointEditablePropertyDidChange):
2019-07-22 Devin Rousso <drousso@apple.com>
Localization: change fps to FPS
<rdar://problem/53342508>
Rubber-stamped by Joseph Pecoraro.
* UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
(WI.RenderingFrameTimelineOverviewGraph.prototype._updateDividers.createDividerAtPosition):
* Localizations/en.lproj/localizedStrings.js:
2019-07-19 Devin Rousso <drousso@apple.com>
Web Inspector: Issues toggling multiple breakpoints on one line
https://bugs.webkit.org/show_bug.cgi?id=199918
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor):
(WI.SourceCodeTextEditor.prototype.close):
(WI.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
(WI.SourceCodeTextEditor.prototype.textEditorUpdatedFormatting):
(WI.SourceCodeTextEditor.prototype._handleFormatterDidChange): Added.
Listen for `WI.SourceCode.Event.FormatterDidChange` events as there may be multiple content
views for the same `WI.SourceCode`. Previously, if there were, only the active one would
properly update it's "line -> column -> breakpoint" mapping, causing an error to be thrown
when the non-active content views tried to retrieve the breakpoint for the new line/column.
2019-07-17 Olivier Blin <olivier.blin@softathome.com>
Web Inspector: application/xml content not shown
https://bugs.webkit.org/show_bug.cgi?id=199861
Reviewed by Devin Rousso.
application/xml content from XHR requests was not shown in the
inspector, an error message was displayed instead.
application/xml content should be treated as text, since
application/xml is the standard mimetype for XML content.
Apache serves XML content with the application/xml mimetype by
default.
* UserInterface/Base/MIMETypeUtilities.js:
(WI.fileExtensionForMIMEType):
Report "xml" extension for "application/xml" mimetype.
(WI.shouldTreatMIMETypeAsText):
Treat XML files as text.
2019-07-16 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Changes panel should be strictly LTR
https://bugs.webkit.org/show_bug.cgi?id=199767
Reviewed by Joseph Pecoraro.
Changes panel is primarily CSS code and CSS is strictly LTR.
* UserInterface/Views/ChangesDetailsSidebarPanel.js:
(WI.ChangesDetailsSidebarPanel):
2019-07-15 Youenn Fablet <youenn@apple.com>
Enable a debug WebRTC mode without any encryption
https://bugs.webkit.org/show_bug.cgi?id=199177
<rdar://problem/52074986>
Reviewed by Eric Carlson.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
2019-07-15 Greg Doolittle <gr3g@apple.com>
Web Inspector: AXI: Audit: Typos in Accessibility audits
https://bugs.webkit.org/show_bug.cgi?id=199716
<rdar://problem/52721711>
Reviewed by Devin Rousso.
* UserInterface/Controllers/AuditManager.js:
2019-07-15 Devin Rousso <drousso@apple.com>
Web Inspector: Device Settings: update Safari user agent from 12.2 to 13.0
https://bugs.webkit.org/show_bug.cgi?id=199758
Reviewed by Maciej Stachowiak.
* UserInterface/Base/Main.js:
(WI._handleDeviceSettingsToolbarButtonClicked):
2019-07-12 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Changes: dismissing a blank property makes style rule to show in Changes panel
https://bugs.webkit.org/show_bug.cgi?id=199760
Reviewed by Devin Rousso.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
Call updatePropertiesModifiedState even when _updateOwnerStyleText returns early.
2019-07-12 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: always show all navigation bar items, but disable those that wouldn't work
https://bugs.webkit.org/show_bug.cgi?id=199594
Reviewed by Ross Kirsling.
Reorder the navigation items of the Elements tab (left to right):
- Show rulers
- Force print media styles
- Force Dark Appearance / Force Light Appearance
- Show compositing borders
- Enable paint flashing
- Show shadow DOM nodes
This way, "related" (e.g. print styles and dark/light appearance both relate to CSS media)
toggles are grouped closer together.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype.get navigationItems):
(WI.DOMTreeContentView.prototype._defaultAppearanceDidChange):
(WI.DOMTreeContentView.prototype._toggleAppearance):
* Localizations/en.lproj/localizedStrings.js:
2019-07-11 Devin Rousso <drousso@apple.com>
Web Inspector: Layers: Uncaught Exception: Request with id = 2 failed. {"code":-32601,"message":"'Page' domain was not found","data":[{"code":-32601,"message":"'Page' domain was not found"}]}
https://bugs.webkit.org/show_bug.cgi?id=199555
Reviewed by Joseph Pecoraro.
Use modern inspected target support checking, and defer agent commands until a target is
available.
* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype._showPaintRectsSettingChanged):
(WI.Layers3DContentView.prototype._updateCompositingBordersButtonState):
(WI.Layers3DContentView.prototype._toggleCompositingBorders):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype._toggleCompositingBorders):
(WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings):
(WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged):
(WI.DOMTreeContentView.prototype._showPrintStylesChanged):
(WI.DOMTreeContentView.prototype._showRulersChanged):
Drive-by: apply the same changes to the Elements tab for when the Layers tab isn't enabled.
2019-07-09 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: replace WTF::Vector with std::initializer_list in CallTracer to avoid dynamic allocations
https://bugs.webkit.org/show_bug.cgi?id=199611
Reviewed by Joseph Pecoraro.
* UserInterface/Models/Recording.js:
(WI.Recording.prototype.async swizzle):
Drive-by: handle the situation where a parameter is an array of deduplicated strings, which
would otherwise be treated as an array of numbers.
2019-07-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Add another Protocol Version (iOS 13.0)
https://bugs.webkit.org/show_bug.cgi?id=199631
<rdar://problem/47538193>
Reviewed by Devin Rousso.
* UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js: Added.
* Versions/Inspector-iOS-13.0.json: Added.
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: special breakpoints and event targets should be sorted into separate "areas"
https://bugs.webkit.org/show_bug.cgi?id=199554
Reviewed by Joseph Pecoraro.
Move the special All Requests breakpoint down to be right above all other URL breakpoints.
Move the `window` object tree element below other DOM node tree elements.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._addTreeElement):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: DOM Debugger: there should be different icons for each type of DOM breakpoint
https://bugs.webkit.org/show_bug.cgi?id=199552
Reviewed by Joseph Pecoraro.
[S] for Subtree Modified
[A] for Attribute Modified
[R] for Node Removed
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement):
* UserInterface/Views/DOMBreakpointTreeElement.css: Added.
(.breakpoint.dom.breakpoint-for-subtree-modified:not(.breakpoint-paused-icon) .icon):
(.breakpoint.dom.breakpoint-for-attribute-modified:not(.breakpoint-paused-icon) .icon):
(.breakpoint.dom.breakpoint-for-node-removed:not(.breakpoint-paused-icon) .icon):
* UserInterface/Main.html:
* UserInterface/Images/DOMBreakpointAttributeModified.svg: Added.
* UserInterface/Images/DOMBreakpointNodeRemoved.svg: Added.
* UserInterface/Images/DOMBreakpointSubtreeModified.svg: Added.
2019-07-08 Devin Rousso <drousso@apple.com>
Uncaught Exception: Unexpected enum value: CPU
https://bugs.webkit.org/show_bug.cgi?id=199564
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype._updateAutoCaptureInstruments):
Filter the list of auto-capture instruments based on what's actually supported, instead of
directly using the saved list from the `WI.Setting`.
2019-07-08 Devin Rousso <drousso@apple.com>
Enabling the Layers tab hides the paint flashing button
https://bugs.webkit.org/show_bug.cgi?id=199549
Reviewed by Joseph Pecoraro.
Still show the Compositing Borders and Paint Flashing navigation items in the Elements tab
even when the Layers tab is enabled (just like the Layers details sidebar).
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.get navigationItems):
(WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings):
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Elements: pasting in the Styles sidebar adds a text node to the DOM tree
https://bugs.webkit.org/show_bug.cgi?id=199588
Reviewed by Joseph Pecoraro.
* UserInterface/Base/Main.js:
(WI._paste):
Bail if `event.defaultPrevented`, as that means that something else has handled (and likely
overrode) this event.
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: the "x" in the Exception icon overlaps the border
https://bugs.webkit.org/show_bug.cgi?id=199553
Reviewed by Joseph Pecoraro.
* UserInterface/Images/Exception.svg:
* UserInterface/Images/Function.svg:
* UserInterface/Images/TailDeletedFunction.svg:
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: there should be a different icon for URL breakpoints
https://bugs.webkit.org/show_bug.cgi?id=199550
Reviewed by Joseph Pecoraro.
Use the same (down|up) arrow icon for the Network Tab and the Network timeline.
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement):
* UserInterface/Views/URLBreakpointTreeElement.css:
(.breakpoint.url:not(.breakpoint-paused-icon) .icon): Added.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._addBreakpoint):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
* UserInterface/Images/URLBreakpoint.svg: Added.
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: CPU: the Duration string isn't localized
https://bugs.webkit.org/show_bug.cgi?id=199582
<rdar://problem/51698165>
Reviewed by Joseph Pecoraro.
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype._layoutEnergyChart):
* Localizations/en.lproj/localizedStrings.js:
2019-07-06 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Styles: unbalanced quotes and parenthesis aren't displayed as property closed after editing values
https://bugs.webkit.org/show_bug.cgi?id=199090
<rdar://problem/51965431>
Reviewed by Devin Rousso.
`}` gets added by WI.tokenizeCSSValue (called by SpreadsheetStyleProperty.prototype._renderValue)
when it encounters unbalanced quotes. Fix unbalanced quotes by re-rendering the value from the model,
not the DOM content.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidCommit):
For consistency, render property name from the model as well.
2019-07-05 Devin Rousso <drousso@apple.com>
Web Inspector: current call frame indicator not visible in dark mode
https://bugs.webkit.org/show_bug.cgi?id=199047
<rdar://problem/51922895>
Reviewed by Timothy Hatcher.
* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline .item.call-frame .status > .status-image):
(.tree-outline .item.call-frame.selected .status > .status-image):
Replace the CSS variables used for `fill` with their actual color value (in `light` mode),
as the semantic "name" of the variable doesn't really match its usage. As an example, the
current call frame shouldn't rely on the value of `--border-color`, as it's not a "border".
2019-07-05 Matt Baker <mattbaker@apple.com>
Web Inspector: Elements: use a CSS transition when showing/hiding DOM breakpoint gutter
https://bugs.webkit.org/show_bug.cgi?id=199411
Reviewed by Devin Rousso.
* UserInterface/Views/DOMTreeContentView.css:
(.content-view.dom-tree .tree-outline.dom):
2019-07-02 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: allow nodes to be copied and pasted
https://bugs.webkit.org/show_bug.cgi?id=199182
Reviewed by Matt Baker.
Copy is already supported, so there's nothing that needs to be done there.
Pasting is as simple as calling `insertAdjacentHTML("afterend", ...)` on the selected node.
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI._paste): Added.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.handlePasteEvent): Added.
2019-07-02 Devin Rousso <drousso@apple.com>
Web Inspector: DOM Debugger: descendant breakpoints should be able to be enabled/disabled/deleted from a collapsed parent
https://bugs.webkit.org/show_bug.cgi?id=199332
Reviewed by Matt Baker.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.get domBreakpoints):
(WI.DOMDebuggerManager.prototype.domBreakpointsForNode):
(WI.DOMDebuggerManager.prototype.domBreakpointsInSubtree): Added.
(WI.DOMDebuggerManager.prototype.removeDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._detachDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._detachBreakpointsForFrame):
(WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL):
(WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
Provide a way of getting a "summary" array of `DOMBreakpoint`s for all descendant nodes.
Rework the data structure for holding `DOMBreakpoint`s to use a `Multimap` so no duplicates
can be added (it uses a `Set` instead of an `Array`).
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype.get hasBreakpoint):
(WI.DOMTreeElement.prototype.set breakpointStatus):
(WI.DOMTreeElement.prototype.bindRevealDescendantBreakpointsMenuItemHandler): Added.
(WI.DOMTreeElement.prototype._subtreeBreakpointChanged): Added.
(WI.DOMTreeElement.prototype._updateBreakpointStatus):
(WI.DOMTreeElement.prototype._statusImageContextmenu):
(WI.DOMTreeElement.prototype.subtreeBreakpointCountDidChange): Deleted.
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
(WI.appendContextMenuItemsForDOMNodeBreakpoints):
Keep track of the actual descendant `DOMNodeTreeElement` that have breakpoints, rather than
just a count, so that the "Reveal Descendant Breakpoints" action is able to access them.
Change "Reveal Descendant Breakpoints" to reveal and select all descendant breakpoints
instead of just the first one.
Drive-by: don't remove specific (event) listener breakpoints when invoking the
"Delete Descendant Breakpoints" action, as that's not obvious from the UI.
* UserInterface/Controllers/BreakpointPopoverController.js:
(WI.BreakpointPopoverController.prototype.appendContextMenuItems):
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement.prototype.populateContextMenu):
* UserInterface/Views/DOMNodeTreeElement.js:
(WI.DOMNodeTreeElement.prototype.populateContextMenu):
* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement.prototype.populateContextMenu):
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement.prototype.populateContextMenu):
Remove the separator before "Delete Breakpoint" so all breakpoint actions are in the same section.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Multimap.js:
(Multimap.prototype.get size): Added.
2019-07-02 Matt Baker <mattbaker@apple.com>
REGRESSION (r238563): Web Inspector: Selection is erratic when holding Up/Down on Network Table
https://bugs.webkit.org/show_bug.cgi?id=193841
<rdar://problem/47559124>
Reviewed by Devin Rousso.
Selecting and revealing a row after reloading Table data, but before the
layout that populates visible rows, could cause the Table to always be
scrolled so that the revealed row is first.
This patch fixes `revealRow` by calculating the position of the row being
revealed in the absence of its DOM element, so that the Table is only
scrolled when necessary.
* UserInterface/Views/Table.js:
(WI.Table.prototype.revealRow):
(WI.Table.prototype._resizeColumnsAndFiller):
Drive-by fix: use realOffsetWidth for consistency.
(WI.Table.prototype._updateVisibleRows):
(WI.Table.prototype._calculateOffsetHeight):
(WI.Table.prototype._calculateScrollTop):
2019-07-02 Devin Rousso <drousso@apple.com>
Web Inspector: Debug: "Reset Web Inspector" should also clear the saved window size and attachment side
https://bugs.webkit.org/show_bug.cgi?id=198956
Reviewed by Matt Baker.
* UserInterface/Base/Main.js:
(WI.reset): Added.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createDebugSettingsView):
2019-07-02 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: missing demo audits for WebInspectorAudit functions
https://bugs.webkit.org/show_bug.cgi?id=198719
Reviewed by Matt Baker.
Other than the LayoutTests, there's no way to see an example of the functionality of many of
the exposed `WebInspectorAudit` functions. There should be a demo audit for every exposed
function so they're more discoverable.
* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype._addDefaultTests):
(WI.AuditManager.prototype._addDefaultTests.removeWhitespace): Added.
Move all demo audit test functions to be actual JavaScript functions, which are then
stringified and stripped of unnecessary white-space.
* Localizations/en.lproj/localizedStrings.js:
2019-07-01 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r245498): Timelines: CPU: discontinuities are filled in by the next record
https://bugs.webkit.org/show_bug.cgi?id=198927
Reviewed by Matt Baker.
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.capturingStarted):
(WI.TimelineManager.prototype.capturingStopped):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording):
(WI.TimelineRecording.prototype.start):
(WI.TimelineRecording.prototype.capturingStarted): Added.
(WI.TimelineRecording.prototype.capturingStopped): Added.
(WI.TimelineRecording.prototype.reset):
(WI.TimelineRecording.prototype.addRecord):
(WI.TimelineRecording.prototype.discontinuitiesInTimeRange):
(WI.TimelineRecording.prototype.addDiscontinuity): Deleted.
Notify the `TimelineRecording` when capturing has started/stopped.
Adjust the first record after a discontinuity to have it's `startTime` match the `endTime`
of the most recent discontinuity.
* UserInterface/Models/Timeline.js:
(WI.Timeline.prototype.addRecord):
* UserInterface/Models/CPUTimeline.js:
(WI.CPUTimeline.prototype.addRecord):
* UserInterface/Models/CPUTimelineRecord.js:
(WI.CPUTimelineRecord.prototype.adjustStartTime): Added.
(WI.CPUTimelineRecord.prototype.adjustStartTimeToLastRecord): Deleted.
* UserInterface/Models/MemoryTimeline.js:
(WI.MemoryTimeline.prototype.addRecord):
* UserInterface/Models/MemoryTimelineRecord.js:
(WI.MemoryTimelineRecord.prototype.adjustStartTime): Added.
(WI.MemoryTimelineRecord.prototype.adjustStartTimeToLastRecord): Deleted.
* UserInterface/Models/NetworkTimeline.js:
(WI.NetworkTimeline.prototype.addRecord):
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.layout):
* UserInterface/Views/MemoryTimelineOverviewGraph.js:
(WI.MemoryTimelineOverviewGraph.prototype.layout):
* UserInterface/Views/MemoryTimelineView.js:
(WI.MemoryTimelineView.prototype.layout):
Include discontinuities that exactly match the start/end time of the record immediately
before/after the discontinuity.
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._handleTimelineCapturingStateChanged):
(WI.TimelineRecordingContentView.prototype._recordingReset):
Move the logic for handling discontinuity start/end times to the `TimelineRecording`.
* UserInterface/Base/Utilities.js:
2019-06-29 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Remove trailing white-space
https://bugs.webkit.org/show_bug.cgi?id=199346
Reviewed by Matt Baker.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype._initiatorCallFramesFromPayload):
* UserInterface/Images/Import.svg:
* UserInterface/Views/CanvasOverviewContentView.css:
(.navigation-bar > .item.canvas-recording-auto-capture > label > input):
* UserInterface/Views/DataGrid.css:
(.data-grid .resizer):
* UserInterface/Views/DatabaseContentView.css:
(.storage-view):
* UserInterface/Views/GoToLineDialog.css:
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/GradientSlider.css:
(.gradient-slider > .add-area):
(.gradient-slider-knob > :matches(img, div)):
* UserInterface/Views/ResourceDetailsSection.css:
* UserInterface/Views/ScrubberNavigationItem.css:
(.navigation-bar .item.scrubber > input[disabled]):
* UserInterface/Views/SourceCodeTextEditor.css:
(.popover .expandable):
* UserInterface/Views/TimelineRecordBar.css:
(.timeline-record-bar.timeline-record-type-script.garbage-collected > .segment,):
* UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
(HeapSnapshotWorker.prototype.createSnapshot):
2019-06-29 Nikita Vasilyev <nvasilyev@apple.com>
Remove duplicate "Private" section and fix white space
Unreviewed code style fix.
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
2019-06-27 Beth Dakin <bdakin@apple.com>
Upstream use of MACCATALYST
https://bugs.webkit.org/show_bug.cgi?id=199245
rdar://problem/51687723
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig:
2019-06-27 Devin Rousso <drousso@apple.com>
Web Inspector: throw an error if console.count/console.countReset is called with an object that throws an error from toString
https://bugs.webkit.org/show_bug.cgi?id=199252
Reviewed by Joseph Pecoraro.
Add entries for `console.countReset` and `console.timeLog`.
Rename `title` to `label` for `console.time`, `console.timeLog`, and `console.timeEnd` to
better match the spec.
* UserInterface/Models/NativeFunctionParameters.js:
2019-06-26 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Update legacy backend commands after enum name change
https://bugs.webkit.org/show_bug.cgi?id=199250
Reviewed by Devin Rousso.
* UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
2019-06-26 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Elements: the forced pseudo-class indicator isn't visible when hovering
https://bugs.webkit.org/show_bug.cgi?id=199166
Reviewed by Matt Baker.
Make the pseudo-class indicator into its own element instead of being a `::before`.
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype.updateSelectionArea):
(WI.DOMTreeElement.prototype.updateTitle):
(WI.DOMTreeElement.prototype._updatePseudoClassIndicator): Added.
(WI.DOMTreeElement.prototype.get pseudoClassesEnabled): Deleted.
(WI.DOMTreeElement.prototype._nodePseudoClassesDidChange): Deleted.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom):
(.tree-outline.dom li .pseudo-class-indicator): Added.
(body[dir=ltr] .tree-outline.dom li .pseudo-class-indicator): Added.
(body[dir=rtl] .tree-outline.dom li .pseudo-class-indicator): Added.
(.tree-outline.dom:focus li.selected .pseudo-class-indicator): Added.
(.tree-outline.dom li.pseudo-class-enabled > .selection-area::before): Deleted.
(body[dir=ltr] .tree-outline.dom li.pseudo-class-enabled > .selection-area::before): Deleted.
(body[dir=rtl] .tree-outline.dom li.pseudo-class-enabled > .selection-area::before): Deleted.
(.tree-outline.dom:focus li.selected.pseudo-class-enabled > .selection-area::before): Deleted.
* UserInterface/Views/FormattedValue.css:
(.formatted-node > .tree-outline.dom):
Adjust the indent of any `DOMTreeOutline` so there's more room for the pseudo-class
indicator, such as in the Console.
2019-06-25 Matt Baker <mattbaker@apple.com>
Web Inspector: Elements: show shadow DOM by default
https://bugs.webkit.org/show_bug.cgi?id=199128
Reviewed by Devin Rousso.
* UserInterface/Base/Setting.js:
* UserInterface/Test/Test.js:
(WI.loaded):
Overriding the default value isn't necessary since the default is now true.
2019-06-25 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r246621): Web Inspector: Styles: property may get removed when editing after deleting value
https://bugs.webkit.org/show_bug.cgi?id=199143
<rdar://problem/52042815>
Reviewed by Matt Baker.
r246621 affected when WI.CSSStyleDeclaration.Event.PropertiesChanged event is fired, which caused
SpreadsheetCSSStyleDeclarationEditor to possibly enter a state when `focused` property is
incorrectly set to false.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved): Removed.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyWillRemove): Added.
Renamed from "removed" to "willRemove" since we need to call it before the property DOM element
is detached from the document.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.remove):
Don't set focused to false when the removed property wasn't focused.
This code need to exist because removing focused element from the DOM doesn't trigger blur event.
2019-06-25 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Implement console.timeLog
https://bugs.webkit.org/show_bug.cgi?id=199184
Reviewed by Devin Rousso.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
Time messages (like timeLog) do not include their messageText
in their parameters list. So to behave more like normal logs
build a parameter list that includes it at the front.
2019-06-23 Matt Baker <mattbaker@apple.com>
Web Inspector: REGRESSION (r246684): Dark Mode: dashboard buttons should have no background
https://bugs.webkit.org/show_bug.cgi?id=199136
<rdar://problem/52035798>
Reviewed by Joseph Pecoraro.
* UserInterface/Views/DefaultDashboardView.css:
(@media (prefers-color-scheme: dark)):
(.toolbar .dashboard .item.button,):
2019-06-23 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Styles: show green highlight for newly added properties only when name and value are present
https://bugs.webkit.org/show_bug.cgi?id=199131
Reviewed by Matt Baker.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.updateStatus):
2019-06-22 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r241980): Web Inspector: Styles: Pressing Tab/Enter on last property no longer focuses on selector on next rule
https://bugs.webkit.org/show_bug.cgi?id=199125
<rdar://problem/52011182>
Reviewed by Matt Baker.
Since SpreadsheetSelectorField's focus handler was removed in r241980, focusing on the selector element
doesn't start editing it.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.startEditingRuleSelector):
2019-06-22 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Styles: unbalanced quotes and parenthesis aren't displayed as property closed after editing values
https://bugs.webkit.org/show_bug.cgi?id=199090
<rdar://problem/51965431>
Reviewed by Matt Baker.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidBlur):
Unbalanced quotes and parenthesis are fixed inside of CSSProperty's rawValue setter.
Render the value from the model, not the view.
2019-06-21 Matt Baker <mattbaker@apple.com>
Web Inspector: remove unused DataGrid style .force-focus
https://bugs.webkit.org/show_bug.cgi?id=199112
<rdar://problem/51993412>
Reviewed by Timothy Hatcher.
* UserInterface/Views/HeapAllocationsTimelineView.css:
(.timeline-view.heap-allocations > .data-grid:not(:focus) tr.selected.invalid):
(.timeline-view.heap-allocations > .data-grid:not(:focus, .force-focus) tr.selected.invalid): Deleted.
* UserInterface/Views/ResourceTreeElement.css:
(.item.resource.resource-type-websocket:not(.selected) .status .ready-state.open,):
(.item.resource.resource-type-websocket:not(.selected) .status .ready-state.connecting,):
Missed in https://bugs.webkit.org/show_bug.cgi?id=190480.
2019-06-21 Matt Baker <mattbaker@apple.com>
Web Inspector: remove .legacy-mac/.latest-mac CSS classes, standardize on .latest-mac UI
https://bugs.webkit.org/show_bug.cgi?id=199109
<rdar://problem/51991129>
Reviewed by Timothy Hatcher.
Drop legacy macOS version support from Web Inspector UI.
* UserInterface/Base/Main.js:
* UserInterface/Views/DefaultDashboardView.css:
(@media (prefers-color-scheme: dark)):
(body.latest-mac .toolbar .dashboard .item.button): Deleted.
* UserInterface/Views/Toolbar.css:
(.toolbar):
(.toolbar .item.button,):
(.toolbar .search-bar > input[type="search"]):
(.toolbar .search-bar > input[type="search"]:focus):
(@media (-webkit-min-device-pixel-ratio: 2)):
(.toolbar .item.button:active):
(body.window-inactive .toolbar .item.button,):
(@media (prefers-color-scheme: dark)):
(.toolbar .search-bar > input[type="search"]::placeholder):
(body.window-inactive .toolbar .search-bar > input[type="search"]::placeholder):
(body.window-inactive .toolbar .search-bar > input[type="search"]::-webkit-search-results-button):
(.toolbar .dashboard-container):
(body .toolbar): Deleted.
(body.legacy-mac .toolbar .item.button,): Deleted.
(body.legacy-mac .toolbar .search-bar > input[type="search"]): Deleted.
(body.legacy-mac .toolbar .search-bar > input[type="search"]:focus): Deleted.
(body.legacy-mac .toolbar .item.button:active): Deleted.
(body.window-inactive.legacy-mac .toolbar .item.button,): Deleted.
(body.latest-mac .toolbar .item.button,): Deleted.
(body.latest-mac .toolbar .search-bar > input[type="search"]): Deleted.
(body.latest-mac .toolbar .search-bar > input[type="search"]:focus): Deleted.
(body.latest-mac .toolbar .item.button:active): Deleted.
(body.latest-mac.window-inactive .toolbar .item.button,): Deleted.
(body.latest-mac .toolbar .search-bar > input[type="search"]::placeholder): Deleted.
(body.latest-mac.window-inactive .toolbar .search-bar > input[type="search"]::placeholder): Deleted.
(body.latest-mac.window-inactive .toolbar .search-bar > input[type="search"]::-webkit-search-results-button): Deleted.
(body.latest-mac .toolbar .dashboard-container): Deleted.
2019-06-20 Matt Baker <mattbaker@apple.com>
Web Inspector: rename shadowRootPushed parameter to match protocol
https://bugs.webkit.org/show_bug.cgi?id=199098
Reviewed by Devin Rousso.
* UserInterface/Protocol/DOMObserver.js:
(WI.DOMObserver.prototype.shadowRootPushed):
2019-06-20 Devin Rousso <drousso@apple.com>
Web Inspector: Error "null is not an object (evaluating 'syntaxTree.containersOfPosition')" when setting a breakpoint
https://bugs.webkit.org/show_bug.cgi?id=199082
Reviewed by Matt Baker.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
The script syntax tree may be fetched even if the resource hasn't finished parsing (or had
a syntax error), so it's possible for it to be `null`.
2019-06-20 Devin Rousso <drousso@apple.com>
Web Inspector: Dark Mode: inactive tab bar item should get darker on hover
https://bugs.webkit.org/show_bug.cgi?id=199022
Reviewed by Darin Adler.
* UserInterface/Views/TabBar.css:
(.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover):
(@media not (prefers-color-scheme: dark) .tab-bar:not(.animating) > .item:not(.selected, .disabled):hover > .icon):
(@media (prefers-color-scheme: dark) .tab-bar):
(@media (prefers-color-scheme: dark) .tab-bar > .item):
(@media (prefers-color-scheme: dark) .tab-bar > .item:not(.disabled).selected):
(@media (prefers-color-scheme: dark) .tab-bar:not(.animating) > .item:not(.selected):hover):
(@media (prefers-color-scheme: dark) body.window-inactive .tab-bar):
(@media (prefers-color-scheme: dark) body.window-inactive .tab-bar > .item):
(@media (prefers-color-scheme: dark) body.window-inactive .tab-bar > .item.selected):
* UserInterface/Views/Toolbar.css:
(@media (prefers-color-scheme: dark) body .toolbar):
2019-06-20 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: setting a breakpoint on a non-JavaScript line should immediately show as unresolved
https://bugs.webkit.org/show_bug.cgi?id=199033
Reviewed by Matt Baker.
Remove the `shouldSpeculativelyResolve` parameter, as it was resolving breakpoints even in
the case that there were no resolved locations for the given breakpoint.
In the case that there are resolved locations, the breakpoint would've already been resolved
by the time that `shouldSpeculativelyResolve` would've taken effect, so it's unnecessary.
This parameter was only used when setting a breakpoint from a `SourceCodeTextEditor` gutter.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.addBreakpoint):
(WI.DebuggerManager.prototype._setBreakpoint):
(WI.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorBreakpointAdded):
2019-06-20 Devin Rousso <drousso@apple.com>
Web Inspector: Edit -> Tag doesn't do anything for html, head, and body elements
https://bugs.webkit.org/show_bug.cgi?id=199052
<rdar://problem/51923906>
Reviewed by Matt Baker.
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
- Don't show an "Edit > Tag" for <html>, <head>, and <body> nodes
- Disable any "Edit" submenu item if it's target is already being edited
- Prevent "Add" submenu items from being shown for text nodes
2019-06-19 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Debugger: current call frame indicator isn't vertically centered
https://bugs.webkit.org/show_bug.cgi?id=199015
Reviewed by Matt Baker.
* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline .item.call-frame .status):
2019-06-19 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r240946): Web Inspector: Styles: Pasting multiple properties has issues
https://bugs.webkit.org/show_bug.cgi?id=198505
<rdar://problem/51374780>
Reviewed by Matt Baker.
Since r240946, setting WI.CSSStyleDeclaration.prototype.text updates the text immediately.
When WI.CSSStyleDeclaration.prototype.update gets called after setting text, it exits early
without firing WI.CSSStyleDeclaration.Event.PropertiesChanged.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration):
(WI.CSSStyleDeclaration.prototype.set text):
2019-06-19 Matt Baker <mattbaker@apple.com>
Web Inspector: Remove unused _pendingFilter from NetworkTableContentView
https://bugs.webkit.org/show_bug.cgi?id=199026
Reviewed by Devin Rousso.
This flag is no longer set as of https://trac.webkit.org/changeset/225895.
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype._processPendingEntries):
2019-06-19 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'sourceCodePosition.lineNumber')
https://bugs.webkit.org/show_bug.cgi?id=199019
Reviewed by Matt Baker.
* UserInterface/Base/Main.js:
(WI.linkifyLocation):
2019-06-19 Zhifei Fang <zhifei_fang@apple.com>
Correct the error object link color in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=198033
Reviewed by Devin Rousso.
* UserInterface/Views/ErrorObjectView.css:
(@media (prefers-dark-interface)):
(.error-object-link-container):
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: Network: detail view shouldn't stay open when the related entry is removed
https://bugs.webkit.org/show_bug.cgi?id=198951
Reviewed by Joseph Pecoraro.
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._mainResourceDidChange):
Hide the detail view if the main resource changes and we aren't preserving the log.
* UserInterface/Views/Table.js:
(WI.Table.prototype.reloadVisibleColumnCells):
Only attempt to populate cells for rows that the `_dataSource` actually has. Without this,
the `_delegate` may be asked to populate a cell for a row it doesn't have, which would error.
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: parseQueryParameters fails to successfully parse query parameter values that contain "="
https://bugs.webkit.org/show_bug.cgi?id=198971
<rdar://problem/51852782>
Reviewed by Joseph Pecoraro.
* UserInterface/Base/URLUtilities.js:
(parseQueryString):
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Heap: subsequent snapshots taken manually don't appear in the list
https://bugs.webkit.org/show_bug.cgi?id=198941
Reviewed by Joseph Pecoraro.
Since heap snapshot records can be added at any time, including when not actively recording,
when the "Entire Recording" range is selected, make sure to set the `filterEndTime` to be an
effectively infinite number so that records added later aren't filtered out.
This isn't done for other timeline views as they may have graphs that don't expect to render
from time 0 till infinity, not to mention being unable to add records when not recording.
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView.prototype._updateTimelineViewTimes):
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Canvas: cannot select saved recordings
https://bugs.webkit.org/show_bug.cgi?id=198953
Reviewed by Joseph Pecoraro.
* UserInterface/Views/TreeElement.js:
(WI.TreeElement.treeElementToggled):
Don't early return if the `TreeElement` isn't `selectable` as the owner `TreeOutline` may
want to dispatch an event that it was clicked.
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: the initial state should be selected when processing a new/imported recording if the navigation sidebar is collapsed
https://bugs.webkit.org/show_bug.cgi?id=198952
Reviewed by Joseph Pecoraro.
Prevent any content from being generated until `initialLayout` is called, as otherwise it's
possible for the `CanvasNavigationSidebar` to update the current action index before the
preview element has been created, which would throw an error.
* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView.prototype.updateActionIndex):
(WI.RecordingContentView.prototype.initialLayout):
(WI.RecordingContentView.prototype._updateSliderValue):
(WI.RecordingContentView.prototype._handleRecordingProcessedAction):
Drive-by: update the slider max each time the selected action index is changed.
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: imported recordings aren't selectable from the overview if there are no canvases in the page
https://bugs.webkit.org/show_bug.cgi?id=198955
Reviewed by Joseph Pecoraro.
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._addSavedRecording):
Hide the content placeholder when a recording is imported. It won't be shown again because
the `subviews` list will never be empty, as there's no way to remove an imported recording.
* UserInterface/Views/CollectionContentView.js:
(WI.CollectionContentView.prototype.addContentViewForItem):
(WI.CollectionContentView.prototype.removeContentViewForItem):
(WI.CollectionContentView.prototype.showContentPlaceholder): Added.
(WI.CollectionContentView.prototype.hideContentPlaceholder): Added.
(WI.CollectionContentView.prototype.initialLayout):
(WI.CollectionContentView.prototype._selectItem):
(WI.CollectionContentView.prototype._showContentPlaceholder): Deleted.
(WI.CollectionContentView.prototype._hideContentPlaceholder): Deleted.
Make `showContentPlaceholder`/`hideContentPlaceholder` protected for any subclasses to call.
2019-06-17 Matt Baker <mattbaker@apple.com>
Web Inspector: Elements: remove ellipses from "Break on" context menu item title
https://bugs.webkit.org/show_bug.cgi?id=198944
Reviewed by Devin Rousso.
Update context menu title to comply with Apple HI guidelines.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ContextMenuUtilities.js:
2019-06-17 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: adding a DOM/Event/URL breakpoint should enable breakpoints
https://bugs.webkit.org/show_bug.cgi?id=198932
Reviewed by Matt Baker.
Match the behavior of JavaScript breakpoints, which enable breakpoints globally when a new
breakpoint is set or an existing breakpoint is enabled.
This avoids the situation where setting a DOM breakpoint or a specific event listener
breakpoint appears to not "work" because breakpoints are globally disabled. There is no
"breakpoints disabled" banner in the Elements tab, so the user could be completely unaware
of this, and therefore be confused as to why these breakpoints aren't being hit.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype._updateEventBreakpoint):
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
(WI.DOMDebuggerManager.prototype._updateURLBreakpoint):
2019-06-17 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: remove extra space above Breakpoints section when breakpoints are disabled
https://bugs.webkit.org/show_bug.cgi?id=198933
Reviewed by Matt Baker.
* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .warning-banner):
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > .warning-banner):
2019-06-17 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: split the General panel into sub panels so it's less crowded
https://bugs.webkit.org/show_bug.cgi?id=198803
Reviewed by Timothy Hatcher.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype.initialLayout):
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
Many of the settings in General only affect a specific part of Web Inspector, and therefore
aren't really "general".
(WI.SettingsTabContentView.prototype._createElementsSettingsView): Added.
- Element Selection
- CSS Changes
(WI.SettingsTabContentView.prototype._createSourcesSettingsView): Added.
- Debugger
- Source Maps
(WI.SettingsTabContentView.prototype._createConsoleSettingsView): Added.
- Traces (renamed from "Console")
- WebRTC Logging
- Media Logging
- MSE Logging
* Localizations/en.lproj/localizedStrings.js:
2019-06-17 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: the Inspector Style Sheet is missing when grouped by path
https://bugs.webkit.org/show_bug.cgi?id=198860
Reviewed by Timothy Hatcher.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype.get styleSheets):
(WI.CSSManager.prototype.inspectorStyleSheetsForFrame):
(WI.CSSManager.prototype.preferredInspectorStyleSheetForFrame):
(WI.CSSManager.prototype._inspectorStyleSheetsForFrame): Deleted.
Expose a way to fetch all inspector stylesheets for a given frame.
Make sure to associate inspector stylesheets with their frame.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._addResourcesRecursivelyForFrame):
(WI.SourcesNavigationSidebarPanel.prototype._handleCSSStyleSheetAdded):
Add paths for inspector stylesheet creation/fetching when grouping by path.
Sort inspector stylesheets as the first item of an origin/frame when grouping by path.
2019-06-17 Jamal Nasser <jamaln@mail.com>
Web Inspector: Go To Line dialog is white when in Dark Mode
https://bugs.webkit.org/show_bug.cgi?id=198596
Reviewed by Timothy Hatcher.
* UserInterface/Views/GoToLineDialog.css:
(@media (prefers-color-scheme: dark)):
(.go-to-line-dialog):
(.go-to-line-dialog > div > input):
(.go-to-line-dialog > div > input::placeholder):
(.go-to-line-dialog > div::before):
2019-06-17 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: searching doesn't use the case sensitive or regex global settings
https://bugs.webkit.org/show_bug.cgi?id=198897
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.customPerformSearch):
2019-06-13 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r246178): extra spaces added in at-rules when formatting CSS
https://bugs.webkit.org/show_bug.cgi?id=198806
Reviewed by Joseph Pecoraro.
* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter.prototype._format):
Add more specific tests for at-rules, and add/remove whitespace depending on the type of
at-rule (e.g. `@supports` vs `@media`), as well as where the scanner is in the parameters of
the at at-rule (e.g. `@supports |` vs `@media (|`).
* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder):
(FormatterContentBuilder.prototype.get lastToken): Added.
(FormatterContentBuilder.prototype.get currentLine):
(FormatterContentBuilder.prototype.removeLastNewline):
(FormatterContentBuilder.prototype.removeLastWhitespace):
(FormatterContentBuilder.prototype._popFormattedContent):
(FormatterContentBuilder.prototype._append):
Update `lastTokenWasNewline` and `lastTokenWasWhitespace` when removing newlines/whitespace.
Memoize the `currentLine` so it's less expensive to re-fetch.
2019-06-13 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: indent type and size settings aren't respected everywhere
https://bugs.webkit.org/show_bug.cgi?id=198804
Reviewed by Timothy Hatcher.
* UserInterface/Views/CodeMirrorEditor.js:
(WI.CodeMirrorEditor.create):
When creating a `CodeMirror` instance, default to using the global `Setting`s as the options.
If an override is specified in `options`, it will take precedence and the `CodeMirror` will
ignore any changes to the `Setting` as well.
* UserInterface/Views/TextEditor.js:
(WI.TextEditor):
(WI.TextEditor.prototype.close): Deleted.
* UserInterface/Views/AuditTestCaseContentView.js:
(WI.AuditTestCaseContentView.prototype.layout):
* UserInterface/Views/BreakpointActionView.js:
(WI.BreakpointActionView.prototype._updateBody):
* UserInterface/Views/ConsolePrompt.js:
(WI.ConsolePrompt):
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WI.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked):
Remove overrides that aren't necessary for `CodeMirror` to fit in the container element:
- `showWhitespaceCharacters`
- `indentWithTabs`
- `indentUnit`
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.close):
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView.prototype.closed): Deleted.
* UserInterface/Views/TextContentView.js:
(WI.TextContentView.prototype.closed): Deleted.
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype.closed):
Delete the logic for removing event listeners from global `Setting`, as it didn't work
anyways, since none of the event listeners were added using a `thisObject`.
2019-06-13 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: sticky header disappears when over scrolling
https://bugs.webkit.org/show_bug.cgi?id=198833
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings .navigation-bar):
(.content-view.settings > .settings-view): Added.
(.content-view.settings): Deleted.
2019-06-10 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: imported recordings do not have JavaScript call trees
https://bugs.webkit.org/show_bug.cgi?id=197490
<rdar://problem/50589158>
Reviewed by Joseph Pecoraro.
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.prototype.initializeCallingContextTrees):
Make sure to actually save the provided stack traces and samples in the export data.
* UserInterface/Models/ScriptTimelineRecord.js:
(WI.ScriptTimelineRecord.fromJSON):
(WI.ScriptTimelineRecord.prototype.toJSON):
Drive-by: include `extraDetails`, which contains useful information like "default prevented".
2019-06-10 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r244268): Web Inspector: Styles: navigating from Computed to Styles doesn't work
https://bugs.webkit.org/show_bug.cgi?id=198508
<rdar://problem/51375503>
Reviewed by Matt Baker.
It didn't work because the detached sidebar panel tried to access its parent view (this.parentSidebar).
* UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
(WI.ComputedStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty): Added.
(WI.ComputedStyleDetailsSidebarPanel):
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty): Deleted.
Move computedStyleDetailsPanelShowProperty to ComputedStyleDetailsSidebarPanel since it's the only
panel where it's needed.
2019-06-10 Alexey Shvayka <shvaikalesh@gmail.com>
Web Inspector: "Copy Path to Property" doesn't work with multiline keys
https://bugs.webkit.org/show_bug.cgi?id=198691
Reviewed by Matt Baker.
Correctly escape line terminators to prevent doubleQuotedString from returning malformed strings.
* UserInterface/Base/Utilities.js: Use JSON.stringify.
2019-06-10 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r246025): prototypes in object previews are visible even when setting `showOnlyJSON`
https://bugs.webkit.org/show_bug.cgi?id=198721
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ObjectTreeView.css:
(.object-tree.properties-only.json-only .object-tree-property.prototype-property): Added.
(.object-tree.properties-only.json-only .object-tree-property .prototype-property): Deleted.
2019-06-07 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: longhand CSS properties overridden by shorthands miss strikethrough
https://bugs.webkit.org/show_bug.cgi?id=198629
<rdar://problem/51504160>
Reviewed by Devin Rousso.
Longhand CSS properties (e.g. "font-size") overriden by shorthands (e.g. "font") now have strikethroughs.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.set overridingProperty):
(WI.CSSProperty):
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._updateStyleCascade):
Call _associateRelatedProperties before _markOverriddenProperties because
_associateRelatedProperties sets relatedShorthandProperty property, which
is now used by _markOverriddenProperties.
(WI.DOMNodeStyles.prototype._markOverriddenProperties.isOverriddenBy):
(WI.DOMNodeStyles.prototype._markOverriddenProperties):
2019-06-06 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: remove always disabled details sidebar navigation item
https://bugs.webkit.org/show_bug.cgi?id=198393
Reviewed by Timothy Hatcher.
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
2019-06-06 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r245833): Timelines: CPU: JavaScript label is missing and JavaScript section of pie chart is black
https://bugs.webkit.org/show_bug.cgi?id=198627
Reviewed by Joseph Pecoraro.
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.displayNameForSampleType):
* UserInterface/Views/CPUTimelineView.css:
(.timeline-view.cpu > .content > .overview .legend > .row > .swatch.sample-type-javascript):
(.timeline-view.cpu .circle-chart > svg > path.segment.sample-type-javascript): Added.
(.timeline-view.cpu .circle-chart > svg > path.segment.sample-type-script): Deleted.
* UserInterface/Views/CPUUsageCombinedView.css:
(.cpu-usage-combined-view > .graph > .range-chart .sample-type-javascript): Added.
(.cpu-usage-combined-view > .graph > .range-chart .sample-type-script): Deleted.
Use the enum string added in r245833 (`sample-type-javascript`) instead of what was there
before (`sample-type-script`).
* UserInterface/Views/Variables.css:
(:root):
Rename `--cpu-script-*` to `--cpu-javascript-*`.
2019-06-06 Devin Rousso <drousso@apple.com>
Web Inspector: Formatter: pretty-print CSS using a Worker
https://bugs.webkit.org/show_bug.cgi?id=197829
<rdar://problem/36891532>
Reviewed by Timothy Hatcher.
* UserInterface/Proxies/FormatterWorkerProxy.js:
(WI.FormatterWorkerProxy.prototype.formatCSS): Added.
* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatCSS): Added.
* UserInterface/Workers/Formatter/CSSFormatter.js: Added.
(CSSFormatter):
(CSSFormatter.prototype.get success):
(CSSFormatter.prototype.get formattedText):
(CSSFormatter.prototype.get sourceMapData):
(CSSFormatter.prototype._format):
* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype.get currentLine): Added.
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype._canUseFormatterWorker):
(WI.TextEditor.prototype._startWorkerPrettyPrint):
* .eslintrc:
2019-06-06 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: print/rulers/compositing/paint navigation items shouldn't be visible if the inspected target doesn't have a PageAgent
https://bugs.webkit.org/show_bug.cgi?id=198410
Reviewed by Timothy Hatcher.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype.get navigationItems):
(WI.DOMTreeContentView.prototype._showRulersChanged):
== Rolled over to ChangeLog-2019-06-05 ==