chrome-devtools-frontend 1.0.956401 → 1.0.957495

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 (43) hide show
  1. package/config/gni/devtools_grd_files.gni +0 -1
  2. package/front_end/Images/generate-css-vars.js +2 -2
  3. package/front_end/core/common/ParsedURL.ts +35 -2
  4. package/front_end/core/common/Settings.ts +1 -1
  5. package/front_end/core/host/InspectorFrontendHost.ts +2 -1
  6. package/front_end/core/i18n/i18nImpl.ts +2 -3
  7. package/front_end/core/i18n/locales/en-US.json +6 -0
  8. package/front_end/core/i18n/locales/en-XL.json +6 -0
  9. package/front_end/core/root/Runtime.ts +0 -72
  10. package/front_end/core/root/root-legacy.ts +0 -2
  11. package/front_end/entrypoints/lighthouse_worker/LighthouseService.ts +4 -7
  12. package/front_end/entrypoints/main/MainImpl.ts +1 -1
  13. package/front_end/models/extensions/ExtensionServer.ts +1 -22
  14. package/front_end/panels/application/AppManifestView.ts +41 -0
  15. package/front_end/panels/console/ConsoleSidebar.ts +9 -9
  16. package/front_end/panels/elements/ElementsPanel.ts +1 -1
  17. package/front_end/panels/elements/components/LayoutPane.ts +1 -1
  18. package/front_end/panels/network/NetworkLogViewColumns.ts +5 -0
  19. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -1
  20. package/front_end/third_party/acorn/acorn.ts +1 -1
  21. package/front_end/ui/components/text_editor/theme.ts +1 -0
  22. package/front_end/ui/legacy/ResizerWidget.ts +4 -2
  23. package/front_end/ui/legacy/SoftDropDown.ts +2 -1
  24. package/front_end/ui/legacy/TextPrompt.ts +2 -2
  25. package/front_end/ui/legacy/Treeoutline.ts +2 -1
  26. package/front_end/ui/legacy/ViewManager.ts +1 -1
  27. package/front_end/ui/legacy/Widget.ts +3 -2
  28. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -0
  29. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +2 -1
  30. package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +1 -2
  31. package/front_end/ui/legacy/softContextMenu.css +4 -1
  32. package/front_end/ui/legacy/theme_support/theme_support_impl.ts +2 -6
  33. package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +3 -2
  34. package/front_end/ui/legacy/utils/inject-core-styles.ts +3 -31
  35. package/front_end/ui/legacy/utils/utils.ts +1 -5
  36. package/front_end/ui/lit-html/lit-html.ts +1 -1
  37. package/package.json +1 -1
  38. package/scripts/build/generate_css_js_files.js +2 -2
  39. package/scripts/build/ninja/generate_css.gni +3 -0
  40. package/front_end/third_party/codemirror/README.md +0 -3
  41. package/front_end/third_party/codemirror/codemirror.css +0 -283
  42. package/front_end/third_party/codemirror/codemirror.ts +0 -19
  43. package/front_end/ui/legacy/utils/append-style.ts +0 -9
@@ -1577,7 +1577,6 @@ grd_files_debug_sources = [
1577
1577
  "front_end/ui/legacy/theme_support/theme_support_impl.js",
1578
1578
  "front_end/ui/legacy/toolbar.css.legacy.js",
1579
1579
  "front_end/ui/legacy/treeoutline.css.legacy.js",
1580
- "front_end/ui/legacy/utils/append-style.js",
1581
1580
  "front_end/ui/legacy/utils/create-shadow-root-with-core-styles.js",
1582
1581
  "front_end/ui/legacy/utils/focus-changed.js",
1583
1582
  "front_end/ui/legacy/utils/inject-core-styles.js",
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
- const [, , targetGenDir, targetName, ...imageSources] = process.argv;
6
+ const [, , buildTimestamp, targetGenDir, targetName, ...imageSources] = process.argv;
7
7
 
8
8
  /**
9
9
  * @param {string} fileName
@@ -18,7 +18,7 @@ function generateCSSVariableDefinition(fileName) {
18
18
  fileName}', import.meta.url).toString() + '\\")');`;
19
19
  }
20
20
 
21
- const CURRENT_YEAR = new Date().getFullYear();
21
+ const CURRENT_YEAR = new Date(Number(buildTimestamp) * 1000).getFullYear();
22
22
  const fileContent = `
23
23
  // Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
24
24
  // Use of this source code is governed by a BSD-style license that can be
@@ -29,7 +29,40 @@
29
29
  */
30
30
 
31
31
  import * as Platform from '../platform/platform.js';
32
- import * as Root from '../root/root.js';
32
+
33
+ /**
34
+ * http://tools.ietf.org/html/rfc3986#section-5.2.4
35
+ */
36
+ export function normalizePath(path: string): string {
37
+ if (path.indexOf('..') === -1 && path.indexOf('.') === -1) {
38
+ return path;
39
+ }
40
+
41
+ const normalizedSegments = [];
42
+ const segments = path.split('/');
43
+ for (const segment of segments) {
44
+ if (segment === '.') {
45
+ continue;
46
+ } else if (segment === '..') {
47
+ normalizedSegments.pop();
48
+ } else if (segment) {
49
+ normalizedSegments.push(segment);
50
+ }
51
+ }
52
+ let normalizedPath = normalizedSegments.join('/');
53
+ if (normalizedPath[normalizedPath.length - 1] === '/') {
54
+ return normalizedPath;
55
+ }
56
+ if (path[0] === '/' && normalizedPath) {
57
+ normalizedPath = '/' + normalizedPath;
58
+ }
59
+ if ((path[path.length - 1] === '/') || (segments[segments.length - 1] === '.') ||
60
+ (segments[segments.length - 1] === '..')) {
61
+ normalizedPath = normalizedPath + '/';
62
+ }
63
+
64
+ return normalizedPath;
65
+ }
33
66
 
34
67
  export class ParsedURL {
35
68
  isValid: boolean;
@@ -291,7 +324,7 @@ export class ParsedURL {
291
324
  if (hrefPath.charAt(0) !== '/') {
292
325
  hrefPath = parsedURL.folderPathComponents + '/' + hrefPath;
293
326
  }
294
- return securityOrigin + Root.Runtime.Runtime.normalizePath(hrefPath) + hrefSuffix;
327
+ return securityOrigin + normalizePath(hrefPath) + hrefSuffix;
295
328
  }
296
329
 
297
330
  static splitLineAndColumn(string: string): {
@@ -36,7 +36,7 @@ import {Format} from './Color.js';
36
36
  import {Console} from './Console.js';
37
37
  import type {GenericEvents, EventDescriptor, EventTargetEvent} from './EventTarget.js';
38
38
  import {ObjectWrapper} from './Object.js';
39
- import {getLocalizedSettingsCategory, getRegisteredSettings, maybeRemoveSettingExtension, RegExpSettingItem, registerSettingExtension, registerSettingsForTest, resetSettings, SettingCategory, SettingExtensionOption, SettingRegistration, SettingType} from './SettingRegistration.js';
39
+ import {getLocalizedSettingsCategory, getRegisteredSettings, maybeRemoveSettingExtension, type RegExpSettingItem, registerSettingExtension, registerSettingsForTest, resetSettings, SettingCategory, type SettingExtensionOption, type SettingRegistration, SettingType} from './SettingRegistration.js';
40
40
 
41
41
  let settingsInstance: Settings|undefined;
42
42
 
@@ -220,7 +220,8 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
220
220
 
221
221
  loadNetworkResource(
222
222
  url: string, headers: string, streamId: number, callback: (arg0: LoadNetworkResourceResult) => void): void {
223
- Root.Runtime.loadResourcePromise(url)
223
+ fetch(url)
224
+ .then(result => result.text())
224
225
  .then(function(text) {
225
226
  resourceLoaderStreamWrite(streamId, text);
226
227
  callback({
@@ -56,11 +56,10 @@ function getLocaleFetchUrl(locale: Intl.UnicodeBCP47LocaleIdentifier): string {
56
56
  * fetched locally or remotely.
57
57
  */
58
58
  export async function fetchAndRegisterLocaleData(locale: Intl.UnicodeBCP47LocaleIdentifier): Promise<void> {
59
- const localeDataTextPromise = Root.Runtime.loadResourcePromise(getLocaleFetchUrl(locale));
59
+ const localeDataTextPromise = fetch(getLocaleFetchUrl(locale)).then(result => result.json());
60
60
  const timeoutPromise =
61
61
  new Promise((resolve, reject) => setTimeout(() => reject(new Error('timed out fetching locale')), 5000));
62
- const localeDataText = await Promise.race([timeoutPromise, localeDataTextPromise]);
63
- const localeData = JSON.parse(localeDataText as string);
62
+ const localeData = await Promise.race([timeoutPromise, localeDataTextPromise]);
64
63
  i18nInstance.registerLocaleData(locale, localeData);
65
64
  }
66
65
 
@@ -2171,6 +2171,12 @@
2171
2171
  "panels/application/AppManifestView.ts | couldNotDownloadARequiredIcon": {
2172
2172
  "message": "Could not download a required icon from the manifest"
2173
2173
  },
2174
+ "panels/application/AppManifestView.ts | darkBackgroundColor": {
2175
+ "message": "Dark background color"
2176
+ },
2177
+ "panels/application/AppManifestView.ts | darkThemeColor": {
2178
+ "message": "Dark theme color"
2179
+ },
2174
2180
  "panels/application/AppManifestView.ts | description": {
2175
2181
  "message": "Description"
2176
2182
  },
@@ -2171,6 +2171,12 @@
2171
2171
  "panels/application/AppManifestView.ts | couldNotDownloadARequiredIcon": {
2172
2172
  "message": "Ĉóûĺd̂ ńôt́ d̂óŵńl̂óâd́ â ŕêq́ûír̂éd̂ íĉón̂ f́r̂óm̂ t́ĥé m̂án̂íf̂éŝt́"
2173
2173
  },
2174
+ "panels/application/AppManifestView.ts | darkBackgroundColor": {
2175
+ "message": "D̂ár̂ḱ b̂áĉḱĝŕôún̂d́ ĉól̂ór̂"
2176
+ },
2177
+ "panels/application/AppManifestView.ts | darkThemeColor": {
2178
+ "message": "D̂ár̂ḱ t̂h́êḿê ćôĺôŕ"
2179
+ },
2174
2180
  "panels/application/AppManifestView.ts | description": {
2175
2181
  "message": "D̂éŝćr̂íp̂t́îón̂"
2176
2182
  },
@@ -47,40 +47,6 @@ export class Runtime {
47
47
  runtimeInstance = undefined;
48
48
  }
49
49
 
50
- /**
51
- * http://tools.ietf.org/html/rfc3986#section-5.2.4
52
- */
53
- static normalizePath(path: string): string {
54
- if (path.indexOf('..') === -1 && path.indexOf('.') === -1) {
55
- return path;
56
- }
57
-
58
- const normalizedSegments = [];
59
- const segments = path.split('/');
60
- for (const segment of segments) {
61
- if (segment === '.') {
62
- continue;
63
- } else if (segment === '..') {
64
- normalizedSegments.pop();
65
- } else if (segment) {
66
- normalizedSegments.push(segment);
67
- }
68
- }
69
- let normalizedPath = normalizedSegments.join('/');
70
- if (normalizedPath[normalizedPath.length - 1] === '/') {
71
- return normalizedPath;
72
- }
73
- if (path[0] === '/' && normalizedPath) {
74
- normalizedPath = '/' + normalizedPath;
75
- }
76
- if ((path[path.length - 1] === '/') || (segments[segments.length - 1] === '.') ||
77
- (segments[segments.length - 1] === '..')) {
78
- normalizedPath = normalizedPath + '/';
79
- }
80
-
81
- return normalizedPath;
82
- }
83
-
84
50
  static queryParam(name: string): string|null {
85
51
  return queryParamsObject.get(name);
86
52
  }
@@ -132,15 +98,6 @@ export class Runtime {
132
98
  return true;
133
99
  }
134
100
 
135
- static resolveSourceURL(path: string): string {
136
- let sourceURL: string = self.location.href;
137
- if (self.location.search) {
138
- sourceURL = sourceURL.replace(self.location.search, '');
139
- }
140
- sourceURL = sourceURL.substring(0, sourceURL.lastIndexOf('/') + 1) + path;
141
- return '\n/*# sourceURL=' + sourceURL + ' */';
142
- }
143
-
144
101
  loadLegacyModule(modulePath: string): Promise<void> {
145
102
  return import(`../../${modulePath}`);
146
103
  }
@@ -297,35 +254,6 @@ export class Experiment {
297
254
  }
298
255
  }
299
256
 
300
- export function loadResourcePromise(url: string): Promise<string> {
301
- return new Promise<string>(load);
302
-
303
- function load(fulfill: (arg0: string) => void, reject: (arg0: Error) => void): void {
304
- const xhr = new XMLHttpRequest();
305
- xhr.open('GET', url, true);
306
- xhr.onreadystatechange = onreadystatechange;
307
-
308
- function onreadystatechange(this: XMLHttpRequest, _e: Event): void {
309
- if (xhr.readyState !== XMLHttpRequest.DONE) {
310
- return;
311
- }
312
-
313
- const response: string = this.response;
314
-
315
- // DevTools Proxy server can mask 404s as 200s, check the body to be sure
316
- const status = /^HTTP\/1.1 404/.test(response) ? 404 : xhr.status;
317
-
318
- if ([0, 200, 304].indexOf(status) === -1) // Testing harness file:/// results in 0.
319
- {
320
- reject(new Error('While loading from url ' + url + ' server responded with a status of ' + status));
321
- } else {
322
- fulfill(response);
323
- }
324
- }
325
- xhr.send(null);
326
- }
327
- }
328
-
329
257
  // This must be constructed after the query parameters have been parsed.
330
258
  export const experiments = new ExperimentsSupport();
331
259
 
@@ -20,8 +20,6 @@ Root.Runtime.queryParam = RootModule.Runtime.Runtime.queryParam;
20
20
  /** @type {!RootModule.Runtime.Runtime} */
21
21
  Root.runtime;
22
22
 
23
- Root.Runtime.loadResourcePromise = RootModule.Runtime.loadResourcePromise;
24
-
25
23
  /** @constructor */
26
24
  Root.Runtime.Extension = RootModule.Runtime.Extension;
27
25
 
@@ -87,20 +87,17 @@ async function fetchLocaleData(locales: string[]): Promise<string|void> {
87
87
 
88
88
  // Try to load the locale data.
89
89
  try {
90
- let localeDataTextPromise;
91
90
  const remoteBase = Root.Runtime.getRemoteBase();
91
+ let localeUrl: string;
92
92
  if (remoteBase && remoteBase.base) {
93
- const localeUrl = `${remoteBase.base}third_party/lighthouse/locales/${locale}.json`;
94
- localeDataTextPromise = Root.Runtime.loadResourcePromise(localeUrl);
93
+ localeUrl = `${remoteBase.base}third_party/lighthouse/locales/${locale}.json`;
95
94
  } else {
96
- const localeUrl = new URL(`../../third_party/lighthouse/locales/${locale}.json`, import.meta.url);
97
- localeDataTextPromise = Root.Runtime.loadResourcePromise(localeUrl.toString());
95
+ localeUrl = new URL(`../../third_party/lighthouse/locales/${locale}.json`, import.meta.url).toString();
98
96
  }
99
97
 
100
98
  const timeoutPromise = new Promise<string>(
101
99
  (resolve, reject) => setTimeout(() => reject(new Error('timed out fetching locale')), 5000));
102
- const localeDataText = await Promise.race([timeoutPromise, localeDataTextPromise]);
103
- const localeData = JSON.parse(localeDataText);
100
+ const localeData = await Promise.race([timeoutPromise, fetch(localeUrl).then(result => result.json())]);
104
101
  // @ts-expect-error https://github.com/GoogleChrome/lighthouse/issues/11628
105
102
  self.registerLocaleData(locale, localeData);
106
103
  return locale;
@@ -806,7 +806,7 @@ export class MainMenuItem implements UI.Toolbar.Provider {
806
806
  dockItemElement.classList.add('flex-auto');
807
807
  dockItemElement.tabIndex = -1;
808
808
  UI.ARIAUtils.setAccessibleName(dockItemElement, UIStrings.dockSide);
809
- const titleElement = dockItemElement.createChild('span', 'flex-auto');
809
+ const titleElement = dockItemElement.createChild('span', 'dockside-title');
810
810
  titleElement.textContent = i18nString(UIStrings.dockSide);
811
811
  const toggleDockSideShorcuts =
812
812
  UI.ShortcutRegistry.ShortcutRegistry.instance().shortcutsForAction('main.toggle-dock');
@@ -952,28 +952,7 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
952
952
  }
953
953
 
954
954
  private expandResourcePath(extensionPath: string, resourcePath: string): string {
955
- return extensionPath + this.normalizePath(resourcePath);
956
- }
957
-
958
- private normalizePath(path: string): string {
959
- const source = path.split('/');
960
- const result = [];
961
-
962
- for (let i = 0; i < source.length; ++i) {
963
- if (source[i] === '.') {
964
- continue;
965
- }
966
- // Ignore empty path components resulting from //, as well as a leading and traling slashes.
967
- if (source[i] === '') {
968
- continue;
969
- }
970
- if (source[i] === '..') {
971
- result.pop();
972
- } else {
973
- result.push(source[i]);
974
- }
975
- }
976
- return '/' + result.join('/');
955
+ return extensionPath + '/' + Common.ParsedURL.normalizePath(resourcePath);
977
956
  }
978
957
 
979
958
  evaluate(
@@ -102,6 +102,14 @@ const UIStrings = {
102
102
  */
103
103
  backgroundColor: 'Background color',
104
104
  /**
105
+ *@description Text in App Manifest View of the Application panel
106
+ */
107
+ darkThemeColor: 'Dark theme color',
108
+ /**
109
+ *@description Text in App Manifest View of the Application panel
110
+ */
111
+ darkBackgroundColor: 'Dark background color',
112
+ /**
105
113
  *@description Text for the orientation of something
106
114
  */
107
115
  orientation: 'Orientation',
@@ -403,6 +411,10 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
403
411
  private readonly startURLField: HTMLElement;
404
412
  private readonly themeColorSwatch: InlineEditor.ColorSwatch.ColorSwatch;
405
413
  private readonly backgroundColorSwatch: InlineEditor.ColorSwatch.ColorSwatch;
414
+ private readonly darkThemeColorField: HTMLElement;
415
+ private readonly darkThemeColorSwatch: InlineEditor.ColorSwatch.ColorSwatch;
416
+ private readonly darkBackgroundColorField: HTMLElement;
417
+ private readonly darkBackgroundColorSwatch: InlineEditor.ColorSwatch.ColorSwatch;
406
418
  private orientationField: HTMLElement;
407
419
  private displayField: HTMLElement;
408
420
  private readonly newNoteUrlField: HTMLElement;
@@ -456,6 +468,14 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
456
468
  this.backgroundColorSwatch = new InlineEditor.ColorSwatch.ColorSwatch();
457
469
  backgroundColorField.appendChild(this.backgroundColorSwatch);
458
470
 
471
+ this.darkThemeColorField = this.presentationSection.appendField(i18nString(UIStrings.darkThemeColor));
472
+ this.darkThemeColorSwatch = new InlineEditor.ColorSwatch.ColorSwatch();
473
+ this.darkThemeColorField.appendChild(this.darkThemeColorSwatch);
474
+
475
+ this.darkBackgroundColorField = this.presentationSection.appendField(i18nString(UIStrings.darkBackgroundColor));
476
+ this.darkBackgroundColorSwatch = new InlineEditor.ColorSwatch.ColorSwatch();
477
+ this.darkBackgroundColorField.appendChild(this.darkBackgroundColorSwatch);
478
+
459
479
  this.orientationField = this.presentationSection.appendField(i18nString(UIStrings.orientation));
460
480
  this.displayField = this.presentationSection.appendField(i18nString(UIStrings.display));
461
481
 
@@ -634,6 +654,27 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
634
654
  this.backgroundColorSwatch.renderColor(backgroundColor, true);
635
655
  }
636
656
 
657
+ const userPreferences = parsedManifest['user_preferences'] || {};
658
+ const colorSchemeDark = userPreferences['color_scheme_dark'] || {};
659
+ const darkThemeColorString = colorSchemeDark['theme_color'];
660
+ const hasDarkThemeColor = typeof darkThemeColorString === 'string';
661
+ this.darkThemeColorField.parentElement?.classList.toggle('hidden', !hasDarkThemeColor);
662
+ if (hasDarkThemeColor) {
663
+ const darkThemeColor = Common.Color.Color.parse(darkThemeColorString);
664
+ if (darkThemeColor) {
665
+ this.darkThemeColorSwatch.renderColor(darkThemeColor, true);
666
+ }
667
+ }
668
+ const darkBackgroundColorString = colorSchemeDark['background_color'];
669
+ const hasDarkBackgroundColor = typeof darkBackgroundColorString === 'string';
670
+ this.darkBackgroundColorField.parentElement?.classList.toggle('hidden', !hasDarkBackgroundColor);
671
+ if (hasDarkBackgroundColor) {
672
+ const darkBackgroundColor = Common.Color.Color.parse(darkBackgroundColorString);
673
+ if (darkBackgroundColor) {
674
+ this.darkBackgroundColorSwatch.renderColor(darkBackgroundColor, true);
675
+ }
676
+ }
677
+
637
678
  this.orientationField.textContent = stringProperty('orientation');
638
679
  const displayType = stringProperty('display');
639
680
  this.displayField.textContent = displayType;
@@ -178,6 +178,15 @@ export class URLGroupTreeElement extends ConsoleSidebarTreeElement {
178
178
  }
179
179
  }
180
180
 
181
+ const enum GroupName {
182
+ ConsoleAPI = 'user message',
183
+ All = 'message',
184
+ Error = 'error',
185
+ Warning = 'warning',
186
+ Info = 'info',
187
+ Verbose = 'verbose',
188
+ }
189
+
181
190
  /**
182
191
  * Maps the GroupName for a filter to the UIString used to render messages.
183
192
  * Stored here so we only construct it once at runtime, rather than everytime we
@@ -274,12 +283,3 @@ export class FilterTreeElement extends ConsoleSidebarTreeElement {
274
283
  return child;
275
284
  }
276
285
  }
277
-
278
- const enum GroupName {
279
- ConsoleAPI = 'user message',
280
- All = 'message',
281
- Error = 'error',
282
- Warning = 'warning',
283
- Info = 'info',
284
- Verbose = 'verbose',
285
- }
@@ -1369,7 +1369,7 @@ export class ElementsActionDelegate implements UI.ActionRegistration.ActionDeleg
1369
1369
  treeOutline.duplicateNode(node);
1370
1370
  return true;
1371
1371
  case 'elements.copy-styles':
1372
- treeOutline.findTreeElement(node)?.copyStyles();
1372
+ void treeOutline.findTreeElement(node)?.copyStyles();
1373
1373
  return true;
1374
1374
  case 'elements.undo':
1375
1375
  void SDK.DOMModel.DOMModelUndoStack.instance().undo();
@@ -8,7 +8,7 @@ import * as UI from '../../../ui/legacy/legacy.js';
8
8
  import * as LitHtml from '../../../ui/lit-html/lit-html.js';
9
9
 
10
10
  import type {BooleanSetting, EnumSetting, Setting} from './LayoutPaneUtils.js';
11
- import {LayoutElement} from './LayoutPaneUtils.js';
11
+ import type {LayoutElement} from './LayoutPaneUtils.js';
12
12
 
13
13
  import type {NodeTextData} from './NodeText.js';
14
14
  import {NodeText} from './NodeText.js';
@@ -8,6 +8,7 @@ import type * as SDK from '../../core/sdk/sdk.js';
8
8
  import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
9
9
  import * as Components from '../../ui/legacy/components/utils/utils.js';
10
10
  import * as UI from '../../ui/legacy/legacy.js';
11
+ import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';
11
12
 
12
13
  import type {NetworkNode} from './NetworkDataGridNode.js';
13
14
  import {NetworkRequestNode} from './NetworkDataGridNode.js';
@@ -205,6 +206,10 @@ export class NetworkLogViewColumns {
205
206
 
206
207
  this.setupDataGrid();
207
208
  this.setupWaterfall();
209
+
210
+ ThemeSupport.ThemeSupport.instance().addEventListener(ThemeSupport.ThemeChangeEvent.eventName, () => {
211
+ this.scheduleRefresh();
212
+ });
208
213
  }
209
214
 
210
215
  private static convertToDataGridDescriptor(columnConfig: Descriptor): DataGrid.DataGrid.ColumnDescriptor {
@@ -257,7 +257,8 @@ export class PerformanceMonitorImpl extends UI.Widget.HBox implements
257
257
  color: metricInfo.color,
258
258
  });
259
259
  }
260
- const backgroundColor = Common.Color.Color.parse(UI.Utils.getThemeColorValue('--color-background'));
260
+ const backgroundColor =
261
+ Common.Color.Color.parse(ThemeSupport.ThemeSupport.instance().getComputedValue('--color-background'));
261
262
 
262
263
  if (backgroundColor) {
263
264
  for (const path of paths.reverse()) {
@@ -7,7 +7,7 @@ import * as acorn from './package/dist/acorn.mjs';
7
7
  import type * as ESTree from './estree-legacy';
8
8
  export {ESTree};
9
9
 
10
- export { Comment, defaultOptions, getLineInfo, isNewLine, lineBreak, lineBreakG, Node, SourceLocation, Token, tokTypes, tokContexts} from './package/dist/acorn.mjs';
10
+ export { type Comment, defaultOptions, getLineInfo, isNewLine, lineBreak, lineBreakG, Node, SourceLocation, Token, tokTypes, tokContexts} from './package/dist/acorn.mjs';
11
11
 
12
12
  export const Parser = acorn.Parser;
13
13
  export const tokenizer = acorn.Parser.tokenizer.bind(acorn.Parser);
@@ -127,6 +127,7 @@ export const editorTheme = CM.EditorView.theme({
127
127
 
128
128
  '.cm-tooltip.cm-tooltip-autocomplete > ul': {
129
129
  backgroundColor: 'var(--color-background)',
130
+ maxHeight: '25em',
130
131
  minWidth: '16em',
131
132
  '& > li.cm-secondaryCompletion': {
132
133
  display: 'flex',
@@ -38,7 +38,7 @@ export class ResizerWidget extends Common.ObjectWrapper.ObjectWrapper<EventTypes
38
38
  addElement(element: HTMLElement): void {
39
39
  if (!this.elementsInternal.has(element)) {
40
40
  this.elementsInternal.add(element);
41
- element.addEventListener('mousedown', this.installDragOnMouseDownBound, false);
41
+ element.addEventListener('pointerdown', this.installDragOnMouseDownBound, false);
42
42
  this.updateElementCursor(element);
43
43
  }
44
44
  }
@@ -46,7 +46,7 @@ export class ResizerWidget extends Common.ObjectWrapper.ObjectWrapper<EventTypes
46
46
  removeElement(element: HTMLElement): void {
47
47
  if (this.elementsInternal.has(element)) {
48
48
  this.elementsInternal.delete(element);
49
- element.removeEventListener('mousedown', this.installDragOnMouseDownBound, false);
49
+ element.removeEventListener('pointerdown', this.installDragOnMouseDownBound, false);
50
50
  element.style.removeProperty('cursor');
51
51
  }
52
52
  }
@@ -58,8 +58,10 @@ export class ResizerWidget extends Common.ObjectWrapper.ObjectWrapper<EventTypes
58
58
  private updateElementCursor(element: HTMLElement): void {
59
59
  if (this.isEnabledInternal) {
60
60
  element.style.setProperty('cursor', this.cursor());
61
+ element.style.setProperty('touch-action', 'none');
61
62
  } else {
62
63
  element.style.removeProperty('cursor');
64
+ element.style.removeProperty('touch-action');
63
65
  }
64
66
  }
65
67
 
@@ -4,6 +4,7 @@
4
4
 
5
5
  import type * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
+ import * as ThemeSupport from './theme_support/theme_support.js';
7
8
  import * as Utils from './utils/utils.js';
8
9
 
9
10
  import * as ARIAUtils from './ARIAUtils.js';
@@ -48,7 +49,7 @@ export class SoftDropDown<T> implements ListDelegate<T> {
48
49
 
49
50
  this.element = document.createElement('button');
50
51
  this.element.classList.add('soft-dropdown');
51
- Utils.appendStyle(this.element, softDropDownButtonStyles);
52
+ ThemeSupport.ThemeSupport.instance().appendStyle(this.element, softDropDownButtonStyles);
52
53
  this.titleElement = this.element.createChild('span', 'title');
53
54
  const dropdownArrowIcon = Icon.create('smallicon-triangle-down');
54
55
  this.element.appendChild(dropdownArrowIcon);
@@ -37,7 +37,7 @@ import * as Platform from '../../core/platform/platform.js';
37
37
  import * as TextUtils from '../../models/text_utils/text_utils.js';
38
38
 
39
39
  import * as ARIAUtils from './ARIAUtils.js';
40
- import * as Utils from './utils/utils.js';
40
+ import * as ThemeSupport from './theme_support/theme_support.js';
41
41
 
42
42
  import type {SuggestBoxDelegate, Suggestion} from './SuggestBox.js';
43
43
  import {SuggestBox} from './SuggestBox.js';
@@ -136,7 +136,7 @@ export class TextPrompt extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
136
136
  this.boundOnMouseWheel = this.onMouseWheel.bind(this);
137
137
  this.boundClearAutocomplete = this.clearAutocomplete.bind(this);
138
138
  this.proxyElement = element.ownerDocument.createElement('span');
139
- Utils.appendStyle(this.proxyElement, textPromptStyles);
139
+ ThemeSupport.ThemeSupport.instance().appendStyle(this.proxyElement, textPromptStyles);
140
140
  this.contentElement = this.proxyElement.createChild('div', 'text-prompt-root');
141
141
  this.proxyElement.style.display = this.proxyElementDisplay;
142
142
  if (element.parentElement) {
@@ -37,6 +37,7 @@ import * as Common from '../../core/common/common.js';
37
37
  import * as Platform from '../../core/platform/platform.js';
38
38
 
39
39
  import * as ARIAUtils from './ARIAUtils.js';
40
+ import * as ThemeSupport from './theme_support/theme_support.js';
40
41
  import * as Utils from './utils/utils.js';
41
42
 
42
43
  import type {Icon} from './Icon.js';
@@ -400,7 +401,7 @@ export class TreeOutlineInShadow extends TreeOutline {
400
401
  }
401
402
 
402
403
  registerRequiredCSS(cssFile: {cssContent: string}): void {
403
- Utils.appendStyle(this.shadowRoot, cssFile);
404
+ ThemeSupport.ThemeSupport.instance().appendStyle(this.shadowRoot, cssFile);
404
405
  }
405
406
 
406
407
  registerCSSFiles(cssFiles: CSSStyleSheet[]): void {
@@ -15,7 +15,7 @@ import type {ToolbarItem} from './Toolbar.js';
15
15
  import {Toolbar, ToolbarMenuButton} from './Toolbar.js';
16
16
  import {createTextChild} from './UIUtils.js';
17
17
  import type {TabbedViewLocation, View, ViewLocation, ViewLocationResolver} from './View.js';
18
- import {getRegisteredLocationResolvers, getRegisteredViewExtensions, maybeRemoveViewExtension, registerLocationResolver, registerViewExtension, ViewLocationCategoryValues, ViewLocationValues, ViewPersistence, ViewRegistration} from './ViewRegistration.js';
18
+ import {getRegisteredLocationResolvers, getRegisteredViewExtensions, maybeRemoveViewExtension, registerLocationResolver, registerViewExtension, ViewLocationCategoryValues, ViewLocationValues, ViewPersistence, type ViewRegistration} from './ViewRegistration.js';
19
19
  import type {Widget, WidgetElement} from './Widget.js';
20
20
  import {VBox} from './Widget.js';
21
21
  import viewContainersStyles from './viewContainers.css.legacy.js';
@@ -32,6 +32,7 @@ import * as DOMExtension from '../../core/dom_extension/dom_extension.js';
32
32
  import * as Helpers from '../components/helpers/helpers.js';
33
33
 
34
34
  import {Constraints, Size} from './Geometry.js';
35
+ import * as ThemeSupport from './theme_support/theme_support.js';
35
36
  import * as Utils from './utils/utils.js';
36
37
  import {XWidget} from './XWidget.js';
37
38
 
@@ -460,9 +461,9 @@ export class Widget {
460
461
 
461
462
  registerRequiredCSS(cssFile: {cssContent: string}): void {
462
463
  if (this.isWebComponent) {
463
- Utils.appendStyle((this.shadowRoot as DocumentFragment), cssFile);
464
+ ThemeSupport.ThemeSupport.instance().appendStyle((this.shadowRoot as DocumentFragment), cssFile);
464
465
  } else {
465
- Utils.appendStyle(this.element, cssFile);
466
+ ThemeSupport.ThemeSupport.instance().appendStyle(this.element, cssFile);
466
467
  }
467
468
  }
468
469
 
@@ -1465,6 +1465,7 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
1465
1465
  }
1466
1466
 
1467
1467
  this.positionResizers();
1468
+ this.updateWidths();
1468
1469
  event.preventDefault();
1469
1470
  }
1470
1471
 
@@ -32,6 +32,7 @@ import * as Common from '../../../../core/common/common.js';
32
32
  import * as i18n from '../../../../core/i18n/i18n.js';
33
33
  import * as Platform from '../../../../core/platform/platform.js';
34
34
  import * as UI from '../../legacy.js';
35
+ import * as ThemeSupport from '../../theme_support/theme_support.js';
35
36
 
36
37
  import type {Calculator} from './TimelineGrid.js';
37
38
  import {TimelineGrid} from './TimelineGrid.js';
@@ -162,7 +163,7 @@ export class Window extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
162
163
 
163
164
  this.parentElement.addEventListener('wheel', this.onMouseWheel.bind(this), true);
164
165
  this.parentElement.addEventListener('dblclick', this.resizeWindowMaximum.bind(this), true);
165
- UI.Utils.appendStyle(this.parentElement, overviewGridStyles);
166
+ ThemeSupport.ThemeSupport.instance().appendStyle(this.parentElement, overviewGridStyles);
166
167
 
167
168
  this.leftResizeElement = parentElement.createChild('div', 'overview-grid-window-resizer') as HTMLElement;
168
169
  UI.UIUtils.installDragHandle(
@@ -33,7 +33,6 @@
33
33
  */
34
34
 
35
35
  import * as Host from '../../../../core/host/host.js';
36
- import * as UI from '../../legacy.js';
37
36
  import * as ThemeSupport from '../../theme_support/theme_support.js';
38
37
 
39
38
  import timelineGridStyles from './timelineGrid.css.legacy.js';
@@ -49,7 +48,7 @@ export class TimelineGrid {
49
48
 
50
49
  constructor() {
51
50
  this.element = document.createElement('div');
52
- UI.Utils.appendStyle(this.element, timelineGridStyles);
51
+ ThemeSupport.ThemeSupport.instance().appendStyle(this.element, timelineGridStyles);
53
52
 
54
53
  this.dividersElementInternal = this.element.createChild('div', 'resources-dividers');
55
54
 
@@ -35,12 +35,15 @@
35
35
  box-shadow: var(--override-mac-specific-box-shadow);
36
36
  }
37
37
 
38
+ .dockside-title {
39
+ padding-right: 13px;
40
+ }
41
+
38
42
  .soft-context-menu-item {
39
43
  display: flex;
40
44
  width: 100%;
41
45
  font-size: 12px;
42
46
  padding: 3px 7px 3px 8px;
43
- margin: 0 13px 0 0;
44
47
  white-space: nowrap;
45
48
  align-items: center;
46
49
  }
@@ -42,7 +42,7 @@ let themeSupportInstance: ThemeSupport;
42
42
  const themeValuesCache = new Map<CSSStyleDeclaration, Map<string, string>>();
43
43
 
44
44
  export class ThemeSupport extends EventTarget {
45
- private themeNameInternal = 'systemPreferred';
45
+ private themeNameInternal = 'default';
46
46
  private customSheets: Set<string> = new Set();
47
47
  private computedRoot = Common.Lazy.lazy(() => window.getComputedStyle(document.documentElement));
48
48
 
@@ -116,11 +116,7 @@ export class ThemeSupport extends EventTarget {
116
116
  this.appendStyle(element, inspectorSyntaxHighlightStyles);
117
117
  }
118
118
 
119
- /**
120
- * Note: this is a duplicate of the function in ui/utils. It exists here
121
- * so there is no circular dependency between ui/utils and theme_support.
122
- */
123
- private appendStyle(node: Node, {cssContent}: {cssContent: string}): void {
119
+ appendStyle(node: Node, {cssContent}: {cssContent: string}): void {
124
120
  const styleElement = document.createElement('style');
125
121
  styleElement.textContent = cssContent;
126
122
  node.appendChild(styleElement);
@@ -2,7 +2,8 @@
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 {appendStyle} from './append-style.js';
5
+ import * as ThemeSupport from '../theme_support/theme_support.js';
6
+
6
7
  import {focusChanged} from './focus-changed.js';
7
8
  import {injectCoreStyles} from './inject-core-styles.js';
8
9
 
@@ -24,7 +25,7 @@ export function createShadowRootWithCoreStyles(element: Element, options: Option
24
25
  injectCoreStyles(shadowRoot);
25
26
  if (cssFile) {
26
27
  if ('cssContent' in cssFile) {
27
- appendStyle(shadowRoot, cssFile);
28
+ ThemeSupport.ThemeSupport.instance().appendStyle(shadowRoot, cssFile);
28
29
  } else {
29
30
  shadowRoot.adoptedStyleSheets = cssFile;
30
31
  }
@@ -7,39 +7,11 @@ import textButtonStyles from '../textButton.css.legacy.js';
7
7
  import * as ThemeSupport from '../theme_support/theme_support.js';
8
8
  import themeColorsStyles from '../themeColors.css.legacy.js';
9
9
 
10
- import {appendStyle} from './append-style.js';
11
-
12
10
  export function injectCoreStyles(root: Element|ShadowRoot): void {
13
- appendStyle(root, inspectorCommonStyles);
14
- appendStyle(root, textButtonStyles);
15
- appendStyle(root, themeColorsStyles);
11
+ ThemeSupport.ThemeSupport.instance().appendStyle(root, inspectorCommonStyles);
12
+ ThemeSupport.ThemeSupport.instance().appendStyle(root, textButtonStyles);
13
+ ThemeSupport.ThemeSupport.instance().appendStyle(root, themeColorsStyles);
16
14
 
17
15
  ThemeSupport.ThemeSupport.instance().injectHighlightStyleSheets(root);
18
16
  ThemeSupport.ThemeSupport.instance().injectCustomStyleSheets(root);
19
17
  }
20
-
21
- let bodyComputedStylesCached: CSSStyleDeclaration|null = null;
22
- export function getThemeColorValue(variableName: string): string {
23
- if (!bodyComputedStylesCached) {
24
- /**
25
- * We are safe to cache this value as we're only using this code to look up
26
- * theme variables, and they do not change during runtime. And if the user
27
- * swaps from light => dark theme, or vice-versa, DevTools is entirely
28
- * reloaded, removing this cache.
29
- */
30
- bodyComputedStylesCached = window.getComputedStyle(document.body);
31
- }
32
-
33
- const colorValue = bodyComputedStylesCached.getPropertyValue(variableName);
34
- if (!colorValue) {
35
- throw new Error(`Could not find theme color for variable ${variableName}.`);
36
- }
37
- return colorValue;
38
- }
39
-
40
- export function getCurrentTheme(): 'light'|'dark' {
41
- if (document.documentElement.classList.contains('-theme-with-dark-background')) {
42
- return 'dark';
43
- }
44
- return 'light';
45
- }
@@ -4,19 +4,15 @@
4
4
 
5
5
  /* eslint-disable rulesdir/es_modules_import */
6
6
 
7
- import {appendStyle} from './append-style.js';
8
7
  import {createShadowRootWithCoreStyles} from './create-shadow-root-with-core-styles.js';
9
8
  import {focusChanged} from './focus-changed.js';
10
- import {getCurrentTheme, getThemeColorValue, injectCoreStyles} from './inject-core-styles.js';
9
+ import {injectCoreStyles} from './inject-core-styles.js';
11
10
  import {measuredScrollbarWidth, resetMeasuredScrollbarWidthForTest} from './measured-scrollbar-width.js';
12
11
  import {registerCustomElement} from './register-custom-element.js';
13
12
 
14
13
  export {
15
- appendStyle,
16
14
  createShadowRootWithCoreStyles,
17
15
  focusChanged,
18
- getCurrentTheme,
19
- getThemeColorValue,
20
16
  injectCoreStyles,
21
17
  measuredScrollbarWidth,
22
18
  registerCustomElement,
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as LitHtml from '../../third_party/lit-html/lit-html.js';
6
6
  import * as Static from './static.js';
7
- export {Directive, TemplateResult} from '../../third_party/lit-html/lit-html.js';
7
+ export {Directive, type TemplateResult} from '../../third_party/lit-html/lit-html.js';
8
8
 
9
9
  const {render, svg, Directives, nothing, noChange} = LitHtml;
10
10
  const {html, literal, flattenTemplate} = Static;
package/package.json CHANGED
@@ -53,5 +53,5 @@
53
53
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
54
54
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
55
55
  },
56
- "version": "1.0.956401"
56
+ "version": "1.0.957495"
57
57
  }
@@ -4,7 +4,7 @@
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
6
  const CleanCSS = require('clean-css');
7
- const [, , isDebugString, legacyString, targetName, srcDir, targetGenDir, files] = process.argv;
7
+ const [, , buildTimestamp, isDebugString, legacyString, targetName, srcDir, targetGenDir, files] = process.argv;
8
8
 
9
9
  const filenames = files.split(',');
10
10
  const configFiles = [];
@@ -37,7 +37,7 @@ export default styles;`;
37
37
 
38
38
  fs.writeFileSync(
39
39
  path.join(targetGenDir, generatedFileName),
40
- `// Copyright ${new Date().getFullYear()} The Chromium Authors. All rights reserved.
40
+ `// Copyright ${new Date(Number(buildTimestamp) * 1000).getFullYear()} The Chromium Authors. All rights reserved.
41
41
  // Use of this source code is governed by a BSD-style license that can be
42
42
  // found in the LICENSE file.
43
43
  // IMPORTANT: this file is auto generated. Please do not edit this file.
@@ -2,8 +2,10 @@
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("//build/timestamp.gni")
5
6
  import("./node.gni")
6
7
  import("./vars.gni")
8
+
7
9
  template("generate_css") {
8
10
  node_action(target_name) {
9
11
  forward_variables_from(invoker, [ "sources" ])
@@ -17,6 +19,7 @@ template("generate_css") {
17
19
  [ devtools_location_prepend + "node_modules/clean-css/package.json" ]
18
20
 
19
21
  args = [
22
+ build_timestamp,
20
23
  "$is_debug",
21
24
  "${invoker.legacy}",
22
25
  target_name,
@@ -1,3 +0,0 @@
1
- Treat `codemirror.css` like a rolled-in upstream dependency. Instead of changing it directly, consider changing `front_end/text_editor/cmdevtools.css` instead.
2
-
3
- [Issue #1076825](https://bugs.chromium.org/p/chromium/issues/detail?id=1076825) tracks the effort to use the upstream file more directly.
@@ -1,283 +0,0 @@
1
- /* The rest of this file contains styles related to the mechanics of
2
- the editor. You probably shouldn't touch them. */
3
-
4
- .CodeMirror {
5
- position: relative;
6
- overflow: hidden;
7
- background: var(--color-background);
8
- }
9
-
10
- .CodeMirror-scroll {
11
- overflow: scroll !important; /* Things will break if this is overridden */
12
- /* 50px is the magic margin used to hide the element's real scrollbars */
13
- /* See overflow: hidden in .CodeMirror */
14
- margin-bottom: -50px;
15
- margin-right: -50px;
16
- padding-bottom: 50px;
17
- height: 100%;
18
- outline: none; /* Prevent dragging from highlighting the element */
19
- position: relative;
20
- }
21
-
22
- .CodeMirror-sizer {
23
- position: relative;
24
- border-right: 50px solid transparent;
25
- }
26
-
27
- /* The fake, visible scrollbars. Used to force redraw during scrolling
28
- before actual scrolling happens, thus preventing shaking and
29
- flickering artifacts. */
30
- .CodeMirror-vscrollbar,
31
- .CodeMirror-hscrollbar,
32
- .CodeMirror-scrollbar-filler,
33
- .CodeMirror-gutter-filler {
34
- position: absolute;
35
- z-index: 6;
36
- display: none;
37
- outline: none;
38
- }
39
-
40
- .CodeMirror-vscrollbar {
41
- right: 0;
42
- top: 0;
43
- overflow-x: hidden;
44
- overflow-y: scroll;
45
- }
46
-
47
- .CodeMirror-hscrollbar {
48
- bottom: 0;
49
- left: 0;
50
- overflow-y: hidden;
51
- overflow-x: scroll;
52
- }
53
-
54
- .CodeMirror-scrollbar-filler {
55
- right: 0;
56
- bottom: 0;
57
- }
58
-
59
- .CodeMirror-gutter-filler {
60
- left: 0;
61
- bottom: 0;
62
- }
63
-
64
- .CodeMirror-gutters {
65
- position: absolute;
66
- left: 0;
67
- top: 0;
68
- min-height: 100%;
69
- z-index: 3;
70
- }
71
-
72
- .CodeMirror-gutter {
73
- white-space: normal;
74
- height: 100%;
75
- display: inline-block;
76
- vertical-align: top;
77
- margin-bottom: -50px;
78
- }
79
-
80
- .CodeMirror-gutter-wrapper {
81
- position: absolute;
82
- z-index: 4;
83
- background: none !important;
84
- border: none !important;
85
- }
86
-
87
- .CodeMirror-gutter-background {
88
- position: absolute;
89
- top: 0;
90
- bottom: 0;
91
- z-index: 4;
92
- }
93
-
94
- .CodeMirror-gutter-elt {
95
- position: absolute;
96
- cursor: default;
97
- z-index: 4;
98
- }
99
-
100
- .CodeMirror-gutter-wrapper ::selection {
101
- background-color: transparent;
102
- }
103
-
104
- .CodeMirror-gutter-wrapper ::-moz-selection {
105
- background-color: transparent;
106
- }
107
-
108
- .CodeMirror-lines {
109
- cursor: text;
110
- min-height: 1px; /* prevents collapsing before first draw */
111
- }
112
-
113
- .CodeMirror pre.CodeMirror-line,
114
- .CodeMirror pre.CodeMirror-line-like {
115
- /* Reset some styles that the rest of the page might have set */
116
- /* stylelint-disable-next-line property-no-vendor-prefix */
117
- -moz-border-radius: 0;
118
- /* stylelint-disable-next-line property-no-vendor-prefix */
119
- -webkit-border-radius: 0;
120
- border-radius: 0;
121
- border-width: 0;
122
- background: transparent;
123
- font-family: inherit;
124
- font-size: inherit;
125
- margin: 0;
126
- white-space: pre;
127
- word-wrap: normal;
128
- line-height: inherit;
129
- color: inherit;
130
- z-index: 2;
131
- position: relative;
132
- overflow: visible;
133
- -webkit-tap-highlight-color: transparent;
134
- /* stylelint-disable-next-line property-no-vendor-prefix */
135
- -webkit-font-variant-ligatures: contextual;
136
- font-variant-ligatures: contextual;
137
- }
138
-
139
- .CodeMirror-wrap pre.CodeMirror-line,
140
- .CodeMirror-wrap pre.CodeMirror-line-like {
141
- word-wrap: break-word;
142
- white-space: pre-wrap;
143
- word-break: normal;
144
- }
145
-
146
- .CodeMirror-linebackground {
147
- position: absolute;
148
- left: 0;
149
- right: 0;
150
- top: 0;
151
- bottom: 0;
152
- z-index: 0;
153
- }
154
-
155
- .CodeMirror-linewidget {
156
- position: relative;
157
- z-index: 2;
158
- padding: 0.1px; /* Force widget margins to stay inside of the container */
159
- }
160
-
161
- .CodeMirror-rtl pre {
162
- direction: rtl;
163
- }
164
-
165
- .CodeMirror-code {
166
- outline: none;
167
- }
168
-
169
- /* Force content-box sizing for the elements where we expect it */
170
- .CodeMirror-scroll,
171
- .CodeMirror-sizer,
172
- .CodeMirror-gutter,
173
- .CodeMirror-gutters,
174
- .CodeMirror-linenumber {
175
- /* stylelint-disable-next-line property-no-vendor-prefix */
176
- -moz-box-sizing: content-box;
177
- box-sizing: content-box;
178
- }
179
-
180
- .CodeMirror-measure {
181
- position: absolute;
182
- width: 100%;
183
- height: 0;
184
- overflow: hidden;
185
- visibility: hidden;
186
- }
187
-
188
- .CodeMirror-cursor {
189
- position: absolute;
190
- pointer-events: none;
191
- }
192
-
193
- .CodeMirror-measure pre {
194
- position: static;
195
- }
196
-
197
- div.CodeMirror-cursors {
198
- visibility: hidden;
199
- position: relative;
200
- z-index: 3;
201
- }
202
-
203
- div.CodeMirror-dragcursors {
204
- visibility: visible;
205
- }
206
-
207
- .CodeMirror-focused div.CodeMirror-cursors {
208
- visibility: visible;
209
- }
210
-
211
- .CodeMirror-selected {
212
- --override-cm-selected-background-color: #d9d9d9;
213
-
214
- background: var(--override-cm-selected-background-color);
215
- }
216
-
217
- .-theme-with-dark-background .CodeMirror-selected,
218
- :host-context(.-theme-with-dark-background) .CodeMirror-selected {
219
- --override-cm-selected-background-color: rgb(38 38 38);
220
- }
221
-
222
- .CodeMirror-focused .CodeMirror-selected {
223
- --override-cm-selected-background-color: #d7d4f0;
224
- }
225
-
226
- .-theme-with-dark-background .CodeMirror-focused .CodeMirror-selected,
227
- :host-context(.-theme-with-dark-background) .CodeMirror-focused .CodeMirror-selected {
228
- --override-cm-selected-background-color: rgb(18 15 43);
229
- }
230
-
231
- .CodeMirror-crosshair {
232
- cursor: crosshair;
233
- }
234
-
235
- .CodeMirror-line {
236
- --override-line-selection-background-color: #d7d4f0;
237
- }
238
-
239
- .CodeMirror-line::selection,
240
- .CodeMirror-line > span::selection,
241
- .CodeMirror-line > span > span::selection {
242
- background:var(--override-line-selection-background-color);
243
- }
244
-
245
- .CodeMirror-line::-moz-selection,
246
- .CodeMirror-line > span::-moz-selection,
247
- .CodeMirror-line > span > span::-moz-selection {
248
- background: var(--override-line-selection-background-color);
249
- }
250
-
251
- .-theme-with-dark-background .CodeMirror-line,
252
- :host-context(.-theme-with-dark-background) .CodeMirror-line {
253
- --override-line-selection-background-color: rgb(18 15 43);
254
-
255
- }
256
-
257
- .cm-searching {
258
- --override-searching-background-color: rgb(255 255 0 / 40%);
259
-
260
- background-color: var(--override-searching-background-color);
261
- }
262
-
263
- /* Used to force a border model for a node */
264
- .cm-force-border {
265
- padding-right: 0.1px;
266
- }
267
-
268
- @media print {
269
- /* Hide the cursor when printing */
270
- .CodeMirror div.CodeMirror-cursors {
271
- visibility: hidden;
272
- }
273
- }
274
-
275
- /* See issue #2901 */
276
- .cm-tab-wrap-hack::after {
277
- content: "";
278
- }
279
-
280
- /* Help users use markselection to safely style text background */
281
- span.CodeMirror-selectedtext {
282
- background: none;
283
- }
@@ -1,19 +0,0 @@
1
- // Copyright 2019 The Chromium Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import type * as CodeMirrorLegacy from './codemirror-legacy';
6
- export {CodeMirrorLegacy};
7
-
8
- import './package/lib/codemirror.js';
9
- import './package/addon/comment/comment.js';
10
- import './package/addon/edit/closebrackets.js';
11
- import './package/addon/edit/matchbrackets.js';
12
- import './package/addon/mode/multiplex.js';
13
- import './package/addon/mode/overlay.js';
14
- import './package/addon/mode/simple.js';
15
- import './package/addon/selection/active-line.js';
16
- import './package/addon/selection/mark-selection.js';
17
- import './package/addon/fold/foldcode.js';
18
- import './package/addon/fold/foldgutter.js';
19
- import './package/addon/fold/brace-fold.js';
@@ -1,9 +0,0 @@
1
- // Copyright 2019 The Chromium Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- export function appendStyle(node: Node, {cssContent}: {cssContent: string}): void {
6
- const styleElement = document.createElement('style');
7
- styleElement.textContent = cssContent;
8
- node.appendChild(styleElement);
9
- }