chrome-devtools-frontend 1.0.1544076 → 1.0.1547147
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/typescript/tsconfig.eslint.json +1 -0
- package/docs/styleguide/ux/styles.md +1 -1
- package/eslint.config.mjs +1 -1
- package/front_end/Images/src/arrow-down.svg +8 -1
- package/front_end/Images/src/arrow-up.svg +8 -1
- package/front_end/core/common/ParsedURL.ts +1 -1
- package/front_end/core/common/common.ts +0 -2
- package/front_end/core/host/AidaClient.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
- package/front_end/core/host/UserMetrics.ts +0 -5
- package/front_end/core/platform/HostRuntime.ts +18 -0
- package/front_end/core/platform/KeyboardUtilities.ts +2 -2
- package/front_end/core/platform/StringUtilities.ts +1 -1
- package/front_end/core/platform/api/HostRuntime.ts +20 -0
- package/front_end/core/platform/api/api.ts +7 -0
- package/front_end/core/platform/browser/HostRuntime.ts +14 -0
- package/front_end/core/platform/browser/browser.ts +7 -0
- package/front_end/core/platform/node/HostRuntime.ts +13 -0
- package/front_end/core/platform/node/node.ts +7 -0
- package/front_end/core/platform/platform.ts +2 -2
- package/front_end/core/protocol_client/CDPConnection.ts +3 -3
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -1
- package/front_end/core/sdk/CSSMetadata.ts +17 -5
- package/front_end/core/sdk/NetworkManager.ts +6 -8
- package/front_end/core/sdk/NetworkRequest.ts +4 -0
- package/front_end/core/sdk/SDKModel.ts +4 -2
- package/front_end/core/sdk/SourceMapScopesInfo.ts +141 -23
- package/front_end/core/sdk/Target.ts +5 -14
- package/front_end/core/sdk/TargetManager.ts +39 -18
- package/front_end/core/sdk/sdk-meta.ts +62 -0
- package/front_end/devtools_compatibility.js +0 -1
- package/front_end/entrypoints/main/MainImpl.ts +2 -2
- package/front_end/foundation/Universe.ts +2 -2
- package/front_end/generated/Deprecation.ts +11 -0
- package/front_end/generated/InspectorBackendCommands.ts +3 -6
- package/front_end/generated/SupportedCSSProperties.js +4 -25
- package/front_end/generated/protocol-mapping.d.ts +0 -15
- package/front_end/generated/protocol-proxy-api.d.ts +0 -11
- package/front_end/generated/protocol.ts +5 -36
- package/front_end/models/ai_assistance/AiConversation.ts +188 -0
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -172
- package/front_end/models/ai_assistance/ConversationHandler.ts +5 -5
- package/front_end/models/ai_assistance/agents/AiAgent.ts +1 -3
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +6 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -9
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +313 -313
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +8 -6
- package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +33 -33
- package/front_end/models/ai_assistance/performance/AICallTree.ts +9 -3
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +5 -3
- package/front_end/models/bindings/SASSSourceMapping.ts +6 -4
- package/front_end/models/cpu_profile/CPUProfileDataModel.ts +10 -7
- package/front_end/models/crux-manager/CrUXManager.ts +7 -4
- package/front_end/models/issues_manager/GenericIssue.ts +12 -9
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
- package/front_end/models/trace/handlers/SamplesHandler.ts +3 -0
- package/front_end/models/trace/helpers/Trace.ts +13 -0
- package/front_end/models/trace/types/TraceEvents.ts +2 -1
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -0
- package/front_end/models/workspace/IgnoreListManager.ts +1 -2
- package/front_end/models/workspace/UISourceCode.ts +50 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +11 -10
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +8 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
- package/front_end/panels/ai_assistance/components/UserActionRow.ts +2 -1
- package/front_end/panels/animation/AnimationTimeline.ts +0 -8
- package/front_end/panels/application/ApplicationPanelSidebar.ts +6 -7
- package/front_end/panels/application/{components/FrameDetailsView.ts → FrameDetailsView.ts} +140 -171
- package/front_end/panels/application/{components/OriginTrialTreeView.ts → OriginTrialTreeView.ts} +9 -9
- package/front_end/panels/application/application.ts +4 -0
- package/front_end/panels/application/components/StackTrace.ts +89 -88
- package/front_end/panels/application/components/components.ts +2 -4
- package/front_end/panels/application/{components/frameDetailsReportView.css → frameDetailsReportView.css} +5 -1
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +80 -0
- package/front_end/panels/common/BadgeNotification.ts +2 -1
- package/front_end/panels/common/DOMLinkifier.ts +7 -2
- package/front_end/panels/common/GdpSignUpDialog.ts +2 -1
- package/front_end/panels/common/common.ts +2 -1
- package/front_end/panels/console/ConsolePrompt.ts +3 -1
- package/front_end/panels/console/ConsoleViewport.ts +1 -2
- package/front_end/panels/elements/ElementIssueUtils.ts +2 -2
- package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +23 -19
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/cssValueTraceView.css +1 -1
- package/front_end/panels/elements/elements-meta.ts +1 -22
- package/front_end/panels/explain/components/ConsoleInsight.ts +44 -57
- package/front_end/panels/explain/components/consoleInsight.css +46 -1
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -2
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +3 -6
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +19 -0
- package/front_end/panels/network/RequestConditionsDrawer.ts +54 -24
- package/front_end/panels/network/networkLogView.css +11 -0
- package/front_end/panels/network/networkTimingTable.css +8 -6
- package/front_end/panels/network/requestConditionsDrawer.css +10 -1
- package/front_end/panels/profiler/ProfilesPanel.ts +1 -2
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +2 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +20 -21
- package/front_end/panels/settings/SettingsScreen.ts +3 -2
- package/front_end/panels/sources/CoveragePlugin.ts +5 -5
- package/front_end/panels/sources/Plugin.ts +1 -1
- package/front_end/panels/sources/ProfilePlugin.ts +22 -14
- package/front_end/panels/sources/UISourceCodeFrame.ts +2 -1
- package/front_end/panels/sources/sources-meta.ts +0 -62
- package/front_end/panels/timeline/README.md +1 -9
- package/front_end/panels/timeline/ThreadAppender.ts +0 -7
- package/front_end/panels/timeline/TimelinePanel.ts +1 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +2 -0
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +15 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +51 -6
- package/front_end/panels/timeline/components/MetricCard.ts +2 -2
- package/front_end/panels/timeline/components/exportTraceOptions.css +11 -2
- package/front_end/panels/timeline/components/insights/NodeLink.ts +2 -3
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -1
- package/front_end/panels/timeline/timeline-meta.ts +0 -10
- package/front_end/panels/timeline/timeline.ts +0 -2
- package/front_end/panels/whats_new/ReleaseNoteView.ts +2 -1
- package/front_end/panels/whats_new/WhatsNewImpl.ts +3 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/tsconfig.json +1 -0
- package/front_end/ui/components/buttons/Button.docs.ts +6 -5
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +1 -0
- package/front_end/ui/components/snackbars/Snackbars.docs.ts +1 -1
- package/front_end/ui/components/spinners/Spinners.docs.ts +1 -1
- package/front_end/ui/components/survey_link/SurveyLink.docs.ts +2 -1
- package/front_end/ui/components/switch/Switch.docs.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.docs.ts +3 -3
- package/front_end/ui/helpers/OpenInNewTab.ts +87 -0
- package/front_end/ui/helpers/helpers.ts +5 -0
- package/front_end/ui/legacy/ARIAUtils.ts +2 -2
- package/front_end/ui/legacy/ActionRegistration.ts +11 -0
- package/front_end/ui/legacy/ContextMenu.docs.ts +12 -11
- package/front_end/ui/legacy/RadioButton.docs.ts +1 -1
- package/front_end/ui/legacy/SelectMenu.docs.ts +1 -1
- package/front_end/ui/legacy/Slider.docs.ts +1 -1
- package/front_end/ui/legacy/SoftDropDown.ts +2 -2
- package/front_end/ui/legacy/TextPrompt.ts +3 -2
- package/front_end/ui/legacy/Treeoutline.ts +2 -1
- package/front_end/ui/legacy/UIUtils.ts +11 -43
- package/front_end/ui/legacy/Widget.ts +3 -2
- package/front_end/ui/legacy/XLink.ts +4 -4
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +2 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +144 -143
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +62 -39
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -7
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +1 -2
- package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -1
- package/front_end/ui/legacy/inspectorCommon.css +2 -2
- package/front_end/ui/legacy/legacy.ts +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/mcp/tsconfig.json +16 -0
- package/package.json +2 -2
- package/front_end/core/common/Linkifier.ts +0 -55
- package/front_end/panels/explain/components/consoleInsightSourcesList.css +0 -51
- package/front_end/panels/timeline/CLSLinkifier.ts +0 -58
- package/front_end/ui/components/docs/README.md +0 -6
- package/front_end/ui/components/docs/building-ui-documentation/ComponentEvents.md +0 -54
- package/front_end/ui/components/docs/building-ui-documentation/ComponentPerformance.md +0 -136
- package/front_end/ui/components/docs/building-ui-documentation/CreatingComponents.md +0 -242
- package/front_end/ui/components/docs/building-ui-documentation/README.md +0 -23
- package/front_end/ui/components/docs/building-ui-documentation/StylingComponents.md +0 -66
- package/front_end/ui/components/docs/building-ui-documentation/TestingComponents.md +0 -111
- package/front_end/ui/components/docs/component_docs.ts +0 -24
- package/front_end/ui/components/docs/component_docs_styles.css +0 -53
- package/front_end/ui/components/docs/create_breadcrumbs.ts +0 -44
- package/front_end/ui/components/docs/slider/basic.html +0 -20
- package/front_end/ui/components/docs/switch/basic.html +0 -20
- /package/front_end/models/issues_manager/descriptions/{genericFormAriaLabelledByToNonExistingId.md → genericFormAriaLabelledByToNonExistingIdError.md} +0 -0
- /package/front_end/models/issues_manager/descriptions/{genericFormLabelHasNeitherForNorNestedInput.md → genericFormLabelHasNeitherForNorNestedInputError.md} +0 -0
- /package/front_end/panels/application/{components/originTrialTokenRows.css → originTrialTokenRows.css} +0 -0
- /package/front_end/panels/application/{components/originTrialTreeView.css → originTrialTreeView.css} +0 -0
- /package/front_end/{core/platform → ui/legacy}/DOMUtilities.ts +0 -0
|
@@ -8,7 +8,6 @@ import type * as Protocol from '../../../../generated/protocol.js';
|
|
|
8
8
|
import * as Bindings from '../../../../models/bindings/bindings.js';
|
|
9
9
|
import type * as CPUProfile from '../../../../models/cpu_profile/cpu_profile.js';
|
|
10
10
|
import * as Workspace from '../../../../models/workspace/workspace.js';
|
|
11
|
-
import * as SourceFrame from '../source_frame/source_frame.js';
|
|
12
11
|
|
|
13
12
|
let performanceInstance: Performance;
|
|
14
13
|
|
|
@@ -16,7 +15,7 @@ export class Performance {
|
|
|
16
15
|
private readonly helper: Helper;
|
|
17
16
|
|
|
18
17
|
private constructor() {
|
|
19
|
-
this.helper = new Helper(
|
|
18
|
+
this.helper = new Helper(Workspace.UISourceCode.DecoratorType.PERFORMANCE);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
static instance(opts: {
|
|
@@ -50,7 +49,8 @@ export class Performance {
|
|
|
50
49
|
const lineInfo = node.positionTicks[j];
|
|
51
50
|
const line = lineInfo.line;
|
|
52
51
|
const time = lineInfo.ticks * sampleDuration;
|
|
53
|
-
|
|
52
|
+
// Since no column number is provided by legacy profile, default to 1 (beginning of line).
|
|
53
|
+
this.helper.addLocationData(target, node.url, {line, column: 1}, time);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -62,13 +62,14 @@ export class Performance {
|
|
|
62
62
|
this.helper.scheduleUpdate();
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
if (!profile.samples) {
|
|
65
|
+
if (!profile.samples || !profile.columns) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
for (let i = 1; i < profile.samples.length; ++i) {
|
|
70
70
|
const line = profile.lines[i];
|
|
71
|
-
|
|
71
|
+
const column = profile.columns?.[i];
|
|
72
|
+
if (!line || !column) {
|
|
72
73
|
continue;
|
|
73
74
|
}
|
|
74
75
|
const node = profile.nodeByIndex(i);
|
|
@@ -80,7 +81,7 @@ export class Performance {
|
|
|
80
81
|
continue;
|
|
81
82
|
}
|
|
82
83
|
const time = profile.timestamps[i] - profile.timestamps[i - 1];
|
|
83
|
-
this.helper.
|
|
84
|
+
this.helper.addLocationData(target, scriptIdOrUrl, {line, column}, time);
|
|
84
85
|
}
|
|
85
86
|
this.helper.scheduleUpdate();
|
|
86
87
|
}
|
|
@@ -91,7 +92,7 @@ let memoryInstance: Memory;
|
|
|
91
92
|
export class Memory {
|
|
92
93
|
private readonly helper: Helper;
|
|
93
94
|
private constructor() {
|
|
94
|
-
this.helper = new Helper(
|
|
95
|
+
this.helper = new Helper(Workspace.UISourceCode.DecoratorType.MEMORY);
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
static instance(opts: {
|
|
@@ -124,43 +125,55 @@ export class Memory {
|
|
|
124
125
|
return;
|
|
125
126
|
}
|
|
126
127
|
const line = node.callFrame.lineNumber + 1;
|
|
127
|
-
|
|
128
|
+
// Since no column number is provided by the heap profile, default to 1 (beginning of line).
|
|
129
|
+
helper.addLocationData(target, script, {line, column: 1}, node.selfSize);
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
export class Helper {
|
|
133
|
-
private readonly type:
|
|
135
|
+
private readonly type: Workspace.UISourceCode.DecoratorType;
|
|
134
136
|
private readonly locationPool = new Bindings.LiveLocation.LiveLocationPool();
|
|
135
137
|
private updateTimer: number|null = null;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Given a location in a script (with line and column numbers being 1-based) stores
|
|
140
|
+
* the time spent at that location in a performance profile.
|
|
141
|
+
*/
|
|
142
|
+
private locationData =
|
|
143
|
+
new Map<SDK.Target.Target|null, Map<Platform.DevToolsPath.UrlString|number, Map<number, Map<number, number>>>>();
|
|
144
|
+
constructor(type: Workspace.UISourceCode.DecoratorType) {
|
|
140
145
|
this.type = type;
|
|
141
146
|
this.reset();
|
|
142
147
|
}
|
|
143
148
|
|
|
144
149
|
reset(): void {
|
|
145
150
|
// The second map uses string keys for script URLs and numbers for scriptId.
|
|
146
|
-
this.
|
|
151
|
+
this.locationData = new Map();
|
|
147
152
|
this.scheduleUpdate();
|
|
148
153
|
}
|
|
149
154
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Stores the time taken running a given script location (line and column)
|
|
157
|
+
*/
|
|
158
|
+
addLocationData(
|
|
159
|
+
target: SDK.Target.Target|null, scriptIdOrUrl: Platform.DevToolsPath.UrlString|number,
|
|
160
|
+
{line, column}: {line: number, column: number}, data: number): void {
|
|
161
|
+
let targetData = this.locationData.get(target);
|
|
154
162
|
if (!targetData) {
|
|
155
163
|
targetData = new Map();
|
|
156
|
-
this.
|
|
164
|
+
this.locationData.set(target, targetData);
|
|
157
165
|
}
|
|
158
166
|
let scriptData = targetData.get(scriptIdOrUrl);
|
|
159
167
|
if (!scriptData) {
|
|
160
168
|
scriptData = new Map();
|
|
161
169
|
targetData.set(scriptIdOrUrl, scriptData);
|
|
162
170
|
}
|
|
163
|
-
|
|
171
|
+
let lineData = scriptData.get(line);
|
|
172
|
+
if (!lineData) {
|
|
173
|
+
lineData = new Map();
|
|
174
|
+
scriptData.set(line, lineData);
|
|
175
|
+
}
|
|
176
|
+
lineData.set(column, (lineData.get(column) || 0) + data);
|
|
164
177
|
}
|
|
165
178
|
|
|
166
179
|
scheduleUpdate(): void {
|
|
@@ -176,10 +189,9 @@ export class Helper {
|
|
|
176
189
|
private async doUpdate(): Promise<void> {
|
|
177
190
|
this.locationPool.disposeAll();
|
|
178
191
|
// Map from sources to line->value profile maps.
|
|
179
|
-
const decorationsBySource = new Map<Workspace.UISourceCode.UISourceCode, Map<number, number
|
|
192
|
+
const decorationsBySource = new Map<Workspace.UISourceCode.UISourceCode, Map<number, Map<number, number>>>();
|
|
180
193
|
const pending: Array<Promise<void>> = [];
|
|
181
|
-
|
|
182
|
-
for (const [target, scriptToLineMap] of this.lineData) {
|
|
194
|
+
for (const [target, scriptToLineMap] of this.locationData) {
|
|
183
195
|
const debuggerModel = target ? target.model(SDK.DebuggerModel.DebuggerModel) : null;
|
|
184
196
|
for (const [scriptIdOrUrl, lineToDataMap] of scriptToLineMap) {
|
|
185
197
|
// debuggerModel is null when the profile is loaded from file.
|
|
@@ -187,23 +199,34 @@ export class Helper {
|
|
|
187
199
|
const workspace = Workspace.Workspace.WorkspaceImpl.instance();
|
|
188
200
|
if (debuggerModel) {
|
|
189
201
|
const workspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance();
|
|
190
|
-
for (const
|
|
191
|
-
|
|
192
|
-
const data
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
for (const [lineNumber, lineData] of lineToDataMap) {
|
|
203
|
+
// lineData contains profiling data by column.
|
|
204
|
+
for (const [columnNumber, data] of lineData) {
|
|
205
|
+
const zeroBasedLine = lineNumber - 1;
|
|
206
|
+
const zeroBasedColumn = columnNumber - 1;
|
|
207
|
+
if (target) {
|
|
208
|
+
const rawLocation = typeof scriptIdOrUrl === 'string' ?
|
|
209
|
+
debuggerModel.createRawLocationByURL(scriptIdOrUrl, zeroBasedLine, zeroBasedColumn || 0) :
|
|
210
|
+
debuggerModel.createRawLocationByScriptId(
|
|
211
|
+
String(scriptIdOrUrl) as Protocol.Runtime.ScriptId, zeroBasedLine, zeroBasedColumn || 0);
|
|
212
|
+
if (rawLocation) {
|
|
213
|
+
pending.push(workspaceBinding.rawLocationToUILocation(rawLocation).then(uiLocation => {
|
|
214
|
+
if (uiLocation) {
|
|
215
|
+
let lineMap = decorationsBySource.get(uiLocation.uiSourceCode);
|
|
216
|
+
if (!lineMap) {
|
|
217
|
+
lineMap = new Map<number, Map<number, number>>();
|
|
218
|
+
decorationsBySource.set(uiLocation.uiSourceCode, lineMap);
|
|
219
|
+
}
|
|
220
|
+
let columnMap = lineMap.get(lineNumber);
|
|
221
|
+
if (!columnMap) {
|
|
222
|
+
columnMap = new Map<number, number>();
|
|
223
|
+
lineMap.set(lineNumber, columnMap);
|
|
224
|
+
}
|
|
225
|
+
columnMap.set((zeroBasedColumn || 0) + 1, data);
|
|
226
|
+
}
|
|
227
|
+
}));
|
|
205
228
|
}
|
|
206
|
-
}
|
|
229
|
+
}
|
|
207
230
|
}
|
|
208
231
|
}
|
|
209
232
|
} else if (typeof scriptIdOrUrl === 'string') {
|
|
@@ -176,7 +176,7 @@ export class Window extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
|
176
176
|
|
|
177
177
|
this.parentElement.addEventListener('wheel', this.onMouseWheel.bind(this), true);
|
|
178
178
|
this.parentElement.addEventListener('dblclick', this.resizeWindowMaximum.bind(this), true);
|
|
179
|
-
|
|
179
|
+
UI.DOMUtilities.appendStyle(this.parentElement, overviewGridStyles);
|
|
180
180
|
|
|
181
181
|
this.leftResizeElement = parentElement.createChild('div', 'overview-grid-window-resizer');
|
|
182
182
|
UI.UIUtils.installDragHandle(
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
|
-
import * as Platform from '../../../../core/platform/platform.js';
|
|
37
36
|
import type * as NetworkTimeCalculator from '../../../../models/network_time_calculator/network_time_calculator.js';
|
|
37
|
+
import * as UI from '../../legacy.js';
|
|
38
38
|
import * as ThemeSupport from '../../theme_support/theme_support.js';
|
|
39
39
|
|
|
40
40
|
import {DEFAULT_FONT_SIZE, getFontFamilyForCanvas} from './Font.js';
|
|
@@ -51,7 +51,7 @@ export class TimelineGrid {
|
|
|
51
51
|
|
|
52
52
|
constructor() {
|
|
53
53
|
this.element = document.createElement('div');
|
|
54
|
-
|
|
54
|
+
UI.DOMUtilities.appendStyle(this.element, timelineGridStyles);
|
|
55
55
|
|
|
56
56
|
this.#dividersElement = this.element.createChild('div', 'resources-dividers');
|
|
57
57
|
|
|
@@ -121,7 +121,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
121
121
|
private readonly lazyContent: () => Promise<TextUtils.ContentData.ContentDataOrError>;
|
|
122
122
|
private prettyInternal: boolean;
|
|
123
123
|
private rawContent: string|CodeMirror.Text|null;
|
|
124
|
-
|
|
124
|
+
protected formattedMap: Formatter.ScriptFormatter.FormatterSourceMapping|null;
|
|
125
125
|
private readonly prettyToggle: UI.Toolbar.ToolbarToggle;
|
|
126
126
|
private shouldAutoPrettyPrint: boolean;
|
|
127
127
|
private readonly progressToolbarItem: UI.Toolbar.ToolbarItem;
|
|
@@ -400,6 +400,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
400
400
|
newSelection = textEditor.createSelection(
|
|
401
401
|
{lineNumber: start[0], columnNumber: start[1]}, {lineNumber: end[0], columnNumber: end[1]});
|
|
402
402
|
} else {
|
|
403
|
+
this.formattedMap = null;
|
|
403
404
|
await this.setContent(this.rawContent || '');
|
|
404
405
|
this.baseDoc = textEditor.state.doc;
|
|
405
406
|
const start = this.prettyToRawLocation(startPos.lineNumber, startPos.columnNumber);
|
|
@@ -1051,12 +1052,6 @@ export interface Transformer {
|
|
|
1051
1052
|
};
|
|
1052
1053
|
}
|
|
1053
1054
|
|
|
1054
|
-
export const enum DecoratorType {
|
|
1055
|
-
PERFORMANCE = 'performance',
|
|
1056
|
-
MEMORY = 'memory',
|
|
1057
|
-
COVERAGE = 'coverage',
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
1055
|
const config = {
|
|
1061
1056
|
editable: new CodeMirror.Compartment(),
|
|
1062
1057
|
language: new CodeMirror.Compartment(),
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
|
|
37
37
|
import * as Common from '../../../../core/common/common.js';
|
|
38
38
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
39
|
-
import * as Platform from '../../../../core/platform/platform.js';
|
|
40
39
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
41
40
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
42
41
|
import * as StackTrace from '../../../../models/stack_trace/stack_trace.js';
|
|
@@ -325,7 +324,7 @@ export class StackTracePreviewContent extends UI.Widget.Widget {
|
|
|
325
324
|
this.element.classList.toggle('width-constrained', this.#options.widthConstrained ?? false);
|
|
326
325
|
this.element.style.display = 'inline-block';
|
|
327
326
|
|
|
328
|
-
|
|
327
|
+
UI.DOMUtilities.appendStyle(this.element.shadowRoot as ShadowRoot, jsUtilsStyles);
|
|
329
328
|
|
|
330
329
|
this.#table = this.contentElement.createChild('table', 'stack-preview-container');
|
|
331
330
|
this.#table.classList.toggle('width-constrained', this.#options.widthConstrained ?? false);
|
|
@@ -17,6 +17,7 @@ import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
|
17
17
|
import type * as Trace from '../../../../models/trace/trace.js';
|
|
18
18
|
import * as Workspace from '../../../../models/workspace/workspace.js';
|
|
19
19
|
import type * as IconButton from '../../../components/icon_button/icon_button.js';
|
|
20
|
+
import * as UIHelpers from '../../../helpers/helpers.js';
|
|
20
21
|
import {html, render} from '../../../lit/lit.js';
|
|
21
22
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
22
23
|
import * as UI from '../../legacy.js';
|
|
@@ -920,7 +921,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
920
921
|
section: 'reveal',
|
|
921
922
|
title: UI.UIUtils.openLinkExternallyLabel(),
|
|
922
923
|
jslogContext: 'open-in-new-tab',
|
|
923
|
-
handler: () =>
|
|
924
|
+
handler: () => UIHelpers.openInNewTab(url),
|
|
924
925
|
});
|
|
925
926
|
result.push({
|
|
926
927
|
section: 'clipboard',
|
|
@@ -141,7 +141,7 @@ iframe.widget {
|
|
|
141
141
|
display: none !important; /* stylelint-disable-line declaration-no-important */
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
.highlighted-search-result
|
|
144
|
+
.highlighted-search-result,:host::highlight(highlighted-search-result) {
|
|
145
145
|
border-radius: 1px;
|
|
146
146
|
background-color: var(--sys-color-yellow-container);
|
|
147
147
|
outline: 1px solid var(--sys-color-yellow-container);
|
|
@@ -326,7 +326,7 @@ input[type='range']:disabled::-webkit-slider-thumb {
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
.highlighted-search-result.current-search-result
|
|
329
|
+
.highlighted-search-result.current-search-result,:host::highlight(current-search-result) {
|
|
330
330
|
/* Note: this value is used in light & dark mode */
|
|
331
331
|
--override-current-search-result-background-color: rgb(255 127 0 / 80%);
|
|
332
332
|
|
|
@@ -10,6 +10,7 @@ import * as ContextFlavorListener from './ContextFlavorListener.js';
|
|
|
10
10
|
import * as ContextMenu from './ContextMenu.js';
|
|
11
11
|
import * as Dialog from './Dialog.js';
|
|
12
12
|
import * as DockController from './DockController.js';
|
|
13
|
+
import * as DOMUtilities from './DOMUtilities.js';
|
|
13
14
|
import * as DropTarget from './DropTarget.js';
|
|
14
15
|
import * as EmptyWidget from './EmptyWidget.js';
|
|
15
16
|
import * as FilterBar from './FilterBar.js';
|
|
@@ -61,6 +62,7 @@ export {
|
|
|
61
62
|
ContextMenu,
|
|
62
63
|
Dialog,
|
|
63
64
|
DockController,
|
|
65
|
+
DOMUtilities,
|
|
64
66
|
DropTarget,
|
|
65
67
|
EmptyWidget,
|
|
66
68
|
FilterBar,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../config/typescript/tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowUmdGlobalAccess": true,
|
|
5
|
+
"outDir": "ignored",
|
|
6
|
+
"target": "ES2023",
|
|
7
|
+
"lib": [
|
|
8
|
+
"ES2023",
|
|
9
|
+
"ES2024.Promise",
|
|
10
|
+
"ESNext.Iterator",
|
|
11
|
+
"ESNext.Collection",
|
|
12
|
+
"ESNext.Array"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"references": [{ "path": "../front_end/tsconfig.json" }]
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/glob": "7.2.0",
|
|
47
47
|
"@types/karma-chai-sinon": "0.1.20",
|
|
48
48
|
"@types/mocha": "10.0.10",
|
|
49
|
-
"@types/node": "
|
|
49
|
+
"@types/node": "24.10.0",
|
|
50
50
|
"@types/sinon": "17.0.4",
|
|
51
51
|
"@types/webidl2": "24.4.3",
|
|
52
52
|
"@types/yargs": "17.0.33",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"flat-cache": "6.1.12"
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
|
-
"version": "1.0.
|
|
106
|
+
"version": "1.0.1547147"
|
|
107
107
|
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// Copyright 2019 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import type * as Platform from '../platform/platform.js';
|
|
6
|
-
|
|
7
|
-
export abstract class Linkifier {
|
|
8
|
-
abstract linkify(object: Object, options?: Options): Node;
|
|
9
|
-
|
|
10
|
-
static async linkify(object: Object|null, options?: Options): Promise<Node> {
|
|
11
|
-
if (!object) {
|
|
12
|
-
throw new Error('Can\'t linkify ' + object);
|
|
13
|
-
}
|
|
14
|
-
const linkifierRegistration = getApplicableRegisteredlinkifiers(object)[0];
|
|
15
|
-
if (!linkifierRegistration) {
|
|
16
|
-
throw new Error('No linkifiers registered for object ' + object);
|
|
17
|
-
}
|
|
18
|
-
const linkifier = await linkifierRegistration.loadLinkifier();
|
|
19
|
-
return linkifier.linkify(object, options);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export interface Options {
|
|
23
|
-
tooltip?: string;
|
|
24
|
-
preventKeyboardFocus?: boolean;
|
|
25
|
-
textContent?: string;
|
|
26
|
-
// Dynamic links include hyperlinks and anchorlinks -- links that navigate the content.
|
|
27
|
-
isDynamicLink?: boolean;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const registeredLinkifiers: LinkifierRegistration[] = [];
|
|
31
|
-
|
|
32
|
-
export function registerLinkifier(registration: LinkifierRegistration): void {
|
|
33
|
-
registeredLinkifiers.push(registration);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function getApplicableRegisteredlinkifiers(object: Object): LinkifierRegistration[] {
|
|
37
|
-
return registeredLinkifiers.filter(isLinkifierApplicableToContextTypes);
|
|
38
|
-
|
|
39
|
-
function isLinkifierApplicableToContextTypes(linkifierRegistration: LinkifierRegistration): boolean {
|
|
40
|
-
if (!linkifierRegistration.contextTypes) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
for (const contextType of linkifierRegistration.contextTypes()) {
|
|
44
|
-
if (object instanceof contextType) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface LinkifierRegistration {
|
|
53
|
-
loadLinkifier: () => Promise<Linkifier>;
|
|
54
|
-
contextTypes?: () => Array<Platform.Constructor.Constructor<unknown>>;
|
|
55
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 The Chromium Authors
|
|
3
|
-
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
* {
|
|
8
|
-
padding: 0;
|
|
9
|
-
margin: 0;
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host {
|
|
14
|
-
display: block;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
ul {
|
|
18
|
-
color: var(--sys-color-primary);
|
|
19
|
-
font-size: 12px;
|
|
20
|
-
font-style: normal;
|
|
21
|
-
font-weight: 400;
|
|
22
|
-
line-height: 18px;
|
|
23
|
-
margin-top: 8px;
|
|
24
|
-
padding-left: var(--sys-size-6);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
li {
|
|
28
|
-
list-style-type: none;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
ul .link {
|
|
32
|
-
color: var(--sys-color-primary);
|
|
33
|
-
display: inline-flex !important; /* stylelint-disable-line declaration-no-important */
|
|
34
|
-
align-items: center;
|
|
35
|
-
gap: 4px;
|
|
36
|
-
text-decoration-line: underline;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
devtools-icon {
|
|
40
|
-
height: 16px;
|
|
41
|
-
width: 16px;
|
|
42
|
-
margin-right: var(--sys-size-1);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
devtools-icon[name="open-externally"] {
|
|
46
|
-
color: var(--icon-link);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.source-disclaimer {
|
|
50
|
-
color: var(--sys-color-on-surface-subtle);
|
|
51
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// Copyright 2018 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
|
-
|
|
6
|
-
import type * as Common from '../../core/common/common.js';
|
|
7
|
-
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
-
|
|
9
|
-
interface Color {
|
|
10
|
-
r: number;
|
|
11
|
-
g: number;
|
|
12
|
-
b: number;
|
|
13
|
-
a: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class CLSRect {
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
color: Color;
|
|
22
|
-
outlineColor: Color;
|
|
23
|
-
constructor([x, y, width, height]: [number, number, number, number]) {
|
|
24
|
-
this.x = x;
|
|
25
|
-
this.y = y;
|
|
26
|
-
this.width = width;
|
|
27
|
-
this.height = height;
|
|
28
|
-
this.color = {r: 238, g: 111, b: 99, a: 0.4};
|
|
29
|
-
this.outlineColor = {r: 238, g: 111, b: 99, a: 0.7};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
let linkifierInstance: Linkifier;
|
|
34
|
-
|
|
35
|
-
export class Linkifier implements Common.Linkifier.Linkifier {
|
|
36
|
-
static instance(opts: {
|
|
37
|
-
forceNew: boolean|null,
|
|
38
|
-
} = {forceNew: null}): Linkifier {
|
|
39
|
-
const {forceNew} = opts;
|
|
40
|
-
if (!linkifierInstance || forceNew) {
|
|
41
|
-
linkifierInstance = new Linkifier();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return linkifierInstance;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
linkify(object: Object, _options?: Common.Linkifier.Options): Node {
|
|
48
|
-
const link = document.createElement('span');
|
|
49
|
-
const rect = (object as CLSRect);
|
|
50
|
-
const {x, y, width, height} = rect;
|
|
51
|
-
link.textContent = `Location: [${x},${y}], Size: [${width}x${height}]`;
|
|
52
|
-
|
|
53
|
-
link.addEventListener('mouseover', () => SDK.OverlayModel.OverlayModel.highlightRect(rect));
|
|
54
|
-
link.addEventListener('mouseleave', () => SDK.OverlayModel.OverlayModel.clearHighlight());
|
|
55
|
-
|
|
56
|
-
return link;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# Listening to and dispatching events
|
|
2
|
-
|
|
3
|
-
Within your component it is likely that you will need to listen to user events, or dispatch custom events to enable other components to be notified of some event or user action.
|
|
4
|
-
|
|
5
|
-
## Listening to events
|
|
6
|
-
|
|
7
|
-
To bind event listeners, we can use Lit-Html's event binding syntax in our template. Take the event you want to listen to, and prefix it with a `@`:
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
LitHtml.render(LitHtml.html`
|
|
11
|
-
<button @click=${this.#onButtonClick}>Click me!</button>
|
|
12
|
-
`, this.#shadow, {host: this});
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Event listeners are defined as private class methods that will be called with an `Event`:
|
|
16
|
-
|
|
17
|
-
```ts
|
|
18
|
-
#onButtonClick(event: Event): void {
|
|
19
|
-
// ...
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
You do not need to worry about the event listener not being bound to the component's scope - Lit-Html takes care of this when we pass `{host: this}` into the `LitHtml.render` call. This tells Lit to bind event listeners on our behalf. In DevTools we have an ESLint rule which ensures that we use this option, so you cannot forget it!
|
|
24
|
-
|
|
25
|
-
## Dispatching events
|
|
26
|
-
|
|
27
|
-
Sometimes you may need to dispatch an event from your component that another element higher in the DOM tree can listen to.
|
|
28
|
-
|
|
29
|
-
The first step is to define the custom event. You do this by extending the built in `Event` class:
|
|
30
|
-
|
|
31
|
-
```ts
|
|
32
|
-
export class AddBreakpointEvent extends Event {
|
|
33
|
-
static readonly eventName = 'addbreakpoint';
|
|
34
|
-
|
|
35
|
-
constructor(public index: number) {
|
|
36
|
-
super(AddBreakpointEvent.eventName, {bubbles: true, composed: true});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Custom events must have a `static readonly eventName` property (this is also enforced by an ESLint rule). We try to mimic the conventions of built in DOM events - event names should be lowercase and contain no spaces or dashes.
|
|
42
|
-
|
|
43
|
-
They must also define a `constructor` which takes in any data that you want to be available on this event. This is how you can attach information to the events you dispatch for listeners to have access to. By declaring a `public node: DOMNode` above, we are declaring that this event must be initialised with a `node`, and that listeners will be able to access it via `event.node`.
|
|
44
|
-
|
|
45
|
-
Within the constructor, we call `super` with our custom event name. We then pass two options in which are recommended (but not required if you know you do not need them):
|
|
46
|
-
|
|
47
|
-
1. `bubbles`: setting this to `true` means that when this event is emitted it will bubble up through the DOM tree. You usually want this because it is how built in browser events behave and it means that any listeners can be anywhere "above" the element that is dispatching the event and still be able to listen for it.
|
|
48
|
-
2. `composed`: this setting declares if the event will propogate through the shadow boundary and into the standard DOM. Setting this to `false` means that all event listeners must be within the shadow DOM to be able to listen to the event.
|
|
49
|
-
|
|
50
|
-
MDN has some useful articles on these concepts if you want to learn more:
|
|
51
|
-
|
|
52
|
-
1. [Introduction to Events: Event bubbling](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_bubbling)
|
|
53
|
-
2. [Event: composed property](https://developer.mozilla.org/en-US/docs/Web/API/Event/composed)
|
|
54
|
-
3. [Using shadow DOM](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM)
|