chrome-devtools-frontend 1.0.1020422 → 1.0.1021097
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/triage_guidelines.md +9 -7
- package/front_end/core/i18n/locales/en-US.json +5 -5
- package/front_end/core/i18n/locales/en-XL.json +5 -5
- package/front_end/core/sdk/CSSModel.ts +5 -2
- package/front_end/models/bindings/BreakpointManager.ts +14 -3
- package/front_end/models/bindings/ResourceScriptMapping.ts +76 -53
- package/front_end/panels/application/components/protocolHandlersView.css +4 -0
- package/front_end/panels/elements/ElementsPanel.ts +3 -0
- package/front_end/panels/elements/LayoutSidebarPane.ts +1 -2
- package/front_end/panels/sources/CSSPlugin.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +12 -12
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +13 -10
- package/front_end/ui/legacy/components/object_ui/objectValue.css +4 -0
- package/package.json +1 -1
@@ -50,16 +50,18 @@ Issues in the untriaged queue should receive a meaningful response within a busi
|
|
50
50
|
- Put proper `Platform>DevTools>XXX` component(s) on the issue and do an initial check-in regarding the priority.
|
51
51
|
- Put one of the following labels on it and set the status to `Available`:
|
52
52
|
- `Hotlist-DevTools-ProductReview` if it's controversial or clear that consensus needs to be built first.
|
53
|
-
- `
|
54
|
-
- `
|
55
|
-
- `
|
56
|
-
- `
|
57
|
-
- `
|
53
|
+
- `Team-DevTools-BrowserAutomation` if it's an issue related to ChromeDriver or puppeteer.
|
54
|
+
- `Team-DevTools-RuntimeDebugging` if it's a JavaScript or WebAssembly debugging issue.
|
55
|
+
- `Team-DevTools-WebDebugging` if it's a Web specific debugging issue (i.e. Network or Application panel).
|
56
|
+
- `Team-DevTools-DesignAccessibility` if it's a design or accessibility issue.
|
57
|
+
- `Team-DevTools-Performance` if the issue is related to our performance tooling (i.e. Performance panel, Lighthouse).
|
58
|
+
- `Team-DevTools-RecordReplay` if it's an issue with the recorder or puppeteer.
|
59
|
+
- No specific `Team` or `Hotlist` if it doesn't fit any specific team otherwise. Make sure to have the `Platform>DevTools` component (or a subcomponent) on it though.
|
58
60
|
- Also remember to put the `Needs-UX` label on it, if help from a designer is likely to be required.
|
59
61
|
|
60
62
|
### Setting Assigned or Available
|
61
63
|
|
62
|
-
Set issues to Available if they don’t need immediate action and nobody right now and in the short-term future (an iteration) needs to work on it.
|
64
|
+
Set issues to `Available` if they don’t need immediate action and nobody right now and in the short-term future (an iteration) needs to work on it.
|
63
65
|
|
64
66
|
Issues that are handled by Microsoft have the label “Hotlist-DevTools-MS-Backlog” and “Hotlist-DevTools-MS-CurrentSprint” respectively and can be considered triaged.
|
65
67
|
|
@@ -107,7 +109,7 @@ The combination of the label “M-<milestone>” and “Release-Block-<channel>
|
|
107
109
|
|
108
110
|
### Managing the backlog
|
109
111
|
|
110
|
-
[[Query]](https://bugs.chromium.org/p/chromium/issues/list?q=
|
112
|
+
[[Query]](https://bugs.chromium.org/p/chromium/issues/list?q=component%3APlatform%3EDevTools%20status%3AAvailable)
|
111
113
|
|
112
114
|
Managing the backlog is out of scope for the triage rotation. The backlog will be groomed continuously by hablich@ for now. The SLA is that there should be a maximum of 50 issues in there.
|
113
115
|
|
@@ -12278,9 +12278,6 @@
|
|
12278
12278
|
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | noProperties": {
|
12279
12279
|
"message": "No properties"
|
12280
12280
|
},
|
12281
|
-
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | noPropertyGetter": {
|
12282
|
-
"message": "No property getter"
|
12283
|
-
},
|
12284
12281
|
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | showAllD": {
|
12285
12282
|
"message": "Show all {PH1}"
|
12286
12283
|
},
|
@@ -12293,8 +12290,11 @@
|
|
12293
12290
|
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | unknown": {
|
12294
12291
|
"message": "unknown"
|
12295
12292
|
},
|
12296
|
-
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts |
|
12297
|
-
"message": "
|
12293
|
+
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | valueNotAccessibleToTheDebugger": {
|
12294
|
+
"message": "Value is not accessible to the debugger"
|
12295
|
+
},
|
12296
|
+
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | valueUnavailable": {
|
12297
|
+
"message": "<value unavailable>"
|
12298
12298
|
},
|
12299
12299
|
"ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts | empty": {
|
12300
12300
|
"message": "empty"
|
@@ -12278,9 +12278,6 @@
|
|
12278
12278
|
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | noProperties": {
|
12279
12279
|
"message": "N̂ó p̂ŕôṕêŕt̂íêś"
|
12280
12280
|
},
|
12281
|
-
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | noPropertyGetter": {
|
12282
|
-
"message": "N̂ó p̂ŕôṕêŕt̂ý ĝét̂t́êŕ"
|
12283
|
-
},
|
12284
12281
|
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | showAllD": {
|
12285
12282
|
"message": "Ŝh́ôẃ âĺl̂ {PH1}"
|
12286
12283
|
},
|
@@ -12293,8 +12290,11 @@
|
|
12293
12290
|
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | unknown": {
|
12294
12291
|
"message": "ûńk̂ńôẃn̂"
|
12295
12292
|
},
|
12296
|
-
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts |
|
12297
|
-
"message": "
|
12293
|
+
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | valueNotAccessibleToTheDebugger": {
|
12294
|
+
"message": "V̂ál̂úê íŝ ńôt́ âćĉéŝśîb́l̂é t̂ó t̂h́ê d́êb́ûǵĝér̂"
|
12295
|
+
},
|
12296
|
+
"ui/legacy/components/object_ui/ObjectPropertiesSection.ts | valueUnavailable": {
|
12297
|
+
"message": "<v̂ál̂úê ún̂áv̂áîĺâb́l̂é>"
|
12298
12298
|
},
|
12299
12299
|
"ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts | empty": {
|
12300
12300
|
"message": "êḿp̂t́ŷ"
|
@@ -313,7 +313,10 @@ export class CSSModel extends SDKModel<EventTypes> {
|
|
313
313
|
return classNames || [];
|
314
314
|
}
|
315
315
|
|
316
|
-
getComputedStyle(nodeId: Protocol.DOM.NodeId): Promise<Map<string, string>|null> {
|
316
|
+
async getComputedStyle(nodeId: Protocol.DOM.NodeId): Promise<Map<string, string>|null> {
|
317
|
+
if (!this.isEnabled()) {
|
318
|
+
await this.enable();
|
319
|
+
}
|
317
320
|
return this.#styleLoader.computedStylePromise(nodeId);
|
318
321
|
}
|
319
322
|
|
@@ -683,7 +686,7 @@ export class CSSModel extends SDKModel<EventTypes> {
|
|
683
686
|
// is different from the regular navigations. In this case, events about CSS
|
684
687
|
// stylesheet has already been received and they are mixed with the previous page
|
685
688
|
// stylesheets. Therefore, we re-enable the CSS agent to get fresh events.
|
686
|
-
// For the regular
|
689
|
+
// For the regular navigations, we can just clear the local data because events about
|
687
690
|
// stylesheets will arrive later.
|
688
691
|
if (event.data.backForwardCacheDetails.restoredFromCache) {
|
689
692
|
await this.suspendModel();
|
@@ -40,6 +40,7 @@ import {DebuggerWorkspaceBinding} from './DebuggerWorkspaceBinding.js';
|
|
40
40
|
import type {LiveLocation} from './LiveLocation.js';
|
41
41
|
import {LiveLocationPool} from './LiveLocation.js';
|
42
42
|
import {DefaultScriptMapping} from './DefaultScriptMapping.js';
|
43
|
+
import {ResourceScriptMapping} from './ResourceScriptMapping.js';
|
43
44
|
|
44
45
|
let breakpointManagerInstance: BreakpointManager;
|
45
46
|
|
@@ -170,12 +171,22 @@ export class BreakpointManager extends Common.ObjectWrapper.ObjectWrapper<EventT
|
|
170
171
|
const isSnippet = script.sourceURL.startsWith('snippet://');
|
171
172
|
const projectType = isSnippet ? Workspace.Workspace.projectTypes.Network : undefined;
|
172
173
|
|
173
|
-
//
|
174
|
+
// Some temporary workarounds that will probably be replaced by live locations.
|
175
|
+
// 1. Handle inline scripts without sourceURL comment separately:
|
174
176
|
// The UISourceCode of inline scripts without sourceURLs will not be availabe
|
175
177
|
// until a later point. Use the v8 script for setting the breakpoint.
|
178
|
+
// 2. Handle resources that have scripts differently: nowadays they don't use the
|
179
|
+
// sourceURL directly anymore, but are resolved relatively to the parents document's
|
180
|
+
// base URL; so resolve it before awaiting its uiSourceCode.
|
176
181
|
const isInlineScriptWithoutSourceURL = script.isInlineScript() && !script.hasSourceURL;
|
177
|
-
const sourceURL
|
178
|
-
|
182
|
+
const hasResourceScriptMapping = !script.isLiveEdit() && script.sourceURL && script.hasSourceURL;
|
183
|
+
let sourceURL = script.sourceURL;
|
184
|
+
if (isInlineScriptWithoutSourceURL) {
|
185
|
+
sourceURL = DefaultScriptMapping.createV8ScriptURL(script);
|
186
|
+
} else if (hasResourceScriptMapping) {
|
187
|
+
sourceURL = ResourceScriptMapping.resolveRelativeSourceURL(script, script.sourceURL);
|
188
|
+
}
|
189
|
+
|
179
190
|
const uiSourceCode =
|
180
191
|
await Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodeForURLPromise(sourceURL, projectType);
|
181
192
|
|
@@ -30,10 +30,10 @@
|
|
30
30
|
|
31
31
|
import * as Common from '../../core/common/common.js';
|
32
32
|
import * as i18n from '../../core/i18n/i18n.js';
|
33
|
-
import
|
33
|
+
import * as Platform from '../../core/platform/platform.js';
|
34
34
|
import * as SDK from '../../core/sdk/sdk.js';
|
35
|
-
import * as Workspace from '../workspace/workspace.js';
|
36
35
|
import * as Protocol from '../../generated/protocol.js';
|
36
|
+
import * as Workspace from '../workspace/workspace.js';
|
37
37
|
|
38
38
|
import type {Breakpoint} from './BreakpointManager.js';
|
39
39
|
import {BreakpointManager} from './BreakpointManager.js';
|
@@ -65,7 +65,7 @@ export class ResourceScriptMapping implements DebuggerSourceMapping {
|
|
65
65
|
readonly debuggerWorkspaceBinding: DebuggerWorkspaceBinding;
|
66
66
|
readonly #uiSourceCodeToScriptFile: Map<Workspace.UISourceCode.UISourceCode, ResourceScriptFile>;
|
67
67
|
readonly #projects: Map<string, ContentProviderBasedProject>;
|
68
|
-
#
|
68
|
+
readonly #scriptToUISourceCode: Map<SDK.Script.Script, Workspace.UISourceCode.UISourceCode>;
|
69
69
|
readonly #eventListeners: Common.EventTarget.EventDescriptor[];
|
70
70
|
|
71
71
|
constructor(
|
@@ -78,21 +78,30 @@ export class ResourceScriptMapping implements DebuggerSourceMapping {
|
|
78
78
|
|
79
79
|
this.#projects = new Map();
|
80
80
|
|
81
|
-
this.#
|
81
|
+
this.#scriptToUISourceCode = new Map();
|
82
82
|
const runtimeModel = debuggerModel.runtimeModel();
|
83
83
|
this.#eventListeners = [
|
84
84
|
this.debuggerModel.addEventListener(
|
85
|
-
SDK.DebuggerModel.Events.ParsedScriptSource,
|
86
|
-
event => {
|
87
|
-
void this.parsedScriptSource(event);
|
88
|
-
},
|
89
|
-
this),
|
85
|
+
SDK.DebuggerModel.Events.ParsedScriptSource, event => this.addScript(event.data), this),
|
90
86
|
this.debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, this.globalObjectCleared, this),
|
91
87
|
runtimeModel.addEventListener(
|
92
88
|
SDK.RuntimeModel.Events.ExecutionContextDestroyed, this.executionContextDestroyed, this),
|
89
|
+
runtimeModel.target().targetManager().addEventListener(
|
90
|
+
SDK.TargetManager.Events.InspectedURLChanged, this.inspectedURLChanged, this),
|
93
91
|
];
|
94
92
|
}
|
95
93
|
|
94
|
+
static resolveRelativeSourceURL(script: SDK.Script.Script, url: Platform.DevToolsPath.UrlString):
|
95
|
+
Platform.DevToolsPath.UrlString {
|
96
|
+
let target: SDK.Target.Target|null = script.debuggerModel.target();
|
97
|
+
while (target && target.type() !== SDK.Target.Type.Frame) {
|
98
|
+
target = target.parentTarget();
|
99
|
+
}
|
100
|
+
const baseURL = target?.inspectedURL() ?? Platform.DevToolsPath.EmptyUrlString;
|
101
|
+
url = Common.ParsedURL.ParsedURL.completeURL(baseURL, url) ?? url;
|
102
|
+
return url;
|
103
|
+
}
|
104
|
+
|
96
105
|
private project(script: SDK.Script.Script): ContentProviderBasedProject {
|
97
106
|
const prefix = script.isContentScript() ? 'js:extensions:' : 'js::';
|
98
107
|
const projectId = prefix + this.debuggerModel.target().id() + ':' + script.frameId;
|
@@ -113,8 +122,7 @@ export class ResourceScriptMapping implements DebuggerSourceMapping {
|
|
113
122
|
if (!script) {
|
114
123
|
return null;
|
115
124
|
}
|
116
|
-
const
|
117
|
-
const uiSourceCode = project.uiSourceCodeForURL(script.sourceURL);
|
125
|
+
const uiSourceCode = this.#scriptToUISourceCode.get(script);
|
118
126
|
if (!uiSourceCode) {
|
119
127
|
return null;
|
120
128
|
}
|
@@ -147,41 +155,63 @@ export class ResourceScriptMapping implements DebuggerSourceMapping {
|
|
147
155
|
return [this.debuggerModel.createRawLocation(script, lineNumber, columnNumber)];
|
148
156
|
}
|
149
157
|
|
150
|
-
private
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
if (script.isContentScript() && !script.hasSourceURL) {
|
156
|
-
const parsedURL = new Common.ParsedURL.ParsedURL(script.sourceURL);
|
157
|
-
if (!parsedURL.isValid) {
|
158
|
-
return false;
|
158
|
+
private inspectedURLChanged(event: Common.EventTarget.EventTargetEvent<SDK.Target.Target>): void {
|
159
|
+
for (let target: SDK.Target.Target|null = this.debuggerModel.target(); target !== event.data;
|
160
|
+
target = target.parentTarget()) {
|
161
|
+
if (target === null) {
|
162
|
+
return;
|
159
163
|
}
|
160
164
|
}
|
161
|
-
|
165
|
+
|
166
|
+
// Just remove and readd all scripts to ensure their URLs are reflected correctly.
|
167
|
+
for (const script of Array.from(this.#scriptToUISourceCode.keys())) {
|
168
|
+
this.removeScript(script);
|
169
|
+
this.addScript(script);
|
170
|
+
}
|
162
171
|
}
|
163
172
|
|
164
|
-
private
|
165
|
-
|
166
|
-
if (
|
173
|
+
private addScript(script: SDK.Script.Script): void {
|
174
|
+
// Ignore live edit scripts here.
|
175
|
+
if (script.isLiveEdit()) {
|
167
176
|
return;
|
168
177
|
}
|
169
|
-
this.#acceptedScripts.add(script);
|
170
|
-
const originalContentProvider = script.originalContentProvider();
|
171
178
|
|
172
|
-
|
173
|
-
|
179
|
+
let url = script.sourceURL;
|
180
|
+
if (!url) {
|
181
|
+
return;
|
182
|
+
}
|
183
|
+
|
184
|
+
if (script.hasSourceURL) {
|
185
|
+
// Try to resolve `//# sourceURL=` annotations relative to
|
186
|
+
// the base URL, according to the sourcemap specification.
|
187
|
+
url = ResourceScriptMapping.resolveRelativeSourceURL(script, url);
|
188
|
+
} else {
|
189
|
+
// Ignore inline <script>s without `//# sourceURL` annotation here.
|
190
|
+
if (script.isInlineScript()) {
|
191
|
+
return;
|
192
|
+
}
|
193
|
+
|
194
|
+
// Filter out embedder injected content scripts.
|
195
|
+
if (script.isContentScript()) {
|
196
|
+
const parsedURL = new Common.ParsedURL.ParsedURL(url);
|
197
|
+
if (!parsedURL.isValid) {
|
198
|
+
return;
|
199
|
+
}
|
200
|
+
}
|
201
|
+
}
|
174
202
|
|
175
203
|
// Remove previous UISourceCode, if any
|
204
|
+
const project = this.project(script);
|
176
205
|
const oldUISourceCode = project.uiSourceCodeForURL(url);
|
177
206
|
if (oldUISourceCode) {
|
178
|
-
const
|
179
|
-
if (
|
180
|
-
|
207
|
+
const oldScriptFile = this.#uiSourceCodeToScriptFile.get(oldUISourceCode);
|
208
|
+
if (oldScriptFile && oldScriptFile.script) {
|
209
|
+
this.removeScript(oldScriptFile.script);
|
181
210
|
}
|
182
211
|
}
|
183
212
|
|
184
213
|
// Create UISourceCode.
|
214
|
+
const originalContentProvider = script.originalContentProvider();
|
185
215
|
const uiSourceCode = project.createUISourceCode(url, originalContentProvider.contentType());
|
186
216
|
NetworkProject.setInitialFrameAttribution(uiSourceCode, script.frameId);
|
187
217
|
const metadata = metadataForURL(this.debuggerModel.target(), script.frameId, url);
|
@@ -189,61 +219,54 @@ export class ResourceScriptMapping implements DebuggerSourceMapping {
|
|
189
219
|
// Bind UISourceCode to scripts.
|
190
220
|
const scriptFile = new ResourceScriptFile(this, uiSourceCode, [script]);
|
191
221
|
this.#uiSourceCodeToScriptFile.set(uiSourceCode, scriptFile);
|
222
|
+
this.#scriptToUISourceCode.set(script, uiSourceCode);
|
192
223
|
|
193
224
|
const mimeType = script.isWasm() ? 'application/wasm' : 'text/javascript';
|
194
225
|
project.addUISourceCodeWithProvider(uiSourceCode, originalContentProvider, metadata, mimeType);
|
195
|
-
|
226
|
+
void this.debuggerWorkspaceBinding.updateLocations(script);
|
196
227
|
}
|
197
228
|
|
198
229
|
scriptFile(uiSourceCode: Workspace.UISourceCode.UISourceCode): ResourceScriptFile|null {
|
199
230
|
return this.#uiSourceCodeToScriptFile.get(uiSourceCode) || null;
|
200
231
|
}
|
201
232
|
|
202
|
-
private
|
203
|
-
|
233
|
+
private removeScript(script: SDK.Script.Script): void {
|
234
|
+
const uiSourceCode = this.#scriptToUISourceCode.get(script);
|
235
|
+
if (!uiSourceCode) {
|
204
236
|
return;
|
205
237
|
}
|
206
|
-
this.#acceptedScripts.delete(script);
|
207
|
-
const project = this.project(script);
|
208
|
-
const uiSourceCode = (project.uiSourceCodeForURL(script.sourceURL) as Workspace.UISourceCode.UISourceCode);
|
209
238
|
const scriptFile = this.#uiSourceCodeToScriptFile.get(uiSourceCode);
|
210
239
|
if (scriptFile) {
|
211
240
|
scriptFile.dispose();
|
212
241
|
}
|
213
242
|
this.#uiSourceCodeToScriptFile.delete(uiSourceCode);
|
214
|
-
|
215
|
-
|
243
|
+
this.#scriptToUISourceCode.delete(script);
|
244
|
+
const project = uiSourceCode.project() as ContentProviderBasedProject;
|
245
|
+
project.removeFile(uiSourceCode.url());
|
246
|
+
void this.debuggerWorkspaceBinding.updateLocations(script);
|
216
247
|
}
|
217
248
|
|
218
249
|
private executionContextDestroyed(event: Common.EventTarget.EventTargetEvent<SDK.RuntimeModel.ExecutionContext>):
|
219
250
|
void {
|
220
251
|
const executionContext = event.data;
|
221
|
-
const
|
222
|
-
|
223
|
-
void this.removeScript(script);
|
252
|
+
for (const script of this.debuggerModel.scriptsForExecutionContext(executionContext)) {
|
253
|
+
this.removeScript(script);
|
224
254
|
}
|
225
255
|
}
|
226
256
|
|
227
257
|
private globalObjectCleared(): void {
|
228
|
-
const
|
229
|
-
|
230
|
-
void this.removeScript(script);
|
258
|
+
for (const script of this.#scriptToUISourceCode.keys()) {
|
259
|
+
this.removeScript(script);
|
231
260
|
}
|
232
261
|
}
|
233
262
|
|
234
263
|
resetForTest(): void {
|
235
|
-
|
236
|
-
for (const script of scripts) {
|
237
|
-
void this.removeScript(script);
|
238
|
-
}
|
264
|
+
this.globalObjectCleared();
|
239
265
|
}
|
240
266
|
|
241
267
|
dispose(): void {
|
242
268
|
Common.EventTarget.removeEventListeners(this.#eventListeners);
|
243
|
-
|
244
|
-
for (const script of scripts) {
|
245
|
-
void this.removeScript(script);
|
246
|
-
}
|
269
|
+
this.globalObjectCleared();
|
247
270
|
for (const project of this.#projects.values()) {
|
248
271
|
project.removeProject();
|
249
272
|
}
|
@@ -56,6 +56,7 @@ import {ElementsTreeElementHighlighter} from './ElementsTreeElementHighlighter.j
|
|
56
56
|
import {ElementsTreeOutline} from './ElementsTreeOutline.js';
|
57
57
|
import type {MarkerDecorator} from './MarkerDecorator.js';
|
58
58
|
import {MetricsSidebarPane} from './MetricsSidebarPane.js';
|
59
|
+
import {LayoutSidebarPane} from './LayoutSidebarPane.js';
|
59
60
|
import {Events as StylesSidebarPaneEvents, StylesSidebarPane} from './StylesSidebarPane.js';
|
60
61
|
import type {StylesUpdateCompletedEvent} from './StylesSidebarPane.js';
|
61
62
|
|
@@ -1143,6 +1144,8 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
1143
1144
|
if (treeElement) {
|
1144
1145
|
void treeElement.updateStyleAdorners();
|
1145
1146
|
}
|
1147
|
+
|
1148
|
+
LayoutSidebarPane.instance().update();
|
1146
1149
|
}
|
1147
1150
|
}
|
1148
1151
|
|
@@ -61,8 +61,6 @@ const gridNodesToElements = (nodes: SDK.DOMModel.DOMNode[]): ElementsComponents.
|
|
61
61
|
});
|
62
62
|
};
|
63
63
|
|
64
|
-
let layoutSidebarPaneInstance: LayoutSidebarPane;
|
65
|
-
|
66
64
|
const flexContainerNodesToElements = (nodes: SDK.DOMModel.DOMNode[]): ElementsComponents.LayoutPane.LayoutElement[] => {
|
67
65
|
return nodes.map(node => {
|
68
66
|
const layoutElement = nodeToLayoutElement(node);
|
@@ -86,6 +84,7 @@ const flexContainerNodesToElements = (nodes: SDK.DOMModel.DOMNode[]): ElementsCo
|
|
86
84
|
});
|
87
85
|
};
|
88
86
|
|
87
|
+
let layoutSidebarPaneInstance: LayoutSidebarPane;
|
89
88
|
export class LayoutSidebarPane extends UI.ThrottledWidget.ThrottledWidget {
|
90
89
|
private layoutPane: ElementsComponents.LayoutPane.LayoutPane;
|
91
90
|
private readonly settings: string[];
|
@@ -121,11 +121,11 @@ function findColorsAndCurves(
|
|
121
121
|
if (content) {
|
122
122
|
const parsedColor = Common.Color.Color.parse(content);
|
123
123
|
if (parsedColor) {
|
124
|
-
onColor(from, parsedColor, content);
|
124
|
+
onColor(node.from, parsedColor, content);
|
125
125
|
} else {
|
126
126
|
const parsedCurve = UI.Geometry.CubicBezier.parse(content);
|
127
127
|
if (parsedCurve) {
|
128
|
-
onCurve(from, parsedCurve, content);
|
128
|
+
onCurve(node.from, parsedCurve, content);
|
129
129
|
}
|
130
130
|
}
|
131
131
|
}
|
@@ -179,7 +179,7 @@ export class DebuggerPlugin extends Plugin {
|
|
179
179
|
private readonly breakpointManager: Bindings.BreakpointManager.BreakpointManager;
|
180
180
|
// Manages pop-overs shown when the debugger is active and the user
|
181
181
|
// hovers over an expression
|
182
|
-
private
|
182
|
+
private popoverHelper: UI.PopoverHelper.PopoverHelper|null = null;
|
183
183
|
private scriptFileForDebuggerModel:
|
184
184
|
Map<SDK.DebuggerModel.DebuggerModel, Bindings.ResourceScriptMapping.ResourceScriptFile>;
|
185
185
|
// The current set of breakpoints for this file. The locations in
|
@@ -214,12 +214,6 @@ export class DebuggerPlugin extends Plugin {
|
|
214
214
|
this.scriptsPanel = SourcesPanel.instance();
|
215
215
|
this.breakpointManager = Bindings.BreakpointManager.BreakpointManager.instance();
|
216
216
|
|
217
|
-
this.popoverHelper =
|
218
|
-
new UI.PopoverHelper.PopoverHelper(this.scriptsPanel.element, this.getPopoverRequest.bind(this));
|
219
|
-
this.popoverHelper.setDisableOnClick(true);
|
220
|
-
this.popoverHelper.setTimeout(250, 250);
|
221
|
-
this.popoverHelper.setHasPadding(true);
|
222
|
-
|
223
217
|
this.breakpointManager.addEventListener(
|
224
218
|
Bindings.BreakpointManager.Events.BreakpointAdded, this.breakpointChange, this);
|
225
219
|
this.breakpointManager.addEventListener(
|
@@ -349,6 +343,12 @@ export class DebuggerPlugin extends Plugin {
|
|
349
343
|
void this.refreshBreakpoints();
|
350
344
|
}
|
351
345
|
void this.callFrameChanged();
|
346
|
+
|
347
|
+
this.popoverHelper?.dispose();
|
348
|
+
this.popoverHelper = new UI.PopoverHelper.PopoverHelper(editor, this.getPopoverRequest.bind(this));
|
349
|
+
this.popoverHelper.setDisableOnClick(true);
|
350
|
+
this.popoverHelper.setTimeout(250, 250);
|
351
|
+
this.popoverHelper.setHasPadding(true);
|
352
352
|
}
|
353
353
|
|
354
354
|
static accepts(uiSourceCode: Workspace.UISourceCode.UISourceCode): boolean {
|
@@ -422,7 +422,7 @@ export class DebuggerPlugin extends Plugin {
|
|
422
422
|
}
|
423
423
|
|
424
424
|
willHide(): void {
|
425
|
-
this.popoverHelper
|
425
|
+
this.popoverHelper?.hidePopover();
|
426
426
|
}
|
427
427
|
|
428
428
|
populateLineGutterContextMenu(contextMenu: UI.ContextMenu.ContextMenu, editorLineNumber: number): void {
|
@@ -739,7 +739,7 @@ export class DebuggerPlugin extends Plugin {
|
|
739
739
|
this.setControlDown(false);
|
740
740
|
}
|
741
741
|
if (event.key === Platform.KeyboardUtilities.ESCAPE_KEY) {
|
742
|
-
if (this.popoverHelper.isPopoverVisible()) {
|
742
|
+
if (this.popoverHelper && this.popoverHelper.isPopoverVisible()) {
|
743
743
|
this.popoverHelper.hidePopover();
|
744
744
|
event.consume();
|
745
745
|
return true;
|
@@ -1000,7 +1000,7 @@ export class DebuggerPlugin extends Plugin {
|
|
1000
1000
|
// Highlight the locations the debugger can continue to (when
|
1001
1001
|
// Control is held)
|
1002
1002
|
private async showContinueToLocations(): Promise<void> {
|
1003
|
-
this.popoverHelper
|
1003
|
+
this.popoverHelper?.hidePopover();
|
1004
1004
|
const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
1005
1005
|
if (!executionContext || !this.editor) {
|
1006
1006
|
return;
|
@@ -1581,8 +1581,8 @@ export class DebuggerPlugin extends Plugin {
|
|
1581
1581
|
}
|
1582
1582
|
this.scriptFileForDebuggerModel.clear();
|
1583
1583
|
|
1584
|
-
this.popoverHelper
|
1585
|
-
this.popoverHelper
|
1584
|
+
this.popoverHelper?.hidePopover();
|
1585
|
+
this.popoverHelper?.dispose();
|
1586
1586
|
|
1587
1587
|
this.breakpointManager.removeEventListener(
|
1588
1588
|
Bindings.BreakpointManager.Events.BreakpointAdded, this.breakpointChange, this);
|
@@ -83,15 +83,18 @@ const UIStrings = {
|
|
83
83
|
*/
|
84
84
|
showAllD: 'Show all {PH1}',
|
85
85
|
/**
|
86
|
-
|
87
|
-
*viewing a
|
88
|
-
*
|
86
|
+
* @description Value element text content in Object Properties Section. Shown when the developer is
|
87
|
+
* viewing a variable in the Scope view, whose value is not available (i.e. because it was optimized
|
88
|
+
* out) by the JavaScript engine, or inspecting a JavaScript object accessor property, which has no
|
89
|
+
* getter. This string should be translated.
|
89
90
|
*/
|
90
|
-
|
91
|
+
valueUnavailable: '<value unavailable>',
|
91
92
|
/**
|
92
|
-
|
93
|
-
|
94
|
-
|
93
|
+
* @description Tooltip for value elements in the Scope view that refer to variables whose values
|
94
|
+
* aren't accessible to the debugger (potentially due to being optimized out by the JavaScript
|
95
|
+
* engine), or for JavaScript object accessor properties which have no getter.
|
96
|
+
*/
|
97
|
+
valueNotAccessibleToTheDebugger: 'Value is not accessible to the debugger',
|
95
98
|
/**
|
96
99
|
*@description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel and Network pane request.
|
97
100
|
*/
|
@@ -1105,9 +1108,9 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
1105
1108
|
}, false);
|
1106
1109
|
} else {
|
1107
1110
|
this.valueElement = document.createElement('span');
|
1108
|
-
this.valueElement.classList.add('object-value-
|
1109
|
-
this.valueElement.textContent = i18nString(UIStrings.
|
1110
|
-
UI.Tooltip.Tooltip.install(this.valueElement, i18nString(UIStrings.
|
1111
|
+
this.valueElement.classList.add('object-value-unavailable');
|
1112
|
+
this.valueElement.textContent = i18nString(UIStrings.valueUnavailable);
|
1113
|
+
UI.Tooltip.Tooltip.install(this.valueElement, i18nString(UIStrings.valueNotAccessibleToTheDebugger));
|
1111
1114
|
}
|
1112
1115
|
|
1113
1116
|
const valueText = this.valueElement.textContent;
|
package/package.json
CHANGED