chrome-devtools-frontend 1.0.1553956 → 1.0.1555430
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/front_end/Images/src/spark.svg +10 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +1 -1
- package/front_end/core/root/Runtime.ts +0 -4
- package/front_end/core/sdk/DOMModel.ts +101 -7
- package/front_end/core/sdk/ResourceTreeModel.ts +0 -1
- package/front_end/generated/SupportedCSSProperties.js +18 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -1
- package/front_end/{ui/components → models}/annotations/AnnotationRepository.ts +3 -3
- package/front_end/models/annotations/README.md +7 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +15 -23
- package/front_end/models/stack_trace/StackTrace.ts +13 -2
- package/front_end/models/stack_trace/StackTraceImpl.ts +81 -6
- package/front_end/models/stack_trace/StackTraceModel.ts +35 -3
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +45 -4
- package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +57 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +1 -0
- package/front_end/panels/ai_assistance/components/artifactsViewer.css +10 -0
- package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +2 -6
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +133 -118
- package/front_end/panels/application/preloading/PreloadingView.ts +12 -6
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +230 -237
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +96 -79
- package/front_end/panels/application/preloading/components/preloadingGrid.css +26 -29
- package/front_end/panels/application/preloading/preloadingView.css +6 -0
- package/front_end/panels/common/Annotation.ts +1 -1
- package/front_end/panels/common/AnnotationManager.ts +1 -1
- package/front_end/panels/common/ExtensionView.ts +1 -0
- package/front_end/panels/console/ConsoleContextSelector.ts +74 -9
- package/front_end/panels/console/consoleContextSelector.css +31 -29
- package/front_end/panels/coverage/coverageListView.css +59 -57
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +39 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +23 -21
- package/front_end/panels/elements/TopLayerContainer.ts +26 -91
- package/front_end/panels/explain/components/ConsoleInsight.ts +3 -3
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/NetworkLogView.ts +1 -1
- package/front_end/panels/network/NetworkPanel.ts +1 -1
- package/front_end/panels/recorder/RecorderController.ts +0 -1
- package/front_end/panels/security/CookieControlsView.ts +21 -10
- package/front_end/panels/security/SecurityPanelSidebar.ts +5 -0
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +0 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -8
- package/front_end/panels/timeline/components/Sidebar.ts +16 -7
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +169 -129
- package/front_end/panels/timeline/components/TimelineSummary.ts +75 -54
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +16 -25
- package/front_end/panels/timeline/components/insights/Cache.ts +12 -8
- package/front_end/panels/timeline/components/insights/Checklist.ts +53 -43
- package/front_end/panels/timeline/components/insights/DOMSize.ts +25 -21
- package/front_end/panels/timeline/components/insights/DocumentLatency.ts +6 -3
- package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +7 -7
- package/front_end/panels/timeline/components/insights/FontDisplay.ts +7 -5
- package/front_end/panels/timeline/components/insights/ForcedReflow.ts +11 -9
- package/front_end/panels/timeline/components/insights/INPBreakdown.ts +7 -6
- package/front_end/panels/timeline/components/insights/ImageDelivery.ts +7 -5
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +20 -18
- package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +12 -12
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +7 -3
- package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +7 -7
- package/front_end/panels/timeline/components/insights/ModernHTTP.ts +7 -5
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +15 -13
- package/front_end/panels/timeline/components/insights/RenderBlocking.ts +2 -2
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +15 -14
- package/front_end/panels/timeline/components/insights/Table.ts +152 -130
- package/front_end/panels/timeline/components/insights/ThirdParties.ts +11 -9
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +50 -48
- package/front_end/panels/timeline/components/timelineSummary.css +58 -57
- package/front_end/panels/timeline/thirdPartyTreeView.css +109 -0
- package/front_end/panels/timeline/timelineDetailsView.css +2 -4
- package/front_end/panels/timeline/timelinePanel.css +0 -110
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +4 -6
- package/front_end/ui/legacy/TabbedPane.ts +20 -13
- package/front_end/ui/legacy/ViewManager.ts +2 -32
- package/front_end/ui/legacy/Widget.ts +1 -3
- package/front_end/ui/legacy/tabbedPane.css +4 -7
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
- /package/front_end/{ui/components → models}/annotations/AnnotationType.ts +0 -0
- /package/front_end/{ui/components → models}/annotations/annotations.ts +0 -0
|
@@ -342,6 +342,10 @@ const UIStrings = {
|
|
|
342
342
|
* @description Context menu item in Elements panel to explain container context via AI.
|
|
343
343
|
*/
|
|
344
344
|
explainContainerContext: 'Explain container context',
|
|
345
|
+
/**
|
|
346
|
+
* @description Link text content in Elements Tree Outline of the Elements panel. When clicked, it "reveals" the true location of an element.
|
|
347
|
+
*/
|
|
348
|
+
reveal: 'reveal',
|
|
345
349
|
} as const;
|
|
346
350
|
const str_ = i18n.i18n.registerUIStrings('panels/elements/ElementsTreeElement.ts', UIStrings);
|
|
347
351
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -379,10 +383,12 @@ export interface ViewInput {
|
|
|
379
383
|
showGridLanesAdorner: boolean;
|
|
380
384
|
showMediaAdorner: boolean;
|
|
381
385
|
showPopoverAdorner: boolean;
|
|
386
|
+
showTopLayerAdorner: boolean;
|
|
382
387
|
isSubgrid: boolean;
|
|
383
388
|
|
|
384
389
|
adorners?: Set<Adorners.Adorner.Adorner>;
|
|
385
390
|
nodeInfo?: DocumentFragment;
|
|
391
|
+
topLayerIndex: number;
|
|
386
392
|
|
|
387
393
|
onGutterClick: (e: Event) => void;
|
|
388
394
|
onAdornerAdded: (adorner: Adorners.Adorner.Adorner) => void;
|
|
@@ -392,6 +398,7 @@ export interface ViewInput {
|
|
|
392
398
|
onGridAdornerClick: (e: Event) => void;
|
|
393
399
|
onMediaAdornerClick: (e: Event) => void;
|
|
394
400
|
onPopoverAdornerClick: (e: Event) => void;
|
|
401
|
+
onTopLayerAdornerClick: (e: Event) => void;
|
|
395
402
|
}
|
|
396
403
|
|
|
397
404
|
export interface ViewOutput {
|
|
@@ -436,9 +443,11 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
436
443
|
ElementsComponents.AdornerManager.RegisteredAdorners.MEDIA);
|
|
437
444
|
const popoverAdornerConfig = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
438
445
|
ElementsComponents.AdornerManager.RegisteredAdorners.POPOVER);
|
|
446
|
+
const topLayerAdornerConfig = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
447
|
+
ElementsComponents.AdornerManager.RegisteredAdorners.TOP_LAYER);
|
|
439
448
|
const hasAdorners = input.adorners?.size || input.showAdAdorner || input.showContainerAdorner ||
|
|
440
449
|
input.showFlexAdorner || input.showGridAdorner || input.showGridLanesAdorner || input.showMediaAdorner ||
|
|
441
|
-
input.showPopoverAdorner;
|
|
450
|
+
input.showPopoverAdorner || input.showTopLayerAdorner;
|
|
442
451
|
// clang-format off
|
|
443
452
|
render(html`
|
|
444
453
|
<div ${ref(el => { output.contentElement = el as HTMLElement; })}>
|
|
@@ -571,6 +580,25 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
571
580
|
${adornerRef(input)}>
|
|
572
581
|
<span>${popoverAdornerConfig.name}</span>
|
|
573
582
|
</devtools-adorner>`: nothing}
|
|
583
|
+
${input.showTopLayerAdorner ? html`<devtools-adorner
|
|
584
|
+
class=clickable
|
|
585
|
+
role=button
|
|
586
|
+
tabindex=0
|
|
587
|
+
.data=${{name: topLayerAdornerConfig.name, jslogContext: topLayerAdornerConfig.name}}
|
|
588
|
+
jslog=${VisualLogging.adorner(topLayerAdornerConfig.name).track({click: true})}
|
|
589
|
+
aria-label=${i18nString(UIStrings.reveal)}
|
|
590
|
+
@click=${input.onTopLayerAdornerClick}
|
|
591
|
+
@keydown=${(event: KeyboardEvent) => {
|
|
592
|
+
if (event.code === 'Enter' || event.code === 'Space') {
|
|
593
|
+
input.onTopLayerAdornerClick(event);
|
|
594
|
+
event.stopPropagation();
|
|
595
|
+
}
|
|
596
|
+
}}
|
|
597
|
+
${adornerRef(input)}>
|
|
598
|
+
<span class="adorner-with-icon">
|
|
599
|
+
${`top-layer (${input.topLayerIndex})`}<devtools-icon name="select-element"></devtools-icon>
|
|
600
|
+
</span>
|
|
601
|
+
</devtools-adorner>`: nothing}
|
|
574
602
|
${repeat(Array.from((input.adorners ?? new Set()).values()).sort(adornerComparator), adorner => {
|
|
575
603
|
return adorner;
|
|
576
604
|
})}
|
|
@@ -768,10 +796,12 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
768
796
|
showMediaAdorner: this.node().isMediaNode() && !this.isClosingTag(),
|
|
769
797
|
showPopoverAdorner: Boolean(Root.Runtime.hostConfig.devToolsAllowPopoverForcing?.enabled) &&
|
|
770
798
|
Boolean(this.node().attributes().find(attr => attr.name === 'popover')) && !this.isClosingTag(),
|
|
799
|
+
showTopLayerAdorner: this.node().topLayerIndex() !== -1 && !this.isClosingTag(),
|
|
771
800
|
gridAdornerActive: this.#gridAdornerActive,
|
|
772
801
|
popoverAdornerActive: this.#popoverAdornerActive,
|
|
773
802
|
isSubgrid: Boolean(this.#layout?.isSubgrid),
|
|
774
803
|
nodeInfo: this.#nodeInfo,
|
|
804
|
+
topLayerIndex: this.node().topLayerIndex(),
|
|
775
805
|
onGutterClick: this.showContextMenu.bind(this),
|
|
776
806
|
onAdornerAdded: adorner => {
|
|
777
807
|
ElementsPanel.instance().registerAdorner(adorner);
|
|
@@ -784,6 +814,12 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
784
814
|
onGridAdornerClick: (event: Event) => this.#onGridAdornerClick(event),
|
|
785
815
|
onMediaAdornerClick: (event: Event) => this.#onMediaAdornerClick(event),
|
|
786
816
|
onPopoverAdornerClick: (event: Event) => this.#onPopoverAdornerClick(event),
|
|
817
|
+
onTopLayerAdornerClick: () => {
|
|
818
|
+
if (!this.treeOutline) {
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
this.treeOutline.revealInTopLayer(this.node());
|
|
822
|
+
},
|
|
787
823
|
},
|
|
788
824
|
this, this.listItemElement);
|
|
789
825
|
}
|
|
@@ -1069,6 +1105,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1069
1105
|
override onbind(): void {
|
|
1070
1106
|
if (this.treeOutline && !this.isClosingTag()) {
|
|
1071
1107
|
this.treeOutline.treeElementByNode.set(this.nodeInternal, this);
|
|
1108
|
+
this.nodeInternal.addEventListener(SDK.DOMModel.DOMNodeEvents.TOP_LAYER_INDEX_CHANGED, this.performUpdate, this);
|
|
1072
1109
|
}
|
|
1073
1110
|
}
|
|
1074
1111
|
|
|
@@ -1079,6 +1116,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1079
1116
|
if (this.treeOutline && this.treeOutline.treeElementByNode.get(this.nodeInternal) === this) {
|
|
1080
1117
|
this.treeOutline.treeElementByNode.delete(this.nodeInternal);
|
|
1081
1118
|
}
|
|
1119
|
+
this.nodeInternal.removeEventListener(SDK.DOMModel.DOMNodeEvents.TOP_LAYER_INDEX_CHANGED, this.performUpdate, this);
|
|
1082
1120
|
}
|
|
1083
1121
|
|
|
1084
1122
|
override onattach(): void {
|
|
@@ -486,7 +486,7 @@ export class ElementsTreeOutline extends
|
|
|
486
486
|
private treeElementBeingDragged?: ElementsTreeElement;
|
|
487
487
|
private dragOverTreeElement?: ElementsTreeElement;
|
|
488
488
|
private updateModifiedNodesTimeout?: number;
|
|
489
|
-
#
|
|
489
|
+
#topLayerContainerByDocument = new WeakMap<SDK.DOMModel.DOMDocument, TopLayerContainer>();
|
|
490
490
|
#issuesManager?: IssuesManager.IssuesManager.IssuesManager;
|
|
491
491
|
#popupHelper?: UI.PopoverHelper.PopoverHelper;
|
|
492
492
|
#nodeElementToIssues = new Map<Element, IssuesManager.Issue.Issue[]>();
|
|
@@ -1526,7 +1526,6 @@ export class ElementsTreeOutline extends
|
|
|
1526
1526
|
domModel.addEventListener(SDK.DOMModel.Events.DocumentUpdated, this.documentUpdated, this);
|
|
1527
1527
|
domModel.addEventListener(SDK.DOMModel.Events.ChildNodeCountUpdated, this.childNodeCountUpdated, this);
|
|
1528
1528
|
domModel.addEventListener(SDK.DOMModel.Events.DistributedNodesChanged, this.distributedNodesChanged, this);
|
|
1529
|
-
domModel.addEventListener(SDK.DOMModel.Events.TopLayerElementsChanged, this.topLayerElementsChanged, this);
|
|
1530
1529
|
domModel.addEventListener(SDK.DOMModel.Events.ScrollableFlagUpdated, this.scrollableFlagUpdated, this);
|
|
1531
1530
|
domModel.addEventListener(
|
|
1532
1531
|
SDK.DOMModel.Events.AffectedByStartingStylesFlagUpdated, this.affectedByStartingStylesFlagUpdated, this);
|
|
@@ -1543,7 +1542,6 @@ export class ElementsTreeOutline extends
|
|
|
1543
1542
|
domModel.removeEventListener(SDK.DOMModel.Events.DocumentUpdated, this.documentUpdated, this);
|
|
1544
1543
|
domModel.removeEventListener(SDK.DOMModel.Events.ChildNodeCountUpdated, this.childNodeCountUpdated, this);
|
|
1545
1544
|
domModel.removeEventListener(SDK.DOMModel.Events.DistributedNodesChanged, this.distributedNodesChanged, this);
|
|
1546
|
-
domModel.removeEventListener(SDK.DOMModel.Events.TopLayerElementsChanged, this.topLayerElementsChanged, this);
|
|
1547
1545
|
domModel.removeEventListener(SDK.DOMModel.Events.ScrollableFlagUpdated, this.scrollableFlagUpdated, this);
|
|
1548
1546
|
domModel.removeEventListener(
|
|
1549
1547
|
SDK.DOMModel.Events.AffectedByStartingStylesFlagUpdated, this.affectedByStartingStylesFlagUpdated, this);
|
|
@@ -1719,16 +1717,24 @@ export class ElementsTreeOutline extends
|
|
|
1719
1717
|
});
|
|
1720
1718
|
}
|
|
1721
1719
|
|
|
1722
|
-
|
|
1720
|
+
createTopLayerContainer(parent: UI.TreeOutline.TreeElement, document: SDK.DOMModel.DOMDocument): void {
|
|
1723
1721
|
if (!parent.treeOutline || !(parent.treeOutline instanceof ElementsTreeOutline)) {
|
|
1724
1722
|
return;
|
|
1725
1723
|
}
|
|
1726
1724
|
const container = new TopLayerContainer(parent.treeOutline, document);
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1725
|
+
this.#topLayerContainerByDocument.set(document, container);
|
|
1726
|
+
parent.appendChild(container);
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
revealInTopLayer(node: SDK.DOMModel.DOMNode): void {
|
|
1730
|
+
const document = node.ownerDocument;
|
|
1731
|
+
if (!document) {
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
const container = this.#topLayerContainerByDocument.get(document);
|
|
1735
|
+
if (container) {
|
|
1736
|
+
container.revealInTopLayer(node);
|
|
1730
1737
|
}
|
|
1731
|
-
this.#topLayerContainerByParent.set(parent, container);
|
|
1732
1738
|
}
|
|
1733
1739
|
|
|
1734
1740
|
private createElementTreeElement(node: SDK.DOMModel.DOMNode|SDK.DOMModel.AdoptedStyleSheet, isClosingTag?: boolean):
|
|
@@ -1898,9 +1904,6 @@ export class ElementsTreeOutline extends
|
|
|
1898
1904
|
index: number, isClosingTag?: boolean): UI.TreeOutline.TreeElement {
|
|
1899
1905
|
const newElement = this.createElementTreeElement(child, isClosingTag);
|
|
1900
1906
|
treeElement.insertChild(newElement, index);
|
|
1901
|
-
if (child instanceof SDK.DOMModel.DOMDocument) {
|
|
1902
|
-
void this.createTopLayerContainer(newElement, child);
|
|
1903
|
-
}
|
|
1904
1907
|
return newElement;
|
|
1905
1908
|
}
|
|
1906
1909
|
|
|
@@ -1997,6 +2000,15 @@ export class ElementsTreeOutline extends
|
|
|
1997
2000
|
this.insertChildElement(treeElement, node, treeElement.childCount(), true);
|
|
1998
2001
|
}
|
|
1999
2002
|
|
|
2003
|
+
if (node instanceof SDK.DOMModel.DOMDocument) {
|
|
2004
|
+
let topLayerContainer = this.#topLayerContainerByDocument.get(node);
|
|
2005
|
+
if (!topLayerContainer) {
|
|
2006
|
+
topLayerContainer = new TopLayerContainer(this, node);
|
|
2007
|
+
this.#topLayerContainerByDocument.set(node, topLayerContainer);
|
|
2008
|
+
}
|
|
2009
|
+
treeElement.appendChild(topLayerContainer);
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2000
2012
|
this.treeElementsBeingUpdated.delete(treeElement);
|
|
2001
2013
|
}
|
|
2002
2014
|
|
|
@@ -2008,16 +2020,6 @@ export class ElementsTreeOutline extends
|
|
|
2008
2020
|
}
|
|
2009
2021
|
}
|
|
2010
2022
|
|
|
2011
|
-
private async topLayerElementsChanged(): Promise<void> {
|
|
2012
|
-
for (const [parent, container] of this.#topLayerContainerByParent) {
|
|
2013
|
-
await container.throttledUpdateTopLayerElements();
|
|
2014
|
-
if (container.currentTopLayerDOMNodes.size > 0 && container.parent !== parent) {
|
|
2015
|
-
parent.appendChild(container);
|
|
2016
|
-
}
|
|
2017
|
-
container.hidden = container.currentTopLayerDOMNodes.size === 0;
|
|
2018
|
-
}
|
|
2019
|
-
}
|
|
2020
|
-
|
|
2021
2023
|
private scrollableFlagUpdated(event: Common.EventTarget.EventTargetEvent<{node: SDK.DOMModel.DOMNode}>): void {
|
|
2022
2024
|
let {node} = event.data;
|
|
2023
2025
|
if (node.nodeName() === '#document') {
|
|
@@ -1,119 +1,54 @@
|
|
|
1
1
|
// Copyright 2022 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
4
|
|
|
6
|
-
import * as Common from '../../core/common/common.js';
|
|
7
|
-
import * as i18n from '../../core/i18n/i18n.js';
|
|
5
|
+
import type * as Common from '../../core/common/common.js';
|
|
8
6
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
9
|
-
import {createIcon} from '../../ui/kit/kit.js';
|
|
10
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
11
8
|
|
|
12
|
-
import * as ElementsComponents from './components/components.js';
|
|
13
|
-
import type {ElementsTreeElement} from './ElementsTreeElement.js';
|
|
14
9
|
import type {ElementsTreeOutline} from './ElementsTreeOutline.js';
|
|
15
10
|
import {ShortcutTreeElement} from './ShortcutTreeElement.js';
|
|
16
11
|
|
|
17
|
-
const UIStrings = {
|
|
18
|
-
/**
|
|
19
|
-
* @description Link text content in Elements Tree Outline of the Elements panel. When clicked, it "reveals" the true location of an element.
|
|
20
|
-
*/
|
|
21
|
-
reveal: 'reveal',
|
|
22
|
-
} as const;
|
|
23
|
-
|
|
24
|
-
const str_ = i18n.i18n.registerUIStrings('panels/elements/TopLayerContainer.ts', UIStrings);
|
|
25
|
-
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
26
|
-
|
|
27
12
|
export class TopLayerContainer extends UI.TreeOutline.TreeElement {
|
|
28
13
|
tree: ElementsTreeOutline;
|
|
29
14
|
document: SDK.DOMModel.DOMDocument;
|
|
30
|
-
currentTopLayerDOMNodes = new Set<SDK.DOMModel.DOMNode>();
|
|
31
|
-
topLayerUpdateThrottler: Common.Throttler.Throttler;
|
|
32
15
|
|
|
33
16
|
constructor(tree: ElementsTreeOutline, document: SDK.DOMModel.DOMDocument) {
|
|
34
17
|
super('#top-layer');
|
|
35
18
|
this.tree = tree;
|
|
36
19
|
this.document = document;
|
|
37
|
-
this.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
20
|
+
this.document.domModel().addEventListener(
|
|
21
|
+
SDK.DOMModel.Events.TopLayerElementsChanged, this.topLayerElementsChanged, this);
|
|
22
|
+
this.topLayerElementsChanged({
|
|
23
|
+
data: {
|
|
24
|
+
document,
|
|
25
|
+
documentShortcuts: [],
|
|
26
|
+
},
|
|
27
|
+
});
|
|
42
28
|
}
|
|
43
29
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.
|
|
47
|
-
this.currentTopLayerDOMNodes = new Set();
|
|
48
|
-
const domModel = this.document.domModel();
|
|
49
|
-
const newTopLayerElementsIDs = await domModel.getTopLayerElements();
|
|
50
|
-
if (!newTopLayerElementsIDs || newTopLayerElementsIDs.length === 0) {
|
|
30
|
+
topLayerElementsChanged(
|
|
31
|
+
event: Common.EventTarget.EventTargetEvent<SDK.DOMModel.EventTypes['TopLayerElementsChanged']>): void {
|
|
32
|
+
if (this.document !== event.data.document) {
|
|
51
33
|
return;
|
|
52
34
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (topLayerDOMNode.nodeName() !== '::backdrop') {
|
|
62
|
-
const topLayerElementShortcut = new SDK.DOMModel.DOMNodeShortcut(
|
|
63
|
-
domModel.target(), topLayerDOMNode.backendNodeId(), 0, topLayerDOMNode.nodeName());
|
|
64
|
-
const topLayerElementRepresentation = new ShortcutTreeElement(topLayerElementShortcut);
|
|
65
|
-
this.appendChild(topLayerElementRepresentation);
|
|
66
|
-
this.currentTopLayerDOMNodes.add(topLayerDOMNode);
|
|
67
|
-
|
|
68
|
-
// Add the element's backdrop if previous top layer element is a backdrop.
|
|
69
|
-
const previousTopLayerDOMNode = (i > 0) ? domModel.idToDOMNode.get(newTopLayerElementsIDs[i - 1]) : undefined;
|
|
70
|
-
if (previousTopLayerDOMNode && previousTopLayerDOMNode.nodeName() === '::backdrop') {
|
|
71
|
-
const backdropElementShortcut = new SDK.DOMModel.DOMNodeShortcut(
|
|
72
|
-
domModel.target(), previousTopLayerDOMNode.backendNodeId(), 0, previousTopLayerDOMNode.nodeName());
|
|
73
|
-
const backdropElementRepresentation = new ShortcutTreeElement(backdropElementShortcut);
|
|
74
|
-
topLayerElementRepresentation.appendChild(backdropElementRepresentation);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// TODO(changhaohan): store not-yet-inserted DOMNodes and adorn them when inserted.
|
|
78
|
-
const topLayerTreeElement = this.tree.treeElementByNode.get(topLayerDOMNode);
|
|
79
|
-
if (topLayerTreeElement) {
|
|
80
|
-
this.addTopLayerAdorner(topLayerTreeElement, topLayerElementRepresentation, ++topLayerElementIndex);
|
|
81
|
-
}
|
|
35
|
+
this.removeChildren();
|
|
36
|
+
const shortcuts = event.data.documentShortcuts;
|
|
37
|
+
this.hidden = shortcuts.length === 0;
|
|
38
|
+
for (const shortcut of shortcuts) {
|
|
39
|
+
const element = new ShortcutTreeElement(shortcut);
|
|
40
|
+
this.appendChild(element);
|
|
41
|
+
for (const child of shortcut.childShortcuts) {
|
|
42
|
+
element.appendChild(new ShortcutTreeElement(child));
|
|
82
43
|
}
|
|
83
44
|
}
|
|
84
45
|
}
|
|
85
46
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
private addTopLayerAdorner(
|
|
94
|
-
element: ElementsTreeElement, topLayerElementRepresentation: ShortcutTreeElement,
|
|
95
|
-
topLayerElementIndex: number): void {
|
|
96
|
-
const config = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
97
|
-
ElementsComponents.AdornerManager.RegisteredAdorners.TOP_LAYER);
|
|
98
|
-
const adornerContent = document.createElement('span');
|
|
99
|
-
adornerContent.classList.add('adorner-with-icon');
|
|
100
|
-
const linkIcon = createIcon('select-element');
|
|
101
|
-
const adornerText = document.createElement('span');
|
|
102
|
-
adornerText.textContent = `top-layer (${topLayerElementIndex})`;
|
|
103
|
-
adornerContent.append(linkIcon);
|
|
104
|
-
adornerContent.append(adornerText);
|
|
105
|
-
const adorner = element?.adorn(config, adornerContent);
|
|
106
|
-
if (adorner) {
|
|
107
|
-
const onClick = ((() => {
|
|
108
|
-
topLayerElementRepresentation.revealAndSelect();
|
|
109
|
-
}) as EventListener);
|
|
110
|
-
adorner.addInteraction(onClick, {
|
|
111
|
-
isToggle: false,
|
|
112
|
-
shouldPropagateOnKeydown: false,
|
|
113
|
-
ariaLabelDefault: i18nString(UIStrings.reveal),
|
|
114
|
-
ariaLabelActive: i18nString(UIStrings.reveal),
|
|
115
|
-
});
|
|
116
|
-
adorner.addEventListener('mousedown', e => e.consume(), false);
|
|
117
|
-
}
|
|
47
|
+
revealInTopLayer(node: SDK.DOMModel.DOMNode): void {
|
|
48
|
+
this.children().forEach(child => {
|
|
49
|
+
if (child instanceof ShortcutTreeElement && child.deferredNode().backendNodeId() === node.backendNodeId()) {
|
|
50
|
+
child.revealAndSelect();
|
|
51
|
+
}
|
|
52
|
+
});
|
|
118
53
|
}
|
|
119
54
|
}
|
|
@@ -200,7 +200,7 @@ export interface ViewInput {
|
|
|
200
200
|
onAnimationEnd: () => void,
|
|
201
201
|
onCitationAnimationEnd: () => void,
|
|
202
202
|
onSearch: () => void,
|
|
203
|
-
onRating: (isPositive: boolean) =>
|
|
203
|
+
onRating: (isPositive: boolean) => Promise<Host.InspectorFrontendHostAPI.AidaClientResult>| undefined,
|
|
204
204
|
onReport: () => void,
|
|
205
205
|
onGoToSignIn: () => void,
|
|
206
206
|
onConsentReminderConfirmed: () => Promise<void>,
|
|
@@ -989,7 +989,7 @@ export class ConsoleInsight extends UI.Widget.Widget {
|
|
|
989
989
|
}
|
|
990
990
|
}
|
|
991
991
|
|
|
992
|
-
#onRating(isPositive: boolean):
|
|
992
|
+
#onRating(isPositive: boolean): Promise<Host.InspectorFrontendHostAPI.AidaClientResult>|undefined {
|
|
993
993
|
if (this.#state.type !== State.INSIGHT) {
|
|
994
994
|
throw new Error('Unexpected state');
|
|
995
995
|
}
|
|
@@ -1009,7 +1009,7 @@ export class ConsoleInsight extends UI.Widget.Widget {
|
|
|
1009
1009
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightRatedNegative);
|
|
1010
1010
|
}
|
|
1011
1011
|
const disallowLogging = Root.Runtime.hostConfig.aidaAvailability?.disallowLogging ?? true;
|
|
1012
|
-
|
|
1012
|
+
return this.#aidaClient.registerClientEvent({
|
|
1013
1013
|
corresponding_aida_rpc_global_id: this.#state.metadata.rpcGlobalId,
|
|
1014
1014
|
disable_user_content_logging: disallowLogging,
|
|
1015
1015
|
do_conversation_client_event: {
|
|
@@ -8,10 +8,10 @@ import * as Common from '../../core/common/common.js';
|
|
|
8
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
9
9
|
import * as Platform from '../../core/platform/platform.js';
|
|
10
10
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
11
|
+
import * as Annotations from '../../models/annotations/annotations.js';
|
|
11
12
|
import type * as NetworkTimeCalculator from '../../models/network_time_calculator/network_time_calculator.js';
|
|
12
13
|
import * as PanelCommon from '../../panels/common/common.js';
|
|
13
14
|
import * as NetworkForward from '../../panels/network/forward/forward.js';
|
|
14
|
-
import * as Annotations from '../../ui/components/annotations/annotations.js';
|
|
15
15
|
import * as LegacyWrapper from '../../ui/components/legacy_wrapper/legacy_wrapper.js';
|
|
16
16
|
import {Icon} from '../../ui/kit/kit.js';
|
|
17
17
|
import type * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
@@ -42,6 +42,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
42
42
|
import * as Root from '../../core/root/root.js';
|
|
43
43
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
44
44
|
import * as Protocol from '../../generated/protocol.js';
|
|
45
|
+
import * as Annotations from '../../models/annotations/annotations.js';
|
|
45
46
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
46
47
|
import * as HAR from '../../models/har/har.js';
|
|
47
48
|
import * as Logs from '../../models/logs/logs.js';
|
|
@@ -51,7 +52,6 @@ import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
|
51
52
|
import * as NetworkForward from '../../panels/network/forward/forward.js';
|
|
52
53
|
import * as Sources from '../../panels/sources/sources.js';
|
|
53
54
|
import * as Adorners from '../../ui/components/adorners/adorners.js';
|
|
54
|
-
import * as Annotations from '../../ui/components/annotations/annotations.js';
|
|
55
55
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
56
56
|
import * as RenderCoordinator from '../../ui/components/render_coordinator/render_coordinator.js';
|
|
57
57
|
import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
|
|
@@ -40,6 +40,7 @@ import * as Host from '../../core/host/host.js';
|
|
|
40
40
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
41
41
|
import * as Platform from '../../core/platform/platform.js';
|
|
42
42
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
43
|
+
import * as Annotations from '../../models/annotations/annotations.js';
|
|
43
44
|
import * as Logs from '../../models/logs/logs.js';
|
|
44
45
|
import * as NetworkTimeCalculator from '../../models/network_time_calculator/network_time_calculator.js';
|
|
45
46
|
import * as Trace from '../../models/trace/trace.js';
|
|
@@ -47,7 +48,6 @@ import * as Workspace from '../../models/workspace/workspace.js';
|
|
|
47
48
|
import * as PanelCommon from '../../panels/common/common.js';
|
|
48
49
|
import * as NetworkForward from '../../panels/network/forward/forward.js';
|
|
49
50
|
import * as Tracing from '../../services/tracing/tracing.js';
|
|
50
|
-
import * as Annotations from '../../ui/components/annotations/annotations.js';
|
|
51
51
|
import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
|
|
52
52
|
import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
|
|
53
53
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -30,7 +30,6 @@ import * as Actions from './recorder-actions/recorder-actions.js';
|
|
|
30
30
|
import recorderControllerStyles from './recorderController.css.js';
|
|
31
31
|
import * as Events from './RecorderEvents.js';
|
|
32
32
|
|
|
33
|
-
// TODO(crbug.com/391381439): Fully migrate off of Constructable Stylesheets.
|
|
34
33
|
const {html, Decorators, Directives: {ref}, LitElement} = Lit;
|
|
35
34
|
const {customElement, state} = Decorators;
|
|
36
35
|
|
|
@@ -208,11 +208,19 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: object, target: HTMLEleme
|
|
|
208
208
|
(input.thirdPartyControlsDict ? !input.thirdPartyControlsDict?.thirdPartyCookieMetadataEnabled: false) ?
|
|
209
209
|
i18nFormatStringTemplate(UIStrings.enableFlag, {
|
|
210
210
|
PH1: getChromeFlagsLink('#tpcd-metadata-grants'),
|
|
211
|
-
})
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
})
|
|
212
|
+
: i18nFormatStringTemplate(
|
|
213
|
+
input.isGracePeriodActive
|
|
214
|
+
? UIStrings.gracePeriodExplanation
|
|
215
|
+
: UIStrings.enrollGracePeriod,
|
|
216
|
+
{
|
|
217
|
+
PH1: html`<devtools-link
|
|
218
|
+
href="https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/grace-period"
|
|
219
|
+
.jslogContext=${'grace-period-link'}
|
|
220
|
+
>${i18nString(UIStrings.gracePeriod)}</devtools-link
|
|
221
|
+
>`,
|
|
222
|
+
},
|
|
223
|
+
)}
|
|
216
224
|
</div>
|
|
217
225
|
</div>
|
|
218
226
|
</label>
|
|
@@ -241,11 +249,14 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: object, target: HTMLEleme
|
|
|
241
249
|
(input.thirdPartyControlsDict ? !input.thirdPartyControlsDict.thirdPartyCookieHeuristicsEnabled: false) ?
|
|
242
250
|
i18nFormatStringTemplate(UIStrings.enableFlag, {
|
|
243
251
|
PH1: getChromeFlagsLink('#tpcd-heuristics-grants'),
|
|
244
|
-
})
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
252
|
+
})
|
|
253
|
+
: i18nFormatStringTemplate(UIStrings.heuristicExplanation, {
|
|
254
|
+
PH1: html`<devtools-link
|
|
255
|
+
href="https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/heuristics-based-exceptions"
|
|
256
|
+
.jslogContext=${'heuristic-link'}
|
|
257
|
+
>${i18nString(UIStrings.scenarios)}</devtools-link
|
|
258
|
+
>`,
|
|
259
|
+
})}
|
|
249
260
|
</div>
|
|
250
261
|
</div>
|
|
251
262
|
</label>
|
|
@@ -171,6 +171,11 @@ export class SecurityPanelSidebar extends UI.Widget.VBox {
|
|
|
171
171
|
this.showLastSelectedElement();
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
// Used in web tests
|
|
175
|
+
elementsByOrigin(): Map<string, OriginTreeElement> {
|
|
176
|
+
return this.#elementsByOrigin;
|
|
177
|
+
}
|
|
178
|
+
|
|
174
179
|
showLastSelectedElement(): void {
|
|
175
180
|
if (this.#cookieControlsTreeElement &&
|
|
176
181
|
this.#securitySidebarLastItemSetting.get() === this.#cookieControlsTreeElement.elemId) {
|
|
@@ -510,7 +510,6 @@ export class CompatibilityTracksAppender {
|
|
|
510
510
|
* @returns the index of the event in all events to be rendered in the flamechart.
|
|
511
511
|
*/
|
|
512
512
|
appendEventAtLevel(event: Trace.Types.Events.Event, level: number, appender: TrackAppender): number {
|
|
513
|
-
// TODO(crbug.com/1442454) Figure out how to avoid the circular calls.
|
|
514
513
|
this.#trackForLevel.set(level, appender);
|
|
515
514
|
const index = this.#entryData.length;
|
|
516
515
|
this.#entryData.push(event);
|
|
@@ -2138,14 +2138,11 @@ export class TimelineUIUtils {
|
|
|
2138
2138
|
const start = Trace.Types.Timing.Milli(rangeStart);
|
|
2139
2139
|
const end = Trace.Types.Timing.Milli(rangeEnd);
|
|
2140
2140
|
const categorySummaryTable = new TimelineComponents.TimelineSummary.CategorySummary();
|
|
2141
|
-
categorySummaryTable.
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
selectedEvents,
|
|
2147
|
-
};
|
|
2148
|
-
element.append(categorySummaryTable);
|
|
2141
|
+
categorySummaryTable.rangeStart = start;
|
|
2142
|
+
categorySummaryTable.rangeEnd = end;
|
|
2143
|
+
categorySummaryTable.total = total;
|
|
2144
|
+
categorySummaryTable.categories = categories;
|
|
2145
|
+
element.append(categorySummaryTable.contentElement);
|
|
2149
2146
|
// Add the 3p datagrid
|
|
2150
2147
|
const treeView = new ThirdPartyTreeView.ThirdPartyTreeElement();
|
|
2151
2148
|
treeView.treeView = thirdPartyTree;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
5
|
|
|
6
6
|
import type * as Trace from '../../../models/trace/trace.js';
|
|
7
|
-
import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';
|
|
8
7
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
9
8
|
|
|
10
9
|
import {InsightActivated, InsightDeactivated} from './insights/SidebarInsight.js';
|
|
@@ -156,7 +155,7 @@ export class SidebarWidget extends UI.Widget.VBox {
|
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
class InsightsView extends UI.Widget.VBox {
|
|
159
|
-
#component =
|
|
158
|
+
#component = SidebarInsightsTab.createWidgetElement();
|
|
160
159
|
|
|
161
160
|
constructor() {
|
|
162
161
|
super();
|
|
@@ -165,21 +164,31 @@ class InsightsView extends UI.Widget.VBox {
|
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
setParsedTrace(parsedTrace: Trace.TraceModel.ParsedTrace|null): void {
|
|
168
|
-
this.#component.
|
|
167
|
+
this.#component.widgetConfig = UI.Widget.widgetConfig(SidebarInsightsTab, {parsedTrace});
|
|
169
168
|
}
|
|
170
169
|
|
|
171
170
|
getActiveInsight(): ActiveInsight|null {
|
|
172
|
-
|
|
171
|
+
const widget = this.#component.getWidget();
|
|
172
|
+
if (widget) {
|
|
173
|
+
return widget.activeInsight;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return null;
|
|
173
177
|
}
|
|
174
178
|
|
|
175
179
|
setActiveInsight(active: ActiveInsight|null, opts: {highlight: boolean}): void {
|
|
176
|
-
this.#component.
|
|
180
|
+
const widget = this.#component.getWidget();
|
|
181
|
+
if (!widget) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
widget.activeInsight = active;
|
|
177
186
|
if (opts.highlight && active) {
|
|
178
187
|
// Wait for the rendering of the component to be done, otherwise we
|
|
179
188
|
// might highlight the wrong insight. The UI needs to be fully
|
|
180
189
|
// re-rendered before we can highlight the newly-expanded insight.
|
|
181
|
-
void
|
|
182
|
-
|
|
190
|
+
void widget.updateComplete.then(() => {
|
|
191
|
+
widget.highlightActiveInsight();
|
|
183
192
|
});
|
|
184
193
|
}
|
|
185
194
|
}
|