chrome-devtools-frontend 1.0.946920 → 1.0.947377

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.
Files changed (117) hide show
  1. package/.eslintrc.js +1 -0
  2. package/config/gni/all_devtools_files.gni +0 -7
  3. package/config/gni/devtools_grd_files.gni +1 -3
  4. package/front_end/.eslintrc.js +5 -1
  5. package/front_end/core/host/InspectorFrontendHost.ts +0 -3
  6. package/front_end/core/root/Runtime.ts +0 -4
  7. package/front_end/core/sdk/AccessibilityModel.ts +0 -2
  8. package/front_end/core/sdk/CSSProperty.ts +0 -2
  9. package/front_end/core/sdk/CSSRule.ts +0 -2
  10. package/front_end/core/sdk/Cookie.ts +1 -5
  11. package/front_end/core/sdk/EmulationModel.ts +0 -2
  12. package/front_end/core/sdk/HeapProfilerModel.ts +0 -2
  13. package/front_end/core/sdk/NetworkManager.ts +0 -3
  14. package/front_end/core/sdk/Resource.ts +0 -3
  15. package/front_end/core/sdk/ResourceTreeModel.ts +0 -3
  16. package/front_end/core/sdk/ServiceWorkerManager.ts +0 -2
  17. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -1
  18. package/front_end/entrypoints/inspector/{inspector.js → inspector.ts} +0 -3
  19. package/front_end/entrypoints/worker_app/{worker_app.js → worker_app.ts} +5 -2
  20. package/front_end/generated/InspectorBackendCommands.js +5 -1
  21. package/front_end/generated/protocol.d.ts +12 -0
  22. package/front_end/models/bindings/CompilerScriptMapping.ts +0 -1
  23. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +4 -11
  24. package/front_end/models/bindings/SASSSourceMapping.ts +0 -1
  25. package/front_end/models/emulation/DeviceModeModel.ts +0 -2
  26. package/front_end/models/issues_manager/CorsIssue.ts +8 -0
  27. package/front_end/panels/animation/AnimationTimeline.ts +0 -2
  28. package/front_end/panels/animation/AnimationUI.ts +0 -2
  29. package/front_end/panels/application/BackForwardCacheStrings.ts +1 -0
  30. package/front_end/panels/css_overview/CSSOverviewModel.ts +0 -2
  31. package/front_end/panels/css_overview/CSSOverviewPanel.ts +0 -7
  32. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +0 -2
  33. package/front_end/panels/issues/CorsIssueDetailsView.ts +6 -2
  34. package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -3
  35. package/front_end/panels/search/SearchView.ts +24 -4
  36. package/front_end/panels/sources/CSSPlugin.ts +3 -0
  37. package/front_end/panels/sources/CoveragePlugin.ts +2 -0
  38. package/front_end/panels/sources/DebuggerPlugin.ts +28 -4
  39. package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +3 -0
  40. package/front_end/panels/sources/ProfilePlugin.ts +3 -0
  41. package/front_end/panels/sources/UISourceCodeFrame.ts +11 -2
  42. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  43. package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -2
  44. package/front_end/third_party/codemirror.next/chunk/java.js +1 -2
  45. package/front_end/third_party/codemirror.next/chunk/json.js +1 -2
  46. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -2
  47. package/front_end/third_party/codemirror.next/chunk/php.js +1 -2
  48. package/front_end/third_party/codemirror.next/chunk/python.js +1 -2
  49. package/front_end/third_party/codemirror.next/chunk/wast.js +1 -2
  50. package/front_end/third_party/codemirror.next/chunk/xml.js +1 -2
  51. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -2
  52. package/front_end/third_party/codemirror.next/package.json +1 -0
  53. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +168 -164
  54. package/front_end/third_party/lighthouse/locales/ar-XB.json +0 -3
  55. package/front_end/third_party/lighthouse/locales/ar.json +0 -3
  56. package/front_end/third_party/lighthouse/locales/bg.json +17 -20
  57. package/front_end/third_party/lighthouse/locales/ca.json +0 -3
  58. package/front_end/third_party/lighthouse/locales/cs.json +0 -3
  59. package/front_end/third_party/lighthouse/locales/da.json +16 -19
  60. package/front_end/third_party/lighthouse/locales/de.json +0 -3
  61. package/front_end/third_party/lighthouse/locales/el.json +0 -3
  62. package/front_end/third_party/lighthouse/locales/en-GB.json +19 -22
  63. package/front_end/third_party/lighthouse/locales/en-US.json +33 -3
  64. package/front_end/third_party/lighthouse/locales/en-XA.json +0 -3
  65. package/front_end/third_party/lighthouse/locales/en-XL.json +33 -3
  66. package/front_end/third_party/lighthouse/locales/es-419.json +17 -20
  67. package/front_end/third_party/lighthouse/locales/es.json +0 -3
  68. package/front_end/third_party/lighthouse/locales/fi.json +16 -19
  69. package/front_end/third_party/lighthouse/locales/fil.json +33 -36
  70. package/front_end/third_party/lighthouse/locales/fr.json +16 -19
  71. package/front_end/third_party/lighthouse/locales/he.json +16 -19
  72. package/front_end/third_party/lighthouse/locales/hi.json +0 -3
  73. package/front_end/third_party/lighthouse/locales/hr.json +16 -19
  74. package/front_end/third_party/lighthouse/locales/hu.json +16 -19
  75. package/front_end/third_party/lighthouse/locales/id.json +16 -19
  76. package/front_end/third_party/lighthouse/locales/it.json +37 -40
  77. package/front_end/third_party/lighthouse/locales/ja.json +16 -19
  78. package/front_end/third_party/lighthouse/locales/ko.json +16 -19
  79. package/front_end/third_party/lighthouse/locales/lt.json +17 -20
  80. package/front_end/third_party/lighthouse/locales/lv.json +0 -3
  81. package/front_end/third_party/lighthouse/locales/nl.json +16 -19
  82. package/front_end/third_party/lighthouse/locales/no.json +17 -20
  83. package/front_end/third_party/lighthouse/locales/pl.json +16 -19
  84. package/front_end/third_party/lighthouse/locales/pt-PT.json +37 -40
  85. package/front_end/third_party/lighthouse/locales/pt.json +16 -19
  86. package/front_end/third_party/lighthouse/locales/ro.json +0 -3
  87. package/front_end/third_party/lighthouse/locales/ru.json +16 -19
  88. package/front_end/third_party/lighthouse/locales/sk.json +0 -3
  89. package/front_end/third_party/lighthouse/locales/sl.json +0 -3
  90. package/front_end/third_party/lighthouse/locales/sr-Latn.json +16 -19
  91. package/front_end/third_party/lighthouse/locales/sr.json +16 -19
  92. package/front_end/third_party/lighthouse/locales/sv.json +17 -20
  93. package/front_end/third_party/lighthouse/locales/ta.json +0 -3
  94. package/front_end/third_party/lighthouse/locales/te.json +0 -3
  95. package/front_end/third_party/lighthouse/locales/th.json +0 -3
  96. package/front_end/third_party/lighthouse/locales/tr.json +0 -3
  97. package/front_end/third_party/lighthouse/locales/uk.json +17 -20
  98. package/front_end/third_party/lighthouse/locales/vi.json +0 -3
  99. package/front_end/third_party/lighthouse/locales/zh-HK.json +0 -3
  100. package/front_end/third_party/lighthouse/locales/zh-TW.json +0 -3
  101. package/front_end/third_party/lighthouse/locales/zh.json +0 -3
  102. package/front_end/third_party/lighthouse/report/bundle.d.ts +63 -61
  103. package/front_end/third_party/lighthouse/report/bundle.js +36 -7
  104. package/front_end/third_party/lighthouse/report-assets/report-generator.js +205 -192
  105. package/front_end/ui/components/text_editor/config.ts +5 -4
  106. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +40 -32
  107. package/front_end/ui/legacy/themeColors.css +1 -1
  108. package/package.json +1 -1
  109. package/scripts/check_gn.js +1 -1
  110. package/scripts/eslint_rules/lib/l10n_filename_matches.js +4 -4
  111. package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +4 -0
  112. package/front_end/entrypoints/inspector/inspector.json +0 -4
  113. package/front_end/entrypoints/worker_app/worker_app.json +0 -3
  114. package/front_end/panels/lighthouse/module.json +0 -6
  115. package/front_end/third_party/lighthouse/report-assets/report.d.ts +0 -1
  116. package/front_end/third_party/lighthouse/report-assets/report.js +0 -233
  117. package/front_end/third_party/lighthouse/report-assets/standalone-template.html +0 -38
@@ -26,9 +26,10 @@ const empty: CM.Extension = [];
26
26
  export const dynamicSetting = CM.Facet.define<DynamicSetting<unknown>>();
27
27
 
28
28
  // The code below is used to wire up dynamic settings to editors. When
29
- // you include one of these objects in an editor configuration, the
30
- // TextEditor class will take care of listening to changes in the
31
- // setting, and updating the configuration as appropriate.
29
+ // you include the result of calling `instance()` in an editor
30
+ // configuration, the TextEditor class will take care of listening to
31
+ // changes in the setting, and updating the configuration as
32
+ // appropriate.
32
33
 
33
34
  export class DynamicSetting<T> {
34
35
  compartment = new CM.Compartment();
@@ -246,7 +247,7 @@ export const closeBrackets: CM.Extension = [
246
247
  // element with the editor styles mounted in it for them. This is
247
248
  // annoying, but necessary because a scrollable parent node clips them
248
249
  // otherwise, `position: fixed` doesn't work due to `contain` styles,
249
- // and appending them diretly to `document.body` doesn't work because
250
+ // and appending them directly to `document.body` doesn't work because
250
251
  // the necessary style sheets aren't available there.
251
252
  let tooltipHost: ShadowRoot|null = null;
252
253
 
@@ -112,8 +112,9 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
112
112
  private shouldAutoPrettyPrint: boolean;
113
113
  private readonly progressToolbarItem: UI.Toolbar.ToolbarItem;
114
114
  private textEditorInternal: TextEditor.TextEditor.TextEditor;
115
- private prettyBaseDoc: CodeMirror.Text|null = null;
115
+ // The 'clean' document, before editing
116
116
  private baseDoc: CodeMirror.Text;
117
+ private prettyBaseDoc: CodeMirror.Text|null = null;
117
118
  private displayedSelection: CodeMirror.EditorSelection|null = null;
118
119
  private searchConfig: UI.SearchableView.SearchConfig|null;
119
120
  private delayedFindSearchMatches: (() => void)|null;
@@ -212,27 +213,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
212
213
  TextEditor.Config.allowScrollPastEof.instance(),
213
214
  TextEditor.Config.codeFolding.instance(),
214
215
  TextEditor.Config.autoDetectIndent.instance(),
215
- CodeMirror.EditorView.theme({
216
- '&.cm-editor': {height: '100%'},
217
- '.cm-scroller': {overflow: 'auto'},
218
- '.cm-lineNumbers .cm-gutterElement.cm-nonBreakableLine': {color: 'var(--color-non-breakable-line)'},
219
- '.cm-searchMatch': {
220
- border: '1px solid var(--color-search-match-border)',
221
- borderRadius: '3px',
222
- margin: '0 -1px',
223
- '&.cm-searchMatch-selected': {
224
- borderRadius: '1px',
225
- backgroundColor: 'var(--color-selected-search-match-background)',
226
- borderColor: 'var(--color-selected-search-match-background)',
227
- '&, & *': {
228
- color: 'var(--color-selected-search-match) !important',
229
- },
230
- },
231
- },
232
- ':host-context(.pretty-printed) & .cm-lineNumbers .cm-gutterElement': {
233
- color: 'var(--legacy-accent-color)',
234
- },
235
- }),
216
+ sourceFrameTheme,
236
217
  CodeMirror.EditorView.domEventHandlers({
237
218
  focus: () => this.onFocus(),
238
219
  blur: () => this.onBlur(),
@@ -352,6 +333,9 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
352
333
  this.updatePrettyPrintState();
353
334
  }
354
335
 
336
+ // If this is a disassembled WASM file or a pretty-printed file,
337
+ // wire in a line number formatter that shows binary offsets or line
338
+ // numbers in the original source.
355
339
  private getLineNumberFormatter(): CodeMirror.Extension {
356
340
  if (this.options.lineNumbers === false) {
357
341
  return [];
@@ -1099,18 +1083,20 @@ const searchHighlighter = CodeMirror.ViewPlugin.fromClass(class {
1099
1083
  const {doc} = view.state;
1100
1084
  for (const {from, to} of view.visibleRanges) {
1101
1085
  let pos = from;
1102
- for (const line of doc.iterLines(doc.lineAt(from).number, doc.lineAt(to).number + 1)) {
1103
- active.regexp.lastIndex = 0;
1104
- for (;;) {
1105
- const match = active.regexp.exec(line);
1106
- if (!match) {
1107
- break;
1086
+ for (const part of doc.iterRange(from, to)) {
1087
+ if (part !== '\n') {
1088
+ active.regexp.lastIndex = 0;
1089
+ for (;;) {
1090
+ const match = active.regexp.exec(part);
1091
+ if (!match) {
1092
+ break;
1093
+ }
1094
+ const start = pos + match.index, end = start + match[0].length;
1095
+ const current = active.currentRange && active.currentRange.from === start && active.currentRange.to === end;
1096
+ builder.add(start, end, current ? currentSearchMatchDeco : searchMatchDeco);
1108
1097
  }
1109
- const start = pos + match.index, end = start + match[0].length;
1110
- const current = active.currentRange && active.currentRange.from === start && active.currentRange.to === end;
1111
- builder.add(start, end, current ? currentSearchMatchDeco : searchMatchDeco);
1112
1098
  }
1113
- pos += line.length + 1;
1099
+ pos += part.length;
1114
1100
  }
1115
1101
  }
1116
1102
  return builder.finish();
@@ -1163,3 +1149,25 @@ function markNonBreakableLines(disassembly: Common.WasmDisassembly.WasmDisassemb
1163
1149
  return CodeMirror.RangeSet.of(marks);
1164
1150
  });
1165
1151
  }
1152
+
1153
+ const sourceFrameTheme = CodeMirror.EditorView.theme({
1154
+ '&.cm-editor': {height: '100%'},
1155
+ '.cm-scroller': {overflow: 'auto'},
1156
+ '.cm-lineNumbers .cm-gutterElement.cm-nonBreakableLine': {color: 'var(--color-non-breakable-line)'},
1157
+ '.cm-searchMatch': {
1158
+ border: '1px solid var(--color-search-match-border)',
1159
+ borderRadius: '3px',
1160
+ margin: '0 -1px',
1161
+ '&.cm-searchMatch-selected': {
1162
+ borderRadius: '1px',
1163
+ backgroundColor: 'var(--color-selected-search-match-background)',
1164
+ borderColor: 'var(--color-selected-search-match-background)',
1165
+ '&, & *': {
1166
+ color: 'var(--color-selected-search-match) !important',
1167
+ },
1168
+ },
1169
+ },
1170
+ ':host-context(.pretty-printed) & .cm-lineNumbers .cm-gutterElement': {
1171
+ color: 'var(--legacy-accent-color)',
1172
+ },
1173
+ });
@@ -110,7 +110,7 @@
110
110
  --color-image-preview-background: rgb(255 255 255);
111
111
 
112
112
  /* Colors for styling inputs */
113
- --color-input-outline: rgb(128 134 139);
113
+ --color-input-outline: rgb(218 220 224);
114
114
  --color-input-outline-active: rgb(26 115 232);
115
115
  --color-input-outline-error: rgb(217 48 37);
116
116
  --color-input-outline-disabled: rgba(128 134 139 / 20%);
package/package.json CHANGED
@@ -55,5 +55,5 @@
55
55
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
56
56
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
57
57
  },
58
- "version": "1.0.946920"
58
+ "version": "1.0.947377"
59
59
  }
@@ -9,7 +9,7 @@ const path = require('path');
9
9
  const FRONTEND_PATH = path.resolve(__dirname, '..', 'front_end');
10
10
 
11
11
  const manifestModules = [];
12
- for (const config of ['inspector', 'devtools_app', 'js_app', 'worker_app']) {
12
+ for (const config of ['devtools_app', 'js_app']) {
13
13
  manifestModules.push(...require(path.resolve(FRONTEND_PATH, 'entrypoints', config, `${config}.json`)).modules);
14
14
  }
15
15
 
@@ -5,9 +5,6 @@
5
5
  'use strict';
6
6
 
7
7
  const path = require('path');
8
- const {devtoolsRootPath} = require('../../devtools_paths.js');
9
-
10
- const DEFAULT_FRONT_END_DIRECTORY = path.join(devtoolsRootPath(), 'front_end');
11
8
 
12
9
  function isModuleScope(context) {
13
10
  return context.getScope().type === 'module';
@@ -60,10 +57,13 @@ module.exports = {
60
57
  return;
61
58
  }
62
59
 
63
- let frontEndDirectory = DEFAULT_FRONT_END_DIRECTORY;
60
+ let frontEndDirectory = '';
64
61
  if (context.options && context.options[0]?.rootFrontendDirectory) {
65
62
  frontEndDirectory = context.options[0].rootFrontendDirectory;
66
63
  }
64
+ if (!frontEndDirectory) {
65
+ throw new Error('rootFrontendDirectory must be provided.');
66
+ }
67
67
  const currentSourceFile = path.resolve(context.getFilename());
68
68
  const currentFileRelativeToFrontEnd = path.relative(frontEndDirectory, currentSourceFile);
69
69
 
@@ -17,14 +17,17 @@ ruleTester.run('l10n_filename_matches', rule, {
17
17
  {
18
18
  code: 'const str_ = i18n.i18n.registerUIStrings(\'components/test.ts\', UIStrings);',
19
19
  filename: 'front_end/components/test.ts',
20
+ options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
20
21
  },
21
22
  {
22
23
  code: 'const str_ = i18n.i18n.registerUIStrings(\'components/ModuleUIStrings.js\', UIStrings);',
23
24
  filename: 'front_end/components/test.ts',
25
+ options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
24
26
  },
25
27
  {
26
28
  code: 'const str_ = i18n.i18n.registerUIStrings(\'components/ModuleUIStrings.ts\', UIStrings);',
27
29
  filename: 'front_end/components/test.ts',
30
+ options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
28
31
  },
29
32
  {
30
33
  code: 'const str_ = i18n.i18n.registerUIStrings(\'ModuleUIStrings.ts\', UIStrings);',
@@ -41,6 +44,7 @@ ruleTester.run('l10n_filename_matches', rule, {
41
44
  {
42
45
  code: 'const str_ = i18n.i18n.registerUIStrings(\'components/foo.ts\', UIStrings);',
43
46
  filename: 'front_end/components/test.ts',
47
+ options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}],
44
48
  errors: [{
45
49
  message:
46
50
  'First argument to \'registerUIStrings\' call must be \'components/test.ts\' or the ModuleUIStrings.(js|ts)'
@@ -1,4 +0,0 @@
1
- {
2
- "modules" : [],
3
- "extends": "devtools_app"
4
- }
@@ -1,3 +0,0 @@
1
- {
2
- "modules" : []
3
- }
@@ -1,6 +0,0 @@
1
- {
2
- "resources": [
3
- "../../third_party/lighthouse/report-assets/standalone-template.html",
4
- "../../third_party/lighthouse/report-assets/report.js"
5
- ]
6
- }