chrome-devtools-frontend 1.0.943017 → 1.0.944427
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/config/gni/all_devtools_files.gni +0 -9
- package/config/gni/devtools_grd_files.gni +6 -1
- package/front_end/core/host/UserMetrics.ts +0 -1
- 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 +7 -19
- package/front_end/core/i18n/locales/en-XL.json +7 -19
- 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/CSSStyleDeclaration.ts +4 -0
- package/front_end/core/sdk/ConsoleModel.ts +1 -5
- package/front_end/core/sdk/NetworkManager.ts +3 -0
- package/front_end/core/sdk/OverlayModel.ts +0 -9
- package/front_end/core/sdk/Script.ts +0 -4
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +13 -12
- package/front_end/core/sdk/sdk-meta.ts +0 -26
- 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 -2
- 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_main/RenderingOptions.ts +0 -13
- 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/main/MainImpl.ts +2 -4
- 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_main/node_main-meta.ts +0 -1
- package/front_end/entrypoints/shell/shell.json +1 -2
- 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/generated/InspectorBackendCommands.js +3 -1
- package/front_end/generated/protocol-mapping.d.ts +1 -0
- package/front_end/generated/protocol-proxy-api.d.ts +2 -0
- package/front_end/generated/protocol.d.ts +40 -0
- 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/models/timeline_model/TimelineJSProfile.ts +3 -16
- package/front_end/models/timeline_model/TimelineModel.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/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 +3 -6
- package/front_end/panels/console/ConsolePrompt.ts +121 -171
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +8 -1
- package/front_end/panels/console/console-meta.ts +0 -1
- package/front_end/panels/console/consoleView.css +1 -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/cssOverviewCompletedView.css +2 -2
- 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 +98 -67
- package/front_end/panels/elements/AccessibilityTreeView.ts +76 -125
- package/front_end/panels/elements/ElementsPanel.ts +6 -7
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -0
- package/front_end/panels/elements/StyleEditorWidget.ts +13 -2
- package/front_end/panels/elements/StylePropertyHighlighter.ts +29 -19
- package/front_end/panels/elements/StylePropertyTreeElement.ts +7 -4
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +27 -3
- 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 -1
- package/front_end/panels/layers/layers-meta.ts +0 -4
- package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -1
- 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/NetworkDataGridNode.ts +5 -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/profiler-meta.ts +0 -1
- package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +0 -1
- package/front_end/panels/screencast/screencast-meta.ts +0 -1
- 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/BreakpointEditDialog.ts +1 -0
- 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 +1 -2
- package/front_end/panels/timeline/TimelineController.ts +0 -3
- package/front_end/panels/timeline/timeline-meta.ts +2 -4
- 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/bundle.ts +3 -2
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +32 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +3 -3
- 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/text_editor/config.ts +34 -14
- package/front_end/ui/components/text_editor/javascript.ts +14 -9
- package/front_end/ui/components/text_editor/theme.ts +29 -4
- 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 -1
- package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +0 -1
- 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 -4
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +5 -2
- package/front_end/ui/legacy/components/utils/Linkifier.ts +49 -79
- package/front_end/ui/legacy/themeColors.css +2 -0
- 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/panels/layers/module.json +0 -4
- package/front_end/ui/legacy/components/source_frame/messagesPopover.css +0 -32
- package/front_end/ui/legacy/components/source_frame/module.json +0 -11
|
@@ -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
|
}
|
|
@@ -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 = {
|
|
@@ -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
|
|
|
@@ -201,6 +206,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
201
206
|
return [
|
|
202
207
|
CodeMirror.EditorView.updateListener.of(update => this.dispatchEventToListeners(Events.EditorUpdate, update)),
|
|
203
208
|
TextEditor.Config.baseConfiguration(doc),
|
|
209
|
+
TextEditor.Config.closeBrackets,
|
|
204
210
|
TextEditor.Config.sourcesAutocompletion.instance(),
|
|
205
211
|
TextEditor.Config.showWhitespace.instance(),
|
|
206
212
|
TextEditor.Config.allowScrollPastEof.instance(),
|
|
@@ -716,7 +722,6 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
716
722
|
if (wasLoaded) {
|
|
717
723
|
textEditor.editor.scrollDOM.scrollTop = scrollTop;
|
|
718
724
|
}
|
|
719
|
-
this.editorInitialized();
|
|
720
725
|
this.wasShownOrLoaded();
|
|
721
726
|
|
|
722
727
|
if (this.delayedFindSearchMatches) {
|
|
@@ -726,9 +731,6 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
726
731
|
this.muteChangeEventsForSetContent = false;
|
|
727
732
|
}
|
|
728
733
|
|
|
729
|
-
protected editorInitialized(): void {
|
|
730
|
-
}
|
|
731
|
-
|
|
732
734
|
setSearchableView(view: UI.SearchableView.SearchableView|null): void {
|
|
733
735
|
this.searchableView = view;
|
|
734
736
|
}
|
|
@@ -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 = [];
|
|
@@ -184,17 +184,9 @@ export class Linkifier implements SDK.TargetManager.Observer {
|
|
|
184
184
|
}
|
|
185
185
|
info.liveLocation = null;
|
|
186
186
|
Linkifier.unbindUILocation(anchor);
|
|
187
|
-
const fallback =
|
|
187
|
+
const fallback = info.fallback;
|
|
188
188
|
if (fallback) {
|
|
189
|
-
|
|
190
|
-
anchor.href = fallback.href;
|
|
191
|
-
UI.Tooltip.Tooltip.install(anchor, fallback.title);
|
|
192
|
-
anchor.className = fallback.className;
|
|
193
|
-
anchor.textContent = fallback.textContent;
|
|
194
|
-
const fallbackInfo = infoByAnchor.get(fallback);
|
|
195
|
-
if (fallbackInfo) {
|
|
196
|
-
infoByAnchor.set(anchor, fallbackInfo);
|
|
197
|
-
}
|
|
189
|
+
anchor.replaceWith(fallback);
|
|
198
190
|
}
|
|
199
191
|
}
|
|
200
192
|
}
|
|
@@ -249,15 +241,11 @@ export class Linkifier implements SDK.TargetManager.Observer {
|
|
|
249
241
|
// Not initialising the anchor element with 'zero width space' (\u200b) causes a crash
|
|
250
242
|
// in the layout engine.
|
|
251
243
|
// TODO(szuend): Remove comment and workaround once the crash is fixed.
|
|
252
|
-
const
|
|
244
|
+
const {link, linkInfo} = Linkifier.createLink(
|
|
253
245
|
fallbackAnchor && fallbackAnchor.textContent ? fallbackAnchor.textContent : '\u200b', className,
|
|
254
246
|
createLinkOptions);
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
return fallbackAnchor;
|
|
258
|
-
}
|
|
259
|
-
info.enableDecorator = this.useLinkDecorator;
|
|
260
|
-
info.fallback = fallbackAnchor;
|
|
247
|
+
linkInfo.enableDecorator = this.useLinkDecorator;
|
|
248
|
+
linkInfo.fallback = fallbackAnchor;
|
|
261
249
|
|
|
262
250
|
const pool = this.locationPoolByTarget.get(rawLocation.debuggerModel.target());
|
|
263
251
|
if (!pool) {
|
|
@@ -268,10 +256,10 @@ export class Linkifier implements SDK.TargetManager.Observer {
|
|
|
268
256
|
|
|
269
257
|
const currentOnLiveLocationUpdate = this.onLiveLocationUpdate;
|
|
270
258
|
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()
|
|
271
|
-
.createLiveLocation(rawLocation, this.updateAnchor.bind(this,
|
|
259
|
+
.createLiveLocation(rawLocation, this.updateAnchor.bind(this, link, linkDisplayOptions), pool)
|
|
272
260
|
.then(liveLocation => {
|
|
273
261
|
if (liveLocation) {
|
|
274
|
-
|
|
262
|
+
linkInfo.liveLocation = liveLocation;
|
|
275
263
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
276
264
|
// @ts-expect-error
|
|
277
265
|
currentOnLiveLocationUpdate();
|
|
@@ -279,8 +267,8 @@ export class Linkifier implements SDK.TargetManager.Observer {
|
|
|
279
267
|
});
|
|
280
268
|
|
|
281
269
|
const anchors = (this.anchorsByTarget.get(rawLocation.debuggerModel.target()) as Element[]);
|
|
282
|
-
anchors.push(
|
|
283
|
-
return
|
|
270
|
+
anchors.push(link);
|
|
271
|
+
return link;
|
|
284
272
|
}
|
|
285
273
|
|
|
286
274
|
linkifyScriptLocation(
|
|
@@ -327,68 +315,61 @@ export class Linkifier implements SDK.TargetManager.Observer {
|
|
|
327
315
|
target, callFrame.scriptId, callFrame.url, callFrame.lineNumber, linkifyOptions);
|
|
328
316
|
}
|
|
329
317
|
|
|
330
|
-
linkifyStackTraceTopFrame(target: SDK.Target.Target, stackTrace: Protocol.Runtime.StackTrace,
|
|
318
|
+
linkifyStackTraceTopFrame(target: SDK.Target.Target, stackTrace: Protocol.Runtime.StackTrace, className?: string):
|
|
331
319
|
HTMLElement {
|
|
332
|
-
console.assert(
|
|
320
|
+
console.assert(stackTrace.callFrames.length > 0);
|
|
333
321
|
|
|
334
|
-
const
|
|
335
|
-
const fallbackAnchor = Linkifier.linkifyURL(
|
|
336
|
-
className
|
|
337
|
-
lineNumber
|
|
338
|
-
columnNumber
|
|
322
|
+
const {url, lineNumber, columnNumber} = stackTrace.callFrames[0];
|
|
323
|
+
const fallbackAnchor = Linkifier.linkifyURL(url, {
|
|
324
|
+
className,
|
|
325
|
+
lineNumber,
|
|
326
|
+
columnNumber,
|
|
339
327
|
showColumnNumber: false,
|
|
340
328
|
inlineFrameIndex: 0,
|
|
341
329
|
maxLength: this.maxLength,
|
|
342
330
|
text: undefined,
|
|
343
|
-
preventClick:
|
|
331
|
+
preventClick: true,
|
|
344
332
|
tabStop: undefined,
|
|
345
333
|
bypassURLTrimming: undefined,
|
|
346
334
|
});
|
|
347
|
-
if (target.isDisposed()) {
|
|
348
|
-
return fallbackAnchor;
|
|
349
|
-
}
|
|
350
335
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
336
|
+
// The contract is that disposed targets don't have a LiveLocationPool
|
|
337
|
+
// associated, whereas all active targets have one such pool. This ensures
|
|
338
|
+
// that the fallbackAnchor is only ever used when the target was disposed.
|
|
339
|
+
const pool = this.locationPoolByTarget.get(target);
|
|
340
|
+
if (!pool) {
|
|
341
|
+
console.assert(target.isDisposed());
|
|
357
342
|
return fallbackAnchor;
|
|
358
343
|
}
|
|
344
|
+
console.assert(!target.isDisposed());
|
|
345
|
+
|
|
346
|
+
// All targets that can report stack traces also have a debugger model.
|
|
347
|
+
const debuggerModel = target.model(SDK.DebuggerModel.DebuggerModel) as SDK.DebuggerModel.DebuggerModel;
|
|
359
348
|
|
|
360
349
|
// Not initialising the anchor element with 'zero width space' (\u200b) causes a crash
|
|
361
350
|
// in the layout engine.
|
|
362
351
|
// TODO(szuend): Remove comment and workaround once the crash is fixed.
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
return fallbackAnchor;
|
|
367
|
-
}
|
|
368
|
-
info.enableDecorator = this.useLinkDecorator;
|
|
369
|
-
info.fallback = fallbackAnchor;
|
|
370
|
-
|
|
371
|
-
const pool = this.locationPoolByTarget.get(target);
|
|
372
|
-
if (!pool) {
|
|
373
|
-
return fallbackAnchor;
|
|
374
|
-
}
|
|
352
|
+
const {link, linkInfo} = Linkifier.createLink('\u200b', className ?? '');
|
|
353
|
+
linkInfo.enableDecorator = this.useLinkDecorator;
|
|
354
|
+
linkInfo.fallback = fallbackAnchor;
|
|
375
355
|
|
|
376
356
|
const linkDisplayOptions = {showColumnNumber: false};
|
|
377
357
|
|
|
378
358
|
const currentOnLiveLocationUpdate = this.onLiveLocationUpdate;
|
|
379
359
|
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()
|
|
380
360
|
.createStackTraceTopFrameLiveLocation(
|
|
381
|
-
|
|
361
|
+
debuggerModel.createRawLocationsByStackTrace(stackTrace),
|
|
362
|
+
this.updateAnchor.bind(this, link, linkDisplayOptions), pool)
|
|
382
363
|
.then(liveLocation => {
|
|
383
|
-
|
|
364
|
+
linkInfo.liveLocation = liveLocation;
|
|
384
365
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
385
366
|
// @ts-expect-error
|
|
386
367
|
currentOnLiveLocationUpdate();
|
|
387
368
|
});
|
|
388
369
|
|
|
389
370
|
const anchors = (this.anchorsByTarget.get(target) as Element[]);
|
|
390
|
-
anchors.push(
|
|
391
|
-
return
|
|
371
|
+
anchors.push(link);
|
|
372
|
+
return link;
|
|
392
373
|
}
|
|
393
374
|
|
|
394
375
|
linkifyCSSLocation(rawLocation: SDK.CSSModel.CSSLocation, classes?: string): Element {
|
|
@@ -403,33 +384,29 @@ export class Linkifier implements SDK.TargetManager.Observer {
|
|
|
403
384
|
// Not initialising the anchor element with 'zero width space' (\u200b) causes a crash
|
|
404
385
|
// in the layout engine.
|
|
405
386
|
// TODO(szuend): Remove comment and workaround once the crash is fixed.
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
if (!info) {
|
|
409
|
-
return anchor;
|
|
410
|
-
}
|
|
411
|
-
info.enableDecorator = this.useLinkDecorator;
|
|
387
|
+
const {link, linkInfo} = Linkifier.createLink('\u200b', classes || '', createLinkOptions);
|
|
388
|
+
linkInfo.enableDecorator = this.useLinkDecorator;
|
|
412
389
|
|
|
413
390
|
const pool = this.locationPoolByTarget.get(rawLocation.cssModel().target());
|
|
414
391
|
if (!pool) {
|
|
415
|
-
return
|
|
392
|
+
return link;
|
|
416
393
|
}
|
|
417
394
|
|
|
418
395
|
const linkDisplayOptions = {showColumnNumber: false};
|
|
419
396
|
|
|
420
397
|
const currentOnLiveLocationUpdate = this.onLiveLocationUpdate;
|
|
421
398
|
Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding.instance()
|
|
422
|
-
.createLiveLocation(rawLocation, this.updateAnchor.bind(this,
|
|
399
|
+
.createLiveLocation(rawLocation, this.updateAnchor.bind(this, link, linkDisplayOptions), pool)
|
|
423
400
|
.then(liveLocation => {
|
|
424
|
-
|
|
401
|
+
linkInfo.liveLocation = liveLocation;
|
|
425
402
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
426
403
|
// @ts-expect-error
|
|
427
404
|
currentOnLiveLocationUpdate();
|
|
428
405
|
});
|
|
429
406
|
|
|
430
407
|
const anchors = (this.anchorsByTarget.get(rawLocation.cssModel().target()) as Element[]);
|
|
431
|
-
anchors.push(
|
|
432
|
-
return
|
|
408
|
+
anchors.push(link);
|
|
409
|
+
return link;
|
|
433
410
|
}
|
|
434
411
|
|
|
435
412
|
reset(): void {
|
|
@@ -557,16 +534,12 @@ export class Linkifier implements SDK.TargetManager.Observer {
|
|
|
557
534
|
}
|
|
558
535
|
const title = linkText !== url ? url : '';
|
|
559
536
|
const linkOptions = {maxLength, title, href: url, preventClick, tabStop: options.tabStop, bypassURLTrimming};
|
|
560
|
-
const link = Linkifier.createLink(linkText, className, linkOptions);
|
|
561
|
-
const info = Linkifier.linkInfo(link);
|
|
562
|
-
if (!info) {
|
|
563
|
-
return link;
|
|
564
|
-
}
|
|
537
|
+
const {link, linkInfo} = Linkifier.createLink(linkText, className, linkOptions);
|
|
565
538
|
if (lineNumber) {
|
|
566
|
-
|
|
539
|
+
linkInfo.lineNumber = lineNumber;
|
|
567
540
|
}
|
|
568
541
|
if (columnNumber) {
|
|
569
|
-
|
|
542
|
+
linkInfo.columnNumber = columnNumber;
|
|
570
543
|
}
|
|
571
544
|
return link;
|
|
572
545
|
}
|
|
@@ -582,16 +555,13 @@ export class Linkifier implements SDK.TargetManager.Observer {
|
|
|
582
555
|
tabStop: undefined,
|
|
583
556
|
bypassURLTrimming: undefined,
|
|
584
557
|
};
|
|
585
|
-
const link = Linkifier.createLink(text, className || '', createLinkOptions);
|
|
586
|
-
const linkInfo = Linkifier.linkInfo(link);
|
|
587
|
-
if (!linkInfo) {
|
|
588
|
-
return link;
|
|
589
|
-
}
|
|
558
|
+
const {link, linkInfo} = Linkifier.createLink(text, className || '', createLinkOptions);
|
|
590
559
|
linkInfo.revealable = revealable;
|
|
591
560
|
return link;
|
|
592
561
|
}
|
|
593
562
|
|
|
594
|
-
private static createLink(text: string|HTMLElement, className: string, options?: _CreateLinkOptions):
|
|
563
|
+
private static createLink(text: string|HTMLElement, className: string, options?: _CreateLinkOptions):
|
|
564
|
+
{link: HTMLElement, linkInfo: _LinkInfo} {
|
|
595
565
|
options = options || {
|
|
596
566
|
maxLength: undefined,
|
|
597
567
|
title: undefined,
|
|
@@ -654,7 +624,7 @@ export class Linkifier implements SDK.TargetManager.Observer {
|
|
|
654
624
|
}
|
|
655
625
|
UI.ARIAUtils.markAsLink(link);
|
|
656
626
|
link.tabIndex = tabStop ? 0 : -1;
|
|
657
|
-
return link;
|
|
627
|
+
return {link, linkInfo};
|
|
658
628
|
}
|
|
659
629
|
|
|
660
630
|
private static setTrimmedText(link: Element, text: string, maxLength?: number): void {
|
|
@@ -167,6 +167,7 @@
|
|
|
167
167
|
--color-selected-option: #fff;
|
|
168
168
|
--color-selected-option-background: #1a73e8;
|
|
169
169
|
--color-highlighted-line: rgb(255 255 0 / 50%);
|
|
170
|
+
--color-completion-hover: rgb(56 121 217 / 10%);
|
|
170
171
|
--color-search-match-border: rgb(128 128 128);
|
|
171
172
|
--color-selected-search-match: var(--color-text-primary);
|
|
172
173
|
--color-selected-search-match-background: rgb(241 234 0);
|
|
@@ -307,6 +308,7 @@
|
|
|
307
308
|
--color-selected-option: #fff;
|
|
308
309
|
--color-selected-option-background: #0e639c;
|
|
309
310
|
--color-highlighted-line: hsl(133deg 100% 30% / 50%);
|
|
311
|
+
--color-completion-hover: rgb(56 121 217 / 10%);
|
|
310
312
|
--color-search-match-border: rgb(128 128 128);
|
|
311
313
|
--color-selected-search-match: #eee;
|
|
312
314
|
--color-selected-search-match-background: hsl(133deg 100% 30%);
|
|
@@ -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
|
|
|
@@ -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 {contrastRatio, contrastRatioAPCA, getAPCAThreshold, getContrastThreshold} from '../front_end/core/common/ColorUtils.js';
|
|
31
|
+
import {contrastRatio, contrastRatioAPCA, getAPCAThreshold, getContrastThreshold} from '../front_end/core/common/ColorUtils.js'; // eslint-disable-line rulesdir/es_modules_import
|
|
32
32
|
|
|
33
33
|
import type {Bounds, PathCommands, ResetData} from './common.js';
|
|
34
34
|
import {constrainNumber, createChild, createElement, createTextChild, ellipsify, Overlay} from './common.js';
|
package/package.json
CHANGED
package/scripts/check_gn.js
CHANGED
|
@@ -17,40 +17,6 @@ const gnPath = path.resolve(__dirname, '..', 'BUILD.gn');
|
|
|
17
17
|
const gnFile = fs.readFileSync(gnPath, 'utf-8');
|
|
18
18
|
const gnLines = gnFile.split('\n');
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Ensures that generated module files are in the right list in BUILD.gn.
|
|
22
|
-
* This is primarily to avoid remote modules from accidentally getting
|
|
23
|
-
* bundled with the main Chrome binary.
|
|
24
|
-
*/
|
|
25
|
-
function checkNonAutostartNonRemoteModules() {
|
|
26
|
-
const errors = [];
|
|
27
|
-
const gnVariable = 'non_autostart_non_remote_modules';
|
|
28
|
-
const lines = selectGNLines(`${gnVariable} = [`, ']');
|
|
29
|
-
if (!lines.length) {
|
|
30
|
-
return [
|
|
31
|
-
'Could not identify non-autostart non-remote modules in gn file',
|
|
32
|
-
'Please look at: ' + __filename,
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
const text = lines.join('\n');
|
|
36
|
-
const modules = manifestModules.filter(m => m.type !== 'autostart').map(m => m.name);
|
|
37
|
-
|
|
38
|
-
const missingModules = modules.filter(m => !text.includes(`${m}/${path.basename(m)}_module.js`));
|
|
39
|
-
if (missingModules.length) {
|
|
40
|
-
errors.push(`Check that you've included [${missingModules.join(', ')}] modules in: ` + gnVariable);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// e.g. "lighthouse/lighthouse_module.js" => "lighthouse"
|
|
44
|
-
const mapLineToModuleName = line => path.dirname(line.substring(1));
|
|
45
|
-
|
|
46
|
-
const extraneousModules = lines.map(mapLineToModuleName).filter(module => !modules.includes(module));
|
|
47
|
-
if (extraneousModules.length) {
|
|
48
|
-
errors.push(`Found extraneous modules [${extraneousModules.join(', ')}] in: ` + gnVariable);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return errors;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
20
|
/**
|
|
55
21
|
* Ensures that all source files (according to the various module.json files) are
|
|
56
22
|
* listed in BUILD.gn.
|
|
@@ -139,7 +105,6 @@ function selectGNLines(startLine, endLine, linesToCheck = gnLines) {
|
|
|
139
105
|
|
|
140
106
|
function main() {
|
|
141
107
|
const errors = [
|
|
142
|
-
...checkNonAutostartNonRemoteModules(),
|
|
143
108
|
...checkAllDevToolsFiles(),
|
|
144
109
|
];
|
|
145
110
|
if (errors.length) {
|