2022-02-18 Robert Jenner Unreviewed, reverting r290149. Broke Debug Builds. Reverted changeset: "Generate compile_commands.json on macOS Builds" https://bugs.webkit.org/show_bug.cgi?id=235686 https://commits.webkit.org/r290149 2022-02-18 Brandon Stewart Generate compile_commands.json on macOS Builds https://bugs.webkit.org/show_bug.cgi?id=235686 Reviewed by Saam Barati. Add support for generating compile_commands.json file to WebKit. compile_commands.json can be used by tools like clangd to provide code complete, refactoring, formatting, and cross references. Steps to generate the compile commands file: make r EXPORT_COMPILE_COMMANDS=YES generate-compile-commands WebKitBuild/Release * Configurations/DebugRelease.xcconfig: 2022-02-18 Saam Barati Add LC_SOURCE_VERSION to compile targets https://bugs.webkit.org/show_bug.cgi?id=236720 Reviewed by Michael Saboff. * Configurations/Version.xcconfig: * Configurations/WebInspectorUIFramework.xcconfig: 2022-02-17 Nikita Vasilyev Web Inspector: [Flexbox] Enable Flexbox Inspector feature https://bugs.webkit.org/show_bug.cgi?id=235820 Reviewed by Patrick Angle. Remove the engineering setting and enable the feature by default. * UserInterface/Base/Setting.js: * UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement.prototype._updateLayoutBadge): * UserInterface/Views/LayoutDetailsSidebarPanel.js: (WI.LayoutDetailsSidebarPanel.prototype.initialLayout): (WI.LayoutDetailsSidebarPanel.prototype.layout): (WI.LayoutDetailsSidebarPanel.prototype._refreshNodeSets): (WI.LayoutDetailsSidebarPanel): * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createEngineeringSettingsView): 2022-02-14 Razvan Caliman Web Inspector: [Flexbox] List flex containers in Layout sidebar https://bugs.webkit.org/show_bug.cgi?id=235647 Reviewed by Patrick Angle. The representation in the Layout details sidebar of the list of flex containers on the page is very similar to the one for grid containers: a list of nodes identified by selector, with adjacent checkboxes that synchronize state with the visibility of a page overlay, interactive color swatches to decorate the corresponding overlay, and a button to jump to the node in the DOM Tree view. Therefore, it makes sense to generalize the code for CSS Grid and reuse it for Flexbox. This patch extracts a generic `WI.NodeOverlayListSection` from `WI.CSSGridNodeOverlayListSection`. This is subclassed by `WI.CSSGridNodeOverlayListSection` and `WI.CSSFlexboxSection`. The two rely on the abstract implementations to show/hide overlays, get/set overlay colors, interrogate overlay visibility, and listen to generic overlay show events. Which particular type of overlay is the target of each panel is determined in `WI.OverlayManager` by the value of `WI.DomNode.layoutContextType`, either "flex" or "grid". A node cannot have more than one layout context type. Where the subclasses differ: - each section has its own label (obviously). - the layout for `WI.CSSGridNodeOverlayListSection` includes a section with settings for the CSS Grid overlay. * Localizations/en.lproj/localizedStrings.js: We've received feedback that the latter is more common in web developers' vocabulary when refering to CSS grids. Adopted the same for the flexbox section empty message. * UserInterface/Main.html: * UserInterface/Views/CSSFlexNodeOverlayListSection.js: Added. (WI.CSSFlexNodeOverlayListSection.prototype.get sectionLabel): (WI.CSSFlexNodeOverlayListSection): * UserInterface/Views/CSSGridNodeOverlayListSection.js: Renamed from Source/WebInspectorUI/UserInterface/Views/CSSGridSection.js. (WI.CSSGridNodeOverlayListSection.prototype.get sectionLabel): (WI.CSSGridNodeOverlayListSection.prototype.initialLayout): (WI.CSSGridNodeOverlayListSection): The layout of `WI.CSSFlexNodeOverlayListSection` includes a set of options to configure the CSS Grid overlay. * UserInterface/Views/LayoutDetailsSidebarPanel.css: (.details-section:is(.layout-css-flexbox, .layout-css-grid):not(.collapsed) > .content,): (.details-section.layout-css-grid > .content > .group > .row > .css-grid-section): Deleted. (.details-section.layout-css-grid:not(.collapsed) > .content,): Deleted. * UserInterface/Views/LayoutDetailsSidebarPanel.js: (WI.LayoutDetailsSidebarPanel): (WI.LayoutDetailsSidebarPanel.prototype.attached): (WI.LayoutDetailsSidebarPanel.prototype.initialLayout): (WI.LayoutDetailsSidebarPanel.prototype.layout): (WI.LayoutDetailsSidebarPanel.prototype._handleLayoutContextTypeChanged): (WI.LayoutDetailsSidebarPanel.prototype._refreshNodeSets): (WI.LayoutDetailsSidebarPanel.prototype._refreshGridNodeSet): Deleted. Added Flexbox section to Layout details sidebar. * UserInterface/Views/NodeOverlayListSection.css: Renamed from Source/WebInspectorUI/UserInterface/Views/CSSGridSection.css. (.node-overlay-list-section): (.node-overlay-list-section > .node-overlay-list): (.node-overlay-list-section > .node-overlay-list > li > .node-overlay-list-item-container): (.node-overlay-list-section > .node-overlay-list > li > .node-overlay-list-item-container > label): (.node-overlay-list-section > .node-overlay-list > li > .node-overlay-list-item-container > label > .node-display-name): (.node-overlay-list-section > .node-overlay-list > li > .node-overlay-list-item-container > :is(.go-to-arrow, .inline-swatch)): (.node-overlay-list-section > .node-overlay-list > li > .node-overlay-list-item-container:not(:hover) > .go-to-arrow): (.node-overlay-list-section > .heading,): (.node-overlay-list-section > .heading > label > .toggle-all): (.node-overlay-list-section :is(.setting-editor, .node-overlay-list-item-container, .heading) input[type="checkbox"]): A full-on replacement of `.css-grid-section` with `.node-overlay-list-section` since the two sections share the same styles. * UserInterface/Views/NodeOverlayListSection.js: Copied from Source/WebInspectorUI/UserInterface/Views/CSSGridSection.js. (WI.NodeOverlayListSection): (WI.NodeOverlayListSection.prototype.set nodeSet): (WI.NodeOverlayListSection.prototype.get sectionLabel): (WI.NodeOverlayListSection.prototype.attached): (WI.NodeOverlayListSection.prototype.detached): (WI.NodeOverlayListSection.prototype.initialLayout): (WI.NodeOverlayListSection.prototype.layout): (WI.NodeOverlayListSection.prototype._handleOverlayStateChanged): (WI.NodeOverlayListSection.prototype._handleToggleAllCheckboxChanged): (WI.NodeOverlayListSection.prototype._updateToggleAllCheckbox): Removed all the specific implementations for CSS Grid after generalizing them into `WI.NodeOverlayListSection`. 2022-02-11 Devin Rousso Web Inspector: Sources: double clicking a breakpoint icon should show the edit popover https://bugs.webkit.org/show_bug.cgi?id=236524 Reviewed by Patrick Angle. This is a more convenient way to access(/discover) the breakpoint's configuration details. * UserInterface/Views/BreakpointTreeElement.js: (WI.BreakpointTreeElement): (WI.BreakpointTreeElement.prototype._handleStatusImageElementDoubleClicked): Added. * UserInterface/Views/BreakpointPopover.js: (WI.BreakpointPopover.show): Added. (WI.BreakpointPopover.appendContextMenuItems): Add a convenience method to create a `WI.BreakpointPopover` (or subclass) for the given breakpoint and `show` it over the given target element. 2022-02-11 Devin Rousso Web Inspector: click to re-enable breakpoint clears automatic continue https://bugs.webkit.org/show_bug.cgi?id=236465 Reviewed by Patrick Angle. This is not very convenient for developers as it means that they have to click more than once when re-enabling an auto-continue breakpoint (i.e. once to enable it (which currently disables auto-continue), and once to re-enable auto-continue). Separating these behaviors is preferable because it's unlikely that a developer would want to disable auto-continue when re-enabling a breakpoint if they've taken the time to previously configure auto-continue. * UserInterface/Views/BreakpointTreeElement.js: (WI.BreakpointTreeElement.prototype.onenter): (WI.BreakpointTreeElement.prototype.onspace): (WI.BreakpointTreeElement.prototype._statusImageElementClicked): * UserInterface/Views/SourceCodeTextEditor.js: (WI.SourceCodeTextEditor.prototype.textEditorBreakpointClicked): Replace `cycleToNextNode` with `disabled = !disabled`. * UserInterface/Models/Breakpoint.js: (WI.Breakpoint.prototype.cycleToNextMode): Deleted. Remove this method now that it's no longer used. 2022-02-11 Nikita Vasilyev Web Inspector: [Flexbox] Show flex badge next to flex containers in DOM Tree https://bugs.webkit.org/show_bug.cgi?id=235924 Reviewed by Patrick Angle. Elements with `display: flex` and `display: inline-flex` should include a "flex" badge. Clicking the badge should toggle the overlay for the corresponding element. * UserInterface/Controllers/GridOverlayConfigurationDiagnosticEventRecorder.js: (WI.GridOverlayConfigurationDiagnosticEventRecorder.prototype.setup): (WI.GridOverlayConfigurationDiagnosticEventRecorder.prototype.teardown): (WI.GridOverlayConfigurationDiagnosticEventRecorder.prototype._handleGridOverlayShown): * UserInterface/Controllers/GridOverlayDiagnosticEventRecorder.js: (WI.GridOverlayDiagnosticEventRecorder.prototype.setup): (WI.GridOverlayDiagnosticEventRecorder.prototype.teardown): (WI.GridOverlayDiagnosticEventRecorder.prototype._handleGridOverlayShown): (WI.GridOverlayDiagnosticEventRecorder): * UserInterface/Controllers/OverlayManager.js: (WI.OverlayManager): (WI.OverlayManager.prototype.showOverlay): (WI.OverlayManager.prototype.hideOverlay): (WI.OverlayManager.prototype.hasVisibleGridOverlays): (WI.OverlayManager.prototype.hasVisibleOverlay): (WI.OverlayManager.prototype.toggleOverlay): (WI.OverlayManager.prototype.getColorForNode): (WI.OverlayManager.prototype.setColorForNode): (WI.OverlayManager.prototype._handleLayoutContextTypeChanged): (WI.OverlayManager.prototype._handleGridSettingChanged): (WI.OverlayManager.prototype._handleMainResourceDidChange): (WI.OverlayManager.prototype.showGridOverlay): Deleted. (WI.OverlayManager.prototype.hideGridOverlay): Deleted. (WI.OverlayManager.prototype.isGridOverlayVisible): Deleted. (WI.OverlayManager.prototype.toggleGridOverlay): Deleted. (WI.OverlayManager.prototype.getGridColorForNode): Deleted. (WI.OverlayManager.prototype.setGridColorForNode): Deleted. Remove grid-specific methods (such as showGridOverlay) and introduce methods that work with both Grid and Flexbox (such as showOverlay). * UserInterface/Views/CSSGridSection.js: (WI.CSSGridSection.prototype.attached): (WI.CSSGridSection.prototype.detached): (WI.CSSGridSection.prototype._handleToggleAllCheckboxChanged): (WI.CSSGridSection.prototype.layout): (WI.CSSGridSection.prototype._handleGridOverlayStateChanged): (WI.CSSGridSection.prototype._updateToggleAllCheckbox): (WI.CSSGridSection): * UserInterface/Views/DOMTreeElement.css: (.tree-outline.dom .layout-badge): (.tree-outline.dom .layout-badge.activated): (body:not(.window-inactive, .window-docked-inactive) .tree-outline.dom:focus-within li.selected .layout-badge): (@media (prefers-color-scheme: dark) .tree-outline.dom .layout-badge): (.tree-outline.dom .badge-css-grid): Deleted. (.tree-outline.dom .badge-css-grid.activated): Deleted. (body:not(.window-inactive, .window-docked-inactive) .tree-outline.dom:focus-within li.selected .badge-css-grid): Deleted. (@media (prefers-color-scheme: dark) .tree-outline.dom .badge-css-grid): Deleted. * UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement): (WI.DOMTreeElement.prototype.onattach): (WI.DOMTreeElement.prototype.ondetach): (WI.DOMTreeElement.prototype.updateTitle): (WI.DOMTreeElement.prototype._updateLayoutBadge): (WI.DOMTreeElement.prototype._layoutBadgeClicked): (WI.DOMTreeElement.prototype._updateLayoutBadgeStatus): (WI.DOMTreeElement.prototype._handleLayoutContextTypeChanged): (WI.DOMTreeElement.prototype._updateGridBadge): Deleted. (WI.DOMTreeElement.prototype._gridBadgeClicked): Deleted. (WI.DOMTreeElement.prototype._gridBadgeDoubleClicked): Deleted. (WI.DOMTreeElement.prototype._updateGridBadgeStatus): Deleted. Renamed `_gridBadgeElement` to `_layoutBadgeElement`. We can't have both "flex" and "grid" badge on the same element, so I called it "layoutBadge". I didn't call it simply "badge" because we may have other badges in the future. 2022-02-03 Nikita Vasilyev Web Inspector: [Flexbox] Add setting to guard Flexbox Inspector feature https://bugs.webkit.org/show_bug.cgi?id=236091 Reviewed by Patrick Angle. * UserInterface/Base/Setting.js: * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createEngineeringSettingsView): 2022-02-02 Timothy Hatcher Web Inspector: didShowExtensionTab needs to pass the frameID of the tab https://bugs.webkit.org/show_bug.cgi?id=236023 rdar://problem/88383984 Reviewed by BJ Burg. * UserInterface/Views/WebInspectorExtensionTabContentView.js: (WI.WebInspectorExtensionTabContentView.prototype._maybeDispatchDidShowExtensionTab): (WI.WebInspectorExtensionTabContentView): 2022-02-02 Don Olmstead WebInspector: Add additional image MIME types to frontend https://bugs.webkit.org/show_bug.cgi?id=235977 Reviewed by Patrick Angle. Add MIME types around JPEG 2000, JPEG XL and AVIF. Sort the listings based on the file extension to make it easier to spot missing image formats. * UserInterface/Base/MIMETypeUtilities.js: (WI.mimeTypeForFileExtension): (WI.fileExtensionForMIMEType): 2022-01-28 Patrick Angle Web Inspector: Add another Protocol Version (iOS 15.4) https://bugs.webkit.org/show_bug.cgi?id=235741 Reviewed by Devin Rousso. * UserInterface/Models/Animation.js: (WI.Animation.prototype.requestEffectTarget): - Update compatibility comment to reflect that the change is not present in iOS 15.4 or earlier. * UserInterface/Protocol/Legacy/15.4/InspectorBackendCommands.js: Added. * Versions/Inspector-iOS-15.4.json: Added. 2022-01-27 Devin Rousso Web Inspector: Console: move Preserve Log checkbox navigation item to a gear-with-contextmenu to save space (and match the Network Tab) https://bugs.webkit.org/show_bug.cgi?id=235541 Reviewed by Patrick Angle. Also collapse source scope bar into a single button for more space, and align it (and the filter bar and type scope bar) to the left to better match other tabs. * UserInterface/Views/LogContentView.js: (WI.LogContentView): (WI.LogContentView.prototype.get navigationItems): (WI.LogContentView.prototype._updateOtherFiltersNavigationItemState): Added. (WI.LogContentView.prototype._handleOtherFiltersNavigationItemContextMenu): Added. (WI.LogContentView.prototype._handleClearLogOnNavigateSettingChanged): (WI.LogContentView.prototype._showHiddenMessagesBannerIfNeeded): Drive-by: Also reset the message source `WI.ScopeBar` when clearing filters. * UserInterface/Views/LogContentView.css: (.console-find-banner): Added. (.message-channel-scope-bar.default-item-selected:not(:hover)): Added. (.message-channel-scope-bar.default-item-selected:hover): Added. (.log-scope-bar + .message-channel-scope-bar): Added. (.console-other-filters-button > .glyph): Added. (.console-other-filters-button:active > .glyph): Added. (.console-other-filters-button.active > .glyph): Added. (.console-other-filters-button.active:active > .glyph): Added. * UserInterface/Views/ConsoleTabContentView.js: (WI.ConsoleTabContentView): Override the `flexibleNavigationItem` so that there's no expanding space before the filter. * UserInterface/Views/ConsoleDrawer.js: (WI.ConsoleDrawer): Somehow this got overlooked when the constructor of `WI.ContentBrowser` was changed :( * UserInterface/Views/FindBanner.css: (.find-banner): (.find-banner > input[type="search"]): Add `--find-banner-input-margin-start` so that this can be overridden by specific clients. * Localizations/en.lproj/localizedStrings.js: 2022-01-27 Elliott Williams Generated xcfilelists contain symlinks when building for macOS https://bugs.webkit.org/show_bug.cgi?id=235663 rdar://88054903 Reviewed by Alexey Proskuryakov. * Configurations/Base.xcconfig: * Configurations/WebInspectorUIFramework.xcconfig: 2022-01-26 Antoine Quint [Web Inspector] Update return value name for Animation.requestEffectTarget() https://bugs.webkit.org/show_bug.cgi?id=235661 Reviewed by Devin Rousso. Update the parameter name to match the name used in the protocol. * UserInterface/Models/Animation.js: (WI.Animation.prototype.requestEffectTarget): 2022-01-26 Antoine Quint [Web Inspector] Graphics tab should display pseudo-elements for more than ::before and ::after https://bugs.webkit.org/show_bug.cgi?id=235234 Reviewed by Devin Rousso. Add a new `DOMStyleable` model class to match the new `DOM.Styleable` protocol type. When calling Animation.requestEffectTarget(), we now use this new DOMStyleable class to display pseudo-elements other than ::before or ::after in the Graphics tab. * UserInterface/Base/DOMUtilities.js: (WI.linkifyStyleable): * UserInterface/Main.html: * UserInterface/Models/Animation.js: (WI.Animation.prototype.requestEffectTarget): * UserInterface/Models/DOMStyleable.js: Added. (WI.DOMStyleable.prototype.fromPayload): (WI.DOMStyleable.prototype.get node): (WI.DOMStyleable.prototype.get pseudoId): (WI.DOMStyleable.prototype.get displayName): (WI.DOMStyleable): * UserInterface/Test.html: * UserInterface/Views/AnimationCollectionContentView.js: (WI.AnimationCollectionContentView.prototype._handleContentViewMouseEnter): * UserInterface/Views/AnimationContentView.js: (WI.AnimationContentView.prototype._refreshSubtitle): * UserInterface/Views/AnimationDetailsSidebarPanel.js: (WI.AnimationDetailsSidebarPanel.prototype._refreshIdentitySection): 2022-01-25 Nikita Vasilyev Web Inspector: Collapse blackboxed call frames by default https://bugs.webkit.org/show_bug.cgi?id=234581 Reviewed by Devin Rousso. Remove "Collapse blackboxed call frames" checkbox from the experimental settings and enable the feature by default. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Base/Setting.js: * UserInterface/Controllers/CallFrameTreeController.js: (WI.CallFrameTreeController.prototype.groupBlackboxedCallFrames): * UserInterface/Controllers/DebuggerManager.js: (WI.DebuggerManager.prototype.shouldAutoExpandBlackboxedCallFrameGroup): * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): 2022-01-25 Devin Rousso Web Inspector: replace gear-with-contextmenu icons used for filtering with filter-with-contextmenu icons https://bugs.webkit.org/show_bug.cgi?id=235546 Reviewed by Dean Jackson. * UserInterface/Views/ComputedStyleDetailsPanel.js: (WI.ComputedStyleDetailsPanel.prototype.initialLayout): * UserInterface/Views/ComputedStyleDetailsPanel.css: (.sidebar > .panel.details.css-style > .content > .computed > .details-section.computed-style-properties > .header > .options.filter): (.sidebar > .panel.details.css-style > .content > .computed > .details-section.computed-style-properties > .header > .options.filter:active): Added. (.sidebar > .panel.details.css-style > .content > .computed > .details-section.computed-style-properties > .header > .options.filter.active): Added. (.sidebar > .panel.details.css-style > .content > .computed > .details-section.computed-style-properties > .header > .options.filter.active:active): Added. * UserInterface/Views/DOMNodeDetailsSidebarPanel.js: (WI.DOMNodeDetailsSidebarPanel.prototype.initialLayout): * UserInterface/Views/DOMNodeDetailsSidebarPanel.css: (.sidebar > .panel.dom-node-details .details-section.dom-node-event-listeners > .header > .filter): (.sidebar > .panel.dom-node-details .details-section.dom-node-event-listeners > .header > .filter:active): Added. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView): * UserInterface/Images/Filter.svg: Added. 2022-01-24 Devin Rousso Web Inspector: Network: give the Ignore Caches button a label so it's more visible and immediately understandable https://bugs.webkit.org/show_bug.cgi?id=235539 Reviewed by Patrick Angle. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView): (WI.NetworkTableContentView.prototype.get navigationItems): (WI.NetworkTableContentView.prototype._resourceCachingDisabledSettingChanged): * Localizations/en.lproj/localizedStrings.js: * UserInterface/Images/IgnoreCaches.svg: Deleted. 2022-01-24 Patrick Angle Web Inspector: [Flexbox] Add instrumentation/protocol bits for flex layout containers https://bugs.webkit.org/show_bug.cgi?id=235454 Reviewed by Devin Rousso. * UserInterface/Models/DOMNode.js: 2022-01-24 Devin Rousso Web Inspector: Network: move filtering checkboxes into a single gear-with-contextmenu to save space https://bugs.webkit.org/show_bug.cgi?id=235538 Reviewed by Patrick Angle. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView): (WI.NetworkTableContentView.prototype.get navigationItems): (WI.NetworkTableContentView.prototype.get filterNavigationItems): (WI.NetworkTableContentView.prototype.closed): (WI.NetworkTableContentView.prototype._changeCollection): (WI.NetworkTableContentView.prototype._updateOtherFiltersNavigationItemState): Added. (WI.NetworkTableContentView.prototype._handleOtherFiltersNavigationItemContextMenu): Added. (WI.NetworkTableContentView.prototype._handleClearNetworkOnNavigateChanged): Renamed from `_handleClearNetworkOnNavigateChanged`. (WI.NetworkTableContentView.prototype._handleGroupMediaRequestsByDOMNodeChanged): Renamed from `_handleGroupMediaRequestsByDOMNodeCheckedDidChange`. * UserInterface/Views/NetworkTableContentView.css: (.network-other-filters-button > .glyph): Added. (.network-other-filters-button:active > .glyph): Added. (.network-other-filters-button.active > .glyph): Added. (.network-other-filters-button.active:active > .glyph): Added. * Localizations/en.lproj/localizedStrings.js: 2022-01-24 Devin Rousso Web Inspector: Network: collapse type filter scope bar into a single button to save space https://bugs.webkit.org/show_bug.cgi?id=235537 Reviewed by Patrick Angle. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView): * UserInterface/Views/NetworkTableContentView.css: (.network-type-filter-scope-bar.default-item-selected:not(:hover)): Added. (.network-type-filter-scope-bar.default-item-selected:hover): Added. 2022-01-21 Nikita Vasilyev Web Inspector: Make alignment editor accessible https://bugs.webkit.org/show_bug.cgi?id=235395 Reviewed by Patrick Angle. Make alignment editor icons focusable, and annotate elements so VoiceOver could correctly read what is selected. * UserInterface/Views/AlignmentEditor.css: (.alignment-editor .glyph:focus): (.alignment-editor .glyph:not(:focus-visible)): * UserInterface/Views/AlignmentEditor.js: (WI.AlignmentEditor): (WI.AlignmentEditor.prototype.set alignment): (WI.AlignmentEditor.prototype._removePreviouslySelected): (WI.AlignmentEditor.prototype._updateSelected): 2022-01-19 Devin Rousso Web Inspector: fully blackboxed stack traces don't show the right top call frame https://bugs.webkit.org/show_bug.cgi?id=235381 Reviewed by Patrick Angle. * UserInterface/Models/StackTrace.js: (WI.StackTrace): (WI.StackTrace.fromPayload): (WI.StackTrace.prototype.get firstNonNativeNonAnonymousNotBlackboxedCallFrame): Only assign to `firstNonNativeNonAnonymousCallFrame` once. Drive-by: Don't re-fetch the blackbox data for the `WI.SourceCode` of the `WI.CallFrame`. Drive-by: Combine optional parameters into an `options = {}` for current code cleanliness and greater flexibility for future changes. * UserInterface/Models/CallFrame.js: (WI.CallFrame): (WI.CallFrame.fromDebuggerPayload): (WI.CallFrame.fromPayload): * UserInterface/Views/ThreadTreeElement.js: (WI.ThreadTreeElement.prototype.refresh): Drive-by: Combine optional parameters into an `options = {}` for current code cleanliness and greater flexibility for future changes. * UserInterface/Views/CallFrameTreeElement.js: (WI.CallFrameTreeElement): (WI.CallFrameTreeElement.prototype.onattach): * UserInterface/Views/CallFrameView.js: (WI.CallFrameView): Drive-by: Don't re-fetch the blackbox data for the `WI.SourceCode` of the `WI.CallFrame`. 2022-01-19 Devin Rousso Web Inspector: blackboxed call frames should be grouped everywhere https://bugs.webkit.org/show_bug.cgi?id=234648 Reviewed by Patrick Angle. * UserInterface/Controllers/CallFrameTreeController.js: (WI.CallFrameTreeController.prototype.groupBlackboxedCallFrames): Added. (WI.CallFrameTreeController.prototype.groupBlackboxedCallFrames.displayable): Added. (WI.CallFrameTreeController.prototype.set callFrames): Added. * UserInterface/Views/StackTraceView.js: (WI.StackTraceView): * UserInterface/Views/ThreadTreeElement.js: (WI.ThreadTreeElement.prototype.refresh): * UserInterface/Views/TimelineDataGrid.js: (WI.TimelineDataGrid.prototype._createPopoverContent): (WI.TimelineDataGrid.prototype._popoverCallStackTreeElementRemoved): Centralize code for creating stack trace views so that the logic that groups blackboxed call frames (and the associated `WI.BlackboxedGroupTreeElement`/`WI.BlackboxedGroupView`) can be shared without duplication. * UserInterface/Views/BlackboxedGroupTreeElement.js: (WI.BlackboxedGroupTreeElement): (WI.BlackboxedGroupTreeElement.prototype.expand): (WI.BlackboxedGroupTreeElement.prototype.customTitleTooltip): Added. Add a parameter to control whether to remember when expanding blackboxed call frame groups so that they can later be auto-expanded. This is needed because that feature is intended so that stepping doesn't re-collapse previously expanded blackboxed call frame groups. A more technical reason is that non-debugging call stacks can live (i.e. be shown) for a long time and therefore there's no good way to clear the remembered state, and we probably don't want to have a previous expansion in the Timelines Tab or Canvas Tab suddenly cause all matching blackboxed call frame groups in the Sources Tab to always be expanded. Drive-by: Override the tooltip to explain that clicking shows the blackboxed call frames. * UserInterface/Views/BlackboxedGroupView.js: Added. (WI.BlackboxedGroupView): (WI.BlackboxedGroupView.generateTitle): (WI.BlackboxedGroupView.generateSubtitle): (WI.BlackboxedGroupView.generateTooltip): * UserInterface/Views/BlackboxedGroupView.css: Added. (.blackboxed-group): (.blackboxed-group > *): (.blackboxed-group .icon): (.blackboxed-group .subtitle): (.blackboxed-group .separator): (@media (prefers-color-scheme: dark) .blackboxed-group .icon): (@media (prefers-color-scheme: dark) .blackboxed-group .subtitle): (@media (prefers-color-scheme: dark) .blackboxed-group .separator): Add a non-tree UI class for showing blackboxed call frame groups (just like how there's `WI.CallFrameTreeElement` for tree UIs and `WI.CallFrameView` for non-tree UIs). Also centralize the UI strings for all blackboxed call frame group UIs as `static` methods. * UserInterface/Views/BlackboxedGroupTreeElement.css: (.tree-outline .item.blackboxed-group.selected > *): Added. (.tree-outline:not(:focus-within) .item.blackboxed-group.selected > *, body:is(.window-inactive, .window-docked-inactive) .tree-outline .item.blackboxed-group.selected > *): Added. (.tree-outline .item.blackboxed-group): Deleted. (.tree-outline .item.blackboxed-group:not(.selected) > *, .tree-outline:not(:focus-within) .item.blackboxed-group.selected > *, body:is(.window-inactive, .window-docked-inactive) .tree-outline .item.blackboxed-group.selected > *): Deleted. (.tree-outline .item.blackboxed-group .icon): Deleted. (@media (prefers-color-scheme: dark) .tree-outline .item.blackboxed-group .icon): Deleted. Share styles from `UserInterface/Views/BlackboxedGroupView.css` since both share `.blackboxed-group`. * UserInterface/Views/CallFrameTreeElement.js: Drive-by: Combine optional parameters into an `options = {}` for current code cleanliness and greater flexibility for future changes. * UserInterface/Views/Variables.css: (:root): * UserInterface/Views/CallFrameTreeElement.css: (.tree-outline .item.call-frame.blackboxed:not(.selected)): * UserInterface/Views/CallFrameView.css: (.call-frame.blackboxed > .title,): Drive-by: Rename `--blackboxed-tree-item-opacity` since it's now also used outside trees. * UserInterface/Main.html: * Localizations/en.lproj/localizedStrings.js: 2022-01-18 Alex Christensen Use c++2a instead of gnu++2a for Cocoa builds https://bugs.webkit.org/show_bug.cgi?id=234936 Reviewed by Sam Weinig. * Configurations/Base.xcconfig: 2022-01-14 Devin Rousso Web Inspector: Sources: cannot copy grouping of blackboxed call frames https://bugs.webkit.org/show_bug.cgi?id=234615 Reviewed by Patrick Angle. * UserInterface/Views/SourcesNavigationSidebarPanel.js: (WI.SourcesNavigationSidebarPanel.prototype.handleCopyEvent): (WI.SourcesNavigationSidebarPanel.prototype.handleCopyEvent.addCallFrame): Added. Include every `WI.CallFrame` managed by any selected `WI.BlackboxedGroupTreeElement` when copying. Also make sure that any async boundaries are taken into account. * UserInterface/Views/BlackboxedGroupTreeElement.js: (WI.BlackboxedGroupTreeElement): (WI.BlackboxedGroupTreeElement.prototype.get callFrames): Added. (WI.BlackboxedGroupTreeElement.prototype.get expandable): Added. (WI.BlackboxedGroupTreeElement.prototype.onenter): Added. (WI.BlackboxedGroupTreeElement.prototype.onspace): Added. Make `WI.BlackboxedGroupTreeElement` selectable, and add extra action handlers for expansion. * UserInterface/Views/BlackboxedGroupTreeElement.css: (.tree-outline .item.blackboxed-group): (.tree-outline .item.blackboxed-group:not(.selected) > *, .tree-outline:not(:focus-within) .item.blackboxed-group.selected > *, body:is(.window-inactive, .window-docked-inactive) .tree-outline .item.blackboxed-group.selected > *): Added. (body:not(.window-inactive, .window-docked-inactive) .tree-outline:focus-within .item.blackboxed-group.selected .icon): Added. Only make the content more transparent if not `.selected` (when the window/tree has focus). * UserInterface/Views/TreeElement.js: (WI.TreeElement.prototype.get expandable): Added. (WI.TreeElement.treeElementToggled): Allow `toggleOnClick` to be used when `selectable` too. This allows `WI.BlackboxedGroupTreeElement` to `expand` on click while also being able to be selected (e.g. shift-up, command-A, etc.). All other uses of `toggleOnClick` set `this.selectable = false;` anyways, so this will have no effect to other clients. * UserInterface/Views/TreeOutline.js: (WI.TreeOutline.prototype.insertChild): (WI.TreeOutline.prototype._treeKeyDown): * UserInterface/Views/DOMTreeOutline.js: (WI.DOMTreeOutline.prototype.update): Add a helper `get expandable` instead of assuming it from `get hasChildren`. This allows `WI.BlackboxedGroupTreeElement` to override it and always be `true`, since there is no situation where we would disallow expansion (which shows the grouped blackboxed call frames). * UserInterface/Models/CallFrame.js: (WI.CallFrame.prototype.get displayName): Added. * UserInterface/Views/CallFrameView.js: (WI.CallFrameView): * UserInterface/Views/CallFrameTreeElement.js: (WI.CallFrameTreeElement): * UserInterface/Views/ConsoleMessageView.js: (WI.ConsoleMessageView.prototype.toClipboardString): Add a helper `get displayName` to avoid repeated specialized logic. 2022-01-14 Devin Rousso Web Inspector: add a contextmenu item to create a URL Breakpoint for resources initiated by script https://bugs.webkit.org/show_bug.cgi?id=235216 Reviewed by Dean Jackson. * UserInterface/Views/ContextMenuUtilities.js: (WI.appendContextMenuItemsForSourceCode): Since URL Breakpoints only work with XHR/`fetch`, only offer to create a URL Breakpoint if the `WI.SourceCode` has `initiatorCallFrames`, meaning it was triggered by JS. We could offer this contextmenu item for _all_ resources, but there are many different resource types that are unlikely (if ever) to be loaded via XHR/`fetch` (e.g. favicons, manifests, fonts, initial JS/CSS files, etc.) that it would likely add clutter and possibly confuse developers into thinking that URL Breakpoints can somehow pause things other than JS. Plus, this can always be changed in a followup, so better to do something minimal first. * UserInterface/Controllers/DOMDebuggerManager.js: (WI.DOMDebuggerManager.prototype.urlBreakpointsMatchingURL): Added. Helper method to find all `WI.URLBreakpoint` that match a given URL, sorted by how exact they would match (e.g. a regex match is less exact than `===`). * Localizations/en.lproj/localizedStrings.js: 2022-01-13 Elliott Williams [XCBuild] Add "product dependencies" which influence workspace build order https://bugs.webkit.org/show_bug.cgi?id=235094 Reviewed by Alexey Proskuryakov. * Configurations/Base.xcconfig: Add EXCLUDED_SOURCE_FILE_NAMES * WebInspectorUI.xcodeproj/project.pbxproj: Add Product Dependencies 2022-01-13 Patrick Angle Web Inspector: Implement `frameURL` option for `devtools.inspectedWindow.eval` command https://bugs.webkit.org/show_bug.cgi?id=222568 Reviewed by Devin Rousso. New test: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtension.mm Add support for evaluating script from an extension in a specific frame on the page by referring to it by the frame's URL. Frame URLs are matched in three steps, first looking for an exact URL match, including query parameters and fragment identifier. If no match is found and the provided `options.frameURL` does not have any fragment identifier or query parameters, a check is then made against each known frame again, this time excluding their fragment identifier. If that check still fails to find a frame for the URL, we perform one more pass, this time excluding the fragment identifier and query parameters for each known frame. * UserInterface/Controllers/WebInspectorExtensionController.js: (WI.WebInspectorExtensionController.prototype.evaluateScriptForExtension): (WI.WebInspectorExtensionController.prototype.reloadForExtension): - Drive-by removal of trailing spaces. (WI.WebInspectorExtensionController.prototype._frameForFrameURL): 2022-01-12 Elliott Williams [Xcode] Configure each project for the legacy build system https://bugs.webkit.org/show_bug.cgi?id=235091 Reviewed by Darin Adler. * WebInspectorUI.xcodeproj/project.pbxproj: 2022-01-12 Antoine Quint Update Web Inspector to not use legacy webkit-prefixed transition events https://bugs.webkit.org/show_bug.cgi?id=235119 Reviewed by Joseph Pecoraro. Came across this while working on bug 235113, we shouldn't be using webkit-prefixed events. * UserInterface/Views/TabBar.js: (WI.TabBar.prototype.insertTabBarItem.animateTabs): (WI.TabBar.prototype.insertTabBarItem.removeStyles): (WI.TabBar.prototype.insertTabBarItem): (WI.TabBar.prototype.removeTabBarItem.animateTabs): (WI.TabBar.prototype.removeTabBarItem.removeStyles): (WI.TabBar.prototype.removeTabBarItem): (WI.TabBar.prototype._finishExpandingTabsAfterClose.): (WI.TabBar.prototype._finishExpandingTabsAfterClose): 2022-01-12 Antoine Quint Web Inspector should expose newer CSS Animations, CSS Transitions and Web Animations events https://bugs.webkit.org/show_bug.cgi?id=235117 Reviewed by Joseph Pecoraro. Came across this while working on bug 235113, the more recent events added to CSS Animations, CSS Transitions and Web Animations are not used in the Web Inspector. * UserInterface/Models/ScriptTimelineRecord.js: (WI.ScriptTimelineRecord.EventType.displayName): 2022-01-12 Razvan Caliman Web Inspector: Unhandled exception when moving cursor mid-token after receiving CSS property name completions https://bugs.webkit.org/show_bug.cgi?id=234393 Reviewed by Patrick Angle. A faulty check for mid-token completions in `WI.CSSKeywordCompletions.forPartialPropertyName()`, which are still unsupported, prevented an early return and completions were provided unexpectedly. This had knock-on effects in `WI.SpreadsheetTextField` which is not set up to handle cases where the caret is placed within the completion query. Calculating the adjusted caret position could return a negative index and throw an unhandled exception. Web Inspector does not currently explicitly support mid-token completions. See https://webkit.org/b/227157 The implementation of fuzzy matching for CSS completions in https://webkit.org/b/234092 means that, unhindered, the completion provider for CSS property names _can_ return mid-token completions. Typing a query like `margin`, then moving the caret to the beginning and correcting to `s|margin` will return completions like `[s]croll-[margin]`. Accepting the completion results in a malformed `SpreadsheetTextField.value` by concatenation within the prefix itself. As the user types mid-token, the prefix becomes ambiguous. Fixing the condition in `WI.CSSKeywordCompletions.forPartialPropertyName()` now inhibits unintentional mid-token completions when fuzzy matching is enabled. * UserInterface/Models/CSSKeywordCompletions.js: (WI.CSSKeywordCompletions.forPartialPropertyName): * UserInterface/Views/SpreadsheetTextField.js: (WI.SpreadsheetTextField.prototype._showSuggestionsView): 2022-01-11 Nikita Vasilyev REGRESSION (r283723): Web Inspector: CSS declarations unexpectedly removed when editing property value https://bugs.webkit.org/show_bug.cgi?id=233195 Reviewed by Devin Rousso. Re-attach CSS property if it was detached while editing. CSSProperty is detached when focusing on property name and deleting it. Consequent edits of the detached CSSProperty were not saved. This patch re-attaches detached property at the previous position. * UserInterface/Models/CSSProperty.js: (WI.CSSProperty.prototype.set name): * UserInterface/Models/CSSStyleDeclaration.js: (WI.CSSStyleDeclaration.prototype.newBlankProperty): (WI.CSSStyleDeclaration.prototype.insertProperty): Introduce this method since the logic is used in two different places now. 2022-01-10 Nikita Vasilyev Web Inspector: Increase padding around icons in Alignment editor https://bugs.webkit.org/show_bug.cgi?id=234036 Reviewed by Devin Rousso. Increase margin and padding around the icons, making the icons more visually appealing and easier to distinguish and from each other. * UserInterface/Images/AlignContentStretch.svg: The gap between rectangles was only 0.5px. Increase it to 2px. * UserInterface/Views/AlignmentEditor.css: (.alignment-editor .glyph): (.alignment-editor .glyph:not(:first-child)): (.alignment-editor .glyph.selected): (.alignment-editor .glyph.selected:active): (.alignment-editor .glyph:not(:last-child)): Deleted. (.alignment-editor .glyph.selected + .glyph): Deleted. 2022-01-10 Alex Christensen Start using C++20 https://bugs.webkit.org/show_bug.cgi?id=233963 Reviewed by Yusuke Suzuki. * Configurations/Base.xcconfig: 2022-01-07 Alexey Shvayka Remove obsolete DOM Level 2 "DOMFocusIn" / "DOMFocusOut" events https://bugs.webkit.org/show_bug.cgi?id=234978 Reviewed by Geoff Garen. * UserInterface/Models/ScriptTimelineRecord.js: (WI.ScriptTimelineRecord.EventType.displayName): 2022-01-07 Patrick Angle Uncaught Exception: Cannot step over because debugger is not paused https://bugs.webkit.org/show_bug.cgi?id=234575 Reviewed by Devin Rousso. Previously keyboard shortcuts for advancing the debugger did not check to make sure that the debugger was actually paused before attempting to step. This led to an uncaught exception in engineering builds. We now enable and disable these keyboard shortcuts based on the whether or not the debugger is currently paused. * UserInterface/Base/Main.js: 2022-01-07 Alex Christensen Unreviewed, reverting r287698. Broke an internal build Reverted changeset: "Start using C++20" https://bugs.webkit.org/show_bug.cgi?id=233963 https://commits.webkit.org/r287698 2022-01-06 Tim Nguyen Unprefix -webkit-print-color-adjust CSS property https://bugs.webkit.org/show_bug.cgi?id=201098 Reviewed by Darin Adler. color-adjust is also a deprecated shorthand that just contains print-color-adjust. * UserInterface/Models/CSSKeywordCompletions.js: 2022-01-06 Alex Christensen Start using C++20 https://bugs.webkit.org/show_bug.cgi?id=233963 Reviewed by Yusuke Suzuki. * Configurations/Base.xcconfig: 2022-01-06 Razvan Caliman Web Inspector: `shape-outside` description doesn't make sense https://bugs.webkit.org/show_bug.cgi?id=234675 Reviewed by Devin Rousso. Add the ability to overwrite CSS documentation obtained from the upstream data source with information sourced from a local JSON file. * Scripts/update-inspector-css-documentation: * UserInterface/External/CSSDocumentation/CSSDocumentation-overrides.json: Added. Local JSON file with fields to overwrite specific data. * UserInterface/External/CSSDocumentation/CSSDocumentation.js: Update description for `shape-outside` CSS property. 2022-01-05 Devin Rousso Web Inspector: Layers: add reference page button https://bugs.webkit.org/show_bug.cgi?id=234901 Reviewed by Patrick Angle. * UserInterface/Views/Layers3DContentView.js: (WI.Layers3DContentView.prototype.initialLayout): * UserInterface/Views/Layers3DContentView.css: (.content-view.layers-3d .reference-page-link-container): Added. 2022-01-05 Devin Rousso Web Inspector: Audit: reference page button is not vertically aligned with Audit version text https://bugs.webkit.org/show_bug.cgi?id=234900 Reviewed by Patrick Angle. * UserInterface/Views/AuditNavigationSidebarPanel.css: (.content-view.tab.audit .content-view .reference-page-link-container): 2022-01-05 Patrick Angle Web Inspector: revert-layer should be autocompleted https://bugs.webkit.org/show_bug.cgi?id=234646 Reviewed by Devin Rousso. * UserInterface/Controllers/CSSManager.js: * UserInterface/Models/CSSKeywordCompletions.js: 2022-01-04 Devin Rousso Web Inspector: Sources: expanding a grouping of blackboxed call frames should be persistent https://bugs.webkit.org/show_bug.cgi?id=234614 Reviewed by Patrick Angle. If the developer has explicitly decided to show blackboxed call frames, we should respect that decision. Requiring them to re-expand after _every_ debugger action is very hostile. So long as the blackboxed call frames remain the same we should persist the expansion. Only if the location of those blackboxed frames changes should we re-collapse. * UserInterface/Controllers/DebuggerManager.js: (WI.DebuggerManager): (WI.DebuggerManager.prototype.rememberBlackboxedCallFrameGroupToAutoExpand): Added. (WI.DebuggerManager.prototype.shouldAutoExpandBlackboxedCallFrameGroup): Added. (WI.DebuggerManager.prototype._didResumeInternal): * UserInterface/Views/BlackboxedGroupTreeElement.js: (WI.BlackboxedGroupTreeElement.prototype.expand): Keep a list of blackboxed call frame groupings that have been expanded by the developer. Use this list to decide whether "new" blackboxed call frame grouping should be auto-expanded by default (i.e. if every `WI.CallFrame` is identical with something in the list). Clear the list when resuming, as we're only trying to keep expanded blackboxed call frame groupings within the same call stack (i.e. while stepping). * UserInterface/Base/Utilities.js: (Array.prototype.groupBy): Deleted. * UserInterface/Views/ThreadTreeElement.js: (WI.ThreadTreeElement.prototype.refresh): Remove the custom `Array.prototype.groupBy` since it's no longer needed (and there's now a builtin function with the same name). Instead, just keep an index of the first blackboxed call frame and iterate until either the end of the call stack or a non-blackboxed call frame is found, `slice`ing from the saved index to the current item to make a blackboxed call frame group. If that blackboxed call frame group should be auto-expanded (see above), create a `WI.CallFrameTreeElement` for each blackboxed call frame instead of one `WI.BlackboxedGroupTreeElement`. * UserInterface/Models/CallFrame.js: (WI.CallFrame.prototype.isEqual): Added. Add a convenience function to compare two `WI.CallFrame`. Right now it just looks at the `WI.SourceCodeLocation`, since for most purposes that's really how one would identify a `WI.CallFrame` (i.e. it's probably more important to know "is this the same spot in code" as opposed to "do we have the same `this` object"). 2022-01-04 Devin Rousso Web Inspector: Add icon for collapsed blackboxed section https://bugs.webkit.org/show_bug.cgi?id=219806 Reviewed by Patrick Angle. * UserInterface/Views/BlackboxedGroupTreeElement.css: (.tree-outline .item.blackboxed-group .icon): (@media (prefers-color-scheme: dark) .tree-outline .item.blackboxed-group .icon): Use `Hide.svg#black` and `Hide.svg#white`. * UserInterface/Images/TypeIcons.svg: Remove `#Blackboxed-dark` and `#Blackboxed-light`. 2021-12-31 Tim Nguyen Web Inspector: fix assert text in Gradient.js Unreviewed. Wrong assert text was added in r287409, it should be radial instead of conic gradients. * UserInterface/Models/Gradient.js: (WI.RadialGradient.prototype.set angleValue): (WI.RadialGradient.prototype.set angleUnits): 2021-12-24 Tim Nguyen Remove non-standard -webkit-background-composite CSS property https://bugs.webkit.org/show_bug.cgi?id=234661 Reviewed by Simon Fraser. * UserInterface/Models/CSSKeywordCompletions.js: 2021-12-24 Tim Nguyen Remove non-standard -webkit-margin-collapse CSS property and longhands https://bugs.webkit.org/show_bug.cgi?id=190788 Reviewed by Simon Fraser. * UserInterface/Models/CSSKeywordCompletions.js: 2021-12-23 Tim Nguyen Web Inspector: Support conic gradients in gradient editor and autocompletion https://bugs.webkit.org/show_bug.cgi?id=234562 Reviewed by Devin Rousso. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Controllers/CSSManager.js: * UserInterface/Models/Gradient.js: (WI.Gradient.angleFromString): (WI.Gradient.fromString): (WI.Gradient.prototype.get angleValue): (WI.Gradient.prototype.set angleValue): (WI.Gradient.prototype.get angleUnits): (WI.Gradient.prototype.set angleUnits): (WI.Gradient.prototype._angleValueForUnits): (WI.Gradient): (WI.LinearGradient.fromComponents): (WI.LinearGradient.prototype.toString): (WI.LinearGradient): (WI.RadialGradient): (WI.RadialGradient.fromComponents): (WI.RadialGradient.prototype.get angleValue): (WI.RadialGradient.prototype.set angleValue): (WI.RadialGradient.prototype.get angleUnits): (WI.RadialGradient.prototype.set angleUnits): (WI.RadialGradient.prototype.copy): (WI.RadialGradient.prototype.toString): (WI.ConicGradient): (WI.ConicGradient.fromComponents): (WI.ConicGradient.prototype.copy): (WI.ConicGradient.prototype.toString): (WI.LinearGradient.prototype.set angleValue): Deleted. (WI.LinearGradient.prototype.get angleValue): Deleted. (WI.LinearGradient.prototype.set angleUnits): Deleted. (WI.LinearGradient.prototype.get angleUnits): Deleted. (WI.LinearGradient.prototype._angleValueForUnits): Deleted. * UserInterface/Views/CodeMirrorTextMarkers.js: * UserInterface/Views/GradientEditor.js: (WI.GradientEditor): (WI.GradientEditor.prototype.set gradient): (WI.GradientEditor.prototype._gradientTypeChanged): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype._addGradientTokens): 2021-12-23 Tim Nguyen Web Inspector: Dark mode: Make gradient editor angle input readable in dark mode https://bugs.webkit.org/show_bug.cgi?id=234640 Reviewed by Devin Rousso. Just use the native input styling, which is dark mode compatible by default. * UserInterface/Views/GradientEditor.css: (.gradient-editor > .gradient-angle > input[type="number"]): 2021-12-21 Patrick Angle Web Inspector: Assertion Failed removing subview in ContentViewContainer.prototype._disassociateFromContentView https://bugs.webkit.org/show_bug.cgi?id=234572 Reviewed by Devin Rousso. r283859 accidentally removed the checks that a content view is attached before attempting to remove it, leading to an assertion. * UserInterface/Views/ContentViewContainer.js: (WI.ContentViewContainer.prototype._disassociateFromContentView): 2021-12-21 Patrick Angle Web Inspector: Assertion Failed adding event listener in CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded https://bugs.webkit.org/show_bug.cgi?id=234570 Reviewed by Devin Rousso. Adding an event listener to listen for style changes every time we update the list of CSS variables isn't quite correct because it means we may attempt to add the event listener multiple times. Instead, this should be done in response to the InspectedNodeChanged event directly to avoid adding the event listener multiple time to the same DOM node. * UserInterface/Models/CSSPropertyNameCompletions.js: (WI.CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded): (WI.CSSPropertyNameCompletions.prototype._handleInspectedNodeChanged): 2021-12-21 Michael Saboff Fix symlinks for alternate root framework locations https://bugs.webkit.org/show_bug.cgi?id=234567 Reviewed by Filip Pizlo. Moved OUTPUT_ALTERNATE_ROOT_PATH in create symlink script from outputFileListPaths to outputPaths. * WebInspectorUI.xcodeproj/project.pbxproj: 2021-12-16 Michael Saboff https://bugs.webkit.org/show_bug.cgi?id=234173 Update Install Paths for build system changes Reviewed by Filip Pizlo. Added build variables and build step to create symlinks pointing to the alternate build locations from the current framework install location. * Configurations/WebInspectorUIFramework.xcconfig: * Scripts/create-symlink-to-altroot.sh: Added. * WebInspectorUI.xcodeproj/project.pbxproj: 2021-12-16 Devin Rousso Implement Array.prototype.groupBy and Array.prototype.groupByToMap https://bugs.webkit.org/show_bug.cgi?id=234327 Reviewed by Yusuke Suzuki. * UserInterface/Models/NativeFunctionParameters.js: 2021-12-14 Razvan Caliman Web Inspector: Computed Panel: Adjust color of CSS Variables grouping mode control https://bugs.webkit.org/show_bug.cgi?id=234246 Reviewed by Devin Rousso. Change color of CSS variables grouping mode scope bar from the system accent color to transparent so it doesn't draw disproportionate attention to itself. * UserInterface/Views/ComputedStyleDetailsPanel.css: (.sidebar > .panel.details.css-style > .content > .computed > .details-section.computed-style-variables .scope-bar.computed-style-variables-grouping-mode:not(:hover)): (.sidebar > .panel.details.css-style > .content > .computed > .details-section.computed-style-variables .scope-bar.computed-style-variables-grouping-mode.default-item-selected:not(:hover)): Deleted. (.sidebar > .panel.details.css-style > .content > .computed > .details-section.computed-style-variables .scope-bar.computed-style-variables-grouping-mode.default-item-selected:hover): Deleted. 2021-12-13 Devin Rousso Web Inspector: remove coloring of Web Inspector area in dock icons https://bugs.webkit.org/show_bug.cgi?id=234262 Reviewed by Patrick Angle. It looks too strong/bold and draws way too much attention. It also doesn't match the styling of other nearby icons. * UserInterface/Images/DockBottom.svg: * UserInterface/Images/DockLeft.svg: * UserInterface/Images/DockRight.svg: 2021-12-13 Elliott Williams Deployment target for macOS 11+ does not follow minor version bumps https://bugs.webkit.org/show_bug.cgi?id=233906 Reviewed by Alexey Proskuryakov. * Configurations/DebugRelease.xcconfig: 2021-12-10 Michael Saboff https://bugs.webkit.org/show_bug.cgi?id=234173 Update Install Paths for build system changes Reviewed by Yusuke Suzuki. Updated install paths for changes in the build system that use a system path prefix. * Configurations/WebInspectorUIFramework.xcconfig: 2021-12-10 Razvan Caliman Web Inspector: Add CSS variable names to property name completion list https://bugs.webkit.org/show_bug.cgi?id=233372 Reviewed by Devin Rousso. Add the list of applicable CSS variables to the list of CSS property name completions. `WI.CSSPropertyNameCompletions` is a long-lived object that holds all supported property names. It doesn't need to change over time in a Web Inspector session. But the list of applicable CSS variables depends on the selected node. To avoid thrashing the long list of values in `WI.CSSPropertyNameCompletions` we don't proactively collect CSS variables. Instead, we introduce a flag to indicate that the list of CSS variables may be stale whenever the inspected node changes. Only when completions are requested do we check this flag and augment the list of CSS property names with the latest list of CSS variables. * UserInterface/Models/CSSCompletions.js: (WI.CSSCompletions.prototype.replaceValues): Allow a sub-class to replace the list of values in one go. If a `WI.CSSQueryController` was used, reset it and provide it the new list of values. * UserInterface/Models/CSSPropertyNameCompletions.js: (WI.CSSPropertyNameCompletions): (WI.CSSPropertyNameCompletions.prototype.executeQuery): (WI.CSSPropertyNameCompletions.prototype.startsWith): (WI.CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded): Holding a copy of the original list of CSS property names in order to create a new list agumented with variables on demand. (WI.CSSPropertyNameCompletions.prototype.addValues): Warn when trying to add new property values which would overwrite the cached and sorted list of CSS property names. (WI.CSSPropertyNameCompletions.prototype._handleInspectedNodeChanged): Consider changing of the inspected node as an indicator that the list of variables is stale. That may not necessarily be true for web pages with all CSS variables declared on :root or , but iterating over them to verify is needlessly expensive especially if completions were not even requested. (WI.CSSPropertyNameCompletions.prototype._handleNodesStylesNeedsRefresh): Consider any change to the styles of the inspected node as a potential change to the list of applicable variables. (WI.CSSPropertyNameCompletions): 2021-12-10 BJ Burg Web Inspector: save and restore extension tab positions https://bugs.webkit.org/show_bug.cgi?id=234115 Reviewed by Devin Rousso and Patrick Angle. The existing tab state restoration system works by saving or loading tab positions from persistent storage and saving or restoring each tab's state using one cookie per tab type. With extension tabs, it is now possible to have more than one tab per tab type. Additionally, extension tabs can be added at any time via InspectorFrontendAPI. Given these challenges, we need a different system for saving and restoring extension tabs. Extension tab restoration is now handled by WI.WebInspectorExtensionController. We consider a tab to be an 'anchor' tab if it is saveable, visible, and not pinnable. In other words, an anchor tab is one of the built-in singleton tabs like Console, Elements, etc. When the tab bar item list is modified, for each extension tab, we save the observed 'anchor' tab's type and a distance from that anchor tab's insertion index. Updates to extension tab positions are saved to persistent storage at most every 5 seconds. When it is time to place an extension tab with createTabForExtension() or showExtensionTab(), perform the reverse operation of computing an insertion index from a anchorTabType and distanceFromAnchorTab. This patch was tested with one extension, multiple extensions, showing/hiding extension tabs, remote inspecting a JSContext, and remote inspecting a WKWebView. * UserInterface/Views/TabBar.js: (WI.TabBar.prototype.get visibleTabBarItemsFromLeftToRight): Added. * UserInterface/Controllers/WebInspectorExtensionController.js: (WI.WebInspectorExtensionController): (WI.WebInspectorExtensionController.get extensionTabPositionsObjectStoreKey): Added. (WI.WebInspectorExtensionController.prototype.registerExtension): (WI.WebInspectorExtensionController.prototype.unregisterExtension): Add and remove WI.TabBar event listeners that notify us of changes to the tab bar. (WI.WebInspectorExtensionController.prototype.createTabForExtension): Deleted. (WI.WebInspectorExtensionController.prototype.async createTabForExtension): Renamed. Load saved tab positions from persistent storage if needed. Compute the insertion index for the new tab. This method is already expected to return a promise, so make it `async` to allow using `await`. (WI.WebInspectorExtensionController.prototype.showExtensionTab): Compute the insertion index for the new tab. (WI.WebInspectorExtensionController.prototype.async _loadExtensionTabPositions): Load saved tab positions from persistent storage, allowing for the case where nothing has been saved yet. (WI.WebInspectorExtensionController.prototype.async _saveExtensionTabPositions): Recompute and save tab positions for all extension tabs. Then write to persistent storage at most every 5 seconds using a WI.Debouncer. (WI.WebInspectorExtensionController.prototype._insertionIndexForExtensionTab): Added, wrapper method. (WI.WebInspectorExtensionController.prototype._computeIndicesForExtensionTab): Compute the anchorTabType, distanceFromAnchorTab, and insertionIndex for the extension tab. If saving tab positions, pass `options.recomputePositions` to ignore saved positions and recompute these fields based on what is currently visible in the tab bar. * UserInterface/Views/WebInspectorExtensionTabContentView.js: (WI.WebInspectorExtensionTabContentView.prototype.get savedTabPositionKey): Added. 2021-12-10 Nikita Vasilyev Web Inspector: Add a swatch for justify-content, justify-items, and justify-self https://bugs.webkit.org/show_bug.cgi?id=233055 Reviewed by Patrick Angle. Add an inline swatch for `justify-content`, that shows icons for common values: start, center, end, space-between, space-around, space-evenly, and stretch. Also, add inline swatches for `justify-items` and `justify-self`, that shows icons for: start, center, end, and stretch. The newly added swatches reuse the existing `align-content` and `align-items` icons, and rotate them -90 degrees. While `align-*` properties define alignment in the block-direction the `justify-*` properties define alignment in the inline-direction. * UserInterface/Models/AlignmentData.js: (WI.AlignmentData._propertyNameToType): * UserInterface/Views/AlignmentEditor.css: (.alignment-editor .glyph.rotate-left > svg): * UserInterface/Views/AlignmentEditor.js: (WI.AlignmentEditor.shouldRotateGlyph): (WI.AlignmentEditor._glyphsForType): (WI.AlignmentEditor.prototype.set alignment): * UserInterface/Views/InlineSwatch.css: (.inline-swatch.alignment > span.rotate-left): * UserInterface/Views/InlineSwatch.js: (WI.InlineSwatch.prototype._updateSwatch): 2021-12-10 Razvan Caliman Web Inspector: Computed Panel: Group CSS variables by value type https://bugs.webkit.org/show_bug.cgi?id=233563 Reviewed by Devin Rousso and Patrick Angle. Add the ability to view CSS variables in the Computed styles details sidebar panel groupped by value type in a few sections: "colors", "dimensions", "numbers" and a catch-all group of "other". * Localizations/en.lproj/localizedStrings.js: * UserInterface/Models/DOMNodeStyles.js: (WI.DOMNodeStyles): (WI.DOMNodeStyles.prototype.variableStylesByType): Iterate on-demand over all CSS variables found in the node's computed styles and assign each to a group depending on its value type: - color - dimension (number followed by a CSS unit-like string) - number - other Additional groups and refinements will come in follow-up patches. (WI.DOMNodeStyles.prototype.refresh.fetchedComputedStyle): The map of CSS variable groups gets invalidated when there's a significant change in the node's computed style. This supports the use case where previously empty groups become populated or, conversely, become empty. * UserInterface/Views/ComputedStyleDetailsPanel.js: (WI.ComputedStyleDetailsPanel): (WI.ComputedStyleDetailsPanel.prototype.refresh): (WI.ComputedStyleDetailsPanel.prototype.applyFilter): (WI.ComputedStyleDetailsPanel.prototype.initialLayout): No longer generate the elements for laying out CSS variables during `initialLayout()` but handle them during `layout()`. This support mutating the DOM for laying out either one top-level list of CSS variables (ungrouped) or multiple lists of CSS variable groups depeding on the grouping mode selected at runtime. * UserInterface/Views/ComputedStyleDetailsPanel.css: (.sidebar > .panel.details.css-style > .content > .computed .details-section > .content): Ensure both top-level and nested details sections overwrite styles. CSS variables groups are in nested details sections. (.sidebar > .panel.details.css-style > .content > .computed .details-section.computed-style-variables .computed-property-item): Adapt stylesheet to account for using `WI.ComputedStyleSection` instead of `WI.SpreadsheetCSSStyleDeclarationEditor` (.sidebar > .panel.details.css-style > .content > .computed > .details-section.computed-style-variables .scope-bar.computed-style-variables-grouping-mode): (.sidebar > .panel.details.css-style > .content > .computed > .details-section.computed-style-variables .scope-bar.computed-style-variables-grouping-mode.default-item-selected:not(:hover)): (.sidebar > .panel.details.css-style > .content > .computed > .details-section.computed-style-variables .scope-bar.computed-style-variables-grouping-mode.default-item-selected:hover): Reuse the visual treatment from SourcesNavigationSidebarPanel.css to avoid highlighting the default grouping mode scope bar item. (.sidebar > .panel.details.css-style > .content > .computed > .details-section > .content): Deleted. (.sidebar > .panel.details.css-style > .content > .computed .property): Deleted. (WI.ComputedStyleDetailsPanel.prototype.layout): Skip destroying and rebuilding sections whose data sources change during `WI.ComputedStyleDetailsPanel.refresh()` and which handle layout internally. We need to remove and rebuild just the sections for CSS variables because layout is requested in response to changing the CSS variables grouping mode. (WI.ComputedStyleDetailsPanel.prototype._createVariablesStyleSection): Replaces the use of `WI.SpreadsheetCSSStyleDeclarationEditor` for rendering CSS variables with `WI.ComputedStyleSection` which is already used for rendering CSS properties. It's a lighter-weight View that's fit for purpose. (WI.ComputedStyleDetailsPanel.prototype._renderVariablesStyleSectionGroup): Use a generic renderer for CSS variable sections that can be reused for any group type. (WI.ComputedStyleDetailsPanel.prototype._handleDetailsSectionCollapsedStateChanged): Generalize handling collapsed state change events for all sections, current and future. (WI.ComputedStyleDetailsPanel.prototype._handleEditorFilterApplied): Generalize handling filtering events for all sections, current and future. (WI.ComputedStyleDetailsPanel.prototype._handleVariablesGroupingModeScopeBarSelectionChanged): (WI.ComputedStyleDetailsPanel.prototype._handleVariablesGroupingSettingChanged): (WI.ComputedStyleDetailsPanel.prototype._handlePropertiesSectionCollapsedStateChanged): Deleted. (WI.ComputedStyleDetailsPanel.prototype._handleVariablesSectionCollapsedStateChanged): Deleted. * UserInterface/Views/ComputedStyleSection.js: (WI.ComputedStyleSection): Change the default value of `_styleTraces` to null instead of an empty array so that `WI.ComputedStyleSection.layout()` doesn't attempt to access it like a `Map`. 2021-12-10 Nikita Vasilyev Web Inspector: Add a swatch for align-items and align-self https://bugs.webkit.org/show_bug.cgi?id=233054 Reviewed by Devin Rousso. Introduce inline swatches for `align-items` and `align-self`, that shows icons for common values: start, center, end, and stretch. * UserInterface/Images/AlignContentCenter.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/AlignmentCenter.svg. * UserInterface/Images/AlignContentEnd.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/AlignmentEnd.svg. * UserInterface/Images/AlignContentSpaceAround.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/AlignmentSpaceAround.svg. * UserInterface/Images/AlignContentSpaceBetween.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/AlignmentSpaceBetween.svg. * UserInterface/Images/AlignContentSpaceEvenly.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/AlignmentSpaceEvenly.svg. * UserInterface/Images/AlignContentStart.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/AlignmentStart.svg. * UserInterface/Images/AlignContentStretch.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/AlignmentStretch.svg. Rename icons from Alignment to AlignContent since they are only used for `align-content` CSS property now. * UserInterface/Images/AlignItemsCenter.svg: Added. * UserInterface/Images/AlignItemsEnd.svg: Added. * UserInterface/Images/AlignItemsStart.svg: Added. * UserInterface/Images/AlignItemsStretch.svg: Added. * UserInterface/Main.html: * UserInterface/Models/AlignmentData.js: Added. (WI.AlignmentData): (WI.AlignmentData.isAlignmentAwarePropertyName): (WI.AlignmentData._propertyNameToType): (WI.AlignmentData.prototype.get type): (WI.AlignmentData.prototype.get text): (WI.AlignmentData.prototype.set text): (WI.AlignmentData.prototype.toString): Introduce a model object to be more consistent with the rest of the inline swatches. * UserInterface/Views/AlignmentEditor.js: (WI.AlignmentEditor): Allow AlignmentEditor to work with more than one CSS property (i.e. align-content), by introducing propertyName argument. (WI.AlignmentEditor.glyphPath): (WI.AlignmentEditor._glyphsForType): (WI.AlignmentEditor.prototype.get alignment): (WI.AlignmentEditor.prototype.set alignment): Rename `value` to `alignment` to be more consistent with the rest of the editors. (WI.AlignmentEditor.prototype._removePreviouslySelected): (WI.AlignmentEditor.prototype._updateSelected): (WI.AlignmentEditor.isAlignContentValue): Deleted. (WI.AlignmentEditor.prototype.get value): Deleted. (WI.AlignmentEditor.prototype.set value): Deleted. * UserInterface/Views/InlineSwatch.js: (WI.InlineSwatch.prototype._updateSwatch): (WI.InlineSwatch.prototype._valueEditorValueDidChange): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype._replaceSpecialTokens): (WI.SpreadsheetStyleProperty.prototype._addAlignmentTokens): 2021-12-10 Razvan Caliman Web Inspector: Extract a specialized CSSNameCompletions from CSSCompletions https://bugs.webkit.org/show_bug.cgi?id=233369 Reviewed by Devin Rousso. `WI.CSSPropertyNameCompletions` is a long-lived object that holds the list of all CSS properties supported by the target. It is instantiated only once on Web Inspector startup. By contrast, `WI.CSSCompletions` is an object instantiated as often as needed with lists of property values, CSS function values, etc. It holds the generic logic for matching values against a given query. The specialized logic for CSS property names was mixed-in with the generic logic in `WI.CSSCompletions`. The main difference is in the format of the payload provided: - an array of objects with key/value pairs for `WI.CSSPropertyNameCompletions`. - an array of strings for general purpose `WI.CSSCompletions`. This patch reduces the complexity in `WI.Completions`: - moves the one-time initialization method to `WI.cssManager.initializeCSSCompletions`. - simplifies `WI.Completions` constructor to expect just an array of strings. - introduces `WI.CSSPropertyNameCompletions` as a sub-class of `WI.CSSCompletions` where its constructor is specialized to handle the payload received from the backend. - moves the `WI.CSSPropertyNameCompletions` instance to `WI.cssManager.cssPropertyNameCompletions`. - removes unused accessors for navigating the list of matched completions. * UserInterface/Base/Main.js: (WI.performOneTimeFrontendInitializationsUsingTarget): * UserInterface/Controllers/CSSManager.js: (WI.CSSManager): (WI.CSSManager.prototype.initializeCSSPropertyNameCompletions.): (WI.CSSManager.prototype.initializeCSSPropertyNameCompletions): Moved the initializiation method for objects used to get CSS completions from `WI.CSSCompletions` with data from the backed to a more appropriate place. (WI.CSSManager.prototype.get propertyNameCompletions): * UserInterface/Controllers/CodeMirrorCompletionController.js: (WI.CodeMirrorCompletionController.prototype._generateCSSCompletions): * UserInterface/Main.html: * UserInterface/Models/CSSCompletions.js: (WI.CSSCompletions.prototype._firstIndexOfPrefix): (WI.CSSCompletions): (WI.CSSCompletions.initializeCSSCompletions.): Deleted. (WI.CSSCompletions.initializeCSSCompletions.collectPropertyNameForCodeMirror): Deleted. (WI.CSSCompletions.initializeCSSCompletions.propertiesCallback): Deleted. (WI.CSSCompletions.initializeCSSCompletions.fontFamilyNamesCallback): Deleted. (WI.CSSCompletions.initializeCSSCompletions): Deleted. Moved to `WI.CSSManager`. (WI.CSSCompletions.prototype.next): Deleted. (WI.CSSCompletions.prototype.previous): Deleted. (WI.CSSCompletions.prototype._closest): Deleted. Removed unused methods for navigating the completions list. This behavior is encapsulated in `WI.CompletionSuggestionsView`. (WI.CSSCompletions.prototype.isValidPropertyName): Deleted. Moved to `WI.CSSPropertyNameCompletions`. * UserInterface/Models/CSSKeywordCompletions.js: (WI.CSSKeywordCompletions.forPartialPropertyName): * UserInterface/Models/CSSPropertyNameCompletions.js: Added. (WI.CSSPropertyNameCompletions.prototype.isValidPropertyName): (WI.CSSPropertyNameCompletions): * UserInterface/Test.html: * UserInterface/Test/Test.js: (WI.performOneTimeFrontendInitializationsUsingTarget): * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.updateStatus): (WI.SpreadsheetStyleProperty.prototype._addCSSDocumentationButton): 2021-12-09 Brent Fulgham Unprefix CSS value text-align: -webkit-match-parent https://bugs.webkit.org/show_bug.cgi?id=229496 Reviewed by Darin Adler. * UserInterface/Models/CSSKeywordCompletions.js: Add 'match-parent' 2021-12-08 BJ Burg [Cocoa] Web Inspector: provide a way for _WKInspectorExtension clients to be to notified when an extension tab navigates https://bugs.webkit.org/show_bug.cgi?id=233935 Reviewed by Patrick Angle. In order instrument all loads inside the extension iframe, we cannot rely on the