chrome-devtools-frontend 1.0.942529 → 1.0.943986
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/WATCHLISTS +1 -1
- package/config/gni/all_devtools_files.gni +0 -14
- package/config/gni/devtools_grd_files.gni +6 -5
- package/front_end/Tests.js +0 -32
- package/front_end/core/i18n/locales/af.json +455 -44
- package/front_end/core/i18n/locales/am.json +455 -44
- package/front_end/core/i18n/locales/ar.json +455 -44
- package/front_end/core/i18n/locales/as.json +455 -44
- package/front_end/core/i18n/locales/az.json +455 -44
- package/front_end/core/i18n/locales/be.json +456 -45
- package/front_end/core/i18n/locales/bg.json +455 -44
- package/front_end/core/i18n/locales/bn.json +455 -44
- package/front_end/core/i18n/locales/bs.json +455 -44
- package/front_end/core/i18n/locales/ca.json +457 -46
- package/front_end/core/i18n/locales/cs.json +458 -47
- package/front_end/core/i18n/locales/cy.json +455 -44
- package/front_end/core/i18n/locales/da.json +455 -44
- package/front_end/core/i18n/locales/de.json +455 -44
- package/front_end/core/i18n/locales/el.json +455 -44
- package/front_end/core/i18n/locales/en-GB.json +449 -38
- package/front_end/core/i18n/locales/en-US.json +8 -8
- package/front_end/core/i18n/locales/en-XL.json +8 -8
- package/front_end/core/i18n/locales/es-419.json +455 -44
- package/front_end/core/i18n/locales/es.json +455 -44
- package/front_end/core/i18n/locales/et.json +455 -44
- package/front_end/core/i18n/locales/eu.json +462 -51
- package/front_end/core/i18n/locales/fa.json +455 -44
- package/front_end/core/i18n/locales/fi.json +455 -44
- package/front_end/core/i18n/locales/fil.json +454 -43
- package/front_end/core/i18n/locales/fr-CA.json +455 -44
- package/front_end/core/i18n/locales/fr.json +456 -45
- package/front_end/core/i18n/locales/gl.json +455 -44
- package/front_end/core/i18n/locales/gu.json +456 -45
- package/front_end/core/i18n/locales/he.json +455 -44
- package/front_end/core/i18n/locales/hi.json +455 -44
- package/front_end/core/i18n/locales/hr.json +455 -44
- package/front_end/core/i18n/locales/hu.json +455 -44
- package/front_end/core/i18n/locales/hy.json +455 -44
- package/front_end/core/i18n/locales/id.json +455 -44
- package/front_end/core/i18n/locales/is.json +455 -44
- package/front_end/core/i18n/locales/it.json +502 -91
- package/front_end/core/i18n/locales/ja.json +456 -45
- package/front_end/core/i18n/locales/ka.json +455 -44
- package/front_end/core/i18n/locales/kk.json +456 -45
- package/front_end/core/i18n/locales/km.json +455 -44
- package/front_end/core/i18n/locales/kn.json +455 -44
- package/front_end/core/i18n/locales/ko.json +455 -44
- package/front_end/core/i18n/locales/ky.json +456 -45
- package/front_end/core/i18n/locales/lo.json +454 -43
- package/front_end/core/i18n/locales/lt.json +455 -44
- package/front_end/core/i18n/locales/lv.json +458 -47
- package/front_end/core/i18n/locales/mk.json +455 -44
- package/front_end/core/i18n/locales/ml.json +461 -50
- package/front_end/core/i18n/locales/mn.json +455 -44
- package/front_end/core/i18n/locales/mr.json +455 -44
- package/front_end/core/i18n/locales/ms.json +455 -44
- package/front_end/core/i18n/locales/my.json +456 -45
- package/front_end/core/i18n/locales/ne.json +456 -45
- package/front_end/core/i18n/locales/nl.json +532 -121
- package/front_end/core/i18n/locales/no.json +455 -44
- package/front_end/core/i18n/locales/or.json +455 -44
- package/front_end/core/i18n/locales/pa.json +455 -44
- package/front_end/core/i18n/locales/pl.json +455 -44
- package/front_end/core/i18n/locales/pt-PT.json +504 -93
- package/front_end/core/i18n/locales/pt.json +454 -43
- package/front_end/core/i18n/locales/ro.json +455 -44
- package/front_end/core/i18n/locales/ru.json +455 -44
- package/front_end/core/i18n/locales/si.json +455 -44
- package/front_end/core/i18n/locales/sk.json +456 -45
- package/front_end/core/i18n/locales/sl.json +455 -44
- package/front_end/core/i18n/locales/sq.json +455 -44
- package/front_end/core/i18n/locales/sr-Latn.json +455 -44
- package/front_end/core/i18n/locales/sr.json +455 -44
- package/front_end/core/i18n/locales/sv.json +456 -45
- package/front_end/core/i18n/locales/sw.json +455 -44
- package/front_end/core/i18n/locales/ta.json +456 -45
- package/front_end/core/i18n/locales/te.json +454 -43
- package/front_end/core/i18n/locales/th.json +455 -44
- package/front_end/core/i18n/locales/tr.json +455 -44
- package/front_end/core/i18n/locales/uk.json +455 -44
- package/front_end/core/i18n/locales/ur.json +455 -44
- package/front_end/core/i18n/locales/uz.json +455 -44
- package/front_end/core/i18n/locales/vi.json +455 -44
- package/front_end/core/i18n/locales/zh-HK.json +459 -48
- package/front_end/core/i18n/locales/zh-TW.json +457 -46
- package/front_end/core/i18n/locales/zh.json +460 -49
- package/front_end/core/i18n/locales/zu.json +455 -44
- package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
- package/front_end/core/sdk/AccessibilityModel.ts +99 -78
- package/front_end/core/sdk/CPUProfilerModel.ts +7 -9
- package/front_end/core/sdk/ConsoleModel.ts +27 -33
- package/front_end/core/sdk/NetworkManager.ts +3 -0
- package/front_end/core/sdk/Script.ts +0 -4
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +13 -12
- package/front_end/entrypoints/device_mode_emulation_frame/device_mode_emulation_frame.ts +1 -1
- package/front_end/entrypoints/devtools_app/devtools_app.js +1 -1
- package/front_end/entrypoints/devtools_app/devtools_app.json +1 -4
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/heap_snapshot_worker/heap_snapshot_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/inspector/inspector.js +1 -1
- package/front_end/entrypoints/inspector/inspector.json +1 -3
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +2 -3
- package/front_end/entrypoints/js_app/js_app.js +1 -1
- package/front_end/entrypoints/js_app/js_app.json +1 -3
- package/front_end/entrypoints/main/MainImpl.ts +2 -2
- package/front_end/entrypoints/main/main-meta.ts +1 -2
- package/front_end/entrypoints/ndb_app/ndb_app.js +1 -1
- package/front_end/entrypoints/node_app/node_app-meta.ts +0 -2
- package/front_end/entrypoints/node_app/node_app.js +1 -1
- package/front_end/entrypoints/node_app/node_app.json +1 -3
- package/front_end/entrypoints/node_main/node_main-meta.ts +0 -1
- package/front_end/entrypoints/shell/shell.json +1 -4
- package/front_end/entrypoints/wasmparser_worker/wasmparser_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/worker_app/worker_app.js +1 -1
- package/front_end/entrypoints/worker_app/worker_app.json +1 -3
- package/front_end/generated/InspectorBackendCommands.js +21 -1
- package/front_end/generated/protocol-mapping.d.ts +32 -1
- package/front_end/generated/protocol-proxy-api.d.ts +36 -2
- package/front_end/generated/protocol.d.ts +120 -7
- package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +5 -1
- package/front_end/models/bindings/DefaultScriptMapping.ts +1 -9
- package/front_end/models/bindings/ResourceScriptMapping.ts +3 -11
- package/front_end/models/formatter/SourceFormatter.ts +0 -15
- package/front_end/models/persistence/persistence-meta.ts +0 -1
- package/front_end/panels/accessibility/accessibility-meta.ts +0 -1
- package/front_end/panels/animation/animation-meta.ts +0 -1
- package/front_end/panels/application/ApplicationPanelCacheSection.ts +1 -1
- package/front_end/panels/application/BackForwardCacheStrings.ts +3 -1
- package/front_end/panels/application/BackForwardCacheView.ts +26 -26
- package/front_end/panels/application/application-meta.ts +0 -1
- package/front_end/panels/application/components/stackTraceRow.css +8 -0
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +1 -2
- package/front_end/panels/changes/changes-meta.ts +0 -1
- package/front_end/panels/console/ConsolePinPane.ts +2 -6
- package/front_end/panels/console/ConsoleViewMessage.ts +8 -1
- package/front_end/panels/console/console-meta.ts +0 -1
- package/front_end/panels/console_counters/console_counters-meta.ts +0 -1
- package/front_end/panels/coverage/coverage-meta.ts +0 -1
- package/front_end/panels/css_overview/css_overview-meta.ts +0 -1
- package/front_end/panels/developer_resources/developer_resources-meta.ts +0 -1
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +96 -66
- package/front_end/panels/elements/AccessibilityTreeView.ts +76 -125
- package/front_end/panels/elements/ElementsPanel.ts +6 -7
- package/front_end/panels/elements/elements-meta.ts +0 -1
- package/front_end/panels/emulation/emulation-meta.ts +0 -1
- package/front_end/panels/help/help-meta.ts +0 -1
- package/front_end/panels/input/input-meta.ts +0 -1
- package/front_end/panels/issues/issues-meta.ts +0 -1
- package/front_end/panels/js_profiler/js_profiler-meta.ts +0 -4
- package/front_end/panels/layers/layers-meta.ts +0 -4
- package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -1
- package/front_end/panels/lighthouse/module.json +0 -3
- package/front_end/panels/media/media-meta.ts +0 -1
- package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +0 -1
- package/front_end/panels/network/network-meta.ts +1 -2
- package/front_end/panels/performance_monitor/performance_monitor-meta.ts +0 -1
- package/front_end/panels/profiler/CPUProfileView.ts +10 -3
- package/front_end/panels/profiler/profiler-meta.ts +0 -3
- package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +0 -1
- package/front_end/panels/screencast/screencast-meta.ts +0 -4
- package/front_end/panels/security/security-meta.ts +0 -1
- package/front_end/panels/sensors/sensors-meta.ts +0 -1
- package/front_end/panels/settings/emulation/emulation-meta.ts +0 -1
- package/front_end/panels/settings/settings-meta.ts +0 -1
- package/front_end/panels/sources/Plugin.ts +0 -3
- package/front_end/panels/sources/UISourceCodeFrame.ts +23 -49
- package/front_end/panels/sources/sources-meta.ts +2 -6
- package/front_end/panels/timeline/timeline-meta.ts +2 -9
- package/front_end/panels/web_audio/web_audio-meta.ts +0 -1
- package/front_end/panels/webauthn/webauthn-meta.ts +0 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +1 -1
- package/front_end/ui/components/docs/component_docs.ts +14 -0
- package/front_end/ui/components/docs/create_breadcrumbs.ts +1 -1
- package/front_end/ui/components/docs/toggle_dark_mode.ts +1 -0
- package/front_end/ui/components/docs/toggle_fonts.ts +2 -0
- package/front_end/ui/components/helpers/get-stylesheet.ts +0 -1
- package/front_end/ui/components/linear_memory_inspector/linear_memory_inspector-meta.ts +1 -2
- package/front_end/ui/components/tree_outline/TreeOutline.ts +71 -8
- package/front_end/ui/components/tree_outline/TreeOutlineUtils.ts +8 -6
- package/front_end/ui/legacy/Dialog.ts +8 -3
- package/front_end/ui/legacy/SoftContextMenu.ts +1 -1
- package/front_end/ui/legacy/Treeoutline.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/CSSAngle.ts +1 -2
- package/front_end/ui/legacy/components/inline_editor/cssAngle.css +4 -0
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/object_ui-meta.ts +0 -4
- package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +0 -3
- package/front_end/ui/legacy/components/quick_open/quick_open-meta.ts +2 -3
- package/front_end/ui/legacy/components/source_frame/FontView.ts +3 -1
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +3 -1
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +3 -1
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +2 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +6 -6
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +5 -2
- package/front_end/ui/legacy/textButton.css +5 -4
- package/inspector_overlay/css_grid_label_helpers.ts +1 -1
- package/inspector_overlay/highlight_common.ts +1 -1
- package/inspector_overlay/tool_highlight.ts +1 -1
- package/package.json +1 -1
- package/scripts/check_gn.js +0 -35
- package/scripts/eslint_rules/lib/es_modules_import.js +15 -24
- package/scripts/eslint_rules/tests/es_modules_import_test.js +8 -16
- package/front_end/emulated_devices/module.json +0 -4
- package/front_end/panels/js_profiler/module.json +0 -5
- package/front_end/panels/layers/module.json +0 -4
- package/front_end/panels/profiler/module.json +0 -3
- package/front_end/panels/screencast/module.json +0 -3
- package/front_end/panels/timeline/module.json +0 -5
- package/front_end/ui/legacy/components/source_frame/messagesPopover.css +0 -32
- package/front_end/ui/legacy/components/source_frame/module.json +0 -11
|
@@ -9,15 +9,12 @@ import * as UI from '../../ui/legacy/legacy.js';
|
|
|
9
9
|
import * as AccessibilityTreeUtils from './AccessibilityTreeUtils.js';
|
|
10
10
|
import {ElementsPanel} from './ElementsPanel.js';
|
|
11
11
|
|
|
12
|
-
export class AccessibilityTreeView extends UI.Widget.VBox
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
private treeData: AccessibilityTreeUtils.AXTreeNode[] = [];
|
|
12
|
+
export class AccessibilityTreeView extends UI.Widget.VBox implements
|
|
13
|
+
SDK.TargetManager.SDKModelObserver<SDK.AccessibilityModel.AccessibilityModel> {
|
|
14
|
+
private accessibilityTreeComponent = new TreeOutline.TreeOutline.TreeOutline<AccessibilityTreeUtils.AXTreeNodeData>();
|
|
16
15
|
private readonly toggleButton: HTMLButtonElement;
|
|
17
|
-
private accessibilityModel: SDK.AccessibilityModel.AccessibilityModel|null = null;
|
|
18
|
-
private rootAXNode: SDK.AccessibilityModel.AccessibilityNode|null = null;
|
|
19
|
-
private selectedTreeNode: AccessibilityTreeUtils.AXTreeNode|null = null;
|
|
20
16
|
private inspectedDOMNode: SDK.DOMModel.DOMNode|null = null;
|
|
17
|
+
private root: SDK.AccessibilityModel.AccessibilityNode|null = null;
|
|
21
18
|
|
|
22
19
|
constructor(toggleButton: HTMLButtonElement) {
|
|
23
20
|
super();
|
|
@@ -27,6 +24,8 @@ export class AccessibilityTreeView extends UI.Widget.VBox {
|
|
|
27
24
|
this.contentElement.appendChild(this.toggleButton);
|
|
28
25
|
this.contentElement.appendChild(this.accessibilityTreeComponent);
|
|
29
26
|
|
|
27
|
+
SDK.TargetManager.TargetManager.instance().observeModels(SDK.AccessibilityModel.AccessibilityModel, this);
|
|
28
|
+
|
|
30
29
|
// The DOM tree and accessibility are kept in sync as much as possible, so
|
|
31
30
|
// on node selection, update the currently inspected node and reveal in the
|
|
32
31
|
// DOM tree.
|
|
@@ -57,153 +56,105 @@ export class AccessibilityTreeView extends UI.Widget.VBox {
|
|
|
57
56
|
});
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
wasShown(): void {
|
|
59
|
+
async wasShown(): Promise<void> {
|
|
60
|
+
await this.refreshAccessibilityTree();
|
|
61
61
|
if (this.inspectedDOMNode) {
|
|
62
|
-
this.loadSubTreeIntoAccessibilityModel(this.inspectedDOMNode);
|
|
63
|
-
} else {
|
|
64
|
-
this.accessibilityTreeComponent.expandRecursively(1);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
setAccessibilityModel(model: SDK.AccessibilityModel.AccessibilityModel|null): void {
|
|
69
|
-
this.accessibilityModel = model;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
wireToDOMModel(domModel: SDK.DOMModel.DOMModel): void {
|
|
73
|
-
if (!domModel.parentModel()) {
|
|
74
|
-
this.setAccessibilityModel(domModel.target().model(SDK.AccessibilityModel.AccessibilityModel));
|
|
62
|
+
await this.loadSubTreeIntoAccessibilityModel(this.inspectedDOMNode);
|
|
75
63
|
}
|
|
76
|
-
domModel.addEventListener(SDK.DOMModel.Events.NodeInserted, this.domUpdated, this);
|
|
77
|
-
domModel.addEventListener(SDK.DOMModel.Events.NodeRemoved, this.domUpdatedNode, this);
|
|
78
|
-
domModel.addEventListener(SDK.DOMModel.Events.AttrModified, this.domUpdatedNode, this);
|
|
79
|
-
domModel.addEventListener(SDK.DOMModel.Events.AttrRemoved, this.domUpdatedNode, this);
|
|
80
|
-
domModel.addEventListener(SDK.DOMModel.Events.CharacterDataModified, this.domUpdated, this);
|
|
81
|
-
domModel.addEventListener(SDK.DOMModel.Events.ChildNodeCountUpdated, this.domUpdated, this);
|
|
82
|
-
domModel.addEventListener(SDK.DOMModel.Events.DistributedNodesChanged, this.domUpdated, this);
|
|
83
|
-
domModel.addEventListener(SDK.DOMModel.Events.DocumentUpdated, this.documentUpdated, this);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
unwireFromDOMModel(domModel: SDK.DOMModel.DOMModel): void {
|
|
87
|
-
domModel.removeEventListener(SDK.DOMModel.Events.NodeInserted, this.domUpdated, this);
|
|
88
|
-
domModel.removeEventListener(SDK.DOMModel.Events.NodeRemoved, this.domUpdatedNode, this);
|
|
89
|
-
domModel.removeEventListener(SDK.DOMModel.Events.AttrModified, this.domUpdatedNode, this);
|
|
90
|
-
domModel.removeEventListener(SDK.DOMModel.Events.AttrRemoved, this.domUpdatedNode, this);
|
|
91
|
-
domModel.removeEventListener(SDK.DOMModel.Events.CharacterDataModified, this.domUpdated, this);
|
|
92
|
-
domModel.removeEventListener(SDK.DOMModel.Events.ChildNodeCountUpdated, this.domUpdated, this);
|
|
93
|
-
domModel.removeEventListener(SDK.DOMModel.Events.DistributedNodesChanged, this.domUpdated, this);
|
|
94
|
-
domModel.removeEventListener(SDK.DOMModel.Events.DocumentUpdated, this.documentUpdated, this);
|
|
95
64
|
}
|
|
96
65
|
|
|
97
|
-
|
|
98
|
-
this.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
await axModel?.updateSubtreeAndAncestors(node.backendNodeId());
|
|
108
|
-
this.renderTree();
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
documentUpdated(event: Common.EventTarget.EventTargetEvent<SDK.DOMModel.DOMModel>): void {
|
|
112
|
-
const domModel = event.data;
|
|
113
|
-
const axModel = domModel.target().model(SDK.AccessibilityModel.AccessibilityModel);
|
|
114
|
-
if (domModel.existingDocument() && !domModel.parentModel() && axModel) {
|
|
115
|
-
this.refreshAccessibilityTree(axModel);
|
|
66
|
+
async refreshAccessibilityTree(): Promise<void> {
|
|
67
|
+
if (!this.root) {
|
|
68
|
+
const frameId = SDK.FrameManager.FrameManager.instance().getTopFrame()?.id;
|
|
69
|
+
if (!frameId) {
|
|
70
|
+
throw Error('No top frame');
|
|
71
|
+
}
|
|
72
|
+
this.root = await AccessibilityTreeUtils.getRootNode(frameId);
|
|
73
|
+
if (!this.root) {
|
|
74
|
+
throw Error('No root');
|
|
75
|
+
}
|
|
116
76
|
}
|
|
77
|
+
await this.renderTree();
|
|
78
|
+
await this.accessibilityTreeComponent.expandRecursively(1);
|
|
117
79
|
}
|
|
118
80
|
|
|
119
|
-
renderTree(): void {
|
|
120
|
-
if (!this.
|
|
121
|
-
|
|
122
|
-
} else {
|
|
123
|
-
this.treeData = [AccessibilityTreeUtils.sdkNodeToAXTreeNode(this.rootAXNode)];
|
|
81
|
+
async renderTree(): Promise<void> {
|
|
82
|
+
if (!this.root) {
|
|
83
|
+
return;
|
|
124
84
|
}
|
|
125
|
-
|
|
85
|
+
const treeData = await AccessibilityTreeUtils.sdkNodeToAXTreeNodes(this.root);
|
|
126
86
|
this.accessibilityTreeComponent.data = {
|
|
127
87
|
defaultRenderer: AccessibilityTreeUtils.accessibilityNodeRenderer,
|
|
128
|
-
tree:
|
|
88
|
+
tree: treeData,
|
|
89
|
+
filter: (node): TreeOutline.TreeOutline.FilterOption => {
|
|
90
|
+
return node.ignored() || (node.role()?.value === 'generic' && !node.name()?.value) ?
|
|
91
|
+
TreeOutline.TreeOutline.FilterOption.FLATTEN :
|
|
92
|
+
TreeOutline.TreeOutline.FilterOption.SHOW;
|
|
93
|
+
},
|
|
129
94
|
};
|
|
130
|
-
|
|
131
|
-
const axModel = this.inspectedDOMNode?.domModel().target().model(SDK.AccessibilityModel.AccessibilityModel);
|
|
132
|
-
const inspectedAXNode = axModel?.axNodeForDOMNode(this.inspectedDOMNode);
|
|
133
|
-
if (inspectedAXNode) {
|
|
134
|
-
this.selectedTreeNode = AccessibilityTreeUtils.sdkNodeToAXTreeNode(inspectedAXNode);
|
|
135
|
-
this.accessibilityTreeComponent.expandToAndSelectTreeNode(this.selectedTreeNode);
|
|
136
|
-
} else {
|
|
137
|
-
this.accessibilityTreeComponent.expandRecursively(1);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
async refreshAccessibilityTree(accessibilityModel: SDK.AccessibilityModel.AccessibilityModel): Promise<void> {
|
|
142
|
-
// We always expand the root node so we might as well fetch one level of children immediately.
|
|
143
|
-
const root = await accessibilityModel.requestRootNode(1);
|
|
144
|
-
if (!root) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
this.rootAXNode = root;
|
|
149
|
-
this.inspectedDOMNode = null;
|
|
150
|
-
this.renderTree();
|
|
151
95
|
}
|
|
152
96
|
|
|
153
97
|
// Given a selected DOM node, asks the model to load the missing subtree from the root to the
|
|
154
98
|
// selected node and then re-renders the tree.
|
|
155
99
|
async loadSubTreeIntoAccessibilityModel(selectedNode: SDK.DOMModel.DOMNode): Promise<void> {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// If this node has been loaded previously, the accessibility tree will return it's cached node.
|
|
161
|
-
// Eventually we'll need some mechanism for forcing it to fetch a new node when we are subscribing
|
|
162
|
-
// for updates, but TBD later.
|
|
163
|
-
// EG for a backend tree like:
|
|
164
|
-
//
|
|
165
|
-
// A*
|
|
166
|
-
// B
|
|
167
|
-
// C
|
|
168
|
-
// D
|
|
169
|
-
// E
|
|
170
|
-
// Where only A is already loaded into the model, calling requestAndLoadSubTreeToNode(C) will
|
|
171
|
-
// load [A, B, D, C] into the model, and return C.
|
|
172
|
-
const inspectedAXNode = await this.accessibilityModel.requestAndLoadSubTreeToNode(selectedNode);
|
|
100
|
+
const ancestors = await AccessibilityTreeUtils.getNodeAndAncestorsFromDOMNode(selectedNode);
|
|
101
|
+
const inspectedAXNode = ancestors.find(node => node.backendDOMNodeId() === selectedNode.backendNodeId());
|
|
173
102
|
if (!inspectedAXNode) {
|
|
174
103
|
return;
|
|
175
104
|
}
|
|
105
|
+
await this.accessibilityTreeComponent.expandNodeIds(ancestors.map(node => node.getFrameId() + '#' + node.id()));
|
|
106
|
+
await this.accessibilityTreeComponent.focusNodeId(AccessibilityTreeUtils.getNodeId(inspectedAXNode));
|
|
107
|
+
}
|
|
176
108
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
// These nodes require a special case, as they don't have an unignored node in the
|
|
183
|
-
// accessibility tree. Someone inspecting these in the DOM is probably expecting to
|
|
184
|
-
// be focused on the root WebArea of the accessibility tree.
|
|
185
|
-
// TODO(meredithl): Fix for when the inspected node is ingored in the accessibility
|
|
186
|
-
// tree. Eg, inspecting <head> in the DOM tree.
|
|
187
|
-
if (selectedNode.nodeName() === 'BODY' || selectedNode.nodeName() === 'HTML') {
|
|
188
|
-
this.accessibilityTreeComponent.expandToAndSelectTreeNode(this.treeData[0]);
|
|
189
|
-
this.selectedTreeNode = this.treeData[0];
|
|
109
|
+
// A node was revealed through the elements picker.
|
|
110
|
+
async revealAndSelectNode(inspectedNode: SDK.DOMModel.DOMNode): Promise<void> {
|
|
111
|
+
if (inspectedNode === this.inspectedDOMNode) {
|
|
190
112
|
return;
|
|
191
113
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
this.
|
|
114
|
+
this.inspectedDOMNode = inspectedNode;
|
|
115
|
+
// We only want to load nodes into the model when the AccessibilityTree is visible.
|
|
116
|
+
if (this.isShowing()) {
|
|
117
|
+
await this.loadSubTreeIntoAccessibilityModel(inspectedNode);
|
|
118
|
+
}
|
|
195
119
|
}
|
|
196
120
|
|
|
197
|
-
// Selected node in the DOM has changed
|
|
198
|
-
// unloaded.
|
|
121
|
+
// Selected node in the DOM tree has changed.
|
|
199
122
|
async selectedNodeChanged(inspectedNode: SDK.DOMModel.DOMNode): Promise<void> {
|
|
123
|
+
if (this.isShowing()) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (inspectedNode.ownerDocument && (inspectedNode.nodeName() === 'HTML' || inspectedNode.nodeName() === 'BODY')) {
|
|
127
|
+
inspectedNode = inspectedNode.ownerDocument;
|
|
128
|
+
}
|
|
200
129
|
if (inspectedNode === this.inspectedDOMNode) {
|
|
201
130
|
return;
|
|
202
131
|
}
|
|
203
132
|
this.inspectedDOMNode = inspectedNode;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
treeUpdated({data}: Common.EventTarget
|
|
136
|
+
.EventTargetEvent<SDK.AccessibilityModel.EventTypes[SDK.AccessibilityModel.Events.TreeUpdated]>):
|
|
137
|
+
void {
|
|
138
|
+
if (!data.root) {
|
|
139
|
+
this.renderTree();
|
|
140
|
+
return;
|
|
207
141
|
}
|
|
142
|
+
const topFrameId = SDK.FrameManager.FrameManager.instance().getTopFrame()?.id;
|
|
143
|
+
if (data.root?.getFrameId() !== topFrameId) {
|
|
144
|
+
this.renderTree();
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
this.root = data.root;
|
|
148
|
+
this.accessibilityTreeComponent.collapseAllNodes();
|
|
149
|
+
|
|
150
|
+
this.refreshAccessibilityTree();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
modelAdded(model: SDK.AccessibilityModel.AccessibilityModel): void {
|
|
154
|
+
model.addEventListener(SDK.AccessibilityModel.Events.TreeUpdated, this.treeUpdated, this);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
modelRemoved(model: SDK.AccessibilityModel.AccessibilityModel): void {
|
|
158
|
+
model.removeEventListener(SDK.AccessibilityModel.Events.TreeUpdated, this.treeUpdated, this);
|
|
208
159
|
}
|
|
209
160
|
}
|
|
@@ -328,11 +328,6 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
328
328
|
modelAdded(domModel: SDK.DOMModel.DOMModel): void {
|
|
329
329
|
const parentModel = domModel.parentModel();
|
|
330
330
|
|
|
331
|
-
// Different frames will have different DOMModels, we only want to add the accessibility model
|
|
332
|
-
// for the top level frame, as the accessibility tree does not yet support exploring IFrames.
|
|
333
|
-
if (this.accessibilityTreeView) {
|
|
334
|
-
this.accessibilityTreeView.wireToDOMModel(domModel);
|
|
335
|
-
}
|
|
336
331
|
let treeOutline: ElementsTreeOutline|null = parentModel ? ElementsTreeOutline.forDOMModel(parentModel) : null;
|
|
337
332
|
if (!treeOutline) {
|
|
338
333
|
treeOutline = new ElementsTreeOutline(true, true);
|
|
@@ -507,6 +502,10 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
507
502
|
crumbs,
|
|
508
503
|
selectedNode: ElementsComponents.Helper.legacyNodeToElementsComponentsNode(selectedNode),
|
|
509
504
|
};
|
|
505
|
+
|
|
506
|
+
if (this.accessibilityTreeView) {
|
|
507
|
+
this.accessibilityTreeView.selectedNodeChanged(selectedNode);
|
|
508
|
+
}
|
|
510
509
|
} else {
|
|
511
510
|
this.breadcrumbs.data = {crumbs: [], selectedNode: null};
|
|
512
511
|
}
|
|
@@ -837,7 +836,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
837
836
|
if (!treeOutline) {
|
|
838
837
|
return null;
|
|
839
838
|
}
|
|
840
|
-
return
|
|
839
|
+
return treeOutline.findTreeElement(node);
|
|
841
840
|
}
|
|
842
841
|
|
|
843
842
|
private leaveUserAgentShadowDOM(node: SDK.DOMModel.DOMNode): SDK.DOMModel.DOMNode {
|
|
@@ -859,7 +858,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
859
858
|
}
|
|
860
859
|
|
|
861
860
|
if (this.accessibilityTreeView) {
|
|
862
|
-
this.accessibilityTreeView.
|
|
861
|
+
this.accessibilityTreeView.revealAndSelectNode(node);
|
|
863
862
|
}
|
|
864
863
|
|
|
865
864
|
await UI.ViewManager.ViewManager.instance().showView('elements', false, !focus);
|
|
@@ -7,7 +7,6 @@ import * as Root from '../../core/root/root.js';
|
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
8
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
9
|
|
|
10
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
11
10
|
import type * as Elements from './elements.js';
|
|
12
11
|
|
|
13
12
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
@@ -6,7 +6,6 @@ import * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as Root from '../../core/root/root.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
9
|
import type * as Emulation from './emulation.js';
|
|
11
10
|
|
|
12
11
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
@@ -6,7 +6,6 @@ import * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
9
|
import type * as Help from './help.js';
|
|
11
10
|
|
|
12
11
|
const UIStrings = {
|
|
@@ -6,7 +6,6 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
6
6
|
import * as Root from '../../core/root/root.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
9
|
import type * as Input from './input.js';
|
|
11
10
|
|
|
12
11
|
const UIStrings = {
|
|
@@ -7,7 +7,6 @@ import * as Root from '../../core/root/root.js';
|
|
|
7
7
|
import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
|
|
8
8
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
9
|
|
|
10
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
11
10
|
import type * as Issues from './issues.js';
|
|
12
11
|
|
|
13
12
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
|
-
import * as Root from '../../core/root/root.js';
|
|
7
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
7
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
8
|
import type * as Profiler from '../profiler/profiler.js';
|
|
11
9
|
|
|
12
10
|
const UIStrings = {
|
|
@@ -30,8 +28,6 @@ let loadedProfilerModule: (typeof Profiler|undefined);
|
|
|
30
28
|
|
|
31
29
|
async function loadProfilerModule(): Promise<typeof Profiler> {
|
|
32
30
|
if (!loadedProfilerModule) {
|
|
33
|
-
// Side-effect import resources in module.json
|
|
34
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/profiler');
|
|
35
31
|
loadedProfilerModule = await import('../profiler/profiler.js');
|
|
36
32
|
}
|
|
37
33
|
return loadedProfilerModule;
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
|
-
import * as Root from '../../core/root/root.js';
|
|
7
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
7
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
8
|
import type * as Layers from './layers.js';
|
|
11
9
|
|
|
12
10
|
const UIStrings = {
|
|
@@ -26,8 +24,6 @@ let loadedLayersModule: (typeof Layers|undefined);
|
|
|
26
24
|
|
|
27
25
|
async function loadLayersModule(): Promise<typeof Layers> {
|
|
28
26
|
if (!loadedLayersModule) {
|
|
29
|
-
// Side-effect import resources in module.json
|
|
30
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/layers');
|
|
31
27
|
loadedLayersModule = await import('./layers.js');
|
|
32
28
|
}
|
|
33
29
|
return loadedLayersModule;
|
|
@@ -6,7 +6,6 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
6
6
|
import * as Root from '../../core/root/root.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
9
|
import type * as Lighthouse from './lighthouse.js';
|
|
11
10
|
|
|
12
11
|
const UIStrings = {
|
|
@@ -6,7 +6,6 @@ import * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
9
|
import type * as MobileThrottling from './mobile_throttling.js';
|
|
11
10
|
|
|
12
11
|
const UIStrings = {
|
|
@@ -3,15 +3,14 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
|
+
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
7
8
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
8
9
|
import * as NetworkForward from '../../panels/network/forward/forward.js';
|
|
9
10
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
11
|
|
|
11
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
12
12
|
import type * as Network from './network.js';
|
|
13
13
|
|
|
14
|
-
import * as i18n from '../../core/i18n/i18n.js';
|
|
15
14
|
const UIStrings = {
|
|
16
15
|
/**
|
|
17
16
|
*@description Command for showing the 'Network' tool
|
|
@@ -149,9 +149,17 @@ export class CPUProfileType extends ProfileType {
|
|
|
149
149
|
super(CPUProfileType.TypeId, i18nString(UIStrings.recordJavascriptCpuProfile));
|
|
150
150
|
this.recording = false;
|
|
151
151
|
|
|
152
|
+
const targetManager = SDK.TargetManager.TargetManager.instance();
|
|
153
|
+
const profilerModels = targetManager.models(SDK.CPUProfilerModel.CPUProfilerModel);
|
|
154
|
+
for (const model of profilerModels) {
|
|
155
|
+
for (const message of model.registeredConsoleProfileMessages) {
|
|
156
|
+
this.consoleProfileFinished(message);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
152
160
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
153
161
|
SDK.CPUProfilerModel.CPUProfilerModel, SDK.CPUProfilerModel.Events.ConsoleProfileFinished,
|
|
154
|
-
this.consoleProfileFinished, this);
|
|
162
|
+
event => this.consoleProfileFinished(event.data), this);
|
|
155
163
|
}
|
|
156
164
|
|
|
157
165
|
profileBeingRecorded(): ProfileHeader|null {
|
|
@@ -187,8 +195,7 @@ export class CPUProfileType extends ProfileType {
|
|
|
187
195
|
return i18nString(UIStrings.cpuProfilesShow);
|
|
188
196
|
}
|
|
189
197
|
|
|
190
|
-
consoleProfileFinished(
|
|
191
|
-
const data = event.data;
|
|
198
|
+
consoleProfileFinished(data: SDK.CPUProfilerModel.ProfileFinishedData): void {
|
|
192
199
|
const profile = new CPUProfileHeader(data.cpuProfilerModel, this, data.title);
|
|
193
200
|
profile.setProtocolProfile(data.cpuProfile);
|
|
194
201
|
this.addProfile(profile);
|
|
@@ -8,7 +8,6 @@ import * as Root from '../../core/root/root.js';
|
|
|
8
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
9
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
10
|
|
|
11
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
12
11
|
import type * as Profiler from './profiler.js';
|
|
13
12
|
|
|
14
13
|
let loadedProfilerModule: (typeof Profiler|undefined);
|
|
@@ -57,8 +56,6 @@ const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined
|
|
|
57
56
|
|
|
58
57
|
async function loadProfilerModule(): Promise<typeof Profiler> {
|
|
59
58
|
if (!loadedProfilerModule) {
|
|
60
|
-
// Side-effect import resources in module.json
|
|
61
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/profiler');
|
|
62
59
|
loadedProfilerModule = await import('./profiler.js');
|
|
63
60
|
}
|
|
64
61
|
return loadedProfilerModule;
|
|
@@ -6,7 +6,6 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
6
6
|
import * as Root from '../../core/root/root.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
9
|
import type * as ProtocolMonitor from './protocol_monitor.js';
|
|
11
10
|
|
|
12
11
|
const UIStrings = {
|
|
@@ -3,18 +3,14 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
|
-
import * as Root from '../../core/root/root.js';
|
|
7
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
7
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
8
|
import type * as Screencast from './screencast.js';
|
|
11
9
|
|
|
12
10
|
let loadedScreencastModule: (typeof Screencast|undefined);
|
|
13
11
|
|
|
14
12
|
async function loadScreencastModule(): Promise<typeof Screencast> {
|
|
15
13
|
if (!loadedScreencastModule) {
|
|
16
|
-
// Side-effect import rescreencast in module.json
|
|
17
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/screencast');
|
|
18
14
|
loadedScreencastModule = await import('./screencast.js');
|
|
19
15
|
}
|
|
20
16
|
return loadedScreencastModule;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
7
7
|
|
|
8
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
9
8
|
import type * as Sensors from './sensors.js';
|
|
10
9
|
|
|
11
10
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
@@ -8,7 +8,6 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
8
8
|
import * as Root from '../../core/root/root.js';
|
|
9
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
10
|
|
|
11
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
12
11
|
import type * as Settings from './settings.js';
|
|
13
12
|
|
|
14
13
|
const UIStrings = {
|