Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Web Inspector: Elements Tab: add a navigation item to control what ba…
…dges are shown https://bugs.webkit.org/show_bug.cgi?id=243858 Reviewed by Patrick Angle. This will allow us to add more badges (e.g. "Scroll", "Events", etc.) without overloading the DOM tree with too many badges, as developers can turn off ones they do not find useful. * Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js: (WI.DOMTreeContentView): (WI.DOMTreeContentView.prototype.get navigationItems): (WI.DOMTreeContentView.prototype.attached): (WI.DOMTreeContentView.prototype.detached): (WI.DOMTreeContentView.prototype._populateConfigureDOMTreeBadgesNavigationItemContextMenu): Added. * Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.css: (.item.button.text-only.configure-dom-tree-badges): Added. (.item.button.text-only.configure-dom-tree-badges:hover): Added. The "Badges" navigation item will show a contextmenu containing checkbox items for each type of DOM tree badge. If any badges are selected, the navigation item is considered activated. Currently there are only two badges: "flex" and "grid". * Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js: (WI.DOMTreeElement): (WI.DOMTreeElement.prototype.onattach): (WI.DOMTreeElement.prototype.ondetach): (WI.DOMTreeElement.prototype.insertChildElement): (WI.DOMTreeElement.prototype.updateTitle): (WI.DOMTreeElement.prototype._createBadge): Added. (WI.DOMTreeElement.prototype._createBadges): Added. (WI.DOMTreeElement.prototype._updateBadges): Added. (WI.DOMTreeElement.prototype._handleLayoutFlagsChanged): (WI.DOMTreeElement.prototype._handleShownDOMTreeBadgesChanged): Added. (WI.DOMTreeElement.prototype._updateLayoutBadge): Deleted. (WI.DOMTreeElement.prototype._updateLayoutBadgeStatus): Deleted. * Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.css: (.tree-outline.dom .badge): Renamed from `.tree-outline.dom .layout-badge`. (.tree-outline.dom .badge.activated): Renamed from `.tree-outline.dom .layout-badge.activated`. (body:not(.window-inactive, .window-docked-inactive) .tree-outline.dom:focus-within li.selected .badge): Renamed from `body:not(.window-inactive, .window-docked-inactive) .tree-outline.dom:focus-within li.selected .layout-badge`. (@media (prefers-color-scheme: dark) .tree-outline.dom .badge): Renamed from `@media (prefers-color-scheme: dark) .tree-outline.dom .layout-badge`. Rework how badges are created to first check that the desired badge is allowed based on the current selections from the above navigation item. Also don't assume that there is only one badge. * Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js: (WI.DOMTreeOutline.prototype.update): Add a `showBadges` constructor option that controls whether any child `WI.DOMTreeElement` will even try to create a badge. This ensures that badges are only created in the DOM tree in the Elements Tab. * Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js: (WI.HierarchicalPathNavigationItem.prototype.update): Drive-by: Use `.width` instead of `.element.realOffsetWidth` as the former includes any CSS margins. * Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js: (WI.ButtonNavigationItem.prototype.get totalMargin): (WI.ButtonNavigationItem.prototype.get textMargin): Added. * Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.css: (.navigation-bar .item.button.text-only): * Source/WebInspectorUI/UserInterface/Views/TextToggleButtonNavigationItem.js: (WI.TextToggleButtonNavigationItem.prototype.get textMargin): Added. * Source/WebInspectorUI/UserInterface/Views/TextToggleButtonNavigationItem.css: (.navigation-bar .item.text-toggle.button.text-only): (.navigation-bar .item.text-toggle.button.text-only:not(:hover, .selected)): Added. Drive-by: Decrease text toggle `margin` and `padding` to better match text button. * Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js: (WI.TimelineOverview): * Source/WebInspectorUI/UserInterface/Views/TimelineOverview.css: (.navigation-bar.timelines .item.text.enabled-timelines): Added. * Source/WebInspectorUI/UserInterface/Views/AuditNavigationSidebarPanel.js: (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView): (WI.AuditNavigationSidebarPanel.prototype.initialLayout): * Source/WebInspectorUI/UserInterface/Views/AuditNavigationSidebarPanel.css: (.content-view.audit .message-text-view .navigation-item-help:is(.start-editing-audits, .stop-editing-audits) .navigation-bar): Deleted. * Source/WebInspectorUI/UserInterface/Views/Main.css: (.navigation-item-help > .navigation-bar): Drive-by: Add an icon for all other text buttons. * Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.css: (.navigation-bar .item:first-child.text): Added. (.navigation-bar .item:last-child.text): Added. Drive-by: Don't add so much padding if the text is at the beginning/end of the `WI.NavigationBar`. * Source/WebInspectorUI/UserInterface/Base/Utilities.js: (Array.prototype.toggleIncludes): * LayoutTests/inspector/unit-tests/array-utilities.html: * LayoutTests/inspector/unit-tests/array-utilities-expected.txt: Drive-by: Allow not passing a `force`, which behaves like a flip-flop. * Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js: Canonical link: https://commits.webkit.org/253579@main
- Loading branch information
Showing
20 changed files
with
206 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.