chrome-devtools-frontend 1.0.1697998 → 1.0.1699061
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/.agents/skills/devtools-verification/SKILL.md +19 -0
- package/.agents/skills/{repro-flaky-tests → fix-tests}/SKILL.md +2 -2
- package/.agents/skills/version-control/SKILL.md +21 -9
- package/front_end/core/platform/HostRuntime.ts +12 -0
- package/front_end/core/platform/api/HostRuntime.ts +13 -0
- package/front_end/core/platform/browser/HostRuntime.ts +34 -0
- package/front_end/core/platform/node/HostRuntime.ts +40 -0
- package/front_end/core/sdk/AnimationModel.ts +12 -98
- package/front_end/core/sdk/CSSModel.ts +4 -2
- package/front_end/core/sdk/CSSPropertyParser.ts +4 -4
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +4 -44
- package/front_end/core/sdk/Connections.ts +6 -1
- package/front_end/core/sdk/ConsoleModel.ts +1 -12
- package/front_end/core/sdk/DOMModel.ts +6 -56
- package/front_end/core/sdk/DebuggerModel.ts +9 -8
- package/front_end/core/sdk/NetworkManager.ts +2 -2
- package/front_end/core/sdk/NetworkRequest.ts +1 -1
- package/front_end/core/sdk/OverlayModel.ts +11 -12
- package/front_end/core/sdk/PageFunctions.ts +187 -0
- package/front_end/core/sdk/Resource.ts +1 -1
- package/front_end/core/sdk/RuntimeModel.ts +1 -20
- package/front_end/core/sdk/Script.ts +21 -0
- package/front_end/core/sdk/SourceMap.ts +15 -2
- package/front_end/core/sdk/SourceMapCache.ts +13 -10
- package/front_end/core/sdk/SourceMapManager.ts +11 -9
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +109 -15
- package/front_end/core/sdk/SourceMapScopesInfo.ts +8 -2
- package/front_end/entrypoints/heap_snapshot_worker/ContextAnalyzer.ts +635 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +26 -12
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +16 -2
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +4 -4
- package/front_end/entrypoints/heap_snapshot_worker/heap_snapshot_worker.ts +2 -0
- package/front_end/entrypoints/shell/shell.ts +1 -1
- package/front_end/models/ai_assistance/DOMHelpers.ts +95 -0
- package/front_end/models/ai_assistance/EvaluateAction.ts +5 -42
- package/front_end/models/ai_assistance/ExtensionScope.ts +2 -31
- package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -4
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +10 -7
- package/front_end/models/ai_assistance/contexts/FileContext.ts +2 -10
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +3 -2
- package/front_end/models/ai_assistance/tools/ListSources.ts +21 -14
- package/front_end/models/bindings/CompilerScriptMapping.ts +3 -10
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +48 -17
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -2
- package/front_end/models/bindings/StylesSourceMapping.ts +1 -1
- package/front_end/models/comment_manager/CD4ABridge.ts +55 -12
- package/front_end/models/comment_manager/CommentManager.ts +46 -91
- package/front_end/models/comment_manager/CommentThread.ts +145 -0
- package/front_end/models/comment_manager/comment_manager.ts +2 -0
- package/front_end/models/emulation/DeviceModeModel.ts +54 -1
- package/front_end/models/extensions/ExtensionAPI.ts +8 -6
- package/front_end/models/extensions/ExtensionEndpoint.ts +11 -8
- package/front_end/models/extensions/HostUrlPattern.ts +4 -3
- package/front_end/models/extensions/LanguageExtensionEndpoint.ts +3 -2
- package/front_end/models/extensions/RecorderExtensionEndpoint.ts +2 -1
- package/front_end/models/formatter/FormatterWorkerPool.ts +4 -6
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +55 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +18 -14
- package/front_end/models/issues_manager/CookieIssue.ts +0 -13
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/WebInstallIssue.ts +63 -0
- package/front_end/models/issues_manager/descriptions/webInstallManifestMissingId.md +3 -0
- package/front_end/models/issues_manager/descriptions/webInstallManifestMissingNameOrShortName.md +3 -0
- package/front_end/models/issues_manager/descriptions/webInstallManifestParsingOrNetworkError.md +3 -0
- package/front_end/models/issues_manager/descriptions/webInstallNoManifest.md +3 -0
- package/front_end/models/issues_manager/descriptions/webInstallStartUrlInvalid.md +3 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/source_map_scopes/NamesResolver.ts +11 -3
- package/front_end/models/source_map_scopes/ScopeChainModel.ts +10 -6
- package/front_end/models/workspace/UISourceCode.ts +20 -0
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +281 -3
- package/front_end/panels/accessibility/accessibilityAnnouncementRecordingView.css +85 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -8
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +4 -10
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/application/CrashReportContextView.ts +1 -1
- package/front_end/panels/application/IndexedDBViews.ts +1 -1
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
- package/front_end/panels/application/components/AdsView.ts +63 -1
- package/front_end/panels/application/components/adsView.css +11 -1
- package/front_end/{ui/comments → panels/common}/CommentThreadWidget.ts +5 -20
- package/front_end/{ui/comments → panels/common}/CommentsOverlayWidget.ts +39 -62
- package/front_end/{ui/comments → panels/common}/CommentsStatusBarPill.ts +5 -5
- package/front_end/panels/common/ExtensionServer.ts +2 -1
- package/front_end/{ui/comments → panels/common}/commentThreadWidget.css +0 -12
- package/front_end/{ui/comments → panels/common}/commentsOverlay.css +2 -1
- package/front_end/{ui/comments/comments-meta.ts → panels/common/common-meta.ts} +11 -11
- package/front_end/panels/common/common.ts +3 -0
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +3 -3
- package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
- package/front_end/panels/elements/ElementsPanel.ts +9 -5
- package/front_end/panels/elements/ElementsTreeElement.ts +11 -3
- package/front_end/panels/elements/ElementsTreeOutline.ts +69 -74
- package/front_end/panels/elements/PropertiesWidget.ts +11 -10
- package/front_end/panels/elements/PropertyRenderer.ts +29 -25
- package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -6
- package/front_end/panels/elements/elementsTreeOutline.css +11 -5
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -3
- package/front_end/panels/event_listeners/EventListenersView.ts +33 -44
- package/front_end/panels/lighthouse/LighthouseController.ts +1 -1
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +6 -7
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +5 -1
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +1 -1
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
- package/front_end/panels/recorder/StepView.ts +19 -4
- package/front_end/panels/recorder/TimelineSection.ts +1 -1
- package/front_end/panels/recorder/stepView.css +1 -0
- package/front_end/panels/security/SecurityPanel.ts +5 -5
- package/front_end/panels/security/SecurityPanelSidebar.ts +2 -11
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +2 -1
- package/front_end/panels/settings/EditFileSystemView.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +2 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +11 -16
- package/front_end/panels/sources/sources-meta.ts +1 -1
- package/front_end/panels/timeline/components/DetailsView.ts +3 -3
- package/front_end/panels/timeline/components/OriginMap.ts +1 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -3
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +0 -3
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/comments/CommentOverlayManager.ts +28 -110
- package/front_end/ui/comments/comments.ts +0 -6
- package/front_end/ui/components/buttons/Button.ts +19 -1
- package/front_end/ui/legacy/ContextMenu.ts +16 -1
- package/front_end/ui/legacy/PlusButton.ts +5 -6
- package/front_end/ui/legacy/Treeoutline.ts +6 -0
- package/front_end/ui/legacy/Widget.ts +33 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +3 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +14 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +36 -32
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
- package/package.json +1 -1
- package/.agents/skills/devtools-ci/SKILL.md +0 -65
- package/.agents/skills/evaluate-ai-css-completion/SKILL.md +0 -143
- package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +0 -104
- package/.agents/skills/fixing-skipped-tests/SKILL.md +0 -32
- package/.agents/skills/gerrit-cli/SKILL.md +0 -74
- package/.agents/skills/gerrit-cli/references/commands.md +0 -169
- package/.agents/skills/gerrit-cli/references/workflows.md +0 -63
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +0 -85
- package/front_end/models/issues_manager/descriptions/cookieExcludeBlockedWithinRelatedWebsiteSet.md +0 -4
|
@@ -6,7 +6,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
6
6
|
import type * as Root from '../../core/root/root.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
|
-
import type * as
|
|
9
|
+
import type * as Common from './common.js';
|
|
10
10
|
|
|
11
11
|
const UIStrings = {
|
|
12
12
|
/**
|
|
@@ -22,16 +22,16 @@ const UIStrings = {
|
|
|
22
22
|
*/
|
|
23
23
|
comments: 'Comments',
|
|
24
24
|
} as const;
|
|
25
|
-
const str_ = i18n.i18n.registerUIStrings('
|
|
25
|
+
const str_ = i18n.i18n.registerUIStrings('panels/common/common-meta.ts', UIStrings);
|
|
26
26
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
27
27
|
|
|
28
|
-
let
|
|
28
|
+
let loadedCommonModule: (typeof Common|undefined);
|
|
29
29
|
|
|
30
|
-
async function
|
|
31
|
-
if (!
|
|
32
|
-
|
|
30
|
+
async function loadCommonModule(): Promise<typeof Common> {
|
|
31
|
+
if (!loadedCommonModule) {
|
|
32
|
+
loadedCommonModule = await import('./common.js');
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return loadedCommonModule;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function isCommentsEnabled(config?: Root.Runtime.HostConfig): boolean {
|
|
@@ -46,8 +46,8 @@ UI.ViewManager.registerViewExtension({
|
|
|
46
46
|
commandPrompt: i18nLazyString(UIStrings.showComments),
|
|
47
47
|
title: i18nLazyString(UIStrings.comments),
|
|
48
48
|
async loadView(universe) {
|
|
49
|
-
const
|
|
50
|
-
return new
|
|
49
|
+
const Common = await loadCommonModule();
|
|
50
|
+
return new Common.CommentsStatusBarPill.CommentsStatusBarPill(undefined, [universe.commentManager]);
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
53
|
|
|
@@ -59,8 +59,8 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
59
59
|
toggleable: true,
|
|
60
60
|
condition: isCommentsEnabled,
|
|
61
61
|
async loadActionDelegate() {
|
|
62
|
-
const
|
|
63
|
-
return new
|
|
62
|
+
const Common = await loadCommonModule();
|
|
63
|
+
return new Common.CommentsOverlayWidget.ActionDelegate();
|
|
64
64
|
},
|
|
65
65
|
});
|
|
66
66
|
|
|
@@ -13,3 +13,6 @@ export * as ExtensionView from './ExtensionView.js';
|
|
|
13
13
|
export * as PersistenceUtils from './PersistenceUtils.js';
|
|
14
14
|
export * as DOMLinkifier from './DOMLinkifier.js';
|
|
15
15
|
export * as ExtensionIframe from './ExtensionView.js';
|
|
16
|
+
export * as CommentThreadWidget from './CommentThreadWidget.js';
|
|
17
|
+
export * as CommentsOverlayWidget from './CommentsOverlayWidget.js';
|
|
18
|
+
export * as CommentsStatusBarPill from './CommentsStatusBarPill.js';
|
|
@@ -20,7 +20,7 @@ const {Directives: {ref}, html, render} = Lit;
|
|
|
20
20
|
|
|
21
21
|
export class AdoptedStyleSheetSetTreeElement extends UI.TreeOutline.TreeElement {
|
|
22
22
|
constructor(readonly adoptedStyleSheets: SDK.DOMModel.AdoptedStyleSheet[]) {
|
|
23
|
-
super('');
|
|
23
|
+
super('', undefined, 'adopted-style-sheets');
|
|
24
24
|
const documentElement = this.listItemElement.createChild('span');
|
|
25
25
|
UI.UIUtils.createTextChild(documentElement, '#adopted-style-sheets');
|
|
26
26
|
for (const adoptedStyleSheet of adoptedStyleSheets) {
|
|
@@ -33,7 +33,7 @@ export class AdoptedStyleSheetTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
33
33
|
private eventListener: Common.EventTarget.EventDescriptor|null = null;
|
|
34
34
|
|
|
35
35
|
constructor(readonly adoptedStyleSheet: SDK.DOMModel.AdoptedStyleSheet) {
|
|
36
|
-
super('');
|
|
36
|
+
super('', undefined, 'adopted-style-sheet');
|
|
37
37
|
const header = adoptedStyleSheet.cssModel.styleSheetHeaderForId(adoptedStyleSheet.id);
|
|
38
38
|
if (header) {
|
|
39
39
|
AdoptedStyleSheetTreeElement.createContents(header, this);
|
|
@@ -79,7 +79,7 @@ export class AdoptedStyleSheetContentsTreeElement extends UI.TreeOutline.TreeEle
|
|
|
79
79
|
private readonly widgetWrapper: HTMLElement;
|
|
80
80
|
|
|
81
81
|
constructor(styleSheetHeader: SDK.CSSStyleSheetHeader.CSSStyleSheetHeader) {
|
|
82
|
-
super('');
|
|
82
|
+
super('', undefined, 'adopted-style-sheet-contents');
|
|
83
83
|
this.widgetWrapper = document.createElement('div');
|
|
84
84
|
this.widgetWrapper.style.display = 'contents';
|
|
85
85
|
this.title = this.widgetWrapper;
|
|
@@ -72,7 +72,7 @@ const UIStrings = {
|
|
|
72
72
|
* @example {Arial} PH5
|
|
73
73
|
*/
|
|
74
74
|
fontVariationSettingsWarning:
|
|
75
|
-
'Value for setting "{PH1}" {PH2} is outside the supported range [{PH3}, {PH4}] for font-family "{PH5}"',
|
|
75
|
+
'Value for setting "{PH1}" {PH2} is outside the supported range [{PH3}, {PH4}] for font-family "{PH5}".',
|
|
76
76
|
/**
|
|
77
77
|
* @description The message shown in the Styles tab when the user hovers over a property declaration that has no effect on flex or grid child items.
|
|
78
78
|
* @example {flex} CONTAINER_DISPLAY_NAME
|
|
@@ -228,6 +228,10 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
228
228
|
return this.#domTreeWidget.getTreeOutlineForTesting();
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
getDOMTreeWidgetForTesting(): DOMTreeWidget {
|
|
232
|
+
return this.#domTreeWidget;
|
|
233
|
+
}
|
|
234
|
+
|
|
231
235
|
constructor(
|
|
232
236
|
targetManager?: SDK.TargetManager.TargetManager,
|
|
233
237
|
settings?: Common.Settings.Settings,
|
|
@@ -864,7 +868,8 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
864
868
|
|
|
865
869
|
// If any of these properties are undefined or reset to an invalid value,
|
|
866
870
|
// this means the search/highlight request is outdated.
|
|
867
|
-
const highlightRequestValid =
|
|
871
|
+
const highlightRequestValid =
|
|
872
|
+
this.searchConfig && this.searchResults && (this.currentSearchResultIndex === index);
|
|
868
873
|
if (highlightRequestValid) {
|
|
869
874
|
this.highlightCurrentSearchResult();
|
|
870
875
|
}
|
|
@@ -873,12 +878,11 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
873
878
|
}
|
|
874
879
|
|
|
875
880
|
void searchResult.node.scrollIntoView();
|
|
876
|
-
|
|
877
|
-
this.#domTreeWidget.highlightMatch(searchResult.node, this.searchConfig?.query);
|
|
878
|
-
}
|
|
881
|
+
this.#domTreeWidget.highlightMatch(searchResult.node, this.searchConfig?.query);
|
|
879
882
|
}
|
|
880
883
|
|
|
881
884
|
private hideSearchHighlights(): void {
|
|
885
|
+
SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight(this.#targetManager);
|
|
882
886
|
if (!this.searchResults?.length || this.currentSearchResultIndex === -1) {
|
|
883
887
|
return;
|
|
884
888
|
}
|
|
@@ -1300,7 +1304,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
1300
1304
|
}
|
|
1301
1305
|
|
|
1302
1306
|
toggleHideElement(node: SDK.DOMModel.DOMNode): void {
|
|
1303
|
-
this.#domTreeWidget.toggleHideElement(node);
|
|
1307
|
+
void this.#domTreeWidget.toggleHideElement(node);
|
|
1304
1308
|
}
|
|
1305
1309
|
|
|
1306
1310
|
toggleEditAsHTML(node: SDK.DOMModel.DOMNode): void {
|
|
@@ -354,6 +354,7 @@ export interface ViewInput {
|
|
|
354
354
|
descendantDecorations: Decoration[];
|
|
355
355
|
decorationsTooltip: string;
|
|
356
356
|
indent: number;
|
|
357
|
+
renderSelection?: boolean;
|
|
357
358
|
|
|
358
359
|
editorState: CodeMirror.EditorState|null;
|
|
359
360
|
editorWidth: number|null;
|
|
@@ -906,7 +907,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
906
907
|
input.onExpand,
|
|
907
908
|
input.issues,
|
|
908
909
|
)}</span>` : nothing}
|
|
909
|
-
|
|
910
|
+
${input.renderSelection !== false ? html`<div class="selection fill ${input.editorState ? 'hidden' : ''}" style=${`margin-left: ${-input.indent}px`}></div>` : nothing}
|
|
910
911
|
<div class=${classMap(gutterContainerClasses)}
|
|
911
912
|
style="left: ${-input.indent}px"
|
|
912
913
|
@click=${input.onGutterClick}>
|
|
@@ -1171,6 +1172,7 @@ export class ElementsTreeWidget extends UI.Widget.Widget {
|
|
|
1171
1172
|
isXMLMimeType = false;
|
|
1172
1173
|
disableEdits = false;
|
|
1173
1174
|
showAIButton = false;
|
|
1175
|
+
renderSelection = true;
|
|
1174
1176
|
isDOMNodeSelected = false;
|
|
1175
1177
|
initialEdit?: InitialEditState|null;
|
|
1176
1178
|
onInitialEditCompleted?: () => void;
|
|
@@ -1584,6 +1586,7 @@ export class ElementsTreeWidget extends UI.Widget.Widget {
|
|
|
1584
1586
|
descendantDecorations: this.#expanded ? [] : this.#descendantDecorations,
|
|
1585
1587
|
decorationsTooltip: this.#decorationsTooltip,
|
|
1586
1588
|
indent: this.#getLeftIndent(),
|
|
1589
|
+
renderSelection: this.renderSelection,
|
|
1587
1590
|
showScrollSnapAdorner: Boolean(this.#layout?.hasScroll) && !isClosingTag,
|
|
1588
1591
|
scrollSnapAdornerActive: this.#scrollSnapAdornerActive,
|
|
1589
1592
|
showSlotAdorner: Boolean(this.node.assignedSlot) && !isClosingTag,
|
|
@@ -1818,11 +1821,16 @@ export class ElementsTreeWidget extends UI.Widget.Widget {
|
|
|
1818
1821
|
}
|
|
1819
1822
|
}
|
|
1820
1823
|
|
|
1821
|
-
|
|
1824
|
+
#clearHighlights(): void {
|
|
1822
1825
|
Highlighting.HighlightManager.HighlightManager.instance().removeHighlights(this.#highlights);
|
|
1823
1826
|
this.#highlights = [];
|
|
1824
1827
|
}
|
|
1825
1828
|
|
|
1829
|
+
hideSearchHighlights(): void {
|
|
1830
|
+
this.#searchQuery = null;
|
|
1831
|
+
this.#clearHighlights();
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1826
1834
|
setInClipboard(inClipboard: boolean): void {
|
|
1827
1835
|
if (this.inClipboard === inClipboard) {
|
|
1828
1836
|
return;
|
|
@@ -2946,7 +2954,7 @@ export class ElementsTreeWidget extends UI.Widget.Widget {
|
|
|
2946
2954
|
}
|
|
2947
2955
|
|
|
2948
2956
|
#highlightSearchResults(): void {
|
|
2949
|
-
this
|
|
2957
|
+
this.#clearHighlights();
|
|
2950
2958
|
|
|
2951
2959
|
if (!this.searchQuery) {
|
|
2952
2960
|
return;
|
|
@@ -150,7 +150,7 @@ interface ViewInput {
|
|
|
150
150
|
onClearMaxRows?: () => void;
|
|
151
151
|
onHoverNode?: (node: SDK.DOMModel.DOMNode|null, showInfo?: boolean, isClosingTag?: boolean) => void;
|
|
152
152
|
onLeave?: () => void;
|
|
153
|
-
onToggleHideElement?: (node: SDK.DOMModel.DOMNode) => void
|
|
153
|
+
onToggleHideElement?: (node: SDK.DOMModel.DOMNode) => Promise<void>;
|
|
154
154
|
onKeyDown?: (event: KeyboardEvent) => void;
|
|
155
155
|
isToggledToHidden?: (node: SDK.DOMModel.DOMNode) => boolean;
|
|
156
156
|
onDuplicateNode?: (node: SDK.DOMModel.DOMNode) => void;
|
|
@@ -523,6 +523,13 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
523
523
|
}
|
|
524
524
|
|
|
525
525
|
const on = Lit.Directive.directive(Lit.CustomDirectives.InterceptBindingDirective);
|
|
526
|
+
const treeItemJslog = (context?: string, drag?: boolean): ReturnType<typeof VisualLogging.treeItem> =>
|
|
527
|
+
VisualLogging.treeItem(context).parent('elementsTreeOutline').track({
|
|
528
|
+
keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Backspace|Delete|Enter|Space|Home|End',
|
|
529
|
+
resize: true,
|
|
530
|
+
...(drag ? {drag: true} : {}),
|
|
531
|
+
click: true,
|
|
532
|
+
});
|
|
526
533
|
|
|
527
534
|
const renderShortcut = (shortcut: SDK.DOMModel.DOMNodeShortcut, shortcutDepth: number): Lit.LitTemplate => {
|
|
528
535
|
const hasShortcutChildren = shortcut.childShortcuts.length > 0;
|
|
@@ -558,12 +565,11 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
558
565
|
?open=${isShortcutExpanded}
|
|
559
566
|
class="elements-tree-shortcut"
|
|
560
567
|
style=${styleMap({'--indent': `${computeLeftIndent(shortcutDepth, hasShortcutChildren)}px`})}
|
|
561
|
-
@select=${onShortcutSelect}
|
|
562
|
-
@expand=${onShortcutExpand}
|
|
568
|
+
@select=${on(onShortcutSelect)}
|
|
569
|
+
@expand=${on(onShortcutExpand)}
|
|
563
570
|
@mousemove=${on(onShortcutMouseMove)}
|
|
564
571
|
@mouseleave=${on(onShortcutMouseLeave)}
|
|
565
|
-
jslog=${
|
|
566
|
-
<div class="selection fill"></div>
|
|
572
|
+
jslog=${treeItemJslog()}>
|
|
567
573
|
<span class="elements-tree-shortcut-title">\u21AA ${title}</span>
|
|
568
574
|
<devtools-adorner
|
|
569
575
|
.name=${ElementsComponents.AdornerManager.RegisteredAdorners.REVEAL}
|
|
@@ -583,9 +589,7 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
583
589
|
</devtools-adorner>
|
|
584
590
|
${hasShortcutChildren ? html`
|
|
585
591
|
<ul role="group">
|
|
586
|
-
${
|
|
587
|
-
${shortcut.childShortcuts.map(child => renderShortcut(child, shortcutDepth + 1))}
|
|
588
|
-
`)}
|
|
592
|
+
${shortcut.childShortcuts.map(child => renderShortcut(child, shortcutDepth + 1))}
|
|
589
593
|
</ul>
|
|
590
594
|
` : nothing}
|
|
591
595
|
</li>
|
|
@@ -613,15 +617,12 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
613
617
|
?open=${isTopLayerExpanded}
|
|
614
618
|
class="elements-tree-top-layer-container"
|
|
615
619
|
style=${styleMap({'--indent': `${computeLeftIndent(containerDepth, true)}px`})}
|
|
616
|
-
@select=${onTopLayerSelect}
|
|
617
|
-
@expand=${onTopLayerExpand}
|
|
618
|
-
jslog=${
|
|
619
|
-
<div class="selection fill"></div>
|
|
620
|
+
@select=${on(onTopLayerSelect)}
|
|
621
|
+
@expand=${on(onTopLayerExpand)}
|
|
622
|
+
jslog=${treeItemJslog()}>
|
|
620
623
|
<span class="elements-tree-shortcut-title">#top-layer</span>
|
|
621
624
|
<ul role="group">
|
|
622
|
-
${
|
|
623
|
-
${shortcuts.map(sc => renderShortcut(sc, containerDepth + 1))}
|
|
624
|
-
`)}
|
|
625
|
+
${shortcuts.map(sc => renderShortcut(sc, containerDepth + 1))}
|
|
625
626
|
</ul>
|
|
626
627
|
</li>
|
|
627
628
|
`;
|
|
@@ -647,10 +648,9 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
647
648
|
?open=${isExpanded}
|
|
648
649
|
class="elements-tree-adopted-style-sheet"
|
|
649
650
|
style=${styleMap({'--indent': `${computeLeftIndent(depth, true)}px`})}
|
|
650
|
-
@select=${onSelect}
|
|
651
|
-
@expand=${onExpand}
|
|
652
|
-
jslog=${
|
|
653
|
-
<div class="selection fill"></div>
|
|
651
|
+
@select=${on(onSelect)}
|
|
652
|
+
@expand=${on(onExpand)}
|
|
653
|
+
jslog=${treeItemJslog('adopted-style-sheet')}>
|
|
654
654
|
<span class="elements-tree-shortcut-title">#adopted-style-sheet${linkText ? html` (${UIComponentUtils.Linkifier.Linkifier.linkifyURL(linkText, {
|
|
655
655
|
text: linkText,
|
|
656
656
|
preventClick: true,
|
|
@@ -662,8 +662,7 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
662
662
|
<li role="treeitem"
|
|
663
663
|
class="elements-tree-adopted-style-sheet-contents"
|
|
664
664
|
style=${styleMap({'--indent': `${computeLeftIndent(depth + 1, false)}px`})}
|
|
665
|
-
jslog=${
|
|
666
|
-
<div class="selection fill"></div>
|
|
665
|
+
jslog=${treeItemJslog('adopted-style-sheet-contents')}>
|
|
667
666
|
${UI.Widget.widget(AdoptedStyleSheetContentsWidget, {styleSheetHeader: header})}
|
|
668
667
|
</li>
|
|
669
668
|
` : nothing}
|
|
@@ -693,10 +692,9 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
693
692
|
?open=${isExpanded}
|
|
694
693
|
class="elements-tree-adopted-style-sheets"
|
|
695
694
|
style=${styleMap({'--indent': `${computeLeftIndent(depth, true)}px`})}
|
|
696
|
-
@select=${onSelect}
|
|
697
|
-
@expand=${onExpand}
|
|
698
|
-
jslog=${
|
|
699
|
-
<div class="selection fill"></div>
|
|
695
|
+
@select=${on(onSelect)}
|
|
696
|
+
@expand=${on(onExpand)}
|
|
697
|
+
jslog=${treeItemJslog('adopted-style-sheets')}>
|
|
700
698
|
<span class="elements-tree-shortcut-title">#adopted-style-sheets</span>
|
|
701
699
|
<ul role="group">
|
|
702
700
|
${UI.TreeOutline.ifExpanded(html`
|
|
@@ -811,7 +809,8 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
811
809
|
};
|
|
812
810
|
|
|
813
811
|
const renderNode = (node: SDK.DOMModel.DOMNode, depth = 0): Lit.LitTemplate => {
|
|
814
|
-
const
|
|
812
|
+
const isDOMNodeSelected = input.selectedNode === node;
|
|
813
|
+
const isSelected = Boolean(input.selectEnabled) && isDOMNodeSelected;
|
|
815
814
|
const isOpeningHovered =
|
|
816
815
|
(input.currentHighlightedNode === node) || (input.hoveredNode === node && !input.hoveredClosingTag);
|
|
817
816
|
const isClosingHovered = input.hoveredNode === node && Boolean(input.hoveredClosingTag);
|
|
@@ -920,10 +919,11 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
920
919
|
// clang-format off
|
|
921
920
|
return html`
|
|
922
921
|
<li role="treeitem"
|
|
922
|
+
selectable=${input.selectEnabled ? 'true' : 'false'}
|
|
923
923
|
?selected=${isSelected && !input.selectedClosingTag}
|
|
924
924
|
class=${classes}
|
|
925
925
|
style=${styleMap({'--indent': `${computeLeftIndent(depth, isExpandable)}px`})}
|
|
926
|
-
?open=${isExpanded && !isEditingAsHTML}
|
|
926
|
+
?open=${hasChildren && isExpanded && !isEditingAsHTML}
|
|
927
927
|
draggable=${isDraggable ? 'true' : 'false'}
|
|
928
928
|
@select=${on((event: UI.TreeOutline.TreeViewElement.SelectEvent) => onSelect(false, Boolean(event.detail?.selectedByUser)))}
|
|
929
929
|
@expand=${on(onExpand)}
|
|
@@ -934,19 +934,14 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
934
934
|
@dragleave=${on(onDragLeave)}
|
|
935
935
|
@drop=${on(onDrop)}
|
|
936
936
|
@dragend=${on(onDragEnd)}
|
|
937
|
-
jslog=${
|
|
938
|
-
keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Backspace|Delete|Enter|Space|Home|End',
|
|
939
|
-
resize: true,
|
|
940
|
-
drag: true,
|
|
941
|
-
click: true,
|
|
942
|
-
})}>
|
|
943
|
-
${UI.Widget.widget(ElementsTreeWidget, {
|
|
937
|
+
jslog=${treeItemJslog(undefined, true)}>${UI.Widget.widget(ElementsTreeWidget, {
|
|
944
938
|
node,
|
|
945
939
|
isClosingTag: false,
|
|
940
|
+
renderSelection: false,
|
|
946
941
|
expanded: isExpanded && !isEditingAsHTML,
|
|
947
942
|
isExpandable: hasChildren,
|
|
948
943
|
selected: isSelected && !input.selectedClosingTag,
|
|
949
|
-
isDOMNodeSelected
|
|
944
|
+
isDOMNodeSelected,
|
|
950
945
|
hovered: isOpeningHovered,
|
|
951
946
|
searchQuery: input.searchMatchNode === node ? (input.searchMatchQuery ?? null) : null,
|
|
952
947
|
inClipboard: input.isNodeInClipboard?.(node) ?? false,
|
|
@@ -972,8 +967,7 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
972
967
|
input.onSelectNodeAfterEdit?.(wasExpanded, error, newNode, moveDirection);
|
|
973
968
|
},
|
|
974
969
|
toggleHideElement: (n: SDK.DOMModel.DOMNode) => {
|
|
975
|
-
input.onToggleHideElement?.(n);
|
|
976
|
-
return Promise.resolve();
|
|
970
|
+
return input.onToggleHideElement?.(n) ?? Promise.resolve();
|
|
977
971
|
},
|
|
978
972
|
isToggledToHidden: (n: SDK.DOMModel.DOMNode) => input.isToggledToHidden?.(n) ?? false,
|
|
979
973
|
showContextMenu: (event: Event) => {
|
|
@@ -982,32 +976,28 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
982
976
|
}
|
|
983
977
|
},
|
|
984
978
|
updateRecord: input.updateRecordForNode?.(node) ?? null,
|
|
985
|
-
})}
|
|
986
|
-
${hasChildren ? html`
|
|
987
|
-
<ul role="group">
|
|
979
|
+
})}${hasChildren ? html`<ul role="group">
|
|
988
980
|
${UI.TreeOutline.ifExpanded(html`
|
|
989
981
|
${node.adoptedStyleSheetsForNode.length > 0 ? renderAdoptedStyleSheets(node, depth + 1) : nothing}
|
|
990
982
|
${repeat(children, child => child.id, child => renderNode(child, depth + 1))}
|
|
991
983
|
${remainingChildrenCount > 0 ? html`
|
|
992
984
|
<li role="treeitem"
|
|
985
|
+
selectable="false"
|
|
993
986
|
class="elements-tree-expand-all"
|
|
994
987
|
style=${styleMap({'--indent': `${computeLeftIndent(depth + 1, false)}px`})}
|
|
995
|
-
jslog=${
|
|
996
|
-
<devtools-button
|
|
988
|
+
jslog=${treeItemJslog('show-all-nodes')}><devtools-button
|
|
997
989
|
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
998
990
|
title=${i18nString(UIStrings.showAllNodesDMore, {PH1: remainingChildrenCount})}
|
|
999
991
|
@click=${on((event: Event) => {
|
|
1000
992
|
event.stopPropagation();
|
|
1001
993
|
input.onExpandAllChildren?.(node);
|
|
1002
|
-
})}>
|
|
1003
|
-
${i18nString(UIStrings.showAllNodesDMore, {PH1: remainingChildrenCount})}
|
|
1004
|
-
</devtools-button>
|
|
1005
|
-
</li>
|
|
994
|
+
})}>${i18nString(UIStrings.showAllNodesDMore, {PH1: remainingChildrenCount})}</devtools-button></li>
|
|
1006
995
|
` : nothing}
|
|
1007
996
|
${node.isInsertionPoint() ? node.distributedNodes().map(distributedNode => renderShortcut(distributedNode, depth + 1)) : nothing}
|
|
1008
997
|
${node instanceof SDK.DOMModel.DOMDocument ? renderTopLayerContainer(node, depth + 1) : nothing}
|
|
1009
998
|
${needsClosingTag ? html`
|
|
1010
999
|
<li role="treeitem"
|
|
1000
|
+
selectable=${input.selectEnabled ? 'true' : 'false'}
|
|
1011
1001
|
?selected=${isSelected && Boolean(input.selectedClosingTag)}
|
|
1012
1002
|
class=${classMap({
|
|
1013
1003
|
selected: isSelected && Boolean(input.selectedClosingTag),
|
|
@@ -1016,7 +1006,7 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
1016
1006
|
})}
|
|
1017
1007
|
style=${styleMap({'--indent': `${computeLeftIndent(depth + 1, false)}px`})}
|
|
1018
1008
|
draggable=${isDraggable ? 'true' : 'false'}
|
|
1019
|
-
jslog=${
|
|
1009
|
+
jslog=${treeItemJslog(undefined, true)}
|
|
1020
1010
|
@select=${on((event: UI.TreeOutline.TreeViewElement.SelectEvent) => onSelect(true, Boolean(event.detail?.selectedByUser)))}
|
|
1021
1011
|
@contextmenu=${on(onContextMenu)}
|
|
1022
1012
|
@mousemove=${on(onClosingMouseMove)}
|
|
@@ -1024,14 +1014,14 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
1024
1014
|
@dragover=${on(onClosingTagDragOver)}
|
|
1025
1015
|
@dragleave=${on(onDragLeave)}
|
|
1026
1016
|
@drop=${on(onClosingTagDrop)}
|
|
1027
|
-
@dragend=${on(onDragEnd)}
|
|
1028
|
-
${UI.Widget.widget(ElementsTreeWidget, {
|
|
1017
|
+
@dragend=${on(onDragEnd)}>${UI.Widget.widget(ElementsTreeWidget, {
|
|
1029
1018
|
node,
|
|
1030
1019
|
isClosingTag: true,
|
|
1020
|
+
renderSelection: false,
|
|
1031
1021
|
expanded: false,
|
|
1032
1022
|
isExpandable: false,
|
|
1033
1023
|
selected: isSelected && Boolean(input.selectedClosingTag),
|
|
1034
|
-
isDOMNodeSelected
|
|
1024
|
+
isDOMNodeSelected,
|
|
1035
1025
|
hovered: isClosingHovered,
|
|
1036
1026
|
computeLeftIndent: computeLeftIndent(depth + 1, false),
|
|
1037
1027
|
disableEdits: input.disableEdits ?? false,
|
|
@@ -1042,13 +1032,10 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
1042
1032
|
}
|
|
1043
1033
|
},
|
|
1044
1034
|
updateRecord: input.updateRecordForNode?.(node) ?? null,
|
|
1045
|
-
})}
|
|
1046
|
-
</li>
|
|
1035
|
+
})}</li>
|
|
1047
1036
|
` : nothing}
|
|
1048
1037
|
`)}
|
|
1049
|
-
</ul>
|
|
1050
|
-
` : nothing}
|
|
1051
|
-
</li>
|
|
1038
|
+
</ul>` : nothing}</li>
|
|
1052
1039
|
`;
|
|
1053
1040
|
// clang-format on
|
|
1054
1041
|
};
|
|
@@ -1101,19 +1088,16 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
1101
1088
|
const root = input.rootDOMNode;
|
|
1102
1089
|
return html`
|
|
1103
1090
|
<li role="treeitem"
|
|
1091
|
+
selectable="false"
|
|
1104
1092
|
class="elements-tree-expand-all"
|
|
1105
1093
|
style=${styleMap({'--indent': `${computeLeftIndent(0, false)}px`})}
|
|
1106
|
-
jslog=${
|
|
1107
|
-
<devtools-button
|
|
1094
|
+
jslog=${treeItemJslog('show-all-nodes')}><devtools-button
|
|
1108
1095
|
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
1109
1096
|
title=${i18nString(UIStrings.showAllNodesDMore, {PH1: remaining})}
|
|
1110
1097
|
@click=${on((event: Event) => {
|
|
1111
1098
|
event.stopPropagation();
|
|
1112
1099
|
input.onExpandAllChildren?.(root);
|
|
1113
|
-
})}>
|
|
1114
|
-
${i18nString(UIStrings.showAllNodesDMore, {PH1: remaining})}
|
|
1115
|
-
</devtools-button>
|
|
1116
|
-
</li>
|
|
1100
|
+
})}>${i18nString(UIStrings.showAllNodesDMore, {PH1: remaining})}</devtools-button></li>
|
|
1117
1101
|
`;
|
|
1118
1102
|
})() : nothing}
|
|
1119
1103
|
${input.omitRootDOMNode && input.rootDOMNode instanceof SDK.DOMModel.DOMDocument ? renderTopLayerContainer(input.rootDOMNode, 0) : nothing}
|
|
@@ -1728,6 +1712,12 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
1728
1712
|
}
|
|
1729
1713
|
return;
|
|
1730
1714
|
}
|
|
1715
|
+
if (isClosingTag && node) {
|
|
1716
|
+
const rootTreeElement = this.#viewOutput?.elementsTreeOutline?.findTreeElement(node);
|
|
1717
|
+
const closingTreeElement = rootTreeElement?.childAt(rootTreeElement.childCount() - 1);
|
|
1718
|
+
closingTreeElement?.select(!focus, true);
|
|
1719
|
+
return;
|
|
1720
|
+
}
|
|
1731
1721
|
this.#viewOutput?.elementsTreeOutline?.selectDOMNode(node, focus);
|
|
1732
1722
|
}
|
|
1733
1723
|
|
|
@@ -1826,16 +1816,19 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
1826
1816
|
|
|
1827
1817
|
async expandRecursively(node: SDK.DOMModel.DOMNode, maxDepth: number = Number.MAX_VALUE): Promise<void> {
|
|
1828
1818
|
if (this.#view === DECLARATIVE_VIEW) {
|
|
1829
|
-
await node.getSubtree(100, true);
|
|
1830
1819
|
const expand = async(n: SDK.DOMModel.DOMNode, depth: number): Promise<void> => {
|
|
1831
1820
|
if (depth > maxDepth) {
|
|
1832
1821
|
return;
|
|
1833
1822
|
}
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1823
|
+
if (n.childDocumentPromiseForTesting) {
|
|
1824
|
+
await n.childDocumentPromiseForTesting;
|
|
1825
|
+
}
|
|
1826
|
+
if (!n.children() && !n.contentDocument() &&
|
|
1827
|
+
(n === node || n.childNodeCount() || n.isIframe() || n.nodeType() === Node.DOCUMENT_NODE)) {
|
|
1828
|
+
await n.getSubtree(100, true);
|
|
1829
|
+
}
|
|
1830
|
+
if (nodeHasVisibleChildren(n, this.rootDOMNode, this.maxTreeDepth, this.omitRootDOMNode)) {
|
|
1831
|
+
this.#expandedNodes.add(n);
|
|
1839
1832
|
}
|
|
1840
1833
|
const visibleChildren = getVisibleChildren(n, this.#showComments);
|
|
1841
1834
|
if (visibleChildren.length) {
|
|
@@ -1957,7 +1950,10 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
1957
1950
|
if (this.#view === DECLARATIVE_VIEW) {
|
|
1958
1951
|
this.performUpdate();
|
|
1959
1952
|
} else {
|
|
1960
|
-
|
|
1953
|
+
let treeElement = node ? this.treeElementForNode(node) : null;
|
|
1954
|
+
if (isClosingTag && treeElement) {
|
|
1955
|
+
treeElement = treeElement.childAt(treeElement.childCount() - 1) as ElementsTreeElement | null;
|
|
1956
|
+
}
|
|
1961
1957
|
this.#viewOutput.elementsTreeOutline?.setHoverEffect(treeElement);
|
|
1962
1958
|
}
|
|
1963
1959
|
}
|
|
@@ -2093,7 +2089,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
2093
2089
|
void this.showContextMenu(node, event);
|
|
2094
2090
|
},
|
|
2095
2091
|
onToggleHideElement: (node: SDK.DOMModel.DOMNode) => {
|
|
2096
|
-
this.toggleHideElement(node);
|
|
2092
|
+
return this.toggleHideElement(node);
|
|
2097
2093
|
},
|
|
2098
2094
|
onKeyDown: (event: KeyboardEvent) => {
|
|
2099
2095
|
this.onKeyDown(event);
|
|
@@ -2319,9 +2315,8 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
2319
2315
|
this.#searchMatchQuery = query ?? null;
|
|
2320
2316
|
if (this.selectedDOMNode() !== node) {
|
|
2321
2317
|
this.selectDOMNode(node, /* focus= */ false);
|
|
2322
|
-
} else {
|
|
2323
|
-
this.performUpdate();
|
|
2324
2318
|
}
|
|
2319
|
+
this.performUpdate();
|
|
2325
2320
|
}
|
|
2326
2321
|
|
|
2327
2322
|
hideMatchHighlights(node: SDK.DOMModel.DOMNode): void {
|
|
@@ -2332,11 +2327,11 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
2332
2327
|
}
|
|
2333
2328
|
}
|
|
2334
2329
|
|
|
2335
|
-
toggleHideElement(node: SDK.DOMModel.DOMNode): void {
|
|
2330
|
+
async toggleHideElement(node: SDK.DOMModel.DOMNode): Promise<void> {
|
|
2336
2331
|
const changeTracker = this.changeTracker;
|
|
2337
2332
|
Elements.DOMChanges.trackVisibilityToggle(changeTracker, node, buildChangeSelector(changeTracker, node),
|
|
2338
2333
|
!this.isToggledToHidden(node));
|
|
2339
|
-
|
|
2334
|
+
await node.toggleHideElement();
|
|
2340
2335
|
}
|
|
2341
2336
|
|
|
2342
2337
|
async removeNode(node: SDK.DOMModel.DOMNode): Promise<void> {
|
|
@@ -2850,7 +2845,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
2850
2845
|
}
|
|
2851
2846
|
|
|
2852
2847
|
if (event.key === 'h' || event.key === 'H') {
|
|
2853
|
-
this.toggleHideElement(node);
|
|
2848
|
+
void this.toggleHideElement(node);
|
|
2854
2849
|
event.consume(true);
|
|
2855
2850
|
return true;
|
|
2856
2851
|
}
|
|
@@ -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 {
|
|
43
|
+
import {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,7 +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 {
|
|
51
|
+
const {widget, widgetRef} = UI.Widget;
|
|
52
52
|
|
|
53
53
|
const UIStrings = {
|
|
54
54
|
/**
|
|
@@ -104,14 +104,14 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
104
104
|
<div class="gray-info-message">${i18nString(UIStrings.noMatchingProperty)}</div>
|
|
105
105
|
` : nothing}
|
|
106
106
|
<devtools-tree show-selection-on-keyboard-focus @treeelementexpand=${onExpand} .template=${html`
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
<style>${ObjectUI.ObjectPropertiesSection.objectValueStyles}</style>
|
|
108
|
+
<style>${ObjectUI.ObjectPropertiesSection.objectPropertiesSectionStyles}</style>
|
|
109
|
+
<ul role=tree open class="source-code object-properties-section" ${
|
|
110
|
+
widget(ObjectUI.ObjectPropertiesSection.ObjectTreeWidget, {
|
|
111
|
+
objectTree: input.objectTree ?? undefined,
|
|
112
|
+
skipProto: true,
|
|
113
|
+
skipGettersAndSetters: true,
|
|
114
|
+
})} ${widgetRef(ObjectUI.ObjectPropertiesSection.ObjectTreeWidget, () => {})}>
|
|
115
115
|
</ul>
|
|
116
116
|
`}></devtools-tree>
|
|
117
117
|
</div>`, target);
|
|
@@ -223,6 +223,7 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
223
223
|
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
224
224
|
readOnly: true,
|
|
225
225
|
});
|
|
226
|
+
this.#objectTree.expanded = true;
|
|
226
227
|
this.#updateFilter();
|
|
227
228
|
}
|
|
228
229
|
|