chrome-devtools-frontend 1.0.1699061 → 1.0.1701636
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/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +16 -11
- package/front_end/core/sdk/NetworkManager.ts +7 -0
- package/front_end/core/sdk/SecurityOrigin.ts +1 -0
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +3 -0
- package/front_end/core/sdk/SourceMap.ts +12 -1
- package/front_end/core/sdk/SourceMapCache.ts +12 -0
- package/front_end/core/sdk/SourceMapManager.ts +17 -8
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +2 -19
- package/front_end/core/sdk/SourceMapScopesInfo.ts +21 -0
- package/front_end/core/sdk/StorageBucketsModel.ts +2 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +7 -3
- package/front_end/entrypoints/formatter_worker/Substitute.ts +90 -26
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +17 -4
- package/front_end/entrypoints/main/GlobalAiButton.ts +2 -6
- package/front_end/entrypoints/main/MainImpl.ts +8 -1
- package/front_end/generated/InspectorBackendCommands.ts +13 -5
- package/front_end/generated/SupportedCSSProperties.ts +14 -0
- package/front_end/generated/protocol-mapping.d.ts +48 -9
- package/front_end/generated/protocol-proxy-api.d.ts +37 -7
- package/front_end/generated/protocol.ts +135 -22
- package/front_end/models/ai_assistance/debug.ts +10 -2
- package/front_end/models/bindings/NetworkProject.ts +30 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +62 -0
- package/front_end/models/change_tracker/ChangeTracker.ts +1 -1
- package/front_end/models/comment_manager/CD4ABridge.ts +4 -4
- package/front_end/models/comment_manager/CommentManager.ts +21 -0
- package/front_end/models/extensions/ExtensionAPI.ts +4 -2
- package/front_end/models/formatter/FormatterWorkerPool.ts +2 -2
- package/front_end/models/issues_manager/CookieIssue.ts +0 -2
- package/front_end/models/javascript_metadata/NativeFunctions.ts +7 -2
- package/front_end/models/persistence/NetworkPersistenceManager.ts +29 -4
- package/front_end/models/source_map_scopes/NamesResolver.ts +65 -40
- package/front_end/models/source_map_scopes/ScopeChainModel.ts +21 -1
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +70 -1
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +5 -8
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +1 -1
- package/front_end/panels/application/AppManifestView.ts +128 -134
- package/front_end/panels/application/CrashReportContextView.ts +5 -5
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +17 -17
- package/front_end/panels/application/DeviceBoundSessionsView.ts +136 -137
- package/front_end/panels/application/IndexedDBModel.ts +3 -0
- package/front_end/panels/application/OriginTrialTreeView.ts +18 -23
- package/front_end/panels/application/ReportingApiTreeElement.ts +3 -3
- package/front_end/panels/application/ReportingApiView.ts +6 -14
- package/front_end/panels/application/application-meta.ts +7 -7
- package/front_end/panels/common/CommentThreadWidget.ts +19 -6
- package/front_end/panels/common/CommentsOverlayWidget.ts +143 -10
- package/front_end/panels/common/CommentsStatusBarPill.ts +13 -1
- package/front_end/panels/common/ExtensionServer.ts +61 -42
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/common/commentThreadWidget.css +18 -0
- package/front_end/panels/common/common-meta.ts +4 -1
- package/front_end/panels/console/ConsolePrompt.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/elements/ClassesPaneWidget.ts +2 -1
- package/front_end/panels/elements/DOMTreeContextMenu.ts +1 -1
- package/front_end/panels/elements/{ElementsTreeOutline.ts → DOMTreeWidget.ts} +45 -31
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +3 -1
- package/front_end/panels/elements/ShortcutTreeElement.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -6
- package/front_end/panels/elements/TopLayerContainer.ts +1 -1
- package/front_end/panels/elements/elements.ts +4 -3
- package/front_end/panels/elements/elementsTreeOutline.css +4 -0
- package/front_end/panels/event_listeners/EventListenersView.ts +9 -4
- package/front_end/panels/issues/IssuesPane.ts +34 -22
- package/front_end/panels/network/RequestPayloadView.ts +17 -15
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +1 -1
- package/front_end/panels/profiler/HeapProfileView.ts +8 -6
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +8 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +6 -4
- package/front_end/panels/recorder/RecordingView.ts +32 -53
- package/front_end/panels/recorder/controlButton.css +6 -0
- package/front_end/panels/recorder/recordingView.css +11 -2
- package/front_end/panels/security/SecurityPanel.ts +87 -99
- package/front_end/panels/sensors/SensorsView.ts +87 -0
- package/front_end/panels/sensors/sensors-meta.ts +69 -1
- package/front_end/panels/settings/keybindsSettingsTab.css +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +136 -55
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +17 -15
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +0 -2
- package/front_end/panels/timeline/components/LiveMetricsView.ts +59 -64
- package/front_end/panels/timeline/components/liveMetricsView.css +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1580 -1524
- package/front_end/third_party/lighthouse/locales/ar-XB.json +111 -72
- package/front_end/third_party/lighthouse/locales/ar.json +113 -74
- package/front_end/third_party/lighthouse/locales/bg.json +112 -73
- package/front_end/third_party/lighthouse/locales/ca.json +112 -73
- package/front_end/third_party/lighthouse/locales/cs.json +112 -73
- package/front_end/third_party/lighthouse/locales/da.json +112 -73
- package/front_end/third_party/lighthouse/locales/de.json +112 -73
- package/front_end/third_party/lighthouse/locales/el.json +112 -73
- package/front_end/third_party/lighthouse/locales/en-GB.json +111 -72
- package/front_end/third_party/lighthouse/locales/en-US.json +102 -66
- package/front_end/third_party/lighthouse/locales/en-XA.json +111 -72
- package/front_end/third_party/lighthouse/locales/en-XL.json +102 -66
- package/front_end/third_party/lighthouse/locales/es-419.json +112 -73
- package/front_end/third_party/lighthouse/locales/es.json +112 -73
- package/front_end/third_party/lighthouse/locales/fi.json +112 -73
- package/front_end/third_party/lighthouse/locales/fil.json +112 -73
- package/front_end/third_party/lighthouse/locales/fr.json +112 -73
- package/front_end/third_party/lighthouse/locales/he.json +112 -73
- package/front_end/third_party/lighthouse/locales/hi.json +112 -73
- package/front_end/third_party/lighthouse/locales/hr.json +112 -73
- package/front_end/third_party/lighthouse/locales/hu.json +112 -73
- package/front_end/third_party/lighthouse/locales/id.json +112 -73
- package/front_end/third_party/lighthouse/locales/it.json +113 -74
- package/front_end/third_party/lighthouse/locales/ja.json +112 -73
- package/front_end/third_party/lighthouse/locales/ko.json +112 -73
- package/front_end/third_party/lighthouse/locales/lt.json +112 -73
- package/front_end/third_party/lighthouse/locales/lv.json +112 -73
- package/front_end/third_party/lighthouse/locales/nl.json +112 -73
- package/front_end/third_party/lighthouse/locales/no.json +112 -73
- package/front_end/third_party/lighthouse/locales/pl.json +112 -73
- package/front_end/third_party/lighthouse/locales/pt-PT.json +112 -73
- package/front_end/third_party/lighthouse/locales/pt.json +112 -73
- package/front_end/third_party/lighthouse/locales/ro.json +112 -73
- package/front_end/third_party/lighthouse/locales/ru.json +112 -73
- package/front_end/third_party/lighthouse/locales/sk.json +112 -73
- package/front_end/third_party/lighthouse/locales/sl.json +112 -73
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +112 -73
- package/front_end/third_party/lighthouse/locales/sr.json +112 -73
- package/front_end/third_party/lighthouse/locales/sv.json +124 -85
- package/front_end/third_party/lighthouse/locales/ta.json +112 -73
- package/front_end/third_party/lighthouse/locales/te.json +112 -73
- package/front_end/third_party/lighthouse/locales/th.json +112 -73
- package/front_end/third_party/lighthouse/locales/tr.json +113 -74
- package/front_end/third_party/lighthouse/locales/uk.json +112 -73
- package/front_end/third_party/lighthouse/locales/vi.json +112 -73
- package/front_end/third_party/lighthouse/locales/zh-HK.json +112 -73
- package/front_end/third_party/lighthouse/locales/zh-TW.json +113 -74
- package/front_end/third_party/lighthouse/locales/zh.json +113 -74
- package/front_end/third_party/lighthouse/report/bundle.d.ts +4 -4
- package/front_end/third_party/lighthouse/report/bundle.js +10 -3
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -2
- package/front_end/third_party/lit/lit.ts +3 -0
- package/front_end/third_party/lit/package.json +3 -0
- package/front_end/third_party/lit/rebuild.sh +3 -2
- package/front_end/ui/comments/CommentAnchorResolver.ts +8 -2
- package/front_end/ui/comments/CommentOverlayManager.ts +2 -1
- package/front_end/ui/legacy/InspectorView.ts +4 -3
- package/front_end/ui/legacy/TabbedPane.ts +121 -80
- package/front_end/ui/legacy/Treeoutline.ts +37 -7
- package/front_end/ui/legacy/UIUtils.ts +7 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +135 -146
- package/front_end/ui/legacy/treeoutline.css +2 -2
- package/front_end/ui/lit/lit.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +11 -0
- package/inspector_overlay/highlight_anchor.ts +197 -0
- package/inspector_overlay/tool_highlight.ts +8 -0
- package/package.json +1 -1
|
@@ -34,6 +34,7 @@ const kForbiddenSchemes = [
|
|
|
34
34
|
'chrome-error:',
|
|
35
35
|
'chrome-search:',
|
|
36
36
|
'devtools:',
|
|
37
|
+
'isolated-app:',
|
|
37
38
|
];
|
|
38
39
|
|
|
39
40
|
declare global {
|
|
@@ -44,6 +45,18 @@ declare global {
|
|
|
44
45
|
|
|
45
46
|
let extensionServerInstance: ExtensionServer|null;
|
|
46
47
|
|
|
48
|
+
function parseCanonicalURL(url: Platform.DevToolsPath.UrlString): URL|null {
|
|
49
|
+
try {
|
|
50
|
+
let parsedURL = new URL(url);
|
|
51
|
+
while (parsedURL.protocol === 'blob:' || parsedURL.protocol === 'filesystem:') {
|
|
52
|
+
parsedURL = new URL(parsedURL.href.slice(parsedURL.protocol.length));
|
|
53
|
+
}
|
|
54
|
+
return parsedURL;
|
|
55
|
+
} catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
47
60
|
export class HostsPolicy {
|
|
48
61
|
static create(policy?: Host.InspectorFrontendHostAPI.ExtensionHostsPolicy): HostsPolicy|null {
|
|
49
62
|
const runtimeAllowedHosts = [];
|
|
@@ -98,12 +111,11 @@ class RegisteredExtension {
|
|
|
98
111
|
return false;
|
|
99
112
|
}
|
|
100
113
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
parsedURL = new URL(inspectedURL);
|
|
104
|
-
} catch {
|
|
114
|
+
const parsedURL = parseCanonicalURL(inspectedURL);
|
|
115
|
+
if (!parsedURL) {
|
|
105
116
|
return false;
|
|
106
117
|
}
|
|
118
|
+
inspectedURL = parsedURL.href as Platform.DevToolsPath.UrlString;
|
|
107
119
|
|
|
108
120
|
if (parsedURL.protocol === 'chrome-extension:') {
|
|
109
121
|
if (parsedURL.origin !== this.origin) {
|
|
@@ -584,7 +596,8 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
584
596
|
return this.subscribers.has(type);
|
|
585
597
|
}
|
|
586
598
|
|
|
587
|
-
private postNotification(type: string, args: unknown[], filter?: (extension: RegisteredExtension) => boolean
|
|
599
|
+
private postNotification(type: string, args: unknown[], filter?: (extension: RegisteredExtension) => boolean,
|
|
600
|
+
argsForExtension?: (extension: RegisteredExtension) => unknown[]): void {
|
|
588
601
|
if (!this.extensionsEnabled) {
|
|
589
602
|
return;
|
|
590
603
|
}
|
|
@@ -592,18 +605,22 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
592
605
|
if (!subscribers) {
|
|
593
606
|
return;
|
|
594
607
|
}
|
|
595
|
-
const message = {command: 'notify-' + type, arguments: args};
|
|
596
608
|
for (const subscriber of subscribers) {
|
|
597
609
|
if (!this.extensionEnabled(subscriber)) {
|
|
598
610
|
continue;
|
|
599
611
|
}
|
|
600
|
-
|
|
612
|
+
let extension: RegisteredExtension|undefined;
|
|
613
|
+
if (filter || argsForExtension) {
|
|
601
614
|
const origin = extensionOrigins.get(subscriber);
|
|
602
|
-
|
|
603
|
-
if (!extension || !filter(extension)) {
|
|
615
|
+
extension = origin && this.registeredExtensions.get(origin);
|
|
616
|
+
if (!extension || (filter && !filter(extension))) {
|
|
604
617
|
continue;
|
|
605
618
|
}
|
|
606
619
|
}
|
|
620
|
+
const message = {
|
|
621
|
+
command: 'notify-' + type,
|
|
622
|
+
arguments: extension && argsForExtension ? argsForExtension(extension) : args,
|
|
623
|
+
};
|
|
607
624
|
subscriber.postMessage(message);
|
|
608
625
|
}
|
|
609
626
|
}
|
|
@@ -1104,10 +1121,9 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
1104
1121
|
return this.evaluate(expression, true, true, evaluateOptions, this.getExtensionOrigin(port), callback.bind(this));
|
|
1105
1122
|
}
|
|
1106
1123
|
|
|
1107
|
-
private
|
|
1124
|
+
private sanitizeHarEntry(entry: HAR.Log.EntryDTO, extension: RegisteredExtension): HAR.Log.EntryDTO {
|
|
1108
1125
|
const baseURL = entry.request.url;
|
|
1109
1126
|
|
|
1110
|
-
// Helper to cleanly resolve and check permission
|
|
1111
1127
|
const isBlocked = (url: string|undefined): boolean => {
|
|
1112
1128
|
if (!url) {
|
|
1113
1129
|
return false;
|
|
@@ -1116,44 +1132,49 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
1116
1132
|
const absoluteURL = new URL(url, baseURL).toString() as Platform.DevToolsPath.UrlString;
|
|
1117
1133
|
return !extension.isAllowedOnTarget(absoluteURL);
|
|
1118
1134
|
} catch {
|
|
1119
|
-
return true;
|
|
1135
|
+
return true;
|
|
1120
1136
|
}
|
|
1121
1137
|
};
|
|
1122
1138
|
|
|
1123
|
-
|
|
1124
|
-
return true;
|
|
1125
|
-
}
|
|
1139
|
+
let initiator = entry._initiator;
|
|
1126
1140
|
if (entry._initiator) {
|
|
1127
1141
|
if (isBlocked(entry._initiator.url)) {
|
|
1128
|
-
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1142
|
+
initiator = null;
|
|
1143
|
+
} else {
|
|
1144
|
+
let stack = entry._initiator.stack;
|
|
1145
|
+
while (stack) {
|
|
1146
|
+
if (stack.callFrames.some(f => isBlocked(f.url))) {
|
|
1147
|
+
initiator = null;
|
|
1148
|
+
break;
|
|
1149
|
+
}
|
|
1150
|
+
stack = stack.parent;
|
|
1134
1151
|
}
|
|
1135
|
-
stack = stack.parent;
|
|
1136
1152
|
}
|
|
1137
1153
|
}
|
|
1138
|
-
|
|
1154
|
+
|
|
1155
|
+
const headerReferencesBlockedURL = (header: {name: string, value: string}): boolean => {
|
|
1139
1156
|
const name = header.name.toLowerCase();
|
|
1140
1157
|
if (name === 'location' || name === 'content-location') {
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
} else if (name === 'refresh') {
|
|
1158
|
+
return isBlocked(header.value);
|
|
1159
|
+
}
|
|
1160
|
+
if (name === 'refresh') {
|
|
1145
1161
|
const match = header.value.match(/;\s*url\s*=\s*(.+)$/i);
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
} else if (name === 'link') {
|
|
1162
|
+
return isBlocked(match?.[1]?.trim());
|
|
1163
|
+
}
|
|
1164
|
+
if (name === 'link') {
|
|
1150
1165
|
const urls = [...header.value.matchAll(/<([^>]+)>/g)].map(m => m[1]);
|
|
1151
|
-
|
|
1152
|
-
return true;
|
|
1153
|
-
}
|
|
1166
|
+
return urls.some(url => isBlocked(url));
|
|
1154
1167
|
}
|
|
1168
|
+
return false;
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1171
|
+
const headers = entry.response.headers.filter(header => !headerReferencesBlockedURL(header));
|
|
1172
|
+
const redirectURL = isBlocked(entry.response.redirectURL) ? '' : entry.response.redirectURL;
|
|
1173
|
+
if (initiator === entry._initiator && headers.length === entry.response.headers.length &&
|
|
1174
|
+
redirectURL === entry.response.redirectURL) {
|
|
1175
|
+
return entry;
|
|
1155
1176
|
}
|
|
1156
|
-
return
|
|
1177
|
+
return {...entry, _initiator: initiator, response: {...entry.response, headers, redirectURL}};
|
|
1157
1178
|
}
|
|
1158
1179
|
|
|
1159
1180
|
private async onGetHAR(message: Extensions.ExtensionAPI.PrivateAPI.ExtensionServerRequestMessage, port: MessagePort):
|
|
@@ -1173,7 +1194,7 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
1173
1194
|
// @ts-expect-error
|
|
1174
1195
|
harLog.entries[i]._requestId = this.requestId(requests[i]);
|
|
1175
1196
|
}
|
|
1176
|
-
harLog.entries = harLog.entries.
|
|
1197
|
+
harLog.entries = harLog.entries.map(entry => this.sanitizeHarEntry(entry, extension));
|
|
1177
1198
|
return harLog;
|
|
1178
1199
|
}
|
|
1179
1200
|
|
|
@@ -1513,8 +1534,8 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
1513
1534
|
this.postNotification(
|
|
1514
1535
|
Extensions.ExtensionAPI.PrivateAPI.Events.NetworkRequestFinished, [this.requestId(request), entry],
|
|
1515
1536
|
extension => extension.isAllowedOnTarget(entry.request.url as Platform.DevToolsPath.UrlString) &&
|
|
1516
|
-
(!targetUrl || extension.isAllowedOnTarget(targetUrl))
|
|
1517
|
-
|
|
1537
|
+
(!targetUrl || extension.isAllowedOnTarget(targetUrl)),
|
|
1538
|
+
extension => [this.requestId(request), this.sanitizeHarEntry(entry, extension)]);
|
|
1518
1539
|
}
|
|
1519
1540
|
|
|
1520
1541
|
private notifyElementsSelectionChanged(): void {
|
|
@@ -1818,12 +1839,10 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
1818
1839
|
}
|
|
1819
1840
|
|
|
1820
1841
|
static canInspectURL(url: Platform.DevToolsPath.UrlString): boolean {
|
|
1821
|
-
let parsedURL;
|
|
1822
1842
|
// This is only to work around invalid URLs we're occasionally getting from some tests.
|
|
1823
1843
|
// TODO(caseq): make sure tests supply valid URLs or we specifically handle invalid ones.
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
} catch {
|
|
1844
|
+
const parsedURL = parseCanonicalURL(url);
|
|
1845
|
+
if (!parsedURL) {
|
|
1827
1846
|
return false;
|
|
1828
1847
|
}
|
|
1829
1848
|
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
width: 100%;
|
|
28
28
|
justify-content: space-between;
|
|
29
29
|
align-items: center;
|
|
30
|
+
gap: var(--sys-size-4);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
.sent-status {
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
gap: var(--sys-size-2);
|
|
36
37
|
font-size: var(--sys-typescale-body5-size);
|
|
37
38
|
color: var(--sys-color-on-surface-subtle);
|
|
39
|
+
flex-shrink: 0;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
.check-icon {
|
|
@@ -153,7 +155,23 @@
|
|
|
153
155
|
padding: var(--sys-size-4) var(--sys-size-5);
|
|
154
156
|
}
|
|
155
157
|
|
|
158
|
+
.tooltip-link {
|
|
159
|
+
display: block;
|
|
160
|
+
margin-top: var(--sys-size-4);
|
|
161
|
+
color: var(--sys-color-primary);
|
|
162
|
+
padding-left: 0;
|
|
163
|
+
background: none;
|
|
164
|
+
border: none;
|
|
165
|
+
font: inherit;
|
|
166
|
+
text-decoration: underline;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.selected-item devtools-widget,
|
|
156
171
|
.selected-item-text {
|
|
172
|
+
display: block;
|
|
173
|
+
flex: 0 1 auto;
|
|
174
|
+
min-width: 0;
|
|
157
175
|
overflow: hidden;
|
|
158
176
|
white-space: nowrap;
|
|
159
177
|
text-overflow: ellipsis;
|
|
@@ -65,7 +65,10 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
UI.Toolbar.registerToolbarItem({
|
|
68
|
-
|
|
68
|
+
async loadItem() {
|
|
69
|
+
const Common = await loadCommonModule();
|
|
70
|
+
return new Common.CommentsOverlayWidget.ButtonProvider();
|
|
71
|
+
},
|
|
69
72
|
location: UI.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_LEFT,
|
|
70
73
|
order: 1,
|
|
71
74
|
condition: isCommentsEnabled,
|
|
@@ -459,7 +459,7 @@ export class ConsolePrompt extends ConsolePromptBase {
|
|
|
459
459
|
?.evaluateCommandInConsole(executionContext, message, expression, useCommandLineAPI);
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
-
private async substituteNames(expression: string, mapping: Map<string, string|null
|
|
462
|
+
private async substituteNames(expression: string, mapping: Array<Map<string, string|null>>): Promise<string> {
|
|
463
463
|
try {
|
|
464
464
|
return await Formatter.FormatterWorkerPool.formatterWorkerPool().javaScriptSubstitute(expression, mapping);
|
|
465
465
|
} catch {
|
|
@@ -1030,7 +1030,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1030
1030
|
result.appendChild(this.formatParameterAsObject(remoteObject, false));
|
|
1031
1031
|
return;
|
|
1032
1032
|
}
|
|
1033
|
-
const treeOutline = new Elements.
|
|
1033
|
+
const treeOutline = new Elements.DOMTreeWidget.ElementsTreeOutline(
|
|
1034
1034
|
/* omitRootDOMNode: */ false, /* selectEnabled: */ true, /* hideGutter: */ true);
|
|
1035
1035
|
treeOutline.rootDOMNode = node;
|
|
1036
1036
|
treeOutline.deindentSingleNode();
|
|
@@ -359,7 +359,8 @@ export class ClassNamePrompt extends UI.TextPrompt.TextPrompt {
|
|
|
359
359
|
|
|
360
360
|
let completions: string[] = await this.classNamesPromise;
|
|
361
361
|
const classesMap = this.nodeClasses((selectedNode));
|
|
362
|
-
|
|
362
|
+
const existingClasses = new Set(expression.split(/[,\s]/).map(className => className.trim()).filter(Boolean));
|
|
363
|
+
completions = completions.filter(value => !classesMap.get(value) && !existingClasses.has(value));
|
|
363
364
|
|
|
364
365
|
if (prefix[0] === '.') {
|
|
365
366
|
completions = completions.map(value => '.' + value);
|
|
@@ -9,9 +9,9 @@ import * as UI from '../../ui/legacy/legacy.js';
|
|
|
9
9
|
import * as Emulation from '../emulation/emulation.js';
|
|
10
10
|
|
|
11
11
|
import {canGetJSPath} from './DOMPath.js';
|
|
12
|
+
import type {DOMTreeWidget} from './DOMTreeWidget.js';
|
|
12
13
|
import {ElementsPanel} from './ElementsPanel.js';
|
|
13
14
|
import {ElementsTreeElement} from './ElementsTreeElement.js';
|
|
14
|
-
import type {DOMTreeWidget} from './ElementsTreeOutline.js';
|
|
15
15
|
|
|
16
16
|
const UIStrings = {
|
|
17
17
|
/**
|
|
@@ -75,7 +75,7 @@ import {ImagePreviewPopover} from './ImagePreviewPopover.js';
|
|
|
75
75
|
import {ShortcutTreeElement} from './ShortcutTreeElement.js';
|
|
76
76
|
import {TopLayerContainer} from './TopLayerContainer.js';
|
|
77
77
|
|
|
78
|
-
const {html, nothing, render, Directives: {classMap, repeat, styleMap}} = Lit;
|
|
78
|
+
const {html, nothing, render, Directives: {classMap, ifDefined, repeat, styleMap}} = Lit;
|
|
79
79
|
|
|
80
80
|
const UIStrings = {
|
|
81
81
|
/**
|
|
@@ -101,7 +101,7 @@ const UIStrings = {
|
|
|
101
101
|
*/
|
|
102
102
|
reveal: 'reveal',
|
|
103
103
|
} as const;
|
|
104
|
-
const str_ = i18n.i18n.registerUIStrings('panels/elements/
|
|
104
|
+
const str_ = i18n.i18n.registerUIStrings('panels/elements/DOMTreeWidget.ts', UIStrings);
|
|
105
105
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
106
106
|
const elementsTreeOutlineByDOMModel = new WeakMap<SDK.DOMModel.DOMModel, ElementsTreeOutline>();
|
|
107
107
|
|
|
@@ -919,6 +919,8 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
919
919
|
// clang-format off
|
|
920
920
|
return html`
|
|
921
921
|
<li role="treeitem"
|
|
922
|
+
data-backend-node-id=${ifDefined(node.backendNodeId())}
|
|
923
|
+
data-target-id=${ifDefined(node.domModel().target().id())}
|
|
922
924
|
selectable=${input.selectEnabled ? 'true' : 'false'}
|
|
923
925
|
?selected=${isSelected && !input.selectedClosingTag}
|
|
924
926
|
class=${classes}
|
|
@@ -977,7 +979,7 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
977
979
|
},
|
|
978
980
|
updateRecord: input.updateRecordForNode?.(node) ?? null,
|
|
979
981
|
})}${hasChildren ? html`<ul role="group">
|
|
980
|
-
${
|
|
982
|
+
${isExpanded && !isEditingAsHTML ? html`
|
|
981
983
|
${node.adoptedStyleSheetsForNode.length > 0 ? renderAdoptedStyleSheets(node, depth + 1) : nothing}
|
|
982
984
|
${repeat(children, child => child.id, child => renderNode(child, depth + 1))}
|
|
983
985
|
${remainingChildrenCount > 0 ? html`
|
|
@@ -997,6 +999,8 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
997
999
|
${node instanceof SDK.DOMModel.DOMDocument ? renderTopLayerContainer(node, depth + 1) : nothing}
|
|
998
1000
|
${needsClosingTag ? html`
|
|
999
1001
|
<li role="treeitem"
|
|
1002
|
+
data-backend-node-id=${ifDefined(node.backendNodeId())}
|
|
1003
|
+
data-target-id=${ifDefined(node.domModel().target().id())}
|
|
1000
1004
|
selectable=${input.selectEnabled ? 'true' : 'false'}
|
|
1001
1005
|
?selected=${isSelected && Boolean(input.selectedClosingTag)}
|
|
1002
1006
|
class=${classMap({
|
|
@@ -1034,7 +1038,7 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
1034
1038
|
updateRecord: input.updateRecordForNode?.(node) ?? null,
|
|
1035
1039
|
})}</li>
|
|
1036
1040
|
` : nothing}
|
|
1037
|
-
`
|
|
1041
|
+
` : nothing}
|
|
1038
1042
|
</ul>` : nothing}</li>
|
|
1039
1043
|
`;
|
|
1040
1044
|
// clang-format on
|
|
@@ -1062,7 +1066,7 @@ export const DECLARATIVE_VIEW: View = (input: ViewInput, _output: ViewOutput, ta
|
|
|
1062
1066
|
<style>${CodeHighlighter.codeHighlighterStyles}</style>
|
|
1063
1067
|
<div class=${disclosureClasses} style=${disclosureStyles}>
|
|
1064
1068
|
<devtools-tree
|
|
1065
|
-
class="elements-tree-outline
|
|
1069
|
+
class="elements-tree-outline ${input.wrap ? '' : 'elements-tree-nowrap'} ${input.hideGutter ? 'elements-hide-gutter' : ''} ${isSingleNode ? 'single-node' : ''}"
|
|
1066
1070
|
disclosure-class="elements-disclosure ${isSingleNode ? 'single-node' : ''} ${input.maxRowsShown ? 'elements-tree-truncated' : ''}"
|
|
1067
1071
|
jslog=${VisualLogging.tree('elements')}
|
|
1068
1072
|
?show-selection-on-keyboard-focus=${input.showSelectionOnKeyboardFocus}
|
|
@@ -1348,7 +1352,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
1348
1352
|
element?: HTMLElement,
|
|
1349
1353
|
[changeTracker]:
|
|
1350
1354
|
UI.Widget.WidgetDependencies<typeof DOMTreeWidget>|[ChangeTracker.ChangeTracker.ChangeTracker?] = [],
|
|
1351
|
-
view: View =
|
|
1355
|
+
view: View = DECLARATIVE_VIEW,
|
|
1352
1356
|
) {
|
|
1353
1357
|
super(element, {
|
|
1354
1358
|
useShadowDom: false,
|
|
@@ -1358,12 +1362,12 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
1358
1362
|
this.#changeTracker = changeTracker;
|
|
1359
1363
|
this.#showHTMLCommentsSetting.addChangeListener(this.#onShowHTMLCommentsChange, this);
|
|
1360
1364
|
if (Common.Settings.Settings.instance().moduleSetting('highlight-node-on-hover-in-overlay').get()) {
|
|
1361
|
-
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
1365
|
-
|
|
1366
|
-
|
|
1365
|
+
SDK.TargetManager.TargetManager.instance().addModelListener(SDK.OverlayModel.OverlayModel,
|
|
1366
|
+
SDK.OverlayModel.Events.HIGHLIGHT_NODE_REQUESTED,
|
|
1367
|
+
this.#highlightNode, this, {scoped: true});
|
|
1368
|
+
SDK.TargetManager.TargetManager.instance().addModelListener(SDK.OverlayModel.OverlayModel,
|
|
1369
|
+
SDK.OverlayModel.Events.INSPECT_MODE_WILL_BE_TOGGLED,
|
|
1370
|
+
this.#clearHighlightedNode, this, {scoped: true});
|
|
1367
1371
|
}
|
|
1368
1372
|
this.#setupPopovers();
|
|
1369
1373
|
}
|
|
@@ -1464,7 +1468,6 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
1464
1468
|
if (domModel.existingDocument()) {
|
|
1465
1469
|
this.rootDOMNode = domModel.existingDocument();
|
|
1466
1470
|
}
|
|
1467
|
-
this.onDocumentUpdated(domModel);
|
|
1468
1471
|
}
|
|
1469
1472
|
|
|
1470
1473
|
#updateModifiedNodesTimeout?: number;
|
|
@@ -1518,12 +1521,12 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
1518
1521
|
event: Common.EventTarget.EventTargetEvent<{node: SDK.DOMModel.DOMNode, parent: SDK.DOMModel.DOMNode}>): void {
|
|
1519
1522
|
const {node, parent} = event.data;
|
|
1520
1523
|
this.resetClipboardIfNeeded(node);
|
|
1521
|
-
if (this.#selectedDOMNode && (this.#selectedDOMNode === node || node.isAncestor(this.#selectedDOMNode))) {
|
|
1522
|
-
this.selectDOMNode(this.#findNextNodeOnRemoval(node, parent), true);
|
|
1523
|
-
}
|
|
1524
1524
|
if (parent) {
|
|
1525
1525
|
this.#addUpdateRecord(parent).nodeRemoved(node);
|
|
1526
1526
|
}
|
|
1527
|
+
if (this.#selectedDOMNode && (this.#selectedDOMNode === node || node.isAncestor(this.#selectedDOMNode))) {
|
|
1528
|
+
this.selectDOMNode(this.#findNextNodeOnRemoval(node, parent), true);
|
|
1529
|
+
}
|
|
1527
1530
|
this.#updateModifiedNodesSoon();
|
|
1528
1531
|
}
|
|
1529
1532
|
|
|
@@ -1671,6 +1674,11 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
1671
1674
|
}
|
|
1672
1675
|
this.#selectedAdoptedStyleSheet = null;
|
|
1673
1676
|
if (this.#view === DECLARATIVE_VIEW) {
|
|
1677
|
+
if (node?.nodeType() === Node.TEXT_NODE && node.parentNode &&
|
|
1678
|
+
(!nodeHasVisibleChildren(node.parentNode, this.rootDOMNode, this.maxTreeDepth, this.omitRootDOMNode) ||
|
|
1679
|
+
!getVisibleChildren(node.parentNode, this.#showComments).includes(node))) {
|
|
1680
|
+
node = node.parentNode;
|
|
1681
|
+
}
|
|
1674
1682
|
const isSameNode = this.#selectedDOMNode === node && this.#selectedClosingTag === Boolean(isClosingTag);
|
|
1675
1683
|
this.#selectedDOMNode = node;
|
|
1676
1684
|
this.#selectedClosingTag = Boolean(isClosingTag);
|
|
@@ -2241,7 +2249,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
2241
2249
|
this.onDocumentUpdated(domModel);
|
|
2242
2250
|
} else {
|
|
2243
2251
|
void domModel.requestDocument().then(document => {
|
|
2244
|
-
if (document && this.isShowing()) {
|
|
2252
|
+
if (document && this.isShowing() && this.#wiredDOMModels.has(domModel)) {
|
|
2245
2253
|
this.rootDOMNode = document;
|
|
2246
2254
|
this.onDocumentUpdated(domModel);
|
|
2247
2255
|
}
|
|
@@ -2265,6 +2273,12 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
2265
2273
|
this.#wiredDOMModels.delete(domModel);
|
|
2266
2274
|
this.#unwireDOMModel(domModel);
|
|
2267
2275
|
}
|
|
2276
|
+
if (this.#rootDOMNode?.domModel() === domModel) {
|
|
2277
|
+
this.#rootDOMNode = null;
|
|
2278
|
+
this.#selectedDOMNode = null;
|
|
2279
|
+
this.#expandedNodes.clear();
|
|
2280
|
+
this.#updateRecords.clear();
|
|
2281
|
+
}
|
|
2268
2282
|
this.performUpdate();
|
|
2269
2283
|
return;
|
|
2270
2284
|
}
|
|
@@ -3137,7 +3151,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
3137
3151
|
this.onDocumentUpdated(domModel);
|
|
3138
3152
|
} else if (this.#view === DECLARATIVE_VIEW) {
|
|
3139
3153
|
void domModel.requestDocument().then(document => {
|
|
3140
|
-
if (document && this.isShowing()) {
|
|
3154
|
+
if (document && this.isShowing() && this.#wiredDOMModels.has(domModel)) {
|
|
3141
3155
|
this.rootDOMNode = document;
|
|
3142
3156
|
this.onDocumentUpdated(domModel);
|
|
3143
3157
|
}
|
|
@@ -3468,8 +3482,8 @@ export class ElementsTreeOutline extends ElementsTreeOutlineBase {
|
|
|
3468
3482
|
}
|
|
3469
3483
|
|
|
3470
3484
|
selectedNodeChanged(focus: boolean): void {
|
|
3471
|
-
this.dispatchEventToListeners(
|
|
3472
|
-
|
|
3485
|
+
this.dispatchEventToListeners(ElementsTreeOutline.Events.SelectedNodeChanged,
|
|
3486
|
+
{node: this.selectedDOMNodeInternal, focus});
|
|
3473
3487
|
}
|
|
3474
3488
|
|
|
3475
3489
|
private fireElementsTreeUpdated(nodes: SDK.DOMModel.DOMNode[]): void {
|
|
@@ -3783,8 +3797,8 @@ export class ElementsTreeOutline extends ElementsTreeOutlineBase {
|
|
|
3783
3797
|
domModel.addEventListener(SDK.DOMModel.Events.DocumentURLChanged, this.documentURLChanged, this);
|
|
3784
3798
|
domModel.addEventListener(SDK.DOMModel.Events.ChildNodeCountUpdated, this.childNodeCountUpdated, this);
|
|
3785
3799
|
domModel.addEventListener(SDK.DOMModel.Events.DistributedNodesChanged, this.distributedNodesChanged, this);
|
|
3786
|
-
domModel.addEventListener(
|
|
3787
|
-
|
|
3800
|
+
domModel.addEventListener(SDK.DOMModel.Events.AffectedByStartingStylesFlagUpdated,
|
|
3801
|
+
this.affectedByStartingStylesFlagUpdated, this);
|
|
3788
3802
|
domModel.addEventListener(SDK.DOMModel.Events.AdoptedStyleSheetsModified, this.adoptedStyleSheetsModified, this);
|
|
3789
3803
|
}
|
|
3790
3804
|
|
|
@@ -3799,8 +3813,8 @@ export class ElementsTreeOutline extends ElementsTreeOutlineBase {
|
|
|
3799
3813
|
domModel.removeEventListener(SDK.DOMModel.Events.DocumentURLChanged, this.documentURLChanged, this);
|
|
3800
3814
|
domModel.removeEventListener(SDK.DOMModel.Events.ChildNodeCountUpdated, this.childNodeCountUpdated, this);
|
|
3801
3815
|
domModel.removeEventListener(SDK.DOMModel.Events.DistributedNodesChanged, this.distributedNodesChanged, this);
|
|
3802
|
-
domModel.removeEventListener(
|
|
3803
|
-
|
|
3816
|
+
domModel.removeEventListener(SDK.DOMModel.Events.AffectedByStartingStylesFlagUpdated,
|
|
3817
|
+
this.affectedByStartingStylesFlagUpdated, this);
|
|
3804
3818
|
domModel.removeEventListener(SDK.DOMModel.Events.AdoptedStyleSheetsModified, this.adoptedStyleSheetsModified, this);
|
|
3805
3819
|
elementsTreeOutlineByDOMModel.delete(domModel);
|
|
3806
3820
|
}
|
|
@@ -4022,8 +4036,8 @@ export class ElementsTreeOutline extends ElementsTreeOutlineBase {
|
|
|
4022
4036
|
return false;
|
|
4023
4037
|
}
|
|
4024
4038
|
|
|
4025
|
-
private createElementTreeElement(node: SDK.DOMModel.DOMNode|SDK.DOMModel.AdoptedStyleSheet[],
|
|
4026
|
-
|
|
4039
|
+
private createElementTreeElement(node: SDK.DOMModel.DOMNode|SDK.DOMModel.AdoptedStyleSheet[],
|
|
4040
|
+
isClosingTag?: boolean): UI.TreeOutline.TreeElement {
|
|
4027
4041
|
if (node instanceof Array) {
|
|
4028
4042
|
return new AdoptedStyleSheetSetTreeElement(node);
|
|
4029
4043
|
}
|
|
@@ -4198,9 +4212,9 @@ export class ElementsTreeOutline extends ElementsTreeOutlineBase {
|
|
|
4198
4212
|
this.#updateChildren(treeElement);
|
|
4199
4213
|
}
|
|
4200
4214
|
|
|
4201
|
-
insertChildElement(
|
|
4202
|
-
|
|
4203
|
-
|
|
4215
|
+
insertChildElement(treeElement: ElementsTreeElement|TopLayerContainer,
|
|
4216
|
+
child: SDK.DOMModel.DOMNode|SDK.DOMModel.AdoptedStyleSheet[], index: number,
|
|
4217
|
+
isClosingTag?: boolean): UI.TreeOutline.TreeElement {
|
|
4204
4218
|
const newElement = this.createElementTreeElement(child, isClosingTag);
|
|
4205
4219
|
treeElement.insertChild(newElement, index);
|
|
4206
4220
|
return newElement;
|
|
@@ -4233,8 +4247,8 @@ export class ElementsTreeOutline extends ElementsTreeOutlineBase {
|
|
|
4233
4247
|
|
|
4234
4248
|
// Remove any tree elements that no longer have this node as their parent and save
|
|
4235
4249
|
// all existing elements that could be reused. This also removes closing tag element.
|
|
4236
|
-
const existingTreeElements = new Map<
|
|
4237
|
-
|
|
4250
|
+
const existingTreeElements = new Map<SDK.DOMModel.DOMNode|SDK.DOMModel.AdoptedStyleSheet[],
|
|
4251
|
+
UI.TreeOutline.TreeElement&ElementsTreeElement>();
|
|
4238
4252
|
for (let i = treeElement.childCount() - 1; i >= 0; --i) {
|
|
4239
4253
|
const existingTreeElement = treeElement.childAt(i);
|
|
4240
4254
|
if (!(existingTreeElement instanceof ElementsTreeElement)) {
|
|
@@ -51,8 +51,8 @@ import {AccessibilityTreeView} from './AccessibilityTreeView.js';
|
|
|
51
51
|
import {ColorSwatchPopoverIcon} from './ColorSwatchPopoverIcon.js';
|
|
52
52
|
import * as ElementsComponents from './components/components.js';
|
|
53
53
|
import {ComputedStyleWidget} from './ComputedStyleWidget.js';
|
|
54
|
+
import {DOMTreeWidget, type ElementsTreeOutline} from './DOMTreeWidget.js';
|
|
54
55
|
import elementsPanelStyles from './elementsPanel.css.js';
|
|
55
|
-
import {DOMTreeWidget, type ElementsTreeOutline} from './ElementsTreeOutline.js';
|
|
56
56
|
import {LayoutPane} from './LayoutPane.js';
|
|
57
57
|
import type {MarkerDecorator} from './MarkerDecorator.js';
|
|
58
58
|
import {MetricsSidebarPane} from './MetricsSidebarPane.js';
|
|
@@ -67,10 +67,10 @@ import * as Media from '../media/media.js';
|
|
|
67
67
|
|
|
68
68
|
import * as ElementsComponents from './components/components.js';
|
|
69
69
|
import {cssPath} from './DOMPath.js';
|
|
70
|
+
import {type ElementsTreeOutline, MappedCharToEntity} from './DOMTreeWidget.js';
|
|
70
71
|
import {getElementIssueDetails} from './ElementIssueUtils.js';
|
|
71
72
|
import {ElementsPanel} from './ElementsPanel.js';
|
|
72
73
|
import * as ElementStatePaneWidget from './ElementStatePaneWidget.js';
|
|
73
|
-
import {type ElementsTreeOutline, MappedCharToEntity} from './ElementsTreeOutline.js';
|
|
74
74
|
import {ImagePreviewPopover} from './ImagePreviewPopover.js';
|
|
75
75
|
import {getRegisteredDecorators, type MarkerDecorator, type MarkerDecoratorRegistration} from './MarkerDecorator.js';
|
|
76
76
|
|
|
@@ -3178,6 +3178,8 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3178
3178
|
drag: true,
|
|
3179
3179
|
click: true,
|
|
3180
3180
|
})}`);
|
|
3181
|
+
this.listItemElement.setAttribute('data-backend-node-id', String(node.backendNodeId()));
|
|
3182
|
+
this.listItemElement.setAttribute('data-target-id', node.domModel().target().id());
|
|
3181
3183
|
|
|
3182
3184
|
this.widgetWrapper = document.createElement('div');
|
|
3183
3185
|
this.widgetWrapper.style.display = 'contents';
|
|
@@ -40,8 +40,8 @@ import * as Lit from '../../ui/lit/lit.js';
|
|
|
40
40
|
import * as VisualElements from '../../ui/visual_logging/visual_logging.js';
|
|
41
41
|
|
|
42
42
|
import * as ElementsComponents from './components/components.js';
|
|
43
|
+
import {ElementsTreeOutline} from './DOMTreeWidget.js';
|
|
43
44
|
import {adornerRef, ElementsTreeElement, handleAdornerKeydown} from './ElementsTreeElement.js';
|
|
44
|
-
import {ElementsTreeOutline} from './ElementsTreeOutline.js';
|
|
45
45
|
|
|
46
46
|
const {html, render} = Lit;
|
|
47
47
|
|
|
@@ -2044,7 +2044,7 @@ export class AnchorFunctionRenderer extends AnchorFunctionRendererBase {
|
|
|
2044
2044
|
|
|
2045
2045
|
override render(match: SDK.CSSPropertyParserMatchers.AnchorFunctionMatch, context: RenderingContext): Node[] {
|
|
2046
2046
|
const content = document.createElement('span');
|
|
2047
|
-
if (match.node.name
|
|
2047
|
+
if (match.node.name !== 'CallExpression') {
|
|
2048
2048
|
// Link an anchor double-dashed ident to its matching anchor element.
|
|
2049
2049
|
void AnchorFunctionRenderer.decorateAnchorForAnchorLink(this.#stylesContainer, content, {identifier: match.text});
|
|
2050
2050
|
} else {
|
|
@@ -729,9 +729,6 @@ export class StylesSidebarPane extends StylesSidebarPaneBase implements StylesCo
|
|
|
729
729
|
}
|
|
730
730
|
|
|
731
731
|
setEditingStyle(editing: boolean): void {
|
|
732
|
-
if (editing) {
|
|
733
|
-
this.isSuppressingResets = false;
|
|
734
|
-
}
|
|
735
732
|
if (this.isEditingStyle === editing) {
|
|
736
733
|
return;
|
|
737
734
|
}
|
|
@@ -816,12 +813,13 @@ export class StylesSidebarPane extends StylesSidebarPaneBase implements StylesCo
|
|
|
816
813
|
#scheduleResetUpdateIfNotEditing(): void {
|
|
817
814
|
this.scheduleResetUpdateIfNotEditingCalledForTest();
|
|
818
815
|
|
|
819
|
-
if
|
|
816
|
+
// Don't schedule if editing; the edit completion will handle the update.
|
|
817
|
+
if (this.userOperation || this.isEditingStyle) {
|
|
820
818
|
return;
|
|
821
819
|
}
|
|
822
820
|
|
|
823
|
-
|
|
824
|
-
|
|
821
|
+
if (this.isSuppressingResets) {
|
|
822
|
+
this.isSuppressingResets = false;
|
|
825
823
|
return;
|
|
826
824
|
}
|
|
827
825
|
|
|
@@ -6,7 +6,7 @@ import type * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
|
-
import type {ElementsTreeOutline} from './
|
|
9
|
+
import type {ElementsTreeOutline} from './DOMTreeWidget.js';
|
|
10
10
|
import {ShortcutTreeElement} from './ShortcutTreeElement.js';
|
|
11
11
|
|
|
12
12
|
export class TopLayerContainer extends UI.TreeOutline.TreeElement {
|
|
@@ -10,7 +10,7 @@ import './ElementsSidebarPane.js';
|
|
|
10
10
|
import './ElementsTreeElement.js';
|
|
11
11
|
import './AdoptedStyleSheetTreeElement.js';
|
|
12
12
|
import './TopLayerContainer.js';
|
|
13
|
-
import './
|
|
13
|
+
import './DOMTreeWidget.js';
|
|
14
14
|
import './ImagePreviewPopover.js';
|
|
15
15
|
import './EventListenersWidget.js';
|
|
16
16
|
import './MarkerDecorator.js';
|
|
@@ -42,11 +42,11 @@ import * as CSSSpecificityBreakdown from './CSSSpecificityBreakdown.js';
|
|
|
42
42
|
import * as CSSValueTraceView from './CSSValueTraceView.js';
|
|
43
43
|
import * as DOMPath from './DOMPath.js';
|
|
44
44
|
import * as DOMTreeContextMenu from './DOMTreeContextMenu.js';
|
|
45
|
+
import * as DOMTreeWidget from './DOMTreeWidget.js';
|
|
45
46
|
import * as ElementsPanel from './ElementsPanel.js';
|
|
46
47
|
import * as ElementsSidebarPane from './ElementsSidebarPane.js';
|
|
47
48
|
import * as ElementStatePaneWidget from './ElementStatePaneWidget.js';
|
|
48
49
|
import * as ElementsTreeElement from './ElementsTreeElement.js';
|
|
49
|
-
import * as ElementsTreeOutline from './ElementsTreeOutline.js';
|
|
50
50
|
import * as EventListenersWidget from './EventListenersWidget.js';
|
|
51
51
|
import * as ImagePreviewPopover from './ImagePreviewPopover.js';
|
|
52
52
|
import * as InspectElementModeController from './InspectElementModeController.js';
|
|
@@ -80,11 +80,12 @@ export {
|
|
|
80
80
|
CSSValueTraceView,
|
|
81
81
|
DOMPath,
|
|
82
82
|
DOMTreeContextMenu,
|
|
83
|
+
DOMTreeWidget,
|
|
84
|
+
DOMTreeWidget as ElementsTreeOutline,
|
|
83
85
|
ElementsPanel,
|
|
84
86
|
ElementsSidebarPane,
|
|
85
87
|
ElementStatePaneWidget,
|
|
86
88
|
ElementsTreeElement,
|
|
87
|
-
ElementsTreeOutline,
|
|
88
89
|
EventListenersWidget,
|
|
89
90
|
ImagePreviewPopover,
|
|
90
91
|
InspectElementModeController,
|