chrome-devtools-frontend 1.0.1602348 → 1.0.1602543
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/AUTHORS +1 -0
- package/front_end/core/common/Settings.ts +1 -871
- package/front_end/core/common/VersionController.ts +880 -0
- package/front_end/core/common/common.ts +2 -0
- package/front_end/core/platform/HostRuntime.ts +9 -3
- package/front_end/core/protocol_client/InspectorBackend.ts +8 -0
- package/front_end/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/Target.ts +5 -0
- package/front_end/core/sdk/WebMCPModel.ts +98 -0
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +13 -19
- package/front_end/models/ai_assistance/AiConversation.ts +3 -3
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +50 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +14 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +19 -4
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +7 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +14 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +0 -23
- package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +7 -7
- package/front_end/models/lighthouse/RunTypes.ts +3 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +9 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +69 -8
- package/front_end/panels/ai_assistance/components/chatMessage.css +31 -2
- package/front_end/panels/application/AppManifestView.ts +2 -2
- package/front_end/panels/application/BackgroundServiceView.ts +9 -9
- package/front_end/panels/application/FrameDetailsView.ts +4 -13
- package/front_end/panels/application/IndexedDBViews.ts +1 -1
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +3 -3
- package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -1
- package/front_end/panels/application/components/permissionsPolicySection.css +54 -52
- package/front_end/panels/application/frameDetailsReportView.css +13 -1
- package/front_end/panels/elements/CSSValueTraceView.ts +9 -1
- package/front_end/panels/elements/PropertiesWidget.ts +14 -13
- package/front_end/panels/elements/PropertyRenderer.ts +10 -9
- package/front_end/panels/elements/StandaloneStylesContainer.ts +15 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +20 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +34 -25
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +5 -0
- package/front_end/panels/issues/AffectedSelectivePermissionsInterventionView.ts +2 -2
- package/front_end/panels/lighthouse/LighthouseController.ts +4 -1
- package/front_end/panels/media/EventDisplayTable.ts +3 -2
- package/front_end/panels/network/EventSourceMessagesView.ts +2 -2
- package/front_end/panels/network/ResourceChunkView.ts +1 -1
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +9 -4
- package/front_end/panels/profiler/HeapProfileView.ts +8 -4
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +40 -33
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotProxy.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +12 -18
- package/front_end/panels/profiler/LiveHeapProfileView.ts +3 -4
- package/front_end/panels/profiler/ProfileHeader.ts +5 -11
- package/front_end/panels/profiler/ProfileView.ts +1 -1
- package/front_end/panels/sensors/SensorsView.ts +24 -43
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +2 -2
- package/front_end/panels/timeline/TimelineTreeView.ts +19 -17
- package/front_end/panels/timeline/components/timelineRangeSummaryView.css +3 -1
- package/front_end/panels/webauthn/WebauthnPane.ts +52 -0
- package/front_end/ui/legacy/Treeoutline.ts +7 -3
- package/front_end/ui/legacy/UIUtils.ts +13 -11
- package/front_end/ui/legacy/Widget.ts +5 -0
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/SortableDataGrid.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +39 -23
- package/front_end/ui/legacy/components/perf_ui/GCActionDelegate.ts +20 -4
- package/front_end/ui/legacy/treeoutline.css +4 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/package.json +1 -1
|
@@ -888,8 +888,12 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
888
888
|
return await TimelinePanel.TimelinePanel.TimelinePanel.executeRecordAndReload();
|
|
889
889
|
}
|
|
890
890
|
|
|
891
|
-
async #handleLighthouseRun(
|
|
892
|
-
|
|
891
|
+
async #handleLighthouseRun(overrides?: LHModel.RunTypes.RunOverrides):
|
|
892
|
+
Promise<LHModel.ReporterTypes.ReportJSON|null> {
|
|
893
|
+
return await LighthousePanel.LighthousePanel.LighthousePanel.executeLighthouseRecording({
|
|
894
|
+
isAIControlled: true,
|
|
895
|
+
...overrides,
|
|
896
|
+
});
|
|
893
897
|
}
|
|
894
898
|
|
|
895
899
|
#getDefaultConversationType(): AiAssistanceModel.AiHistoryStorage.ConversationType|undefined {
|
|
@@ -988,6 +992,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
988
992
|
performanceRecordAndReload: this.#handlePerformanceRecordAndReload.bind(this),
|
|
989
993
|
onInspectElement: this.#handleInspectElement.bind(this),
|
|
990
994
|
networkTimeCalculator: NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator(),
|
|
995
|
+
lighthouseRecording: this.#handleLighthouseRun.bind(this),
|
|
991
996
|
});
|
|
992
997
|
}
|
|
993
998
|
}
|
|
@@ -1026,6 +1031,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1026
1031
|
performanceRecordAndReload: this.#handlePerformanceRecordAndReload.bind(this),
|
|
1027
1032
|
onInspectElement: this.#handleInspectElement.bind(this),
|
|
1028
1033
|
networkTimeCalculator: NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator(),
|
|
1034
|
+
lighthouseRecording: this.#handleLighthouseRun.bind(this),
|
|
1029
1035
|
});
|
|
1030
1036
|
this.#updateConversationState(conversation);
|
|
1031
1037
|
this.#conversation?.setContext(context);
|
|
@@ -1501,6 +1507,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1501
1507
|
performanceRecordAndReload: this.#handlePerformanceRecordAndReload.bind(this),
|
|
1502
1508
|
onInspectElement: this.#handleInspectElement.bind(this),
|
|
1503
1509
|
networkTimeCalculator: NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator(),
|
|
1510
|
+
lighthouseRecording: this.#handleLighthouseRun.bind(this),
|
|
1504
1511
|
});
|
|
1505
1512
|
}
|
|
1506
1513
|
this.#updateConversationState(conversation);
|
|
@@ -14,9 +14,10 @@ import * as SDK from '../../../core/sdk/sdk.js';
|
|
|
14
14
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
15
15
|
import type {
|
|
16
16
|
AiWidget, ComputedStyleAiWidget, CoreVitalsAiWidget, DomTreeAiWidget, LcpBreakdownAiWidget, PerformanceTraceAiWidget,
|
|
17
|
-
StylePropertiesAiWidget} from '../../../models/ai_assistance/agents/AiAgent.js';
|
|
17
|
+
StylePropertiesAiWidget, TimelineRangeSummaryAiWidget} from '../../../models/ai_assistance/agents/AiAgent.js';
|
|
18
18
|
import * as AiAssistanceModel from '../../../models/ai_assistance/ai_assistance.js';
|
|
19
19
|
import * as ComputedStyle from '../../../models/computed_style/computed_style.js';
|
|
20
|
+
import * as Trace from '../../../models/trace/trace.js';
|
|
20
21
|
import * as Marked from '../../../third_party/marked/marked.js';
|
|
21
22
|
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
22
23
|
import * as Input from '../../../ui/components/input/input.js';
|
|
@@ -656,6 +657,7 @@ interface WidgetMakerResponse {
|
|
|
656
657
|
renderedWidget: Lit.LitTemplate|null;
|
|
657
658
|
revealable: unknown;
|
|
658
659
|
customRevealTitle?: Platform.UIString.LocalizedString;
|
|
660
|
+
widgetName?: string;
|
|
659
661
|
}
|
|
660
662
|
|
|
661
663
|
const nodeCache = new Map<Protocol.DOM.BackendNodeId, SDK.DOMModel.DOMNode>();
|
|
@@ -764,21 +766,36 @@ function renderWidgetResponse(response: WidgetMakerResponse|null): Lit.LitTempla
|
|
|
764
766
|
'widget-and-revealer-container': true,
|
|
765
767
|
'revealer-only': response.renderedWidget === null,
|
|
766
768
|
});
|
|
769
|
+
|
|
770
|
+
const revealButton = html`
|
|
771
|
+
<devtools-button class="widget-reveal"
|
|
772
|
+
.iconName=${'tab-move'}
|
|
773
|
+
.variant=${Buttons.Button.Variant.TEXT}
|
|
774
|
+
@click=${onReveal}
|
|
775
|
+
>${response.customRevealTitle ?? lockedString(UIStringsNotTranslate.reveal)}</devtools-button>
|
|
776
|
+
`;
|
|
777
|
+
|
|
767
778
|
// clang-format off
|
|
768
779
|
return html`
|
|
769
780
|
<div class=${classes}>
|
|
781
|
+
${response.widgetName ? html`
|
|
782
|
+
<div class="widget-header">
|
|
783
|
+
<div class="widget-name">${response.widgetName}</div>
|
|
784
|
+
<div class="widget-reveal-container">
|
|
785
|
+
${revealButton}
|
|
786
|
+
</div>
|
|
787
|
+
</div>
|
|
788
|
+
` : Lit.nothing}
|
|
770
789
|
${response.renderedWidget ? html`
|
|
771
790
|
<div class="widget-content-container">
|
|
772
791
|
${response.renderedWidget}
|
|
773
792
|
</div>` : Lit.nothing
|
|
774
793
|
}
|
|
775
|
-
|
|
776
|
-
<
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
>${response.customRevealTitle ?? lockedString(UIStringsNotTranslate.reveal)}</devtools-button>
|
|
781
|
-
</div>
|
|
794
|
+
${!response.widgetName ? html`
|
|
795
|
+
<div class="widget-reveal-container">
|
|
796
|
+
${revealButton}
|
|
797
|
+
</div>
|
|
798
|
+
` : Lit.nothing}
|
|
782
799
|
</div>
|
|
783
800
|
`;
|
|
784
801
|
// clang-format on
|
|
@@ -846,6 +863,7 @@ async function makeDomTreeWidget(widgetData: DomTreeAiWidget): Promise<WidgetMak
|
|
|
846
863
|
return {
|
|
847
864
|
renderedWidget,
|
|
848
865
|
revealable: new SDK.DOMModel.DeferredDOMNode(root.domModel().target(), root.backendNodeId()),
|
|
866
|
+
widgetName: 'LCP element',
|
|
849
867
|
};
|
|
850
868
|
}
|
|
851
869
|
|
|
@@ -892,6 +910,9 @@ async function renderWidgets(
|
|
|
892
910
|
case 'LCP_BREAKDOWN':
|
|
893
911
|
response = await makeLcpBreakdownWidget(widgetData);
|
|
894
912
|
break;
|
|
913
|
+
case 'TIMELINE_RANGE_SUMMARY':
|
|
914
|
+
response = await makeTimelineRangeSummaryWidget(widgetData);
|
|
915
|
+
break;
|
|
895
916
|
default:
|
|
896
917
|
Platform.assertNever(widgetData, 'Unknown AiWidget name');
|
|
897
918
|
}
|
|
@@ -1318,3 +1339,43 @@ export class ChatMessage extends UI.Widget.Widget {
|
|
|
1318
1339
|
void this.performUpdate();
|
|
1319
1340
|
}
|
|
1320
1341
|
}
|
|
1342
|
+
|
|
1343
|
+
async function makeTimelineRangeSummaryWidget(widgetData: TimelineRangeSummaryAiWidget):
|
|
1344
|
+
Promise<WidgetMakerResponse|null> {
|
|
1345
|
+
const {bounds, parsedTrace, track} = widgetData.data;
|
|
1346
|
+
let events: readonly Trace.Types.Events.Event[] = [];
|
|
1347
|
+
if (track === 'main') {
|
|
1348
|
+
const flameChartView = Timeline.TimelinePanel.TimelinePanel.instance().getFlameChart();
|
|
1349
|
+
const mainDataProvider = flameChartView.getMainDataProvider();
|
|
1350
|
+
const mainTrack =
|
|
1351
|
+
mainDataProvider.timelineData().groups.find((group: {name: string}) => group.name.startsWith('Main \u2014 '));
|
|
1352
|
+
if (mainTrack) {
|
|
1353
|
+
events = mainDataProvider.groupTreeEvents(mainTrack) ?? [];
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
const eventsArray = Array.from(events);
|
|
1357
|
+
eventsArray.sort((a, b) => a.ts - b.ts);
|
|
1358
|
+
|
|
1359
|
+
const thirdPartyTree = new Timeline.ThirdPartyTreeView.ThirdPartyTreeViewWidget();
|
|
1360
|
+
const mapper = new Trace.EntityMapper.EntityMapper(parsedTrace);
|
|
1361
|
+
thirdPartyTree.setModelWithEvents(eventsArray, parsedTrace, mapper);
|
|
1362
|
+
thirdPartyTree.refreshTree(true);
|
|
1363
|
+
|
|
1364
|
+
// clang-format off
|
|
1365
|
+
const template = html`
|
|
1366
|
+
<devtools-widget
|
|
1367
|
+
${widget(TimelineComponents.TimelineRangeSummaryView.TimelineRangeSummaryView, {
|
|
1368
|
+
data: {
|
|
1369
|
+
parsedTrace,
|
|
1370
|
+
events,
|
|
1371
|
+
startTime: Trace.Helpers.Timing.microToMilli(bounds.min),
|
|
1372
|
+
endTime: Trace.Helpers.Timing.microToMilli(bounds.max),
|
|
1373
|
+
thirdPartyTreeTemplate: html`<devtools-performance-third-party-tree-view
|
|
1374
|
+
.treeView=${thirdPartyTree}></devtools-performance-third-party-tree-view>`,
|
|
1375
|
+
} as TimelineComponents.TimelineRangeSummaryView.TimelineRangeSummaryViewData,
|
|
1376
|
+
})}
|
|
1377
|
+
></devtools-widget>`;
|
|
1378
|
+
// clang-format on
|
|
1379
|
+
|
|
1380
|
+
return {renderedWidget: template, revealable: null};
|
|
1381
|
+
}
|
|
@@ -372,8 +372,25 @@
|
|
|
372
372
|
gap: var(--sys-size-5);
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
-
|
|
376
|
-
|
|
375
|
+
|
|
376
|
+
.widget-header {
|
|
377
|
+
display: flex;
|
|
378
|
+
justify-content: space-between;
|
|
379
|
+
align-items: center;
|
|
380
|
+
background: var(--sys-color-surface5);
|
|
381
|
+
padding: var(--sys-size-2) var(--sys-size-4);
|
|
382
|
+
border-top-left-radius: var(--sys-shape-corner-medium);
|
|
383
|
+
border-top-right-radius: var(--sys-shape-corner-medium);
|
|
384
|
+
|
|
385
|
+
.widget-name {
|
|
386
|
+
font: var(--sys-typescale-body3-regular);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.widget-reveal-container {
|
|
390
|
+
padding: 0;
|
|
391
|
+
background: none;
|
|
392
|
+
border-radius: 0;
|
|
393
|
+
}
|
|
377
394
|
}
|
|
378
395
|
|
|
379
396
|
.widget-reveal-container {
|
|
@@ -396,6 +413,18 @@
|
|
|
396
413
|
background-color: var(--sys-color-surface3);
|
|
397
414
|
|
|
398
415
|
--override-computed-style-property-white-space: normal;
|
|
416
|
+
|
|
417
|
+
/* When header is present, content follows it and shouldn't have top radii */
|
|
418
|
+
.widget-header+& {
|
|
419
|
+
border-top-left-radius: 0;
|
|
420
|
+
border-top-right-radius: 0;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/* When header is present, content is the last child and needs bottom radii */
|
|
424
|
+
.widget-header+&:last-child {
|
|
425
|
+
border-bottom-left-radius: var(--sys-shape-corner-medium);
|
|
426
|
+
border-bottom-right-radius: var(--sys-shape-corner-medium);
|
|
427
|
+
}
|
|
399
428
|
}
|
|
400
429
|
|
|
401
430
|
.network-request-preview {
|
|
@@ -1106,8 +1106,8 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
1106
1106
|
${identityData && onCopyId ? renderIdentity(identityData, onCopyId, output) : nothing}
|
|
1107
1107
|
${presentationData ? renderPresentation(presentationData, output) : nothing}
|
|
1108
1108
|
${protocolHandlersData ? renderProtocolHandlers(protocolHandlersData, output) : nothing}
|
|
1109
|
-
${iconsData && onToggleIconMasked
|
|
1110
|
-
renderIcons(iconsData, maskedIcons, onToggleIconMasked, output) : nothing}
|
|
1109
|
+
${iconsData && onToggleIconMasked ?
|
|
1110
|
+
renderIcons(iconsData, Boolean(maskedIcons), onToggleIconMasked, output) : nothing}
|
|
1111
1111
|
${windowControlsData && output ? renderWindowControlsSection(
|
|
1112
1112
|
windowControlsData, selectedPlatform, onSelectOs, onToggleWcoToolbar, output) : nothing}
|
|
1113
1113
|
${shortcutsData ? renderShortcuts(shortcutsData) : nothing}
|
|
@@ -384,15 +384,15 @@ export class BackgroundServiceView extends UI.Widget.VBox {
|
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
private createDataGrid(): DataGrid.DataGrid.DataGridImpl<EventData> {
|
|
387
|
-
const columns =
|
|
388
|
-
{id: 'id', title: '#', weight: 1},
|
|
389
|
-
{id: 'timestamp', title: i18nString(UIStrings.timestamp), weight: 7},
|
|
390
|
-
{id: 'event-name', title: i18nString(UIStrings.event), weight: 8},
|
|
391
|
-
{id: 'origin', title: i18nString(UIStrings.origin), weight: 8},
|
|
392
|
-
{id: 'storage-key', title: i18nString(UIStrings.storageKey), weight: 8},
|
|
393
|
-
{id: 'sw-scope', title: i18nString(UIStrings.swScope), weight: 4},
|
|
394
|
-
{id: 'instance-id', title: i18nString(UIStrings.instanceId), weight: 8},
|
|
395
|
-
]
|
|
387
|
+
const columns: DataGrid.DataGrid.ColumnDescriptor[] = [
|
|
388
|
+
{id: 'id', title: '#' as Common.UIString.LocalizedString, weight: 1, sortable: false},
|
|
389
|
+
{id: 'timestamp', title: i18nString(UIStrings.timestamp), weight: 7, sortable: false},
|
|
390
|
+
{id: 'event-name', title: i18nString(UIStrings.event), weight: 8, sortable: false},
|
|
391
|
+
{id: 'origin', title: i18nString(UIStrings.origin), weight: 8, sortable: false},
|
|
392
|
+
{id: 'storage-key', title: i18nString(UIStrings.storageKey), weight: 8, sortable: false},
|
|
393
|
+
{id: 'sw-scope', title: i18nString(UIStrings.swScope), weight: 4, sortable: false},
|
|
394
|
+
{id: 'instance-id', title: i18nString(UIStrings.instanceId), weight: 8, sortable: false},
|
|
395
|
+
];
|
|
396
396
|
const dataGrid = new DataGrid.DataGrid.DataGridImpl({
|
|
397
397
|
displayName: i18nString(UIStrings.backgroundServices),
|
|
398
398
|
columns,
|
|
@@ -268,7 +268,7 @@ export interface FrameDetailsReportViewData {
|
|
|
268
268
|
adScriptAncestry: Protocol.Network.AdAncestry|null;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
interface FrameDetailsViewInput {
|
|
271
|
+
export interface FrameDetailsViewInput {
|
|
272
272
|
frame: SDK.ResourceTreeModel.ResourceTreeFrame;
|
|
273
273
|
target: SDK.Target.Target|null;
|
|
274
274
|
creationStackTrace: StackTrace.StackTrace.StackTrace|null;
|
|
@@ -282,9 +282,9 @@ interface FrameDetailsViewInput {
|
|
|
282
282
|
onRevealInSources: () => void;
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
type View = (input: FrameDetailsViewInput, output: undefined, target: HTMLElement) => void;
|
|
285
|
+
export type View = (input: FrameDetailsViewInput, output: undefined, target: HTMLElement) => void;
|
|
286
286
|
|
|
287
|
-
const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
287
|
+
export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
288
288
|
if (!input.frame) {
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
@@ -892,16 +892,7 @@ export class FrameDetailsReportView extends UI.Widget.Widget {
|
|
|
892
892
|
const result = await this.#frame?.parentFrame()?.getAdScriptAncestry(this.#frame?.id);
|
|
893
893
|
if (result && result.ancestryChain.length > 0) {
|
|
894
894
|
this.#adScriptAncestry = result;
|
|
895
|
-
|
|
896
|
-
// Obtain the Target associated with the first ad script, because in most scenarios all
|
|
897
|
-
// scripts share the same debuggerId. However, discrepancies might arise when content scripts
|
|
898
|
-
// from browser extensions are involved. We will monitor the debugging experiences and revisit
|
|
899
|
-
// this approach if it proves problematic.
|
|
900
|
-
const firstScript = this.#adScriptAncestry.ancestryChain[0];
|
|
901
|
-
const debuggerModel = firstScript?.debuggerId ?
|
|
902
|
-
await SDK.DebuggerModel.DebuggerModel.modelForDebuggerId(firstScript.debuggerId) :
|
|
903
|
-
null;
|
|
904
|
-
this.#target = debuggerModel?.target() ?? null;
|
|
895
|
+
this.#target = this.#frame?.resourceTreeModel().target() ?? null;
|
|
905
896
|
}
|
|
906
897
|
|
|
907
898
|
const frame = this.#frame;
|
|
@@ -320,7 +320,7 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
320
320
|
private createDataGrid(): DataGrid.DataGrid.DataGridImpl<unknown> {
|
|
321
321
|
const keyPath = this.isIndex && this.index ? this.index.keyPath : this.objectStore.keyPath;
|
|
322
322
|
|
|
323
|
-
const columns
|
|
323
|
+
const columns: DataGrid.DataGrid.ColumnDescriptor[] = [];
|
|
324
324
|
|
|
325
325
|
// Create column defaults so that we avoid repetition below.
|
|
326
326
|
const columnDefaults: Partial<DataGrid.DataGrid.ColumnDescriptor> = {
|
|
@@ -210,8 +210,8 @@ export class ServiceWorkerCacheView extends UI.View.SimpleView {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
private createDataGrid(): DataGrid.DataGrid.DataGridImpl<DataGridNode> {
|
|
213
|
-
const columns =
|
|
214
|
-
{id: 'number', title: '#', sortable: false, width: '3px'},
|
|
213
|
+
const columns: DataGrid.DataGrid.ColumnDescriptor[] = [
|
|
214
|
+
{id: 'number', title: '#' as Common.UIString.LocalizedString, sortable: false, width: '3px'},
|
|
215
215
|
{id: 'name', title: i18nString(UIStrings.name), weight: 4, sortable: true},
|
|
216
216
|
{
|
|
217
217
|
id: 'response-type',
|
|
@@ -237,7 +237,7 @@ export class ServiceWorkerCacheView extends UI.View.SimpleView {
|
|
|
237
237
|
sortable: true,
|
|
238
238
|
},
|
|
239
239
|
{id: 'vary-header', title: i18n.i18n.lockedString('Vary Header'), weight: 1, sortable: true},
|
|
240
|
-
]
|
|
240
|
+
];
|
|
241
241
|
const dataGrid = new DataGrid.DataGrid.DataGridImpl({
|
|
242
242
|
displayName: i18nString(UIStrings.serviceWorkerCache),
|
|
243
243
|
columns,
|
|
@@ -219,7 +219,7 @@ export class PermissionsPolicySection extends UI.Widget.Widget {
|
|
|
219
219
|
#view: View;
|
|
220
220
|
|
|
221
221
|
constructor(element?: HTMLElement, view = DEFAULT_VIEW) {
|
|
222
|
-
super(element, {useShadowDom:
|
|
222
|
+
super(element, {useShadowDom: false});
|
|
223
223
|
this.#view = view;
|
|
224
224
|
}
|
|
225
225
|
|
|
@@ -4,56 +4,58 @@
|
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
7
|
+
@scope to (devtools-widget > *) {
|
|
8
|
+
:scope {
|
|
9
|
+
display: contents;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.text-ellipsis {
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
text-overflow: ellipsis;
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.link,
|
|
19
|
+
.devtools-link {
|
|
20
|
+
color: var(--sys-color-primary);
|
|
21
|
+
text-decoration: underline;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
outline-offset: 2px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
button.link {
|
|
27
|
+
border: none;
|
|
28
|
+
background: none;
|
|
29
|
+
font-family: inherit;
|
|
30
|
+
font-size: inherit;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.policies-list {
|
|
34
|
+
padding-top: 3px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.permissions-row {
|
|
38
|
+
display: flex;
|
|
39
|
+
line-height: 22px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.permissions-row div {
|
|
43
|
+
padding-right: 5px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.feature-name {
|
|
47
|
+
width: 135px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.allowed-icon {
|
|
51
|
+
vertical-align: sub;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.block-reason {
|
|
55
|
+
width: 215px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.disabled-features-button {
|
|
59
|
+
padding-left: var(--sys-size-3);
|
|
60
|
+
}
|
|
59
61
|
}
|
|
@@ -79,6 +79,18 @@ button.text-link {
|
|
|
79
79
|
display: flex;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
.inline-items devtools-button {
|
|
83
|
+
flex: 0 0 20px;
|
|
84
|
+
width: 20px;
|
|
85
|
+
height: 20px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.inline-items .text-ellipsis {
|
|
89
|
+
flex: 0 1 auto;
|
|
90
|
+
min-width: 0;
|
|
91
|
+
padding-left: 2px;
|
|
92
|
+
}
|
|
93
|
+
|
|
82
94
|
.span-cols {
|
|
83
95
|
grid-column-start: span 2;
|
|
84
96
|
margin-left: var(--sys-size-9);
|
|
@@ -115,4 +127,4 @@ button.text-link {
|
|
|
115
127
|
color: linktext;
|
|
116
128
|
text-decoration-color: linktext;
|
|
117
129
|
}
|
|
118
|
-
}
|
|
130
|
+
}
|
|
@@ -128,6 +128,7 @@ export class CSSValueTraceView extends UI.Widget.VBox {
|
|
|
128
128
|
expandPercentagesInShorthands: boolean,
|
|
129
129
|
shorthandPositionOffset: number,
|
|
130
130
|
focus: boolean,
|
|
131
|
+
signal?: AbortSignal,
|
|
131
132
|
): Promise<void> {
|
|
132
133
|
const matchedResult = subexpression === null ?
|
|
133
134
|
property.parseValue(matchedStyles, computedStyles) :
|
|
@@ -136,7 +137,7 @@ export class CSSValueTraceView extends UI.Widget.VBox {
|
|
|
136
137
|
return undefined;
|
|
137
138
|
}
|
|
138
139
|
return await this.#showTrace(
|
|
139
|
-
property, matchedResult, renderers, expandPercentagesInShorthands, shorthandPositionOffset, focus);
|
|
140
|
+
property, matchedResult, renderers, expandPercentagesInShorthands, shorthandPositionOffset, focus, signal);
|
|
140
141
|
}
|
|
141
142
|
|
|
142
143
|
async #showTrace(
|
|
@@ -146,6 +147,7 @@ export class CSSValueTraceView extends UI.Widget.VBox {
|
|
|
146
147
|
expandPercentagesInShorthands: boolean,
|
|
147
148
|
shorthandPositionOffset: number,
|
|
148
149
|
focus: boolean,
|
|
150
|
+
signal?: AbortSignal,
|
|
149
151
|
): Promise<void> {
|
|
150
152
|
this.#highlighting = new Highlighting();
|
|
151
153
|
const rendererMap = new Map(renderers.map(r => [r.matchType, r]));
|
|
@@ -165,6 +167,7 @@ export class CSSValueTraceView extends UI.Widget.VBox {
|
|
|
165
167
|
/* cssControls */ undefined,
|
|
166
168
|
/* options */ {},
|
|
167
169
|
tracing,
|
|
170
|
+
signal,
|
|
168
171
|
);
|
|
169
172
|
substitutions.push(Renderer.render(matchedResult.ast.tree, context).nodes);
|
|
170
173
|
}
|
|
@@ -180,6 +183,7 @@ export class CSSValueTraceView extends UI.Widget.VBox {
|
|
|
180
183
|
/* cssControls */ undefined,
|
|
181
184
|
/* options */ {},
|
|
182
185
|
tracing,
|
|
186
|
+
signal,
|
|
183
187
|
);
|
|
184
188
|
evaluations.push(Renderer.render(matchedResult.ast.tree, context).nodes);
|
|
185
189
|
asyncCallbackResults.push(tracing.runAsyncEvaluations());
|
|
@@ -199,6 +203,10 @@ export class CSSValueTraceView extends UI.Widget.VBox {
|
|
|
199
203
|
property,
|
|
200
204
|
rendererMap,
|
|
201
205
|
matchedResult,
|
|
206
|
+
undefined,
|
|
207
|
+
{},
|
|
208
|
+
undefined,
|
|
209
|
+
signal,
|
|
202
210
|
);
|
|
203
211
|
this.#evaluations.push(Renderer.render(matchedResult.ast.tree, context).nodes);
|
|
204
212
|
}
|
|
@@ -40,7 +40,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
40
40
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
41
41
|
import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
|
42
42
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
43
|
-
import {html, nothing, render} from '../../ui/lit/lit.js';
|
|
43
|
+
import {Directives, html, nothing, render} from '../../ui/lit/lit.js';
|
|
44
44
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
45
45
|
|
|
46
46
|
import propertiesWidgetStyles from './propertiesWidget.css.js';
|
|
@@ -48,6 +48,7 @@ import propertiesWidgetStyles from './propertiesWidget.css.js';
|
|
|
48
48
|
const OBJECT_GROUP_NAME = 'properties-sidebar-pane';
|
|
49
49
|
|
|
50
50
|
const {bindToSetting} = UI.UIUtils;
|
|
51
|
+
const {repeat} = Directives;
|
|
51
52
|
|
|
52
53
|
const UIStrings = {
|
|
53
54
|
/**
|
|
@@ -75,7 +76,6 @@ interface PropertiesWidgetInput {
|
|
|
75
76
|
onFilterChanged: (e: CustomEvent<string>) => void;
|
|
76
77
|
onRegexToggled: () => void;
|
|
77
78
|
isRegex: boolean;
|
|
78
|
-
treeOutline: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline;
|
|
79
79
|
objectTree: ObjectUI.ObjectPropertiesSection.ObjectTree|null;
|
|
80
80
|
allChildrenFiltered: boolean;
|
|
81
81
|
}
|
|
@@ -103,7 +103,17 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
103
103
|
${input.objectTree && input.allChildrenFiltered ? html`
|
|
104
104
|
<div class="gray-info-message">${i18nString(UIStrings.noMatchingProperty)}</div>
|
|
105
105
|
` : nothing}
|
|
106
|
-
|
|
106
|
+
<devtools-tree .template=${html`
|
|
107
|
+
<ul role=tree class="source-code object-properties-section">
|
|
108
|
+
<style>${ObjectUI.ObjectPropertiesSection.objectValueStyles}</style>;
|
|
109
|
+
<style>${ObjectUI.ObjectPropertiesSection.objectPropertiesSectionStyles}</style>;
|
|
110
|
+
${repeat(ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement.createPropertyNodes(
|
|
111
|
+
input.objectTree?.children ?? {},
|
|
112
|
+
true /* skipProto */,
|
|
113
|
+
true /* skipGettersAndSetters */),
|
|
114
|
+
node => html`<devtools-tree-wrapper .treeElement=${node}></devtools-tree-wrapper>`)}
|
|
115
|
+
</ul>
|
|
116
|
+
`}></devtools-tree>
|
|
107
117
|
</div>`, target);
|
|
108
118
|
// clang-format on
|
|
109
119
|
};
|
|
@@ -218,15 +228,7 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
218
228
|
|
|
219
229
|
override async performUpdate(): Promise<void> {
|
|
220
230
|
await this.#updateNodeIfRequired();
|
|
221
|
-
|
|
222
|
-
this.treeOutline.removeChildren();
|
|
223
|
-
} else {
|
|
224
|
-
const treeElement = this.treeOutline.rootElement();
|
|
225
|
-
treeElement.removeChildren();
|
|
226
|
-
ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement.populateWithProperties(
|
|
227
|
-
treeElement, await this.#objectTree.populateChildrenIfNeeded(), true /* skipProto */,
|
|
228
|
-
true /* skipGettersAndSetters */);
|
|
229
|
-
}
|
|
231
|
+
await this.#objectTree?.populateChildrenIfNeeded();
|
|
230
232
|
const allChildrenFiltered =
|
|
231
233
|
!(this.#objectTree?.children?.accessors?.some(c => !c.isFiltered) ||
|
|
232
234
|
this.#objectTree?.children?.arrayRanges?.some(() => true) ||
|
|
@@ -237,7 +239,6 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
237
239
|
onFilterChanged: this.onFilterChanged.bind(this),
|
|
238
240
|
onRegexToggled: this.onRegexToggled.bind(this),
|
|
239
241
|
isRegex: this.#isRegex,
|
|
240
|
-
treeOutline: this.treeOutline,
|
|
241
242
|
allChildrenFiltered,
|
|
242
243
|
objectTree: this.#objectTree,
|
|
243
244
|
},
|
|
@@ -354,7 +354,7 @@ export class RenderingContext {
|
|
|
354
354
|
MatchRenderer<SDK.CSSPropertyParser.Match>>,
|
|
355
355
|
readonly matchedResult: SDK.CSSPropertyParser.BottomUpTreeMatching,
|
|
356
356
|
readonly cssControls?: SDK.CSSPropertyParser.CSSControlMap, readonly options: {readonly?: boolean} = {},
|
|
357
|
-
readonly tracing?: TracingContext) {
|
|
357
|
+
readonly tracing?: TracingContext, readonly signal?: AbortSignal) {
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
addControl(cssType: string, control: HTMLElement): void {
|
|
@@ -414,11 +414,12 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
|
|
|
414
414
|
readonly?: boolean,
|
|
415
415
|
},
|
|
416
416
|
tracing: TracingContext|undefined,
|
|
417
|
+
signal: AbortSignal|undefined,
|
|
417
418
|
) {
|
|
418
419
|
super(ast);
|
|
419
420
|
this.#matchedResult = matchedResult;
|
|
420
421
|
this.#context =
|
|
421
|
-
new RenderingContext(this.ast, property, renderers, this.#matchedResult, cssControls, options, tracing);
|
|
422
|
+
new RenderingContext(this.ast, property, renderers, this.#matchedResult, cssControls, options, tracing, signal);
|
|
422
423
|
}
|
|
423
424
|
|
|
424
425
|
static render(nodeOrNodes: CodeMirror.SyntaxNode|CodeMirror.SyntaxNode[], context: RenderingContext):
|
|
@@ -430,7 +431,7 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
|
|
|
430
431
|
const renderers = nodeOrNodes.map(
|
|
431
432
|
node => this.walkExcludingSuccessors(
|
|
432
433
|
context.ast.subtree(node), context.property, context.renderers, context.matchedResult, cssControls,
|
|
433
|
-
context.options, context.tracing));
|
|
434
|
+
context.options, context.tracing, context.signal));
|
|
434
435
|
const nodes = renderers.map(node => node.#output).reduce(mergeWithSpacing, []);
|
|
435
436
|
return {nodes, cssControls};
|
|
436
437
|
}
|
|
@@ -491,8 +492,8 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
|
|
|
491
492
|
static renderValueElement(
|
|
492
493
|
property: SDK.CSSProperty.CSSProperty|{name: string, value: string},
|
|
493
494
|
matchedResult: SDK.CSSPropertyParser.BottomUpTreeMatching|null,
|
|
494
|
-
renderers: Array<MatchRenderer<SDK.CSSPropertyParser.Match>>,
|
|
495
|
-
|
|
495
|
+
renderers: Array<MatchRenderer<SDK.CSSPropertyParser.Match>>, tracing?: TracingContext,
|
|
496
|
+
signal?: AbortSignal): {valueElement: HTMLElement, cssControls: SDK.CSSPropertyParser.CSSControlMap} {
|
|
496
497
|
const valueElement = document.createElement('span');
|
|
497
498
|
valueElement.setAttribute(
|
|
498
499
|
'jslog', `${VisualLogging.value().track({
|
|
@@ -502,7 +503,7 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
|
|
|
502
503
|
UI.ARIAUtils.setLabel(valueElement, i18nString(UIStrings.cssPropertyValue, {PH1: property.value}));
|
|
503
504
|
valueElement.className = 'value';
|
|
504
505
|
valueElement.tabIndex = -1;
|
|
505
|
-
const {nodes, cssControls} = this.renderValueNodes(property, matchedResult, renderers, tracing);
|
|
506
|
+
const {nodes, cssControls} = this.renderValueNodes(property, matchedResult, renderers, tracing, signal);
|
|
506
507
|
nodes.forEach(node => valueElement.appendChild(node));
|
|
507
508
|
valueElement.normalize();
|
|
508
509
|
return {valueElement, cssControls};
|
|
@@ -511,8 +512,8 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
|
|
|
511
512
|
static renderValueNodes(
|
|
512
513
|
property: SDK.CSSProperty.CSSProperty|{name: string, value: string},
|
|
513
514
|
matchedResult: SDK.CSSPropertyParser.BottomUpTreeMatching|null,
|
|
514
|
-
renderers: Array<MatchRenderer<SDK.CSSPropertyParser.Match>>,
|
|
515
|
-
|
|
515
|
+
renderers: Array<MatchRenderer<SDK.CSSPropertyParser.Match>>, tracing?: TracingContext,
|
|
516
|
+
signal?: AbortSignal): {nodes: Node[], cssControls: SDK.CSSPropertyParser.CSSControlMap} {
|
|
516
517
|
if (!matchedResult) {
|
|
517
518
|
return {nodes: [document.createTextNode(property.value)], cssControls: new Map()};
|
|
518
519
|
}
|
|
@@ -524,7 +525,7 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
|
|
|
524
525
|
|
|
525
526
|
const context = new RenderingContext(
|
|
526
527
|
matchedResult.ast, property instanceof SDK.CSSProperty.CSSProperty ? property : null, rendererMap,
|
|
527
|
-
matchedResult, undefined, {}, tracing);
|
|
528
|
+
matchedResult, undefined, {}, tracing, signal);
|
|
528
529
|
return Renderer.render([matchedResult.ast.tree, ...matchedResult.ast.trailingNodes], context);
|
|
529
530
|
}
|
|
530
531
|
}
|