chrome-devtools-frontend 1.0.1578486 → 1.0.1579812
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/cookbook/devtools_on_devtools.md +2 -2
- package/docs/feature-specs/elements-gutter-decorators.md +40 -0
- package/docs/feature-specs/elements-tree-selection-and-hover.md +31 -0
- package/docs/feature-specs/images/elements-gutter-decorators-multiple.png +0 -0
- package/docs/get_the_code.md +3 -3
- package/front_end/core/common/Revealer.ts +0 -5
- package/front_end/core/sdk/ConsoleModel.ts +0 -3
- package/front_end/generated/ARIAProperties.js +0 -6
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/protocol.ts +1 -0
- package/front_end/models/ai_assistance/AiConversation.ts +42 -22
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +30 -0
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +79 -0
- package/front_end/models/issues_manager/CookieIssue.ts +0 -1
- package/front_end/models/issues_manager/IssuesManager.ts +2 -15
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +5 -3
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +33 -27
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +38 -18
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +7 -4
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -0
- package/front_end/panels/ai_assistance/components/chatInput.css +10 -3
- package/front_end/panels/animation/AnimationGroupPreviewUI.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsView.ts +51 -76
- package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +1 -0
- package/front_end/panels/application/components/BackForwardCacheView.ts +4 -2
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.css +0 -5
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +1 -0
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +2 -2
- package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +4 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -32
- package/front_end/panels/console/consoleView.css +0 -5
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +78 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +93 -121
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -0
- package/front_end/panels/elements/LayoutPane.ts +8 -7
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
- package/front_end/panels/elements/components/StylePropertyEditor.ts +2 -1
- package/front_end/panels/elements/elements.ts +3 -0
- package/front_end/panels/elements/elementsTreeOutline.css +16 -5
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseStartView.ts +1 -1
- package/front_end/panels/lighthouse/lighthouseStartView.css +6 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
- package/front_end/panels/media/PlayerListView.ts +14 -2
- package/front_end/panels/media/playerListView.css +5 -0
- package/front_end/panels/network/NetworkItemView.ts +2 -1
- package/front_end/panels/network/NetworkLogView.ts +2 -5
- package/front_end/panels/network/NetworkLogViewColumns.ts +19 -7
- package/front_end/panels/network/RequestInitiatorView.ts +20 -4
- package/front_end/panels/network/RequestPayloadView.ts +253 -280
- package/front_end/panels/network/ShowMoreDetailsWidget.ts +3 -3
- package/front_end/panels/network/components/RequestHeaderSection.ts +1 -1
- package/front_end/panels/network/requestPayloadTree.css +6 -3
- package/front_end/panels/network/requestPayloadView.css +1 -0
- package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
- package/front_end/panels/recorder/components/RecordingListView.ts +1 -1
- package/front_end/panels/recorder/components/StepEditor.ts +3 -3
- package/front_end/panels/security/SecurityPanel.ts +0 -16
- package/front_end/panels/security/security-meta.ts +1 -15
- package/front_end/panels/settings/EditFileSystemView.ts +8 -8
- package/front_end/panels/settings/KeybindsSettingsTab.ts +2 -1
- package/front_end/panels/settings/SettingsScreen.ts +4 -4
- package/front_end/panels/sources/CallStackSidebarPane.ts +1 -1
- package/front_end/panels/sources/components/HeadersView.ts +2 -2
- package/front_end/panels/timeline/components/BreadcrumbsUI.ts +1 -1
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +1 -1
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +47 -26
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +121 -39
- package/front_end/panels/timeline/overlays/components/timespanBreakdownOverlay.css +106 -101
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/buttons/Button.ts +1 -1
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +7 -12
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
- package/front_end/ui/legacy/InplaceEditor.ts +1 -1
- package/front_end/ui/legacy/InspectorView.ts +6 -5
- package/front_end/ui/legacy/ListControl.ts +2 -1
- package/front_end/ui/legacy/ListWidget.ts +1 -1
- package/front_end/ui/legacy/SoftContextMenu.ts +2 -1
- package/front_end/ui/legacy/Treeoutline.ts +82 -22
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +4 -2
- package/front_end/ui/legacy/components/data_grid/SortableDataGrid.ts +59 -9
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +28 -15
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +2 -1
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +2 -2
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +3 -3
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -3
- package/front_end/ui/legacy/softDropDown.css +7 -1
- package/front_end/ui/visual_logging/Debugging.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/mcp/mcp.ts +2 -0
- package/package.json +1 -1
|
@@ -4,130 +4,135 @@
|
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
7
|
+
@scope to (devtools-widget > *) {
|
|
8
|
+
.timespan-breakdown-overlay-section {
|
|
9
|
+
border: solid;
|
|
10
|
+
border-color: var(--sys-color-on-surface);
|
|
11
|
+
border-width: 4px 1px 0;
|
|
12
|
+
align-content: flex-start;
|
|
13
|
+
text-align: center;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
text-overflow: ellipsis;
|
|
16
|
+
background-image: linear-gradient(180deg, var(--sys-color-on-primary), transparent);
|
|
17
|
+
height: 90%;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
padding-top: var(--sys-size-2);
|
|
20
|
+
|
|
21
|
+
.is-below & {
|
|
22
|
+
border-top-width: 0;
|
|
23
|
+
border-bottom-width: 4px;
|
|
24
|
+
align-content: flex-end;
|
|
25
|
+
/* anchor the text at the bottom */
|
|
26
|
+
padding-bottom: var(--sys-size-2);
|
|
27
|
+
padding-top: 0;
|
|
28
|
+
|
|
29
|
+
/* re-order so the timestamp is below label */
|
|
30
|
+
.timespan-breakdown-overlay-label {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column-reverse;
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
|
-
}
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
.timeline-segment-container {
|
|
38
|
+
display: flex;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
flex-direction: row;
|
|
41
|
+
justify-content: flex-end;
|
|
42
|
+
align-items: flex-end;
|
|
43
|
+
width: 100%;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
height: 100%;
|
|
46
|
+
max-height: 100px;
|
|
47
|
+
|
|
48
|
+
/* Ensure that the first & last sections always have the left/right border */
|
|
49
|
+
/* (disable stylelint because we need the !important to override border
|
|
48
50
|
* styles below + keeping them here is clearer to read) */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
.timespan-breakdown-overlay-section:first-child {
|
|
52
|
+
/* stylelint-disable-next-line declaration-no-important */
|
|
53
|
+
border-left-width: 1px !important;
|
|
54
|
+
}
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
.timespan-breakdown-overlay-section:last-child {
|
|
57
|
+
/* stylelint-disable-next-line declaration-no-important */
|
|
58
|
+
border-right-width: 1px !important;
|
|
59
|
+
}
|
|
55
60
|
}
|
|
56
|
-
}
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
62
|
+
.timeline-segment-container.is-below {
|
|
63
|
+
align-items: flex-start;
|
|
64
|
+
}
|
|
61
65
|
|
|
62
|
-
/* Depending on if the number of sections is odd or even, we alternate the
|
|
66
|
+
/* Depending on if the number of sections is odd or even, we alternate the
|
|
63
67
|
* heights of the even/odd sections. We do this to ensure that the first item
|
|
64
68
|
* is never a "high" item, because that looks a bit clunky. */
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
.timeline-segment-container.even-number-of-sections {
|
|
70
|
+
.timespan-breakdown-overlay-section:nth-child(even) {
|
|
71
|
+
height: 100%;
|
|
72
|
+
}
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
.timespan-breakdown-overlay-section:nth-child(odd) {
|
|
75
|
+
border-left-width: 0;
|
|
76
|
+
border-right-width: 0;
|
|
77
|
+
}
|
|
73
78
|
}
|
|
74
|
-
}
|
|
75
79
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
.timeline-segment-container.odd-number-of-sections {
|
|
81
|
+
.timespan-breakdown-overlay-section:nth-child(odd) {
|
|
82
|
+
height: 100%;
|
|
83
|
+
}
|
|
80
84
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
.timespan-breakdown-overlay-section:nth-child(even) {
|
|
86
|
+
border-left-width: 0;
|
|
87
|
+
border-right-width: 0;
|
|
88
|
+
}
|
|
84
89
|
}
|
|
85
|
-
}
|
|
86
90
|
|
|
87
|
-
.timespan-breakdown-overlay-label {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
overflow: hidden;
|
|
98
|
-
text-overflow: ellipsis;
|
|
99
|
-
text-wrap: nowrap;
|
|
100
|
-
|
|
101
|
-
.duration-text {
|
|
102
|
-
font-size: var(--sys-typescale-body4-size);
|
|
103
|
-
text-overflow: ellipsis;
|
|
91
|
+
.timespan-breakdown-overlay-label {
|
|
92
|
+
font-family: var(--default-font-family);
|
|
93
|
+
font-size: var(--sys-typescale-body2-size);
|
|
94
|
+
line-height: var(--sys-typescale-body4-line-height);
|
|
95
|
+
font-weight: var(--ref-typeface-weight-medium);
|
|
96
|
+
color: var(--sys-color-on-surface);
|
|
97
|
+
text-align: center;
|
|
98
|
+
box-sizing: border-box;
|
|
99
|
+
width: max-content;
|
|
100
|
+
padding: 0 3px;
|
|
104
101
|
overflow: hidden;
|
|
102
|
+
text-overflow: ellipsis;
|
|
105
103
|
text-wrap: nowrap;
|
|
106
|
-
display: block;
|
|
107
|
-
}
|
|
108
104
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
.duration-text {
|
|
106
|
+
font-size: var(--sys-typescale-body4-size);
|
|
107
|
+
text-overflow: ellipsis;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
text-wrap: nowrap;
|
|
110
|
+
display: block;
|
|
111
|
+
}
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
pointer-events: none;
|
|
117
|
-
visibility: hidden;
|
|
118
|
-
}
|
|
113
|
+
.discovery-time-ms {
|
|
114
|
+
font-weight: var(--ref-typeface-weight-bold);
|
|
115
|
+
}
|
|
119
116
|
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
&.labelHidden {
|
|
118
|
+
/* Have to use this not display: none so it maintains its width */
|
|
119
|
+
user-select: none;
|
|
120
|
+
pointer-events: none;
|
|
121
|
+
visibility: hidden;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&.labelTruncated {
|
|
125
|
+
/* This means the label will show the text that fits with an ellipsis for
|
|
122
126
|
* the overflow */
|
|
123
|
-
|
|
124
|
-
|
|
127
|
+
max-width: 100%;
|
|
128
|
+
}
|
|
125
129
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
&.offScreenLeft {
|
|
131
|
+
text-align: left;
|
|
132
|
+
}
|
|
129
133
|
|
|
130
|
-
|
|
131
|
-
|
|
134
|
+
&.offScreenRight {
|
|
135
|
+
text-align: right;
|
|
136
|
+
}
|
|
132
137
|
}
|
|
133
138
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: Dependencies sourced from the upstream `chromium` repository
|
|
2
2
|
URL: https://chromium.googlesource.com/chromium/src
|
|
3
3
|
Version: N/A
|
|
4
|
-
Revision:
|
|
4
|
+
Revision: 894232ec55c07f1499cfd86b67d62de0b1366c1c
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|
|
@@ -126,7 +126,7 @@ export class Button extends HTMLElement {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
override cloneNode(deep?: boolean): Node {
|
|
129
|
-
const node =
|
|
129
|
+
const node = document.importNode(this, deep);
|
|
130
130
|
Object.assign(node.#props, this.#props);
|
|
131
131
|
node.#render();
|
|
132
132
|
return node;
|
|
@@ -217,21 +217,16 @@ class SuggestionBox extends LitElement {
|
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
+
// clang-format off
|
|
220
221
|
return html`<style>${contentEditableStyles}</style><ul class="suggestions">
|
|
221
|
-
${this.#suggestions.map((suggestion, index) =>
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
})}
|
|
226
|
-
@mousedown=${this.#dispatchSuggestEvent.bind(this, suggestion)}
|
|
227
|
-
jslog=${VisualLogging.item('suggestion').track({
|
|
228
|
-
click: true,
|
|
229
|
-
})}
|
|
230
|
-
>
|
|
222
|
+
${this.#suggestions.map((suggestion, index) => html`
|
|
223
|
+
<li class=${classMap({selected: index === this.cursor})}
|
|
224
|
+
@mousedown=${this.#dispatchSuggestEvent.bind(this, suggestion)}
|
|
225
|
+
jslog=${VisualLogging.item('suggestion').track({ click: true, resize: true })}>
|
|
231
226
|
${suggestion}
|
|
232
|
-
</li
|
|
233
|
-
})}
|
|
227
|
+
</li>`)}
|
|
234
228
|
</ul>`;
|
|
229
|
+
// clang-format on
|
|
235
230
|
}
|
|
236
231
|
}
|
|
237
232
|
|
|
@@ -475,7 +475,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
475
475
|
aria-level=${depth + 1}
|
|
476
476
|
aria-posinset=${positionInSet + 1}
|
|
477
477
|
class=${listItemClasses}
|
|
478
|
-
jslog=${VisualLogging.treeItem(node.jslogContext).track({click: true, keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Enter|Space|Home|End'})}
|
|
478
|
+
jslog=${VisualLogging.treeItem(node.jslogContext).track({click: true, resize: true, keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Enter|Space|Home|End'})}
|
|
479
479
|
@click=${this.#onNodeClick}
|
|
480
480
|
track-dom-node-to-tree-node=${trackDOMNodeToTreeNode(this.#domNodeToTreeNodeMap, node)}
|
|
481
481
|
${Lit.Directives.ref(domNode => {
|
|
@@ -129,7 +129,7 @@ export class InplaceEditor<T> {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
function defaultFinishHandler(event: KeyboardEvent): string {
|
|
132
|
-
if (event.key === 'Enter') {
|
|
132
|
+
if (event.key === 'Enter' && !event.shiftKey) {
|
|
133
133
|
return 'commit';
|
|
134
134
|
}
|
|
135
135
|
if (event.keyCode === Keys.Esc.code || event.key === Platform.KeyboardUtilities.ESCAPE_KEY) {
|
|
@@ -155,6 +155,7 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
155
155
|
private focusRestorer?: WidgetFocusRestorer|null;
|
|
156
156
|
private ownerSplitWidget?: SplitWidget;
|
|
157
157
|
private reloadRequiredInfobar?: Infobar;
|
|
158
|
+
#debuggedTabReloadRequiredInfobar?: Infobar;
|
|
158
159
|
#selectOverrideFolderInfobar?: Infobar;
|
|
159
160
|
#resizeObserver: ResizeObserver;
|
|
160
161
|
#toggleOrientationButton: ToolbarButton;
|
|
@@ -636,7 +637,7 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
636
637
|
}
|
|
637
638
|
|
|
638
639
|
displayDebuggedTabReloadRequiredWarning(message: string): void {
|
|
639
|
-
if (!this
|
|
640
|
+
if (!this.#debuggedTabReloadRequiredInfobar) {
|
|
640
641
|
const infobar = new Infobar(
|
|
641
642
|
InfobarType.INFO, message,
|
|
642
643
|
[
|
|
@@ -654,9 +655,9 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
654
655
|
undefined, 'reload-required');
|
|
655
656
|
infobar.setParentView(this);
|
|
656
657
|
this.attachInfobar(infobar);
|
|
657
|
-
this
|
|
658
|
+
this.#debuggedTabReloadRequiredInfobar = infobar;
|
|
658
659
|
infobar.setCloseCallback(() => {
|
|
659
|
-
|
|
660
|
+
this.#debuggedTabReloadRequiredInfobar = undefined;
|
|
660
661
|
});
|
|
661
662
|
|
|
662
663
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
@@ -666,8 +667,8 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
666
667
|
}
|
|
667
668
|
|
|
668
669
|
removeDebuggedTabReloadRequiredWarning(): void {
|
|
669
|
-
if (this
|
|
670
|
-
this.
|
|
670
|
+
if (this.#debuggedTabReloadRequiredInfobar) {
|
|
671
|
+
this.#debuggedTabReloadRequiredInfobar.dispose();
|
|
671
672
|
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
672
673
|
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.PrimaryPageChanged,
|
|
673
674
|
this.removeDebuggedTabReloadRequiredWarning, this);
|
|
@@ -364,7 +364,8 @@ export class ListControl<T> {
|
|
|
364
364
|
element = this.delegate.createElementForItem(item);
|
|
365
365
|
if (!element.hasAttribute('jslog')) {
|
|
366
366
|
element.setAttribute(
|
|
367
|
-
'jslog',
|
|
367
|
+
'jslog',
|
|
368
|
+
`${VisualLogging.item().track({click: true, resize: true, keydown: 'ArrowUp|ArrowDown|PageUp|PageDown'})}`);
|
|
368
369
|
}
|
|
369
370
|
this.itemToElement.set(item, element);
|
|
370
371
|
this.updateElementARIA(element, index);
|
|
@@ -150,7 +150,7 @@ export class ListWidget<T> extends VBox {
|
|
|
150
150
|
}
|
|
151
151
|
const content = this.delegate.renderItem(item, editable, this.#items.length - 1);
|
|
152
152
|
if (!content.hasAttribute('jslog')) {
|
|
153
|
-
element.setAttribute('jslog', `${VisualLogging.item()}`);
|
|
153
|
+
element.setAttribute('jslog', `${VisualLogging.item().track({resize: true})}`);
|
|
154
154
|
}
|
|
155
155
|
element.appendChild(content);
|
|
156
156
|
if (editable) {
|
|
@@ -335,7 +335,8 @@ export class SoftContextMenu {
|
|
|
335
335
|
menuItemElement.addEventListener('mouseleave', (this.menuItemMouseLeave.bind(this) as EventListener), false);
|
|
336
336
|
|
|
337
337
|
if (item.jslogContext) {
|
|
338
|
-
menuItemElement.setAttribute(
|
|
338
|
+
menuItemElement.setAttribute(
|
|
339
|
+
'jslog', `${VisualLogging.item(item.jslogContext).track({click: true, resize: true})}`);
|
|
339
340
|
}
|
|
340
341
|
return menuItemElement;
|
|
341
342
|
}
|
|
@@ -499,6 +499,7 @@ export class TreeElement {
|
|
|
499
499
|
this.listItemNode.setAttribute(
|
|
500
500
|
'jslog', `${VisualLogging.treeItem().parent('parentTreeItem').context(jslogContext).track({
|
|
501
501
|
click: true,
|
|
502
|
+
resize: true,
|
|
502
503
|
keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Backspace|Delete|Enter|Space|Home|End',
|
|
503
504
|
})}`);
|
|
504
505
|
ARIAUtils.markAsTreeitem(this.listItemNode);
|
|
@@ -1535,6 +1536,7 @@ export class TreeSearch < NodeT extends TreeNode<NodeT>,
|
|
|
1535
1536
|
}
|
|
1536
1537
|
|
|
1537
1538
|
class TreeViewTreeElement extends TreeElement {
|
|
1539
|
+
static readonly CLONED_ATTRIBUTES = SDK.DOMModel.ARIA_ATTRIBUTES.union(new Set(['jslog']));
|
|
1538
1540
|
#clonedAttributes = new Set<string>();
|
|
1539
1541
|
#clonedClasses = new Set<string>();
|
|
1540
1542
|
|
|
@@ -1556,7 +1558,7 @@ class TreeViewTreeElement extends TreeElement {
|
|
|
1556
1558
|
this.#clonedClasses.clear();
|
|
1557
1559
|
for (let i = 0; i < this.configElement.attributes.length; ++i) {
|
|
1558
1560
|
const attribute = this.configElement.attributes.item(i);
|
|
1559
|
-
if (attribute && attribute.name !== 'role' &&
|
|
1561
|
+
if (attribute && attribute.name !== 'role' && TreeViewTreeElement.CLONED_ATTRIBUTES.has(attribute.name)) {
|
|
1560
1562
|
this.listItemElement.setAttribute(attribute.name, attribute.value);
|
|
1561
1563
|
this.#clonedAttributes.add(attribute.name);
|
|
1562
1564
|
}
|
|
@@ -1574,6 +1576,8 @@ class TreeViewTreeElement extends TreeElement {
|
|
|
1574
1576
|
this.titleElement.appendChild(HTMLElementWithLightDOMTemplate.cloneNode(child));
|
|
1575
1577
|
}
|
|
1576
1578
|
|
|
1579
|
+
this.hidden = hasBooleanAttribute(this.configElement, 'hidden');
|
|
1580
|
+
|
|
1577
1581
|
Highlighting.HighlightManager.HighlightManager.instance().apply(this.titleElement);
|
|
1578
1582
|
}
|
|
1579
1583
|
|
|
@@ -1582,23 +1586,26 @@ class TreeViewTreeElement extends TreeElement {
|
|
|
1582
1586
|
}
|
|
1583
1587
|
|
|
1584
1588
|
remove(): void {
|
|
1585
|
-
|
|
1586
|
-
if (parent) {
|
|
1587
|
-
parent.removeChild(this);
|
|
1588
|
-
parent.setExpandable(parent.children().length > 0);
|
|
1589
|
-
}
|
|
1589
|
+
removeNode(this);
|
|
1590
1590
|
TreeViewTreeElement.#elementToTreeElement.delete(this.configElement);
|
|
1591
1591
|
}
|
|
1592
1592
|
}
|
|
1593
1593
|
|
|
1594
|
-
function getTreeNodes(nodeList: NodeList|Node[]): HTMLLIElement
|
|
1594
|
+
function getTreeNodes(nodeList: NodeList|Node[]): Array<HTMLLIElement|TreeElementWrapper> {
|
|
1595
1595
|
return nodeList.values()
|
|
1596
1596
|
.flatMap(node => {
|
|
1597
|
+
if (node instanceof TreeElementWrapper) {
|
|
1598
|
+
return [node];
|
|
1599
|
+
}
|
|
1597
1600
|
if (node instanceof HTMLLIElement && node.role === 'treeitem') {
|
|
1598
|
-
return [
|
|
1601
|
+
return [
|
|
1602
|
+
node,
|
|
1603
|
+
...node.querySelectorAll<HTMLLIElement|TreeElementWrapper>(
|
|
1604
|
+
'ul[role="group"] li[role="treeitem"],ul[role="group"] devtools-tree-wrapper')
|
|
1605
|
+
];
|
|
1599
1606
|
}
|
|
1600
1607
|
if (node instanceof HTMLElement) {
|
|
1601
|
-
return node.querySelectorAll<HTMLLIElement>('li[role="treeitem"]');
|
|
1608
|
+
return node.querySelectorAll<HTMLLIElement|TreeElementWrapper>('li[role="treeitem"],devtools-tree-wrapper');
|
|
1602
1609
|
}
|
|
1603
1610
|
return [];
|
|
1604
1611
|
})
|
|
@@ -1617,6 +1624,14 @@ function getStyleElements(nodes: NodeList|Node[]): HTMLElement[] {
|
|
|
1617
1624
|
});
|
|
1618
1625
|
}
|
|
1619
1626
|
|
|
1627
|
+
function removeNode(node: TreeElement): void {
|
|
1628
|
+
const parent = node.parent;
|
|
1629
|
+
if (parent) {
|
|
1630
|
+
parent.removeChild(node);
|
|
1631
|
+
parent.setExpandable(parent.children().length > 0);
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1620
1635
|
/**
|
|
1621
1636
|
* A tree element that can be used as progressive enhancement over a <ul> element. A `template` IDL attribute allows
|
|
1622
1637
|
* additionally to insert the <ul> into a <template>, avoiding rendering anything into light DOM, which is recommended.
|
|
@@ -1683,7 +1698,7 @@ function getStyleElements(nodes: NodeList|Node[]): HTMLElement[] {
|
|
|
1683
1698
|
* @attribute hide-overflow
|
|
1684
1699
|
*/
|
|
1685
1700
|
export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
1686
|
-
static readonly observedAttributes = ['navigation-variant', 'hide-overflow'];
|
|
1701
|
+
static readonly observedAttributes = ['navigation-variant', 'hide-overflow', 'dense'];
|
|
1687
1702
|
readonly #treeOutline = new TreeOutlineInShadow(undefined, this);
|
|
1688
1703
|
|
|
1689
1704
|
constructor() {
|
|
@@ -1710,7 +1725,7 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1710
1725
|
return this.#treeOutline;
|
|
1711
1726
|
}
|
|
1712
1727
|
|
|
1713
|
-
#getParentTreeElement(element: HTMLLIElement): {treeElement: TreeElement, expanded: boolean}|null {
|
|
1728
|
+
#getParentTreeElement(element: HTMLLIElement|TreeElementWrapper): {treeElement: TreeElement, expanded: boolean}|null {
|
|
1714
1729
|
const subtreeRoot = element.parentElement;
|
|
1715
1730
|
if (!(subtreeRoot instanceof HTMLUListElement)) {
|
|
1716
1731
|
return null;
|
|
@@ -1765,15 +1780,25 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1765
1780
|
}
|
|
1766
1781
|
const nextElement = nextSibling ? TreeViewTreeElement.get(nextSibling) : null;
|
|
1767
1782
|
const index = nextElement ? parent.treeElement.indexOfChild(nextElement) : parent.treeElement.children().length;
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1783
|
+
let treeElement;
|
|
1784
|
+
if (node instanceof HTMLLIElement) {
|
|
1785
|
+
treeElement = new TreeViewTreeElement(this.#treeOutline, node);
|
|
1786
|
+
const expandable = Boolean(node.querySelector('ul[role="group"]'));
|
|
1787
|
+
treeElement.setExpandable(expandable);
|
|
1788
|
+
} else {
|
|
1789
|
+
treeElement = node.treeElement;
|
|
1774
1790
|
}
|
|
1775
|
-
if (
|
|
1776
|
-
|
|
1791
|
+
if (treeElement) {
|
|
1792
|
+
if (treeElement.parent) {
|
|
1793
|
+
removeNode(treeElement);
|
|
1794
|
+
}
|
|
1795
|
+
parent.treeElement.insertChild(treeElement, index);
|
|
1796
|
+
if (hasBooleanAttribute(node, 'selected')) {
|
|
1797
|
+
treeElement.revealAndSelect(true);
|
|
1798
|
+
}
|
|
1799
|
+
if (parent.expanded) {
|
|
1800
|
+
parent.treeElement.expand();
|
|
1801
|
+
}
|
|
1777
1802
|
}
|
|
1778
1803
|
}
|
|
1779
1804
|
for (const element of getStyleElements(nodes)) {
|
|
@@ -1783,7 +1808,11 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1783
1808
|
|
|
1784
1809
|
protected override removeNodes(nodes: NodeList): void {
|
|
1785
1810
|
for (const node of getTreeNodes(nodes)) {
|
|
1786
|
-
|
|
1811
|
+
if (node instanceof HTMLLIElement) {
|
|
1812
|
+
TreeViewTreeElement.get(node)?.remove();
|
|
1813
|
+
} else if (node.treeElement) {
|
|
1814
|
+
removeNode(node.treeElement);
|
|
1815
|
+
}
|
|
1787
1816
|
}
|
|
1788
1817
|
}
|
|
1789
1818
|
|
|
@@ -1803,16 +1832,29 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1803
1832
|
return hasBooleanAttribute(this, 'navigation-variant');
|
|
1804
1833
|
}
|
|
1805
1834
|
|
|
1835
|
+
set dense(dense: boolean) {
|
|
1836
|
+
this.toggleAttribute('dense', dense);
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
get dense(): boolean {
|
|
1840
|
+
return hasBooleanAttribute(this, 'dense');
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1806
1843
|
attributeChangedCallback(name: string, oldValue: string|null, newValue: string|null): void {
|
|
1807
1844
|
if (oldValue === newValue) {
|
|
1808
1845
|
return;
|
|
1809
1846
|
}
|
|
1847
|
+
const booleanValueIsTrue = newValue !== null && newValue !== 'false';
|
|
1810
1848
|
switch (name) {
|
|
1811
1849
|
case 'navigation-variant':
|
|
1812
|
-
this.#treeOutline.setVariant(
|
|
1850
|
+
this.#treeOutline.setVariant(booleanValueIsTrue ? TreeVariant.NAVIGATION_TREE : TreeVariant.OTHER);
|
|
1813
1851
|
break;
|
|
1814
1852
|
case 'hide-overflow':
|
|
1815
|
-
this.#treeOutline.setHideOverflow(
|
|
1853
|
+
this.#treeOutline.setHideOverflow(booleanValueIsTrue);
|
|
1854
|
+
break;
|
|
1855
|
+
case 'dense':
|
|
1856
|
+
this.#treeOutline.setDense(booleanValueIsTrue);
|
|
1857
|
+
break;
|
|
1816
1858
|
}
|
|
1817
1859
|
}
|
|
1818
1860
|
}
|
|
@@ -1831,11 +1873,29 @@ export namespace TreeViewElement {
|
|
|
1831
1873
|
}
|
|
1832
1874
|
}
|
|
1833
1875
|
|
|
1876
|
+
export class TreeElementWrapper extends HTMLElement {
|
|
1877
|
+
#treeElement?: TreeElement;
|
|
1878
|
+
set treeElement(treeElement: TreeElement) {
|
|
1879
|
+
if (this.#treeElement?.parent) {
|
|
1880
|
+
const parent = this.#treeElement.parent;
|
|
1881
|
+
const index = parent.indexOfChild(this.#treeElement);
|
|
1882
|
+
parent.removeChildAtIndex(index);
|
|
1883
|
+
parent.insertChild(treeElement, index);
|
|
1884
|
+
}
|
|
1885
|
+
this.#treeElement = treeElement;
|
|
1886
|
+
}
|
|
1887
|
+
get treeElement(): TreeElement|undefined {
|
|
1888
|
+
return this.#treeElement;
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1834
1892
|
customElements.define('devtools-tree', TreeViewElement);
|
|
1893
|
+
customElements.define('devtools-tree-wrapper', TreeElementWrapper);
|
|
1835
1894
|
|
|
1836
1895
|
declare global {
|
|
1837
1896
|
interface HTMLElementTagNameMap {
|
|
1838
1897
|
'devtools-tree': TreeViewElement;
|
|
1898
|
+
'devtools-tree-wrapper': TreeElementWrapper;
|
|
1839
1899
|
}
|
|
1840
1900
|
}
|
|
1841
1901
|
|
|
@@ -1762,8 +1762,10 @@ export class DataGridNode<T> {
|
|
|
1762
1762
|
|
|
1763
1763
|
protected createElement(): HTMLElement {
|
|
1764
1764
|
this.elementInternal = document.createElement('tr');
|
|
1765
|
-
this.elementInternal.setAttribute(
|
|
1766
|
-
|
|
1765
|
+
this.elementInternal.setAttribute('jslog', `${VisualLogging.tableRow().track({
|
|
1766
|
+
resize: true,
|
|
1767
|
+
keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Enter|Space'
|
|
1768
|
+
})}`);
|
|
1767
1769
|
this.elementInternal.classList.add('data-grid-data-grid-node');
|
|
1768
1770
|
if (this.dataGrid) {
|
|
1769
1771
|
this.dataGrid.elementToDataGridNode.set(this.elementInternal, this);
|