chrome-devtools-frontend 1.0.930993 → 1.0.932348
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/config/gni/devtools_grd_files.gni +6 -2
- package/front_end/core/common/ParsedURL.ts +12 -10
- package/front_end/core/host/InspectorFrontendHostAPI.ts +8 -6
- package/front_end/core/i18n/locales/en-US.json +345 -12
- package/front_end/core/i18n/locales/en-XL.json +345 -12
- package/front_end/core/platform/DevToolsPath.ts +34 -0
- package/front_end/core/platform/platform.ts +2 -0
- package/front_end/core/protocol_client/NodeURL.ts +2 -1
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +4 -2
- package/front_end/core/sdk/ChildTargetManager.ts +2 -0
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +4 -2
- package/front_end/core/sdk/DebuggerModel.ts +4 -3
- package/front_end/core/sdk/NetworkRequest.ts +3 -2
- package/front_end/core/sdk/Resource.ts +6 -5
- package/front_end/core/sdk/Script.ts +4 -2
- package/front_end/core/sdk/Target.ts +4 -0
- package/front_end/core/sdk/TracingModel.ts +8 -17
- package/front_end/entrypoint_template.html +1 -1
- package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +1 -1
- package/front_end/models/bindings/BreakpointManager.ts +6 -3
- package/front_end/models/bindings/ResourceMapping.ts +2 -1
- package/front_end/models/bindings/StylesSourceMapping.ts +2 -1
- package/front_end/models/emulation/DeviceModeModel.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystem.ts +9 -7
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +8 -7
- package/front_end/models/persistence/PersistenceActions.ts +1 -1
- package/front_end/models/persistence/PlatformFileSystem.ts +4 -3
- package/front_end/models/text_utils/ContentProvider.ts +2 -1
- package/front_end/models/text_utils/StaticContentProvider.ts +4 -2
- package/front_end/models/workspace/UISourceCode.ts +3 -2
- package/front_end/panels/animation/AnimationGroupPreviewUI.ts +25 -25
- package/front_end/panels/animation/AnimationModel.ts +157 -156
- package/front_end/panels/animation/AnimationScreenshotPopover.ts +26 -26
- package/front_end/panels/animation/AnimationTimeline.ts +274 -260
- package/front_end/panels/animation/AnimationUI.ts +155 -145
- package/front_end/panels/application/BackForwardCacheStrings.ts +621 -0
- package/front_end/panels/application/BackForwardCacheView.ts +24 -8
- package/front_end/panels/application/ReportingApiReportsView.ts +3 -2
- package/front_end/panels/application/ReportingApiView.ts +1 -2
- package/front_end/panels/application/backForwardCacheView.css +10 -0
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +48 -40
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +37 -37
- package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +23 -19
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +56 -56
- package/front_end/panels/changes/ChangesView.ts +42 -225
- package/front_end/panels/changes/changes-legacy.ts +0 -2
- package/front_end/panels/changes/changes.ts +0 -6
- package/front_end/panels/changes/changesView.css +2 -69
- package/front_end/panels/changes/module.json +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +80 -75
- package/front_end/panels/console/ConsoleView.ts +1 -9
- package/front_end/panels/console/consolePinPane.css +4 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +2 -1
- package/front_end/panels/security/mainView.css +2 -1
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +2 -1
- package/front_end/panels/sources/NavigatorView.ts +5 -2
- package/front_end/panels/sources/SourcesPanel.ts +28 -1
- package/front_end/panels/sources/sources-meta.ts +1 -4
- package/front_end/third_party/codemirror.next/bundle.ts +6 -4
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +30 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +4 -3
- package/front_end/ui/components/buttons/Button.ts +22 -6
- package/front_end/ui/components/buttons/button.css +50 -4
- package/front_end/ui/components/diff_view/DiffView.ts +288 -0
- package/front_end/ui/components/diff_view/diffView.css +73 -0
- package/front_end/ui/components/diff_view/diff_view.ts +5 -0
- package/front_end/ui/components/docs/button/basic.html +28 -0
- package/front_end/ui/components/docs/button/basic.ts +43 -2
- package/front_end/ui/components/report_view/report.css +1 -0
- package/front_end/ui/components/text_editor/config.ts +34 -1
- package/front_end/ui/legacy/ForwardedInputEventHandler.ts +5 -3
- package/front_end/ui/legacy/components/color_picker/spectrum.css +2 -4
- package/front_end/ui/legacy/themeColors.css +4 -0
- package/package.json +1 -1
- package/scripts/build/generate_css_js_files.js +1 -0
- package/scripts/migration/class-fields/migrate.js +1 -3
- package/front_end/panels/changes/ChangesHighlighter.ts +0 -179
- package/front_end/panels/changes/ChangesTextEditor.ts +0 -96
|
@@ -10,6 +10,9 @@ import * as ReportView from '../../ui/components/report_view/report_view.js';
|
|
|
10
10
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
11
11
|
import * as Protocol from '../../generated/protocol.js';
|
|
12
12
|
|
|
13
|
+
import {NotRestoredReasonDescription} from './BackForwardCacheStrings.js';
|
|
14
|
+
import backForwardCacheViewStyles from './backForwardCacheView.css.js';
|
|
15
|
+
|
|
13
16
|
const UIStrings = {
|
|
14
17
|
/**
|
|
15
18
|
* @description Title text in Back-forward Cache view of the Application panel
|
|
@@ -79,6 +82,11 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
79
82
|
this.update();
|
|
80
83
|
}
|
|
81
84
|
|
|
85
|
+
wasShown(): void {
|
|
86
|
+
super.wasShown();
|
|
87
|
+
this.registerCSSFiles([backForwardCacheViewStyles]);
|
|
88
|
+
}
|
|
89
|
+
|
|
82
90
|
private onBackForwardCacheUpdate(): void {
|
|
83
91
|
this.update();
|
|
84
92
|
}
|
|
@@ -159,18 +167,26 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
159
167
|
// clang-format on
|
|
160
168
|
}
|
|
161
169
|
|
|
162
|
-
private renderExplanations(
|
|
170
|
+
private renderExplanations(category: string, explanations: Protocol.Page.BackForwardCacheNotRestoredExplanation[]):
|
|
163
171
|
LitHtml.TemplateResult {
|
|
164
172
|
return LitHtml.html`
|
|
165
173
|
${
|
|
166
|
-
explanations.length > 0 ?
|
|
167
|
-
|
|
168
|
-
<${ReportView.ReportView.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
ReportView.ReportView.ReportValue.litTagName}>
|
|
174
|
+
explanations.length > 0 ? LitHtml.html`
|
|
175
|
+
<${ReportView.ReportView.ReportKey.litTagName}>${category}</${ReportView.ReportView.ReportKey.litTagName}>
|
|
176
|
+
<${ReportView.ReportView.ReportValue.litTagName}>
|
|
177
|
+
<ul class='not-restored-reason-list'>${explanations.map(explanation => this.renderReason(explanation))}</ul>
|
|
178
|
+
</${ReportView.ReportView.ReportValue.litTagName}>
|
|
172
179
|
` :
|
|
173
|
-
|
|
180
|
+
LitHtml.nothing}
|
|
181
|
+
`;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
private renderReason(explanation: Protocol.Page.BackForwardCacheNotRestoredExplanation): LitHtml.TemplateResult {
|
|
185
|
+
return LitHtml.html`
|
|
186
|
+
<li>${explanation.reason} : ${
|
|
187
|
+
(explanation.reason in NotRestoredReasonDescription) ?
|
|
188
|
+
LitHtml.html`${NotRestoredReasonDescription[explanation.reason].name()}` :
|
|
189
|
+
LitHtml.nothing} </li>
|
|
174
190
|
`;
|
|
175
191
|
}
|
|
176
192
|
}
|
|
@@ -30,10 +30,10 @@ export class ReportingApiReportsView extends UI.SplitWidget.SplitWidget {
|
|
|
30
30
|
super(/* isVertical: */ false, /* secondIsSidebar: */ true);
|
|
31
31
|
const topPanel = new UI.Widget.VBox();
|
|
32
32
|
const bottomPanel = new UI.Widget.VBox();
|
|
33
|
-
|
|
33
|
+
topPanel.setMinimumSize(0, 80);
|
|
34
34
|
this.setMainWidget(topPanel);
|
|
35
|
+
bottomPanel.setMinimumSize(0, 40);
|
|
35
36
|
this.setSidebarWidget(bottomPanel);
|
|
36
|
-
this.installResizer(resizer);
|
|
37
37
|
|
|
38
38
|
topPanel.contentElement.appendChild(this.reportsGrid);
|
|
39
39
|
this.reportsGrid.addEventListener('cellfocused', this.onFocus.bind(this));
|
|
@@ -73,6 +73,7 @@ export class ReportingApiReportsView extends UI.SplitWidget.SplitWidget {
|
|
|
73
73
|
const report = cell && this.reports.find(report => report.id === cell.value);
|
|
74
74
|
if (report) {
|
|
75
75
|
const jsonView = await SourceFrame.JSONView.JSONView.createView(JSON.stringify(report.body));
|
|
76
|
+
jsonView?.setMinimumSize(0, 40);
|
|
76
77
|
if (jsonView) {
|
|
77
78
|
this.setSidebarWidget(jsonView);
|
|
78
79
|
}
|
|
@@ -15,12 +15,11 @@ export class ReportingApiView extends UI.SplitWidget.SplitWidget {
|
|
|
15
15
|
const networkManager = mainTarget && mainTarget.model(SDK.NetworkManager.NetworkManager);
|
|
16
16
|
if (networkManager) {
|
|
17
17
|
const reportingApiReportsView = new ReportingApiReportsView(networkManager);
|
|
18
|
-
const resizer = reportingApiReportsView.element.createChild('div');
|
|
19
18
|
const reportingApiEndpointsView = new UI.Widget.VBox();
|
|
19
|
+
reportingApiEndpointsView.setMinimumSize(0, 40);
|
|
20
20
|
reportingApiEndpointsView.contentElement.appendChild(new ApplicationComponents.EndpointsGrid.EndpointsGrid());
|
|
21
21
|
this.setMainWidget(reportingApiReportsView);
|
|
22
22
|
this.setSidebarWidget(reportingApiEndpointsView);
|
|
23
|
-
this.installResizer(resizer);
|
|
24
23
|
networkManager.enableReportingApi();
|
|
25
24
|
}
|
|
26
25
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2021 The Chromium Authors. All rights reserved.
|
|
3
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
.not-restored-reason-list {
|
|
7
|
+
margin: 0;
|
|
8
|
+
list-style-type: none;
|
|
9
|
+
padding-inline-start: 0;
|
|
10
|
+
}
|
|
@@ -20,37 +20,37 @@ const str_ = i18n.i18n.registerUIStrings('panels/browser_debugger/CategorizedBre
|
|
|
20
20
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
21
21
|
|
|
22
22
|
export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
readonly #categoriesTreeOutline: UI.TreeOutline.TreeOutlineInShadow;
|
|
24
|
+
readonly #viewId: string;
|
|
25
|
+
readonly #detailsPausedReason: Protocol.Debugger.PausedEventReason;
|
|
26
|
+
readonly #categories: Map<string, Item>;
|
|
27
|
+
readonly #breakpoints: Map<SDK.DOMDebuggerModel.CategorizedBreakpoint, Item>;
|
|
28
|
+
#highlightedElement?: HTMLLIElement;
|
|
29
29
|
constructor(
|
|
30
30
|
categories: string[], breakpoints: SDK.DOMDebuggerModel.CategorizedBreakpoint[], viewId: string,
|
|
31
31
|
detailsPausedReason: Protocol.Debugger.PausedEventReason) {
|
|
32
32
|
super(true);
|
|
33
|
-
this
|
|
33
|
+
this.#categoriesTreeOutline = new UI.TreeOutline.TreeOutlineInShadow();
|
|
34
34
|
|
|
35
|
-
this
|
|
36
|
-
this.contentElement.appendChild(this
|
|
37
|
-
this
|
|
38
|
-
this
|
|
35
|
+
this.#categoriesTreeOutline.setShowSelectionOnKeyboardFocus(/* show */ true);
|
|
36
|
+
this.contentElement.appendChild(this.#categoriesTreeOutline.element);
|
|
37
|
+
this.#viewId = viewId;
|
|
38
|
+
this.#detailsPausedReason = detailsPausedReason;
|
|
39
39
|
|
|
40
|
-
this
|
|
40
|
+
this.#categories = new Map();
|
|
41
41
|
for (const category of categories) {
|
|
42
|
-
if (!this
|
|
42
|
+
if (!this.#categories.has(category)) {
|
|
43
43
|
this.createCategory(category);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
if (categories.length > 0) {
|
|
47
|
-
const firstCategory = this
|
|
47
|
+
const firstCategory = this.#categories.get(categories[0]);
|
|
48
48
|
if (firstCategory) {
|
|
49
49
|
firstCategory.element.select();
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
this
|
|
53
|
+
this.#breakpoints = new Map();
|
|
54
54
|
for (const breakpoint of breakpoints) {
|
|
55
55
|
this.createBreakpoint(breakpoint);
|
|
56
56
|
}
|
|
@@ -62,8 +62,16 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
62
62
|
UI.Context.Context.instance().addFlavorChangeListener(SDK.Target.Target, this.update, this);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
get categories(): Map<string, Item> {
|
|
66
|
+
return this.#categories;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
get breakpoints(): Map<SDK.DOMDebuggerModel.CategorizedBreakpoint, Item> {
|
|
70
|
+
return this.#breakpoints;
|
|
71
|
+
}
|
|
72
|
+
|
|
65
73
|
focus(): void {
|
|
66
|
-
this
|
|
74
|
+
this.#categoriesTreeOutline.forceSelect();
|
|
67
75
|
}
|
|
68
76
|
|
|
69
77
|
private createCategory(name: string): void {
|
|
@@ -74,7 +82,7 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
74
82
|
const treeElement = new UI.TreeOutline.TreeElement(labelNode);
|
|
75
83
|
treeElement.listItemElement.addEventListener('keydown', event => {
|
|
76
84
|
if (event.key === ' ') {
|
|
77
|
-
const category = this
|
|
85
|
+
const category = this.#categories.get(name);
|
|
78
86
|
if (category) {
|
|
79
87
|
category.checkbox.click();
|
|
80
88
|
}
|
|
@@ -83,9 +91,9 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
83
91
|
});
|
|
84
92
|
labelNode.checkboxElement.addEventListener('focus', () => treeElement.listItemElement.focus());
|
|
85
93
|
UI.ARIAUtils.setChecked(treeElement.listItemElement, false);
|
|
86
|
-
this
|
|
94
|
+
this.#categoriesTreeOutline.appendChild(treeElement);
|
|
87
95
|
|
|
88
|
-
this
|
|
96
|
+
this.#categories.set(name, {element: treeElement, checkbox: labelNode.checkboxElement});
|
|
89
97
|
}
|
|
90
98
|
|
|
91
99
|
protected createBreakpoint(breakpoint: SDK.DOMDebuggerModel.CategorizedBreakpoint): void {
|
|
@@ -97,7 +105,7 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
97
105
|
const treeElement = new UI.TreeOutline.TreeElement(labelNode);
|
|
98
106
|
treeElement.listItemElement.addEventListener('keydown', event => {
|
|
99
107
|
if (event.key === ' ') {
|
|
100
|
-
const breakpointToClick = this
|
|
108
|
+
const breakpointToClick = this.#breakpoints.get(breakpoint);
|
|
101
109
|
if (breakpointToClick) {
|
|
102
110
|
breakpointToClick.checkbox.click();
|
|
103
111
|
}
|
|
@@ -107,12 +115,12 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
107
115
|
labelNode.checkboxElement.addEventListener('focus', () => treeElement.listItemElement.focus());
|
|
108
116
|
UI.ARIAUtils.setChecked(treeElement.listItemElement, false);
|
|
109
117
|
treeElement.listItemElement.createChild('div', 'breakpoint-hit-marker');
|
|
110
|
-
const category = this
|
|
118
|
+
const category = this.#categories.get(breakpoint.category());
|
|
111
119
|
if (category) {
|
|
112
120
|
category.element.appendChild(treeElement);
|
|
113
121
|
}
|
|
114
122
|
// Better to return that to produce a side-effect
|
|
115
|
-
this
|
|
123
|
+
this.#breakpoints.set(breakpoint, {element: treeElement, checkbox: labelNode.checkboxElement});
|
|
116
124
|
}
|
|
117
125
|
|
|
118
126
|
protected getBreakpointFromPausedDetails(_details: SDK.DebuggerModel.DebuggerPausedDetails):
|
|
@@ -125,11 +133,11 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
125
133
|
const debuggerModel = target ? target.model(SDK.DebuggerModel.DebuggerModel) : null;
|
|
126
134
|
const details = debuggerModel ? debuggerModel.debuggerPausedDetails() : null;
|
|
127
135
|
|
|
128
|
-
if (!details || details.reason !== this
|
|
129
|
-
if (this
|
|
130
|
-
UI.ARIAUtils.setDescription(this
|
|
131
|
-
this
|
|
132
|
-
|
|
136
|
+
if (!details || details.reason !== this.#detailsPausedReason || !details.auxData) {
|
|
137
|
+
if (this.#highlightedElement) {
|
|
138
|
+
UI.ARIAUtils.setDescription(this.#highlightedElement, '');
|
|
139
|
+
this.#highlightedElement.classList.remove('breakpoint-hit');
|
|
140
|
+
this.#highlightedElement = undefined;
|
|
133
141
|
}
|
|
134
142
|
return;
|
|
135
143
|
}
|
|
@@ -138,22 +146,22 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
138
146
|
return;
|
|
139
147
|
}
|
|
140
148
|
|
|
141
|
-
UI.ViewManager.ViewManager.instance().showView(this
|
|
142
|
-
const category = this
|
|
149
|
+
UI.ViewManager.ViewManager.instance().showView(this.#viewId);
|
|
150
|
+
const category = this.#categories.get(breakpoint.category());
|
|
143
151
|
if (category) {
|
|
144
152
|
category.element.expand();
|
|
145
153
|
}
|
|
146
|
-
const matchingBreakpoint = this
|
|
154
|
+
const matchingBreakpoint = this.#breakpoints.get(breakpoint);
|
|
147
155
|
if (matchingBreakpoint) {
|
|
148
|
-
this
|
|
149
|
-
UI.ARIAUtils.setDescription(this
|
|
150
|
-
this
|
|
156
|
+
this.#highlightedElement = matchingBreakpoint.element.listItemElement;
|
|
157
|
+
UI.ARIAUtils.setDescription(this.#highlightedElement, i18nString(UIStrings.breakpointHit));
|
|
158
|
+
this.#highlightedElement.classList.add('breakpoint-hit');
|
|
151
159
|
}
|
|
152
160
|
}
|
|
153
161
|
|
|
154
162
|
// Probably can be kept although eventListener does not call this._breakpointCheckboxClicke
|
|
155
163
|
private categoryCheckboxClicked(category: string): void {
|
|
156
|
-
const item = this
|
|
164
|
+
const item = this.#categories.get(category);
|
|
157
165
|
if (!item) {
|
|
158
166
|
return;
|
|
159
167
|
}
|
|
@@ -161,9 +169,9 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
161
169
|
const enabled = item.checkbox.checked;
|
|
162
170
|
UI.ARIAUtils.setChecked(item.element.listItemElement, enabled);
|
|
163
171
|
|
|
164
|
-
for (const breakpoint of this
|
|
172
|
+
for (const breakpoint of this.#breakpoints.keys()) {
|
|
165
173
|
if (breakpoint.category() === category) {
|
|
166
|
-
const matchingBreakpoint = this
|
|
174
|
+
const matchingBreakpoint = this.#breakpoints.get(breakpoint);
|
|
167
175
|
if (matchingBreakpoint) {
|
|
168
176
|
matchingBreakpoint.checkbox.checked = enabled;
|
|
169
177
|
this.toggleBreakpoint(breakpoint, enabled);
|
|
@@ -177,7 +185,7 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
177
185
|
}
|
|
178
186
|
|
|
179
187
|
private breakpointCheckboxClicked(breakpoint: SDK.DOMDebuggerModel.CategorizedBreakpoint): void {
|
|
180
|
-
const item = this
|
|
188
|
+
const item = this.#breakpoints.get(breakpoint);
|
|
181
189
|
if (!item) {
|
|
182
190
|
return;
|
|
183
191
|
}
|
|
@@ -188,7 +196,7 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
188
196
|
// Put the rest in a separate function
|
|
189
197
|
let hasEnabled = false;
|
|
190
198
|
let hasDisabled = false;
|
|
191
|
-
for (const other of this
|
|
199
|
+
for (const other of this.#breakpoints.keys()) {
|
|
192
200
|
if (other.category() === breakpoint.category()) {
|
|
193
201
|
if (other.enabled()) {
|
|
194
202
|
hasEnabled = true;
|
|
@@ -198,7 +206,7 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
198
206
|
}
|
|
199
207
|
}
|
|
200
208
|
|
|
201
|
-
const category = this
|
|
209
|
+
const category = this.#categories.get(breakpoint.category());
|
|
202
210
|
if (!category) {
|
|
203
211
|
return;
|
|
204
212
|
}
|
|
@@ -212,7 +220,7 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
212
220
|
}
|
|
213
221
|
wasShown(): void {
|
|
214
222
|
super.wasShown();
|
|
215
|
-
this
|
|
223
|
+
this.#categoriesTreeOutline.registerCSSFiles([categorizedBreakpointsSidebarPaneStyles]);
|
|
216
224
|
}
|
|
217
225
|
}
|
|
218
226
|
export interface Item {
|
|
@@ -119,25 +119,25 @@ let domBreakpointsSidebarPaneInstance: DOMBreakpointsSidebarPane;
|
|
|
119
119
|
export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
120
120
|
UI.ContextFlavorListener.ContextFlavorListener, UI.ListControl.ListDelegate<SDK.DOMDebuggerModel.DOMBreakpoint> {
|
|
121
121
|
elementToCheckboxes: WeakMap<Element, HTMLInputElement>;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
readonly #emptyElement: HTMLElement;
|
|
123
|
+
readonly #breakpoints: UI.ListModel.ListModel<SDK.DOMDebuggerModel.DOMBreakpoint>;
|
|
124
|
+
#list: UI.ListControl.ListControl<SDK.DOMDebuggerModel.DOMBreakpoint>;
|
|
125
|
+
#highlightedBreakpoint: SDK.DOMDebuggerModel.DOMBreakpoint|null;
|
|
126
126
|
|
|
127
127
|
private constructor() {
|
|
128
128
|
super(true);
|
|
129
129
|
|
|
130
130
|
this.elementToCheckboxes = new WeakMap();
|
|
131
131
|
|
|
132
|
-
this
|
|
133
|
-
this
|
|
134
|
-
this
|
|
135
|
-
this
|
|
136
|
-
this.contentElement.appendChild(this
|
|
137
|
-
this
|
|
138
|
-
UI.ARIAUtils.markAsList(this
|
|
139
|
-
UI.ARIAUtils.setAccessibleName(this
|
|
140
|
-
this
|
|
132
|
+
this.#emptyElement = this.contentElement.createChild('div', 'gray-info-message');
|
|
133
|
+
this.#emptyElement.textContent = i18nString(UIStrings.noBreakpoints);
|
|
134
|
+
this.#breakpoints = new UI.ListModel.ListModel();
|
|
135
|
+
this.#list = new UI.ListControl.ListControl(this.#breakpoints, this, UI.ListControl.ListMode.NonViewport);
|
|
136
|
+
this.contentElement.appendChild(this.#list.element);
|
|
137
|
+
this.#list.element.classList.add('breakpoint-list', 'hidden');
|
|
138
|
+
UI.ARIAUtils.markAsList(this.#list.element);
|
|
139
|
+
UI.ARIAUtils.setAccessibleName(this.#list.element, i18nString(UIStrings.domBreakpointsList));
|
|
140
|
+
this.#emptyElement.tabIndex = -1;
|
|
141
141
|
|
|
142
142
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
143
143
|
SDK.DOMDebuggerModel.DOMDebuggerModel, SDK.DOMDebuggerModel.Events.DOMBreakpointAdded, this.breakpointAdded,
|
|
@@ -157,7 +157,7 @@ export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
this
|
|
160
|
+
this.#highlightedBreakpoint = null;
|
|
161
161
|
this.update();
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -208,7 +208,7 @@ export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
|
208
208
|
labelElement.appendChild(description);
|
|
209
209
|
|
|
210
210
|
const checkedStateText = item.enabled ? i18nString(UIStrings.checked) : i18nString(UIStrings.unchecked);
|
|
211
|
-
if (item === this
|
|
211
|
+
if (item === this.#highlightedBreakpoint) {
|
|
212
212
|
element.classList.add('breakpoint-hit');
|
|
213
213
|
UI.ARIAUtils.setDescription(element, i18nString(UIStrings.sBreakpointHit, {PH1: checkedStateText}));
|
|
214
214
|
UI.ARIAUtils.setDescription(checkboxElement, i18nString(UIStrings.breakpointHit));
|
|
@@ -216,8 +216,8 @@ export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
|
216
216
|
UI.ARIAUtils.setDescription(element, checkedStateText);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
this
|
|
220
|
-
this
|
|
219
|
+
this.#emptyElement.classList.add('hidden');
|
|
220
|
+
this.#list.element.classList.remove('hidden');
|
|
221
221
|
|
|
222
222
|
return element;
|
|
223
223
|
}
|
|
@@ -257,7 +257,7 @@ export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
|
257
257
|
private breakpointToggled(event: Common.EventTarget.EventTargetEvent<SDK.DOMDebuggerModel.DOMBreakpoint>): void {
|
|
258
258
|
const hadFocus = this.hasFocus();
|
|
259
259
|
const breakpoint = event.data;
|
|
260
|
-
this
|
|
260
|
+
this.#list.refreshItem(breakpoint);
|
|
261
261
|
if (hadFocus) {
|
|
262
262
|
this.focus();
|
|
263
263
|
}
|
|
@@ -268,20 +268,20 @@ export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
|
268
268
|
const breakpoints = event.data;
|
|
269
269
|
let lastIndex = -1;
|
|
270
270
|
for (const breakpoint of breakpoints) {
|
|
271
|
-
const index = this
|
|
271
|
+
const index = this.#breakpoints.indexOf(breakpoint);
|
|
272
272
|
if (index >= 0) {
|
|
273
|
-
this
|
|
273
|
+
this.#breakpoints.remove(index);
|
|
274
274
|
lastIndex = index;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
if (this
|
|
278
|
-
this
|
|
279
|
-
this.setDefaultFocusedElement(this
|
|
280
|
-
this
|
|
277
|
+
if (this.#breakpoints.length === 0) {
|
|
278
|
+
this.#emptyElement.classList.remove('hidden');
|
|
279
|
+
this.setDefaultFocusedElement(this.#emptyElement);
|
|
280
|
+
this.#list.element.classList.add('hidden');
|
|
281
281
|
} else if (lastIndex >= 0) {
|
|
282
|
-
const breakpointToSelect = this
|
|
282
|
+
const breakpointToSelect = this.#breakpoints.at(lastIndex);
|
|
283
283
|
if (breakpointToSelect) {
|
|
284
|
-
this
|
|
284
|
+
this.#list.selectItem(breakpointToSelect);
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
if (hadFocus) {
|
|
@@ -290,7 +290,7 @@ export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
private addBreakpoint(breakpoint: SDK.DOMDebuggerModel.DOMBreakpoint): void {
|
|
293
|
-
this
|
|
293
|
+
this.#breakpoints.insertWithComparator(breakpoint, (breakpointA, breakpointB) => {
|
|
294
294
|
if (breakpointA.type > breakpointB.type) {
|
|
295
295
|
return -1;
|
|
296
296
|
}
|
|
@@ -299,8 +299,8 @@ export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
|
299
299
|
}
|
|
300
300
|
return 0;
|
|
301
301
|
});
|
|
302
|
-
if (!this
|
|
303
|
-
this
|
|
302
|
+
if (!this.#list.selectedItem() || !this.hasFocus()) {
|
|
303
|
+
this.#list.selectItem(this.#breakpoints.at(0));
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
|
|
@@ -328,10 +328,10 @@ export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
|
328
328
|
|
|
329
329
|
private update(): void {
|
|
330
330
|
const details = UI.Context.Context.instance().flavor(SDK.DebuggerModel.DebuggerPausedDetails);
|
|
331
|
-
if (this
|
|
332
|
-
const oldHighlightedBreakpoint = this
|
|
333
|
-
this
|
|
334
|
-
this
|
|
331
|
+
if (this.#highlightedBreakpoint) {
|
|
332
|
+
const oldHighlightedBreakpoint = this.#highlightedBreakpoint;
|
|
333
|
+
this.#highlightedBreakpoint = null;
|
|
334
|
+
this.#list.refreshItem(oldHighlightedBreakpoint);
|
|
335
335
|
}
|
|
336
336
|
if (!details || !details.auxData || details.reason !== Protocol.Debugger.PausedEventReason.DOM) {
|
|
337
337
|
return;
|
|
@@ -348,13 +348,13 @@ export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
|
348
348
|
return;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
for (const breakpoint of this
|
|
351
|
+
for (const breakpoint of this.#breakpoints) {
|
|
352
352
|
if (breakpoint.node === data.node && breakpoint.type === data.type) {
|
|
353
|
-
this
|
|
353
|
+
this.#highlightedBreakpoint = breakpoint;
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
|
-
if (this
|
|
357
|
-
this
|
|
356
|
+
if (this.#highlightedBreakpoint) {
|
|
357
|
+
this.#list.refreshItem(this.#highlightedBreakpoint);
|
|
358
358
|
}
|
|
359
359
|
UI.ViewManager.ViewManager.instance().showView('sources.domBreakpoints');
|
|
360
360
|
}
|
|
@@ -19,20 +19,20 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
19
19
|
let objectEventListenersSidebarPaneInstance: ObjectEventListenersSidebarPane;
|
|
20
20
|
|
|
21
21
|
export class ObjectEventListenersSidebarPane extends UI.Widget.VBox implements UI.Toolbar.ItemsProvider {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
readonly #refreshButton: UI.Toolbar.ToolbarButton;
|
|
23
|
+
readonly #eventListenersView: EventListeners.EventListenersView.EventListenersView;
|
|
24
|
+
#lastRequestedContext?: SDK.RuntimeModel.ExecutionContext;
|
|
25
25
|
private constructor() {
|
|
26
26
|
super();
|
|
27
|
-
this
|
|
27
|
+
this.#refreshButton =
|
|
28
28
|
new UI.Toolbar.ToolbarButton(i18nString(UIStrings.refreshGlobalListeners), 'largeicon-refresh');
|
|
29
|
-
this
|
|
30
|
-
this
|
|
29
|
+
this.#refreshButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, this.refreshClick, this);
|
|
30
|
+
this.#refreshButton.setEnabled(false);
|
|
31
31
|
|
|
32
|
-
this
|
|
32
|
+
this.#eventListenersView = new EventListeners.EventListenersView.EventListenersView(
|
|
33
33
|
this.update.bind(this), /* enableDefaultTreeFocus */ true);
|
|
34
|
-
this
|
|
35
|
-
this.setDefaultFocusedChild(this
|
|
34
|
+
this.#eventListenersView.show(this.element);
|
|
35
|
+
this.setDefaultFocusedChild(this.#eventListenersView);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
static instance(): ObjectEventListenersSidebarPane {
|
|
@@ -42,37 +42,41 @@ export class ObjectEventListenersSidebarPane extends UI.Widget.VBox implements U
|
|
|
42
42
|
return objectEventListenersSidebarPaneInstance;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
get eventListenersView(): EventListeners.EventListenersView.EventListenersView {
|
|
46
|
+
return this.#eventListenersView;
|
|
47
|
+
}
|
|
48
|
+
|
|
45
49
|
toolbarItems(): UI.Toolbar.ToolbarItem[] {
|
|
46
|
-
return [this
|
|
50
|
+
return [this.#refreshButton];
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
update(): void {
|
|
50
|
-
if (this
|
|
51
|
-
this
|
|
52
|
-
|
|
54
|
+
if (this.#lastRequestedContext) {
|
|
55
|
+
this.#lastRequestedContext.runtimeModel.releaseObjectGroup(objectGroupName);
|
|
56
|
+
this.#lastRequestedContext = undefined;
|
|
53
57
|
}
|
|
54
58
|
const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
|
55
59
|
if (!executionContext) {
|
|
56
|
-
this
|
|
57
|
-
this
|
|
60
|
+
this.#eventListenersView.reset();
|
|
61
|
+
this.#eventListenersView.addEmptyHolderIfNeeded();
|
|
58
62
|
return;
|
|
59
63
|
}
|
|
60
|
-
this
|
|
64
|
+
this.#lastRequestedContext = executionContext;
|
|
61
65
|
Promise.all([this.windowObjectInContext(executionContext)])
|
|
62
|
-
.then(this
|
|
66
|
+
.then(this.#eventListenersView.addObjects.bind(this.#eventListenersView));
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
wasShown(): void {
|
|
66
70
|
super.wasShown();
|
|
67
71
|
UI.Context.Context.instance().addFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, this.update, this);
|
|
68
|
-
this
|
|
72
|
+
this.#refreshButton.setEnabled(true);
|
|
69
73
|
this.update();
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
willHide(): void {
|
|
73
77
|
super.willHide();
|
|
74
78
|
UI.Context.Context.instance().removeFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, this.update, this);
|
|
75
|
-
this
|
|
79
|
+
this.#refreshButton.setEnabled(false);
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
private windowObjectInContext(executionContext: SDK.RuntimeModel.ExecutionContext):
|