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
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@codemirror/panel": "0.19.0",
|
|
29
29
|
"@codemirror/rangeset": "0.19.2",
|
|
30
30
|
"@codemirror/search": "0.19.2",
|
|
31
|
-
"@codemirror/state": "0.19.
|
|
31
|
+
"@codemirror/state": "0.19.6",
|
|
32
32
|
"@codemirror/stream-parser": "0.19.2",
|
|
33
33
|
"@codemirror/text": "0.19.5",
|
|
34
34
|
"@codemirror/tooltip": "0.19.6",
|
|
@@ -12,3 +12,17 @@ import * as ToggleFonts from './toggle_fonts.js';
|
|
|
12
12
|
ToggleDarkMode.init();
|
|
13
13
|
CreateBreadcrumbs.init();
|
|
14
14
|
ToggleFonts.init();
|
|
15
|
+
|
|
16
|
+
// This can be used by tests to hide the UI elements that are part of the component docs interface.
|
|
17
|
+
// E.g., this is useful for screenshot tests.
|
|
18
|
+
window.addEventListener('hidecomponentdocsui', () => {
|
|
19
|
+
for (const node of document.querySelectorAll('.component-docs-ui')) {
|
|
20
|
+
(node as HTMLElement).style.display = 'none';
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
window.addEventListener('showcomponentdocsui', () => {
|
|
25
|
+
for (const node of document.querySelectorAll('.component-docs-ui')) {
|
|
26
|
+
(node as HTMLElement).style.display = '';
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -16,6 +16,7 @@ export function init(): void {
|
|
|
16
16
|
window.addEventListener('load', () => {
|
|
17
17
|
const button = document.createElement('button');
|
|
18
18
|
button.innerText = 'Toggle light/dark mode';
|
|
19
|
+
button.className = 'component-docs-ui';
|
|
19
20
|
|
|
20
21
|
button.style.position = 'fixed';
|
|
21
22
|
button.style.bottom = '10px';
|
|
@@ -14,6 +14,7 @@ export function init(): void {
|
|
|
14
14
|
// we want a single font-family to be used by the tests.
|
|
15
15
|
if (urlParams.has('fontFamily')) {
|
|
16
16
|
const div = document.createElement('div');
|
|
17
|
+
div.className = 'component-docs-ui';
|
|
17
18
|
div.style.position = 'fixed';
|
|
18
19
|
div.style.bottom = '10px';
|
|
19
20
|
div.style.right = '230px';
|
|
@@ -30,6 +31,7 @@ export function init(): void {
|
|
|
30
31
|
|
|
31
32
|
document.body.classList.add(PLATFORM_LINUX_CLASS);
|
|
32
33
|
const button = document.createElement('button');
|
|
34
|
+
button.className = 'component-docs-ui';
|
|
33
35
|
|
|
34
36
|
const loop = [
|
|
35
37
|
PLATFORM_LINUX_CLASS,
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
5
6
|
import * as UI from '../../legacy/legacy.js';
|
|
6
7
|
|
|
7
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
8
8
|
import type * as LinearMemoryInspector from './linear_memory_inspector.js';
|
|
9
9
|
|
|
10
|
-
import * as i18n from '../../../core/i18n/i18n.js';
|
|
11
10
|
const UIStrings = {
|
|
12
11
|
/**
|
|
13
12
|
*@description Title of the Linear Memory Inspector tool
|
|
@@ -10,7 +10,7 @@ import * as Coordinator from '../render_coordinator/render_coordinator.js';
|
|
|
10
10
|
|
|
11
11
|
import treeOutlineStyles from './treeOutline.css.js';
|
|
12
12
|
|
|
13
|
-
import type {TreeNode, TreeNodeWithChildren} from './TreeOutlineUtils.js';
|
|
13
|
+
import type {TreeNodeId, TreeNode, TreeNodeWithChildren} from './TreeOutlineUtils.js';
|
|
14
14
|
import {findNextNodeForTreeOutlineKeyboardNavigation, getNodeChildren, getPathToTreeNode, isExpandableNode, trackDOMNodeToTreeNode} from './TreeOutlineUtils.js';
|
|
15
15
|
|
|
16
16
|
const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
|
|
@@ -24,6 +24,7 @@ export interface TreeOutlineData<TreeNodeDataType> {
|
|
|
24
24
|
* cause issues in the TreeOutline.
|
|
25
25
|
*/
|
|
26
26
|
tree: readonly TreeNode<TreeNodeDataType>[];
|
|
27
|
+
filter?: (node: TreeNodeDataType) => FilterOption;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export function defaultRenderer(node: TreeNode<string>): LitHtml.TemplateResult {
|
|
@@ -66,6 +67,19 @@ export class ItemMouseOutEvent<TreeNodeDataType> extends Event {
|
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* The tree can be filtered by providing a custom filter function.
|
|
73
|
+
* The filter is applied on every node when constructing the tree
|
|
74
|
+
* and proceeds as follows:
|
|
75
|
+
* - If the filter return SHOW for a node, the node is included in the tree.
|
|
76
|
+
* - If the filter returns FLATTEN, the node is ignored but its subtree is included.
|
|
77
|
+
*/
|
|
78
|
+
export const enum FilterOption {
|
|
79
|
+
SHOW = 'SHOW',
|
|
80
|
+
FLATTEN = 'FLATTEN',
|
|
81
|
+
}
|
|
82
|
+
|
|
69
83
|
export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
70
84
|
static readonly litTagName = LitHtml.literal`devtools-tree-outline`;
|
|
71
85
|
private readonly shadow = this.attachShadow({mode: 'open'});
|
|
@@ -79,7 +93,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
79
93
|
* know for sure when that node will be rendered. This variable tracks the
|
|
80
94
|
* node that we want focused but may not yet have been rendered.
|
|
81
95
|
*/
|
|
82
|
-
private
|
|
96
|
+
private nodeIdPendingFocus: TreeNodeId|null = null;
|
|
83
97
|
private selectedTreeNode: TreeNode<TreeNodeDataType>|null = null;
|
|
84
98
|
private defaultRenderer =
|
|
85
99
|
(node: TreeNode<TreeNodeDataType>, _state: {isExpanded: boolean}): LitHtml.TemplateResult => {
|
|
@@ -91,6 +105,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
91
105
|
}
|
|
92
106
|
return LitHtml.html`${String(node.treeNodeData)}`;
|
|
93
107
|
};
|
|
108
|
+
private nodeFilter?: ((node: TreeNodeDataType) => FilterOption);
|
|
94
109
|
|
|
95
110
|
/**
|
|
96
111
|
* scheduledRender = render() has been called and scheduled a render.
|
|
@@ -134,6 +149,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
134
149
|
set data(data: TreeOutlineData<TreeNodeDataType>) {
|
|
135
150
|
this.defaultRenderer = data.defaultRenderer;
|
|
136
151
|
this.treeData = data.tree;
|
|
152
|
+
this.nodeFilter = data.filter;
|
|
137
153
|
if (!this.hasRenderedAtLeastOnce) {
|
|
138
154
|
this.selectedTreeNode = this.treeData[0];
|
|
139
155
|
}
|
|
@@ -150,14 +166,29 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
150
166
|
await this.render();
|
|
151
167
|
}
|
|
152
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Collapses all nodes in the tree.
|
|
171
|
+
*/
|
|
172
|
+
async collapseAllNodes(): Promise<void> {
|
|
173
|
+
this.nodeExpandedMap.clear();
|
|
174
|
+
await this.render();
|
|
175
|
+
}
|
|
176
|
+
|
|
153
177
|
/**
|
|
154
178
|
* Takes a TreeNode, expands the outline to reveal it, and focuses it.
|
|
155
179
|
*/
|
|
156
180
|
async expandToAndSelectTreeNode(targetTreeNode: TreeNode<TreeNodeDataType>): Promise<void> {
|
|
157
|
-
|
|
181
|
+
return this.expandToAndSelectTreeNodeId(targetTreeNode.id);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Takes a TreeNode ID, expands the outline to reveal it, and focuses it.
|
|
186
|
+
*/
|
|
187
|
+
async expandToAndSelectTreeNodeId(targetTreeNodeId: TreeNodeId): Promise<void> {
|
|
188
|
+
const pathToTreeNode = await getPathToTreeNode(this.treeData, targetTreeNodeId);
|
|
158
189
|
|
|
159
190
|
if (pathToTreeNode === null) {
|
|
160
|
-
throw new Error(`Could not find node with id ${
|
|
191
|
+
throw new Error(`Could not find node with id ${targetTreeNodeId} in the tree.`);
|
|
161
192
|
}
|
|
162
193
|
pathToTreeNode.forEach((node, index) => {
|
|
163
194
|
// We don't expand the very last node, which was the target node.
|
|
@@ -167,10 +198,26 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
167
198
|
});
|
|
168
199
|
|
|
169
200
|
// Mark the node as pending focus so when it is rendered into the DOM we can focus it
|
|
170
|
-
this.
|
|
201
|
+
this.nodeIdPendingFocus = targetTreeNodeId;
|
|
171
202
|
await this.render();
|
|
172
203
|
}
|
|
173
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Takes a list of TreeNode IDs and expands the corresponding nodes.
|
|
207
|
+
*/
|
|
208
|
+
expandNodeIds(nodeIds: TreeNodeId[]): Promise<void> {
|
|
209
|
+
nodeIds.forEach(id => this.nodeExpandedMap.set(id, true));
|
|
210
|
+
return this.render();
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Takes a TreeNode ID and focuses the corresponding node.
|
|
215
|
+
*/
|
|
216
|
+
focusNodeId(nodeId: TreeNodeId): Promise<void> {
|
|
217
|
+
this.nodeIdPendingFocus = nodeId;
|
|
218
|
+
return this.render();
|
|
219
|
+
}
|
|
220
|
+
|
|
174
221
|
async collapseChildrenOfNode(domNode: HTMLLIElement): Promise<void> {
|
|
175
222
|
const treeNode = this.domNodeToTreeNodeMap.get(domNode);
|
|
176
223
|
if (!treeNode) {
|
|
@@ -208,7 +255,22 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
208
255
|
}
|
|
209
256
|
|
|
210
257
|
private async fetchNodeChildren(node: TreeNodeWithChildren<TreeNodeDataType>): Promise<TreeNode<TreeNodeDataType>[]> {
|
|
211
|
-
|
|
258
|
+
const children = await getNodeChildren(node);
|
|
259
|
+
if (!this.nodeFilter) {
|
|
260
|
+
return children;
|
|
261
|
+
}
|
|
262
|
+
const filteredChildren = [];
|
|
263
|
+
for (const child of children) {
|
|
264
|
+
const filtering = this.nodeFilter(child.treeNodeData);
|
|
265
|
+
// We always include the selected node in the tree, regardless of its filtering status.
|
|
266
|
+
if (filtering === FilterOption.SHOW || this.isSelectedNode(child) || child.id === this.nodeIdPendingFocus) {
|
|
267
|
+
filteredChildren.push(child);
|
|
268
|
+
} else if (filtering === FilterOption.FLATTEN && isExpandableNode(child)) {
|
|
269
|
+
const grandChildren = await this.fetchNodeChildren(child);
|
|
270
|
+
filteredChildren.push(...grandChildren);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return filteredChildren;
|
|
212
274
|
}
|
|
213
275
|
|
|
214
276
|
private setNodeExpandedState(node: TreeNode<TreeNodeDataType>, newExpandedState: boolean): void {
|
|
@@ -337,7 +399,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
337
399
|
}
|
|
338
400
|
|
|
339
401
|
private focusPendingNode(domNode: HTMLLIElement): void {
|
|
340
|
-
this.
|
|
402
|
+
this.nodeIdPendingFocus = null;
|
|
341
403
|
this.focusTreeNode(domNode);
|
|
342
404
|
}
|
|
343
405
|
|
|
@@ -411,7 +473,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
411
473
|
return;
|
|
412
474
|
}
|
|
413
475
|
|
|
414
|
-
if (this.
|
|
476
|
+
if (this.nodeIdPendingFocus && node.id === this.nodeIdPendingFocus) {
|
|
415
477
|
this.focusPendingNode(domNode);
|
|
416
478
|
}
|
|
417
479
|
})}
|
|
@@ -433,6 +495,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
433
495
|
`;
|
|
434
496
|
// clang-format on
|
|
435
497
|
}
|
|
498
|
+
|
|
436
499
|
private async render(): Promise<void> {
|
|
437
500
|
if (this.scheduledRender) {
|
|
438
501
|
// If we are already rendering, don't render again immediately, but
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
import * as Platform from '../../../core/platform/platform.js';
|
|
5
5
|
import * as LitHtml from '../../lit-html/lit-html.js';
|
|
6
6
|
|
|
7
|
+
export type TreeNodeId = string;
|
|
8
|
+
|
|
7
9
|
interface BaseTreeNode<TreeNodeDataType> {
|
|
8
10
|
treeNodeData: TreeNodeDataType;
|
|
9
11
|
renderer?: (node: TreeNode<TreeNodeDataType>, state: {isExpanded: boolean}) => LitHtml.TemplateResult;
|
|
10
|
-
id:
|
|
12
|
+
id: TreeNodeId;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export interface TreeNodeWithChildren<TreeNodeDataType> extends BaseTreeNode<TreeNodeDataType> {
|
|
@@ -196,10 +198,10 @@ export const getNodeChildren =
|
|
|
196
198
|
* And you look for F, you'll get back [A, D, F]
|
|
197
199
|
*/
|
|
198
200
|
export const getPathToTreeNode =
|
|
199
|
-
async<TreeNodeDataType>(tree: readonly TreeNode<TreeNodeDataType>[],
|
|
201
|
+
async<TreeNodeDataType>(tree: readonly TreeNode<TreeNodeDataType>[], nodeIdToFind: TreeNodeId):
|
|
200
202
|
Promise<TreeNode<TreeNodeDataType>[]|null> => {
|
|
201
203
|
for (const rootNode of tree) {
|
|
202
|
-
const foundPathOrNull = await getPathToTreeNodeRecursively(rootNode,
|
|
204
|
+
const foundPathOrNull = await getPathToTreeNodeRecursively(rootNode, nodeIdToFind, [rootNode]);
|
|
203
205
|
if (foundPathOrNull !== null) {
|
|
204
206
|
return foundPathOrNull;
|
|
205
207
|
}
|
|
@@ -208,16 +210,16 @@ export const getPathToTreeNode =
|
|
|
208
210
|
};
|
|
209
211
|
|
|
210
212
|
const getPathToTreeNodeRecursively = async<TreeNodeDataType>(
|
|
211
|
-
currentNode: TreeNode<TreeNodeDataType>,
|
|
213
|
+
currentNode: TreeNode<TreeNodeDataType>, nodeIdToFind: TreeNodeId,
|
|
212
214
|
pathToNode: TreeNode<TreeNodeDataType>[]): Promise<TreeNode<TreeNodeDataType>[]|null> => {
|
|
213
|
-
if (currentNode.id ===
|
|
215
|
+
if (currentNode.id === nodeIdToFind) {
|
|
214
216
|
return pathToNode;
|
|
215
217
|
}
|
|
216
218
|
|
|
217
219
|
if (currentNode.children) {
|
|
218
220
|
const children = await getNodeChildren(currentNode);
|
|
219
221
|
for (const child of children) {
|
|
220
|
-
const foundPathOrNull = await getPathToTreeNodeRecursively(child,
|
|
222
|
+
const foundPathOrNull = await getPathToTreeNodeRecursively(child, nodeIdToFind, [...pathToNode, child]);
|
|
221
223
|
if (foundPathOrNull !== null) {
|
|
222
224
|
return foundPathOrNull;
|
|
223
225
|
}
|
|
@@ -137,9 +137,14 @@ export class Dialog extends Common.ObjectWrapper.eventMixin<EventTypes, typeof G
|
|
|
137
137
|
if (node instanceof HTMLElement) {
|
|
138
138
|
const element = (node as HTMLElement);
|
|
139
139
|
const tabIndex = element.tabIndex;
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
if (!exclusionSet?.has(element)) {
|
|
141
|
+
if (tabIndex >= 0) {
|
|
142
|
+
this.tabIndexMap.set(element, tabIndex);
|
|
143
|
+
element.tabIndex = -1;
|
|
144
|
+
} else if (element.hasAttribute('contenteditable')) {
|
|
145
|
+
this.tabIndexMap.set(element, element.hasAttribute('tabindex') ? tabIndex : 0);
|
|
146
|
+
element.tabIndex = -1;
|
|
147
|
+
}
|
|
143
148
|
}
|
|
144
149
|
}
|
|
145
150
|
}
|
|
@@ -35,7 +35,7 @@ import type * as Platform from '../../core/platform/platform.js';
|
|
|
35
35
|
import * as ARIAUtils from './ARIAUtils.js';
|
|
36
36
|
import {AnchorBehavior, GlassPane, MarginBehavior, PointerEventsBehavior, SizeBehavior} from './GlassPane.js';
|
|
37
37
|
import {Icon} from './Icon.js';
|
|
38
|
-
import * as ThemeSupport from './theme_support/theme_support.js';
|
|
38
|
+
import * as ThemeSupport from './theme_support/theme_support.js';
|
|
39
39
|
import {createTextChild, ElementFocusRestorer} from './UIUtils.js';
|
|
40
40
|
import softContextMenuStyles from './softContextMenu.css.legacy.js';
|
|
41
41
|
|
|
@@ -399,7 +399,7 @@ export class TreeOutlineInShadow extends TreeOutline {
|
|
|
399
399
|
this.renderSelection = true;
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
-
registerRequiredCSS(cssFile: string): void {
|
|
402
|
+
registerRequiredCSS(cssFile: string|{cssContent: string}): void {
|
|
403
403
|
Utils.appendStyle(this.shadowRoot, cssFile);
|
|
404
404
|
}
|
|
405
405
|
|
|
@@ -46,7 +46,7 @@ import {Size} from './Geometry.js';
|
|
|
46
46
|
import {GlassPane, PointerEventsBehavior, SizeBehavior} from './GlassPane.js';
|
|
47
47
|
import {Icon} from './Icon.js';
|
|
48
48
|
import {KeyboardShortcut} from './KeyboardShortcut.js';
|
|
49
|
-
import * as ThemeSupport from './theme_support/theme_support.js';
|
|
49
|
+
import * as ThemeSupport from './theme_support/theme_support.js';
|
|
50
50
|
import * as Utils from './utils/utils.js';
|
|
51
51
|
|
|
52
52
|
import type {ToolbarButton} from './Toolbar.js';
|
|
@@ -222,8 +222,7 @@ export class CSSAngle extends HTMLElement {
|
|
|
222
222
|
.data=${{
|
|
223
223
|
angle: this.angle,
|
|
224
224
|
} as CSSAngleSwatchData}>
|
|
225
|
-
</${CSSAngleSwatch.litTagName}><slot></slot>
|
|
226
|
-
</div>
|
|
225
|
+
</${CSSAngleSwatch.litTagName}><slot></slot></div>
|
|
227
226
|
${this.popoverOpen ? this.renderPopover() : null}
|
|
228
227
|
</div>
|
|
229
228
|
`, this.shadow, {
|
|
@@ -36,7 +36,7 @@ export class JavaScriptREPL {
|
|
|
36
36
|
|
|
37
37
|
static async evaluateAndBuildPreview(
|
|
38
38
|
text: string, throwOnSideEffect: boolean, replMode: boolean, timeout?: number, allowErrors?: boolean,
|
|
39
|
-
objectGroup?: string): Promise<{
|
|
39
|
+
objectGroup?: string, awaitPromise: boolean = false): Promise<{
|
|
40
40
|
preview: DocumentFragment,
|
|
41
41
|
result: SDK.RuntimeModel.EvaluationResult|null,
|
|
42
42
|
}> {
|
|
@@ -60,7 +60,7 @@ export class JavaScriptREPL {
|
|
|
60
60
|
returnByValue: undefined,
|
|
61
61
|
allowUnsafeEvalBlockedByCSP: undefined,
|
|
62
62
|
};
|
|
63
|
-
const result = await executionContext.evaluate(options, false /* userGesture */,
|
|
63
|
+
const result = await executionContext.evaluate(options, false /* userGesture */, awaitPromise);
|
|
64
64
|
const preview = JavaScriptREPL.buildEvaluationPreview(result, allowErrors);
|
|
65
65
|
return {preview, result};
|
|
66
66
|
}
|
|
@@ -2,19 +2,15 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import * as Root from '../../../../core/root/root.js';
|
|
6
5
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
7
6
|
import * as UI from '../../legacy.js';
|
|
8
7
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
8
|
import type * as ObjectUI from './object_ui.js';
|
|
11
9
|
|
|
12
10
|
let loadedObjectUIModule: (typeof ObjectUI|undefined);
|
|
13
11
|
|
|
14
12
|
async function loadObjectUIModule(): Promise<typeof ObjectUI> {
|
|
15
13
|
if (!loadedObjectUIModule) {
|
|
16
|
-
// Side-effect import resources in module.json
|
|
17
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('ui/legacy/components/object_ui');
|
|
18
14
|
loadedObjectUIModule = await import('./object_ui.js');
|
|
19
15
|
}
|
|
20
16
|
return loadedObjectUIModule;
|
|
@@ -7,7 +7,6 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
7
7
|
import * as Root from '../../../../core/root/root.js';
|
|
8
8
|
import * as UI from '../../legacy.js';
|
|
9
9
|
|
|
10
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
11
10
|
import type * as PerfUI from './perf_ui.js';
|
|
12
11
|
|
|
13
12
|
const UIStrings = {
|
|
@@ -51,8 +50,6 @@ let loadedPerfUIModule: (typeof PerfUI|undefined);
|
|
|
51
50
|
|
|
52
51
|
async function loadPerfUIModule(): Promise<typeof PerfUI> {
|
|
53
52
|
if (!loadedPerfUIModule) {
|
|
54
|
-
// Side-effect import resources in module.json
|
|
55
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('perf_ui');
|
|
56
53
|
loadedPerfUIModule = await import('./perf_ui.js');
|
|
57
54
|
}
|
|
58
55
|
return loadedPerfUIModule;
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
6
6
|
import * as UI from '../../legacy.js';
|
|
7
7
|
|
|
8
|
+
import type * as QuickOpen from './quick_open.js';
|
|
9
|
+
|
|
8
10
|
const UIStrings = {
|
|
9
11
|
/**
|
|
10
12
|
*@description Title of action that opens a file
|
|
@@ -18,9 +20,6 @@ const UIStrings = {
|
|
|
18
20
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/quick_open/quick_open-meta.ts', UIStrings);
|
|
19
21
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
20
22
|
|
|
21
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
22
|
-
import type * as QuickOpen from './quick_open.js';
|
|
23
|
-
|
|
24
23
|
let loadedQuickOpenModule: (typeof QuickOpen|undefined);
|
|
25
24
|
|
|
26
25
|
async function loadQuickOpenModule(): Promise<typeof QuickOpen> {
|
|
@@ -35,6 +35,8 @@ import * as Platform from '../../../../core/platform/platform.js';
|
|
|
35
35
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
36
36
|
import * as UI from '../../legacy.js';
|
|
37
37
|
|
|
38
|
+
import fontViewStyles from './fontView.css.legacy.js';
|
|
39
|
+
|
|
38
40
|
const UIStrings = {
|
|
39
41
|
/**
|
|
40
42
|
*@description Text that appears on a button for the font resource type filter.
|
|
@@ -60,7 +62,7 @@ export class FontView extends UI.View.SimpleView {
|
|
|
60
62
|
constructor(mimeType: string, contentProvider: TextUtils.ContentProvider.ContentProvider) {
|
|
61
63
|
super(i18nString(UIStrings.font));
|
|
62
64
|
// eslint-disable-next-line no-restricted-syntax -- Should import styles https://crbug.com/1106746
|
|
63
|
-
this.registerRequiredCSS(
|
|
65
|
+
this.registerRequiredCSS(fontViewStyles);
|
|
64
66
|
this.element.classList.add('font-view');
|
|
65
67
|
this.url = contentProvider.contentURL();
|
|
66
68
|
UI.ARIAUtils.setAccessibleName(this.element, i18nString(UIStrings.previewOfFontFromS, {PH1: this.url}));
|
|
@@ -38,6 +38,8 @@ import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
|
38
38
|
import * as Workspace from '../../../../models/workspace/workspace.js';
|
|
39
39
|
import * as UI from '../../legacy.js';
|
|
40
40
|
|
|
41
|
+
import imageViewStyles from './imageView.css.legacy.js';
|
|
42
|
+
|
|
41
43
|
const UIStrings = {
|
|
42
44
|
/**
|
|
43
45
|
*@description Text in Image View of the Sources panel
|
|
@@ -97,7 +99,7 @@ export class ImageView extends UI.View.SimpleView {
|
|
|
97
99
|
constructor(mimeType: string, contentProvider: TextUtils.ContentProvider.ContentProvider) {
|
|
98
100
|
super(i18nString(UIStrings.image));
|
|
99
101
|
// eslint-disable-next-line no-restricted-syntax -- Should import styles https://crbug.com/1106746
|
|
100
|
-
this.registerRequiredCSS(
|
|
102
|
+
this.registerRequiredCSS(imageViewStyles);
|
|
101
103
|
this.element.tabIndex = -1;
|
|
102
104
|
this.element.classList.add('image-view');
|
|
103
105
|
this.url = contentProvider.contentURL();
|
|
@@ -34,6 +34,8 @@ import * as SDK from '../../../../core/sdk/sdk.js';
|
|
|
34
34
|
import * as UI from '../../legacy.js';
|
|
35
35
|
import * as ObjectUI from '../object_ui/object_ui.js';
|
|
36
36
|
|
|
37
|
+
import jsonViewStyles from './jsonView.css.legacy.js';
|
|
38
|
+
|
|
37
39
|
const UIStrings = {
|
|
38
40
|
/**
|
|
39
41
|
*@description Text to find an item
|
|
@@ -55,7 +57,7 @@ export class JSONView extends UI.Widget.VBox implements UI.SearchableView.Search
|
|
|
55
57
|
super();
|
|
56
58
|
this.initialized = false;
|
|
57
59
|
// eslint-disable-next-line no-restricted-syntax -- Should import styles https://crbug.com/1106746
|
|
58
|
-
this.registerRequiredCSS(
|
|
60
|
+
this.registerRequiredCSS(jsonViewStyles);
|
|
59
61
|
this.parsedJSON = parsedJSON;
|
|
60
62
|
this.startCollapsed = Boolean(startCollapsed);
|
|
61
63
|
this.element.classList.add('json-view');
|
|
@@ -37,6 +37,7 @@ import * as UI from '../../legacy.js';
|
|
|
37
37
|
|
|
38
38
|
import type {SourceFrameOptions} from './SourceFrame.js';
|
|
39
39
|
import {SourceFrameImpl} from './SourceFrame.js';
|
|
40
|
+
import resourceSourceFrameStyles from './resourceSourceFrame.css.legacy.js';
|
|
40
41
|
|
|
41
42
|
const UIStrings = {
|
|
42
43
|
/**
|
|
@@ -84,7 +85,7 @@ export class SearchableContainer extends UI.Widget.VBox {
|
|
|
84
85
|
constructor(resource: TextUtils.ContentProvider.ContentProvider, contentType: string, autoPrettyPrint?: boolean) {
|
|
85
86
|
super(true);
|
|
86
87
|
// eslint-disable-next-line no-restricted-syntax -- Should import styles https://crbug.com/1106746
|
|
87
|
-
this.registerRequiredCSS(
|
|
88
|
+
this.registerRequiredCSS(resourceSourceFrameStyles);
|
|
88
89
|
const sourceFrame = new ResourceSourceFrame(resource, contentType);
|
|
89
90
|
this.sourceFrame = sourceFrame;
|
|
90
91
|
const canPrettyPrint =
|
|
@@ -159,6 +159,11 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
159
159
|
this.textEditorInternal = new TextEditor.TextEditor.TextEditor(this.placeholderEditorState(''));
|
|
160
160
|
this.textEditorInternal.style.flexGrow = '1';
|
|
161
161
|
this.element.appendChild(this.textEditorInternal);
|
|
162
|
+
this.element.addEventListener('keydown', (event: KeyboardEvent): void => {
|
|
163
|
+
if (event.defaultPrevented) {
|
|
164
|
+
event.stopPropagation();
|
|
165
|
+
}
|
|
166
|
+
});
|
|
162
167
|
|
|
163
168
|
this.baseDoc = this.textEditorInternal.state.doc;
|
|
164
169
|
|
|
@@ -246,7 +251,6 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
246
251
|
}),
|
|
247
252
|
activeSearchState,
|
|
248
253
|
CodeMirror.Prec.lowest(searchHighlighter),
|
|
249
|
-
config.lineNumbers.of([]),
|
|
250
254
|
config.language.of([]),
|
|
251
255
|
this.wasmDisassemblyInternal ? markNonBreakableLines(this.wasmDisassemblyInternal) : nonBreakableLines,
|
|
252
256
|
this.options.lineWrapping ? CodeMirror.EditorView.lineWrapping : [],
|
|
@@ -708,7 +712,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
708
712
|
extensions: [
|
|
709
713
|
this.editorConfiguration(content),
|
|
710
714
|
languageSupport,
|
|
711
|
-
this.getLineNumberFormatter(),
|
|
715
|
+
config.lineNumbers.of(this.getLineNumberFormatter()),
|
|
712
716
|
config.editable.of(this.editable ? [] : CodeMirror.EditorState.readOnly.of(true)),
|
|
713
717
|
],
|
|
714
718
|
});
|
|
@@ -717,7 +721,6 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
717
721
|
if (wasLoaded) {
|
|
718
722
|
textEditor.editor.scrollDOM.scrollTop = scrollTop;
|
|
719
723
|
}
|
|
720
|
-
this.editorInitialized();
|
|
721
724
|
this.wasShownOrLoaded();
|
|
722
725
|
|
|
723
726
|
if (this.delayedFindSearchMatches) {
|
|
@@ -727,9 +730,6 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
727
730
|
this.muteChangeEventsForSetContent = false;
|
|
728
731
|
}
|
|
729
732
|
|
|
730
|
-
protected editorInitialized(): void {
|
|
731
|
-
}
|
|
732
|
-
|
|
733
733
|
setSearchableView(view: UI.SearchableView.SearchableView|null): void {
|
|
734
734
|
this.searchableView = view;
|
|
735
735
|
}
|
|
@@ -7,6 +7,9 @@ import * as Platform from '../../../../core/platform/platform.js';
|
|
|
7
7
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
8
8
|
import * as UI from '../../legacy.js';
|
|
9
9
|
|
|
10
|
+
import xmlTreeStyles from './xmlTree.css.legacy.js';
|
|
11
|
+
import xmlViewStyles from './xmlView.css.legacy.js';
|
|
12
|
+
|
|
10
13
|
const UIStrings = {
|
|
11
14
|
/**
|
|
12
15
|
*@description Text to find an item
|
|
@@ -26,11 +29,11 @@ export class XMLView extends UI.Widget.Widget implements UI.SearchableView.Searc
|
|
|
26
29
|
constructor(parsedXML: Document) {
|
|
27
30
|
super(true);
|
|
28
31
|
// eslint-disable-next-line no-restricted-syntax -- Should import styles https://crbug.com/1106746
|
|
29
|
-
this.registerRequiredCSS(
|
|
32
|
+
this.registerRequiredCSS(xmlViewStyles);
|
|
30
33
|
this.contentElement.classList.add('shadow-xml-view', 'source-code');
|
|
31
34
|
this.treeOutline = new UI.TreeOutline.TreeOutlineInShadow();
|
|
32
35
|
// eslint-disable-next-line no-restricted-syntax -- Should import styles https://crbug.com/1106746
|
|
33
|
-
this.treeOutline.registerRequiredCSS(
|
|
36
|
+
this.treeOutline.registerRequiredCSS(xmlTreeStyles);
|
|
34
37
|
this.contentElement.appendChild(this.treeOutline.element);
|
|
35
38
|
this.currentSearchFocusIndex = 0;
|
|
36
39
|
this.currentSearchTreeElements = [];
|
|
@@ -108,8 +108,9 @@
|
|
|
108
108
|
.text-button:not(:disabled):focus {
|
|
109
109
|
forced-color-adjust: none;
|
|
110
110
|
background-color: ButtonFace;
|
|
111
|
-
color:
|
|
111
|
+
color: Highlight !important; /* stylelint-disable-line declaration-no-important */
|
|
112
112
|
border-color: Highlight;
|
|
113
|
+
outline: 2px solid ButtonText;
|
|
113
114
|
box-shadow: var(--legacy-focus-ring-active-shadow);
|
|
114
115
|
}
|
|
115
116
|
|
|
@@ -117,7 +118,7 @@
|
|
|
117
118
|
.text-button:not(:disabled):active {
|
|
118
119
|
forced-color-adjust: none;
|
|
119
120
|
background-color: Highlight;
|
|
120
|
-
color: HighlightText;
|
|
121
|
+
color: HighlightText !important; /* stylelint-disable-line declaration-no-important */
|
|
121
122
|
box-shadow: var(--legacy-accent-color);
|
|
122
123
|
}
|
|
123
124
|
|
|
@@ -130,14 +131,14 @@
|
|
|
130
131
|
|
|
131
132
|
.text-button.primary-button:not(:disabled):focus {
|
|
132
133
|
background-color: Highlight;
|
|
133
|
-
color: HighlightText;
|
|
134
|
+
color: HighlightText !important; /* stylelint-disable-line declaration-no-important */
|
|
134
135
|
border-color: ButtonText;
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
.text-button.primary-button:not(:disabled):hover,
|
|
138
139
|
.text-button.primary-button:not(:disabled):active {
|
|
139
140
|
background-color: HighlightText;
|
|
140
|
-
color: Highlight;
|
|
141
|
+
color: Highlight !important; /* stylelint-disable-line declaration-no-important */
|
|
141
142
|
border-color: Highlight;
|
|
142
143
|
}
|
|
143
144
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import {luminance} from '../front_end/core/common/ColorUtils.js';
|
|
5
|
+
import {luminance} from '../front_end/core/common/ColorUtils.js'; // eslint-disable-line rulesdir/es_modules_import
|
|
6
6
|
|
|
7
7
|
import type {AreaBounds, Bounds, Position} from './common.js';
|
|
8
8
|
import {createChild} from './common.js';
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
29
29
|
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
30
|
|
|
31
|
-
import {rgbaToHsla} from '../front_end/core/common/ColorUtils.js';
|
|
31
|
+
import {rgbaToHsla} from '../front_end/core/common/ColorUtils.js'; // eslint-disable-line rulesdir/es_modules_import
|
|
32
32
|
|
|
33
33
|
import type {Bounds, PathCommands, Quad} from './common.js';
|
|
34
34
|
|