chrome-devtools-frontend 1.0.934857 → 1.0.936663

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 (101) hide show
  1. package/config/gni/all_devtools_files.gni +0 -27
  2. package/config/gni/devtools_grd_files.gni +10 -15
  3. package/front_end/.eslintrc.js +1 -0
  4. package/front_end/Tests.js +13 -0
  5. package/front_end/core/host/UserMetrics.ts +2 -1
  6. package/front_end/core/i18n/locales/en-US.json +15 -6
  7. package/front_end/core/i18n/locales/en-XL.json +15 -6
  8. package/front_end/core/sdk/ConsoleModel.ts +0 -20
  9. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -7
  10. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +1 -1
  11. package/front_end/entrypoints/inspector_main/module.json +1 -2
  12. package/front_end/entrypoints/main/MainImpl.ts +10 -3
  13. package/front_end/entrypoints/node_app/node_app.json +0 -1
  14. package/front_end/entrypoints/node_main/node_main-meta.ts +0 -3
  15. package/front_end/entrypoints/shell/shell.json +0 -9
  16. package/front_end/entrypoints/worker_app/worker_app.json +0 -5
  17. package/front_end/models/issues_manager/IssuesManager.ts +2 -2
  18. package/front_end/models/issues_manager/{DeprecationIssue.ts → NavigatorUserAgentIssue.ts} +4 -4
  19. package/front_end/models/issues_manager/issues_manager.ts +2 -2
  20. package/front_end/panels/application/BackForwardCacheView.ts +54 -6
  21. package/front_end/panels/application/module.json +0 -5
  22. package/front_end/panels/console/ConsoleFilter.ts +1 -1
  23. package/front_end/panels/console/ConsolePinPane.ts +1 -0
  24. package/front_end/panels/console/ConsoleViewMessage.ts +2 -19
  25. package/front_end/panels/console/module.json +0 -2
  26. package/front_end/panels/console_counters/console_counters-meta.ts +0 -3
  27. package/front_end/panels/coverage/CoverageListView.ts +13 -4
  28. package/front_end/panels/coverage/module.json +0 -1
  29. package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +1 -0
  30. package/front_end/panels/css_overview/module.json +1 -2
  31. package/front_end/panels/developer_resources/developer_resources-meta.ts +0 -2
  32. package/front_end/panels/elements/ElementsTreeElement.ts +2 -1
  33. package/front_end/panels/elements/StylesSidebarPane.ts +16 -1
  34. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -0
  35. package/front_end/panels/elements/components/QueryContainer.ts +1 -0
  36. package/front_end/panels/elements/module.json +0 -3
  37. package/front_end/panels/emulation/DeviceModeWrapper.ts +4 -0
  38. package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +18 -2
  39. package/front_end/panels/emulation/module.json +1 -2
  40. package/front_end/panels/help/help-meta.ts +0 -3
  41. package/front_end/panels/input/input-meta.ts +0 -2
  42. package/front_end/panels/media/module.json +0 -1
  43. package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +0 -3
  44. package/front_end/panels/network/module.json +0 -5
  45. package/front_end/panels/performance_monitor/performance_monitor-meta.ts +0 -3
  46. package/front_end/panels/profiler/module.json +1 -3
  47. package/front_end/panels/profiler/profilesPanel.css +1 -1
  48. package/front_end/panels/settings/emulation/devicesSettingsTab.css +1 -1
  49. package/front_end/panels/settings/settings-meta.ts +0 -2
  50. package/front_end/panels/sources/BreakpointEditDialog.ts +1 -0
  51. package/front_end/panels/sources/NavigatorView.ts +8 -8
  52. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +15 -0
  53. package/front_end/panels/sources/module.json +0 -5
  54. package/front_end/panels/sources/watchExpressionsSidebarPane.css +10 -3
  55. package/front_end/panels/timeline/module.json +1 -3
  56. package/front_end/panels/web_audio/web_audio-meta.ts +0 -3
  57. package/front_end/panels/webauthn/webauthn-meta.ts +0 -2
  58. package/front_end/ui/components/buttons/button.css +1 -0
  59. package/front_end/ui/components/docs/create_breadcrumbs.ts +1 -0
  60. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -1
  61. package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -0
  62. package/front_end/ui/components/text_editor/config.ts +3 -1
  63. package/front_end/ui/components/text_editor/theme.ts +5 -0
  64. package/front_end/ui/legacy/TabbedPane.ts +4 -0
  65. package/front_end/ui/legacy/UIUtils.ts +1 -1
  66. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -1
  67. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +6 -1
  68. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +3 -1
  69. package/front_end/ui/legacy/components/data_grid/dataGrid.css +5 -0
  70. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +2 -1
  71. package/front_end/ui/legacy/components/inline_editor/CSSLength.ts +10 -3
  72. package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +3 -2
  73. package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +5 -1
  74. package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +2 -1
  75. package/front_end/ui/legacy/components/inline_editor/Swatches.ts +4 -2
  76. package/front_end/ui/legacy/components/inline_editor/cssLength.css +30 -9
  77. package/front_end/ui/legacy/components/source_frame/module.json +1 -2
  78. package/front_end/ui/legacy/inspectorCommon.css +2 -12
  79. package/front_end/ui/legacy/softDropDownButton.css +0 -11
  80. package/front_end/ui/legacy/themeColors.css +2 -2
  81. package/package.json +1 -1
  82. package/scripts/build/rollup.config.js +3 -0
  83. package/scripts/eslint_rules/lib/ban_a_tags_in_lit_html.js +47 -0
  84. package/scripts/eslint_rules/tests/ban_a_tags_in_lit_html_test.js +60 -0
  85. package/front_end/entrypoints/node_main/module.json +0 -8
  86. package/front_end/panels/console_counters/module.json +0 -5
  87. package/front_end/panels/developer_resources/module.json +0 -6
  88. package/front_end/panels/event_listeners/module.json +0 -6
  89. package/front_end/panels/help/module.json +0 -5
  90. package/front_end/panels/input/module.json +0 -5
  91. package/front_end/panels/mobile_throttling/module.json +0 -5
  92. package/front_end/panels/performance_monitor/module.json +0 -5
  93. package/front_end/panels/search/module.json +0 -5
  94. package/front_end/panels/settings/module.json +0 -5
  95. package/front_end/panels/web_audio/module.json +0 -5
  96. package/front_end/panels/webauthn/module.json +0 -6
  97. package/front_end/ui/legacy/components/color_picker/module.json +0 -8
  98. package/front_end/ui/legacy/components/cookie_table/module.json +0 -9
  99. package/front_end/ui/legacy/components/data_grid/module.json +0 -8
  100. package/front_end/ui/legacy/components/inline_editor/module.json +0 -14
  101. package/front_end/ui/legacy/components/object_ui/module.json +0 -5
@@ -303,6 +303,7 @@ export class WatchExpression extends Common.ObjectWrapper.ObjectWrapper<EventTyp
303
303
  private textPrompt?: ObjectUI.ObjectPropertiesSection.ObjectPropertyPrompt;
304
304
  private result?: SDK.RemoteObject.RemoteObject|null;
305
305
  private preventClickTimeout?: number;
306
+ private resizeObserver?: ResizeObserver;
306
307
  constructor(
307
308
  expression: string|null,
308
309
  expandController: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController,
@@ -412,6 +413,7 @@ export class WatchExpression extends Common.ObjectWrapper.ObjectWrapper<EventTyp
412
413
  if (this.expressionInternal) {
413
414
  this.expandController.stopWatchSectionsWithId(this.expressionInternal);
414
415
  }
416
+ this.resizeObserver?.disconnect();
415
417
  this.expressionInternal = newExpression;
416
418
  this.update();
417
419
  this.dispatchEventToListeners(Events.ExpressionUpdated, this);
@@ -442,6 +444,19 @@ export class WatchExpression extends Common.ObjectWrapper.ObjectWrapper<EventTyp
442
444
  expressionValue?: SDK.RemoteObject.RemoteObject, exceptionDetails?: Protocol.Runtime.ExceptionDetails): Element {
443
445
  const headerElement = this.element.createChild('div', 'watch-expression-header');
444
446
  const deleteButton = UI.Icon.Icon.create('smallicon-cross', 'watch-expression-delete-button');
447
+ this.resizeObserver = new ResizeObserver(entries => {
448
+ entries.forEach(entry => {
449
+ // 55 serves as a width threshold here (in px)
450
+ if (entry.contentRect.width < 55) {
451
+ deleteButton.classList.remove('right-aligned');
452
+ deleteButton.classList.add('left-aligned');
453
+ } else {
454
+ deleteButton.classList.remove('left-aligned');
455
+ deleteButton.classList.add('right-aligned');
456
+ }
457
+ });
458
+ });
459
+ this.resizeObserver.observe(headerElement);
445
460
  UI.Tooltip.Tooltip.install(deleteButton, i18nString(UIStrings.deleteWatchExpression));
446
461
  deleteButton.addEventListener('click', this.deleteWatchExpression.bind(this), false);
447
462
 
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "dependencies": [
3
3
  "ui/legacy",
4
- "panels/search",
5
4
  "ui/legacy/components/source_frame",
6
- "ui/legacy/components/inline_editor",
7
- "ui/legacy/components/color_picker",
8
- "panels/event_listeners",
9
- "ui/legacy/components/object_ui",
10
5
  "panels/coverage"
11
6
  ]
12
7
  }
@@ -7,12 +7,19 @@
7
7
  .watch-expression-delete-button {
8
8
  position: absolute;
9
9
  top: 5px;
10
- right: 16px;
11
10
  cursor: pointer;
12
11
  opacity: 0%;
13
12
  }
14
13
 
15
- .watch-expression-header:hover .watch-expression-delete-button {
14
+ .right-aligned {
15
+ right: 16px;
16
+ }
17
+
18
+ .left-aligned {
19
+ left: -11px;
20
+ }
21
+
22
+ .watch-expression-title:hover .watch-expression-delete-button {
16
23
  opacity: 100%;
17
24
  }
18
25
 
@@ -108,7 +115,7 @@ li.watch-expression-editing::before {
108
115
  }
109
116
 
110
117
  @media (forced-colors: active) {
111
- .watch-expression-header:hover .watch-expression-delete-button,
118
+ .watch-expression-title:hover .watch-expression-delete-button,
112
119
  .watch-expressions .dimmed {
113
120
  opacity: 100%;
114
121
  }
@@ -4,8 +4,6 @@
4
4
  "panels/coverage",
5
5
  "panels/layer_viewer",
6
6
  "ui/legacy/components/perf_ui",
7
- "ui/legacy/components/data_grid",
8
- "panels/profiler",
9
- "panels/mobile_throttling"
7
+ "panels/profiler"
10
8
  ]
11
9
  }
@@ -3,7 +3,6 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as i18n from '../../core/i18n/i18n.js';
6
- import * as Root from '../../core/root/root.js';
7
6
  import * as UI from '../../ui/legacy/legacy.js';
8
7
 
9
8
  // eslint-disable-next-line rulesdir/es_modules_import
@@ -30,8 +29,6 @@ let loadedWebAudioModule: (typeof WebAudio|undefined);
30
29
 
31
30
  async function loadWebAudioModule(): Promise<typeof WebAudio> {
32
31
  if (!loadedWebAudioModule) {
33
- // Side-effect import resources in module.json
34
- await Root.Runtime.Runtime.instance().loadModulePromise('panels/web_audio');
35
32
  loadedWebAudioModule = await import('./web_audio.js');
36
33
  }
37
34
  return loadedWebAudioModule;
@@ -26,8 +26,6 @@ let loadedWebauthnModule: (typeof Webauthn|undefined);
26
26
 
27
27
  async function loadWebauthnModule(): Promise<typeof Webauthn> {
28
28
  if (!loadedWebauthnModule) {
29
- // Side-effect import resources in module.json
30
- await Root.Runtime.Runtime.instance().loadModulePromise('panels/webauthn');
31
29
  loadedWebauthnModule = await import('./webauthn.js');
32
30
  }
33
31
  return loadedWebauthnModule;
@@ -32,6 +32,7 @@ button {
32
32
  display: inline-flex;
33
33
  font-family: inherit;
34
34
  font-size: 12px;
35
+ font-weight: 500;
35
36
  height: 24px;
36
37
  line-height: 14px;
37
38
  padding: 5px 12px;
@@ -6,6 +6,7 @@ import * as LitHtml from '../../lit-html/lit-html.js';
6
6
  export function init(): void {
7
7
  const container = document.createElement('ul');
8
8
  // clang-format off
9
+ // eslint-disable-next-line rulesdir/ban_a_tags_in_lit_html
9
10
  LitHtml.render(LitHtml.html`
10
11
 
11
12
  <style>
@@ -48,7 +48,6 @@ export const CSS_RESOURCES_TO_LOAD_INTO_RUNTIME = [
48
48
  'ui/legacy/progressIndicator.css',
49
49
  'panels/application/serviceWorkerUpdateCycleView.css',
50
50
  'ui/legacy/tabbedPane.css',
51
- 'ui/legacy/components/inline_editor/colorSwatch.css',
52
51
  'ui/legacy/glassPane.css',
53
52
  'ui/legacy/suggestBox.css',
54
53
  'ui/legacy/treeoutline.css',
@@ -66,6 +66,7 @@ export class Linkifier extends HTMLElement {
66
66
  // Disabled until https://crbug.com/1079231 is fixed.
67
67
  await coordinator.write(() => {
68
68
  // clang-format off
69
+ // eslint-disable-next-line rulesdir/ban_a_tags_in_lit_html
69
70
  LitHtml.render(LitHtml.html`<a class="link" href=${this.#url} @click=${this.onLinkActivation}><slot>${LinkifierUtils.linkText(this.#url, this.#lineNumber)}</slot></a>`, this.#shadow, { host: this});
70
71
  // clang-format on
71
72
  });
@@ -57,7 +57,9 @@ export const tabMovesFocus = DynamicSetting.bool('textEditorTabMovesFocus', CM.k
57
57
  shift: (view: CM.EditorView): boolean => view.state.doc.length ? CM.indentLess(view) : false,
58
58
  }]));
59
59
 
60
- export const autocompletion = DynamicSetting.bool('textEditorAutocompletion', CM.autocompletion({icons: false}));
60
+ export const autocompletion = CM.autocompletion({icons: false});
61
+
62
+ export const sourcesAutocompletion = DynamicSetting.bool('textEditorAutocompletion', autocompletion);
61
63
 
62
64
  export const bracketMatching = DynamicSetting.bool('textEditorBracketMatching', CM.bracketMatching());
63
65
 
@@ -57,6 +57,11 @@ export const editorTheme = CM.EditorView.theme({
57
57
  padding: '0 3px 0 9px',
58
58
  },
59
59
 
60
+ '.cm-matchingBracket, .cm-nonmatchingBracket': {
61
+ background: 'transparent',
62
+ borderBottom: 'none',
63
+ },
64
+
60
65
  '&:focus-within .cm-matchingBracket': {
61
66
  color: 'inherit',
62
67
  backgroundColor: 'var(--color-matching-bracket-background)',
@@ -251,6 +251,10 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
251
251
  }
252
252
 
253
253
  closeTabs(ids: string[], userGesture?: boolean): void {
254
+ if (ids.length === 0) {
255
+ return;
256
+ }
257
+
254
258
  const focused = this.hasFocus();
255
259
  for (let i = 0; i < ids.length; ++i) {
256
260
  this.innerCloseTab(ids[i], userGesture);
@@ -450,7 +450,7 @@ function modifiedHexValue(hexString: string, event: Event): string|null {
450
450
  return resultString;
451
451
  }
452
452
 
453
- function modifiedFloatNumber(number: number, event: Event, modifierMultiplier?: number): number|null {
453
+ export function modifiedFloatNumber(number: number, event: Event, modifierMultiplier?: number): number|null {
454
454
  const direction = getValueModificationDirection(event);
455
455
  if (!direction) {
456
456
  return null;
@@ -42,6 +42,7 @@ import {ContrastDetails, Events as ContrastDetailsEvents} from './ContrastDetail
42
42
 
43
43
  import type {ContrastInfo} from './ContrastInfo.js';
44
44
  import {ContrastOverlay} from './ContrastOverlay.js';
45
+ import spectrumStyles from './spectrum.css.js';
45
46
 
46
47
  const UIStrings = {
47
48
  /**
@@ -183,7 +184,6 @@ export class Spectrum extends Common.ObjectWrapper.eventMixin<EventTypes, typeof
183
184
  private colorFormat?: string;
184
185
  constructor(contrastInfo?: ContrastInfo|null) {
185
186
  super(true);
186
- this.registerRequiredCSS('ui/legacy/components/color_picker/spectrum.css');
187
187
 
188
188
  this.contentElement.tabIndex = 0;
189
189
  this.colorElement = this.contentElement.createChild('div', 'spectrum-color');
@@ -1140,6 +1140,7 @@ export class Spectrum extends Common.ObjectWrapper.eventMixin<EventTypes, typeof
1140
1140
  }
1141
1141
 
1142
1142
  wasShown(): void {
1143
+ this.registerCSSFiles([spectrumStyles]);
1143
1144
  this.hueAlphaWidth = this.hueElement.offsetWidth;
1144
1145
  this.slideHelperWidth = this.hueSlider.offsetWidth / 2;
1145
1146
  this.dragWidth = this.colorElement.offsetWidth;
@@ -43,6 +43,8 @@ import * as NetworkForward from '../../../../panels/network/forward/forward.js';
43
43
  import * as UI from '../../legacy.js';
44
44
  import * as DataGrid from '../data_grid/data_grid.js';
45
45
 
46
+ import cookiesTableStyles from './cookiesTable.css.js';
47
+
46
48
  const UIStrings = {
47
49
  /**
48
50
  *@description Cookie table cookies table expires session value in Cookies Table of the Cookies table in the Application panel
@@ -124,7 +126,6 @@ export class CookiesTable extends UI.Widget.VBox {
124
126
  deleteCallback?: ((arg0: SDK.Cookie.Cookie, arg1: () => void) => void)) {
125
127
  super();
126
128
 
127
- this.registerRequiredCSS('ui/legacy/components/cookie_table/cookiesTable.css');
128
129
  this.element.classList.add('cookies-table');
129
130
 
130
131
  this.saveCallback = saveCallback;
@@ -286,6 +287,10 @@ export class CookiesTable extends UI.Widget.VBox {
286
287
  this.cookieToBlockedReasons = null;
287
288
  }
288
289
 
290
+ wasShown(): void {
291
+ this.registerCSSFiles([cookiesTableStyles]);
292
+ }
293
+
289
294
  setCookies(
290
295
  cookies: SDK.Cookie.Cookie[],
291
296
  cookieToBlockedReasons?: ReadonlyMap<SDK.Cookie.Cookie, SDK.CookieModel.BlockedReason[]>): void {
@@ -31,6 +31,8 @@ import * as i18n from '../../../../core/i18n/i18n.js';
31
31
  import * as Platform from '../../../../core/platform/platform.js';
32
32
  import * as UI from '../../legacy.js';
33
33
 
34
+ import dataGridStyles from './dataGrid.css.js';
35
+
34
36
  const UIStrings = {
35
37
  /**
36
38
  *@description Accessible text label for expandible nodes in datagrids
@@ -169,7 +171,6 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
169
171
  const {displayName, columns: columnsArray, editCallback, deleteCallback, refreshCallback} = dataGridParameters;
170
172
  this.element = document.createElement('div');
171
173
  this.element.classList.add('data-grid');
172
- UI.Utils.appendStyle(this.element, 'ui/legacy/components/data_grid/dataGrid.css');
173
174
  this.element.tabIndex = 0;
174
175
  this.element.addEventListener('keydown', this.keyDown.bind(this), false);
175
176
  this.element.addEventListener('contextmenu', this.contextMenu.bind(this), true);
@@ -2351,6 +2352,7 @@ export class DataGridWidget<T> extends UI.Widget.VBox {
2351
2352
  }
2352
2353
 
2353
2354
  wasShown(): void {
2355
+ this.registerCSSFiles([dataGridStyles]);
2354
2356
  this.dataGrid.wasShown();
2355
2357
  }
2356
2358
 
@@ -154,6 +154,7 @@
154
154
  }
155
155
 
156
156
  .data-grid th .sort-order-icon-container {
157
+ background-color: var(--color-background-elevation-1);
157
158
  position: absolute;
158
159
  top: 1px;
159
160
  right: 0;
@@ -162,6 +163,10 @@
162
163
  align-items: center;
163
164
  }
164
165
 
166
+ .data-grid th:hover .sort-order-icon-container {
167
+ background-color: var(--color-background-highlight);
168
+ }
169
+
165
170
  .data-grid th .sort-order-icon {
166
171
  margin-right: 4px;
167
172
  margin-bottom: -2px;
@@ -6,6 +6,7 @@ import * as Common from '../../../../core/common/common.js';
6
6
  import * as Platform from '../../../../core/platform/platform.js';
7
7
  import * as UI from '../../legacy.js';
8
8
 
9
+ import bezierEditorStyles from './bezierEditor.css.js';
9
10
  import {BezierUI} from './BezierUI.js';
10
11
 
11
12
  export class BezierEditor extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox) {
@@ -29,7 +30,6 @@ export class BezierEditor extends Common.ObjectWrapper.eventMixin<EventTypes, ty
29
30
  constructor(bezier: UI.Geometry.CubicBezier) {
30
31
  super(true);
31
32
  this.bezierInternal = bezier;
32
- this.registerRequiredCSS('ui/legacy/components/inline_editor/bezierEditor.css');
33
33
  this.contentElement.tabIndex = 0;
34
34
  this.setDefaultFocusedElement(this.contentElement);
35
35
 
@@ -79,6 +79,7 @@ export class BezierEditor extends Common.ObjectWrapper.eventMixin<EventTypes, ty
79
79
  }
80
80
 
81
81
  wasShown(): void {
82
+ this.registerCSSFiles([bezierEditorStyles]);
82
83
  this.unselectPresets();
83
84
  // Check if bezier matches a preset
84
85
  for (const category of this.presetCategories) {
@@ -77,6 +77,10 @@ export class CSSLength extends HTMLElement {
77
77
  }
78
78
 
79
79
  private onValueMousedown(event: MouseEvent): void {
80
+ if (event.button !== 0) {
81
+ return;
82
+ }
83
+
80
84
  this.currentMouseClientX = event.clientX;
81
85
  const targetDocument = event.target instanceof Node && event.target.ownerDocument;
82
86
  if (targetDocument) {
@@ -136,9 +140,12 @@ export class CSSLength extends HTMLElement {
136
140
  <span class="value"
137
141
  @mousedown=${this.onValueMousedown}
138
142
  @mouseup=${this.onValueMouseup}
139
- >${this.length.value}</span><select class="unit ${this.length.unit}" @mouseup=${this.onUnitMouseup} @change=${this.onUnitChange}>
140
- ${options}
141
- </select>
143
+ >${this.length.value}</span><span class="unit">${this.length.unit}</span><div class="unit-dropdown">
144
+ <span class="icon"></span>
145
+ <select @mouseup=${this.onUnitMouseup} @change=${this.onUnitChange}>
146
+ ${options}
147
+ </select>
148
+ </div>
142
149
  `;
143
150
  // clang-format on
144
151
  }
@@ -9,6 +9,7 @@ import * as UI from '../../legacy.js';
9
9
 
10
10
  import type {CSSShadowModel} from './CSSShadowModel.js';
11
11
  import {CSSLength} from './CSSShadowModel.js';
12
+ import cssShadowEditorStyles from './cssShadowEditor.css.js';
12
13
 
13
14
  const UIStrings = {
14
15
  /**
@@ -61,7 +62,6 @@ export class CSSShadowEditor extends Common.ObjectWrapper.eventMixin<EventTypes,
61
62
  private changedElement?: HTMLInputElement|null;
62
63
  constructor() {
63
64
  super(true);
64
- this.registerRequiredCSS('ui/legacy/components/inline_editor/cssShadowEditor.css');
65
65
  this.contentElement.tabIndex = 0;
66
66
  this.setDefaultFocusedElement(this.contentElement);
67
67
 
@@ -106,7 +106,7 @@ export class CSSShadowEditor extends Common.ObjectWrapper.eventMixin<EventTypes,
106
106
  field.appendChild(textInput);
107
107
  textInput.id = propertyName;
108
108
  textInput.addEventListener('keydown', this.handleValueModification.bind(this), false);
109
- textInput.addEventListener('mousewheel', this.handleValueModification.bind(this), false);
109
+ textInput.addEventListener('wheel', this.handleValueModification.bind(this), false);
110
110
  textInput.addEventListener('input', this.onTextInput.bind(this), false);
111
111
  textInput.addEventListener('blur', this.onTextBlur.bind(this), false);
112
112
  return textInput;
@@ -120,6 +120,7 @@ export class CSSShadowEditor extends Common.ObjectWrapper.eventMixin<EventTypes,
120
120
  }
121
121
 
122
122
  wasShown(): void {
123
+ this.registerCSSFiles([cssShadowEditorStyles]);
123
124
  this.updateUI();
124
125
  }
125
126
 
@@ -8,6 +8,7 @@ import * as SDK from '../../../../core/sdk/sdk.js';
8
8
  import * as IconButton from '../../../components/icon_button/icon_button.js';
9
9
  import * as UI from '../../legacy.js';
10
10
 
11
+ import fontEditorStyles from './fontEditor.css.js';
11
12
  import * as FontEditorUnitConverter from './FontEditorUnitConverter.js';
12
13
  import * as FontEditorUtils from './FontEditorUtils.js';
13
14
 
@@ -123,7 +124,6 @@ export class FontEditor extends Common.ObjectWrapper.eventMixin<EventTypes, type
123
124
 
124
125
  constructor(propertyMap: Map<string, string>) {
125
126
  super(true);
126
- this.registerRequiredCSS('ui/legacy/components/inline_editor/fontEditor.css');
127
127
  this.selectedNode = UI.Context.Context.instance().flavor(SDK.DOMModel.DOMNode);
128
128
 
129
129
  this.propertyMap = propertyMap;
@@ -174,6 +174,10 @@ export class FontEditor extends Common.ObjectWrapper.eventMixin<EventTypes, type
174
174
  /** hasUnits= */ true);
175
175
  }
176
176
 
177
+ wasShown(): void {
178
+ this.registerCSSFiles([fontEditorStyles]);
179
+ }
180
+
177
181
  private async createFontSelectorSection(propertyValue?: string): Promise<void> {
178
182
  if (propertyValue) {
179
183
  // FIXME(crbug.com/1148434): propertyValue will not be split correctly for font family names that contain commas.
@@ -7,6 +7,7 @@ import * as Platform from '../../../../core/platform/platform.js';
7
7
  import * as UI from '../../legacy.js';
8
8
 
9
9
  import {ColorSwatch} from './ColorSwatch.js';
10
+ import swatchPopoverStyles from './swatchPopover.css.js';
10
11
 
11
12
  export class SwatchPopoverHelper extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
12
13
  private readonly popover: UI.GlassPane.GlassPane;
@@ -22,7 +23,6 @@ export class SwatchPopoverHelper extends Common.ObjectWrapper.ObjectWrapper<Even
22
23
  constructor() {
23
24
  super();
24
25
  this.popover = new UI.GlassPane.GlassPane();
25
- this.popover.registerRequiredCSS('ui/legacy/components/inline_editor/swatchPopover.css');
26
26
  this.popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent);
27
27
  this.popover.setMarginBehavior(UI.GlassPane.MarginBehavior.Arrow);
28
28
  this.popover.element.addEventListener('mousedown', e => e.consume(), false);
@@ -60,6 +60,7 @@ export class SwatchPopoverHelper extends Common.ObjectWrapper.ObjectWrapper<Even
60
60
  this.hide(true);
61
61
  }
62
62
 
63
+ this.popover.registerCSSFiles([swatchPopoverStyles]);
63
64
  this.dispatchEventToListeners(Events.WillShowPopover);
64
65
 
65
66
  this.isHidden = false;
@@ -8,6 +8,8 @@ import * as UI from '../../legacy.js';
8
8
 
9
9
  import {ColorSwatch, FormatChangedEvent} from './ColorSwatch.js';
10
10
  import type {CSSShadowModel} from './CSSShadowModel.js';
11
+ import bezierSwatchStyles from './bezierSwatch.css.js';
12
+ import cssShadowSwatchStyles from './cssShadowSwatch.css.js';
11
13
 
12
14
  export class BezierSwatch extends HTMLSpanElement {
13
15
  private readonly iconElementInternal: UI.Icon.Icon;
@@ -16,7 +18,7 @@ export class BezierSwatch extends HTMLSpanElement {
16
18
  constructor() {
17
19
  super();
18
20
  const root = UI.Utils.createShadowRootWithCoreStyles(this, {
19
- cssFile: 'ui/legacy/components/inline_editor/bezierSwatch.css',
21
+ cssFile: [bezierSwatchStyles],
20
22
  delegatesFocus: undefined,
21
23
  });
22
24
  this.iconElementInternal = UI.Icon.Icon.create('smallicon-bezier', 'bezier-swatch-icon');
@@ -63,7 +65,7 @@ export class CSSShadowSwatch extends HTMLSpanElement {
63
65
  constructor() {
64
66
  super();
65
67
  const root = UI.Utils.createShadowRootWithCoreStyles(this, {
66
- cssFile: 'ui/legacy/components/inline_editor/cssShadowSwatch.css',
68
+ cssFile: [cssShadowSwatchStyles],
67
69
  delegatesFocus: undefined,
68
70
  });
69
71
  this.iconElementInternal = UI.Icon.Icon.create('smallicon-shadow', 'shadow-swatch-icon');
@@ -14,21 +14,42 @@
14
14
  cursor: ew-resize;
15
15
  }
16
16
 
17
- select.unit {
17
+ .unit-dropdown {
18
+ display: none;
19
+ }
20
+
21
+ .unit-dropdown select {
18
22
  all: unset;
19
23
  cursor: pointer;
20
- width: 2ch;
24
+ opacity: 0%;
25
+ width: 0.8em;
26
+ }
27
+
28
+ .icon {
29
+ position: absolute;
30
+ display: inline-block;
31
+ -webkit-mask-image: var(--image-file-chevrons);
32
+ -webkit-mask-position: -12px 4px;
33
+ -webkit-mask-size: 19px 6px;
34
+ -webkit-mask-repeat: no-repeat;
35
+ background-color: var(--color-text-primary);
36
+ content: '';
37
+ height: 1em;
38
+ width: 1em;
39
+ }
40
+
41
+ :host(:not(:last-child)) {
42
+ margin-right: 0.1em;
21
43
  }
22
44
 
23
- select.unit:hover {
24
- text-decoration: underline;
45
+ :host(:not(:last-child)) .unit-dropdown {
46
+ position: absolute;
25
47
  }
26
48
 
27
- select.unit.rem {
28
- width: 3ch;
49
+ .css-length:hover .unit-dropdown {
50
+ display: inline-block;
29
51
  }
30
52
 
31
- select.unit.vmin,
32
- select.unit.vmax {
33
- width: 4ch;
53
+ :host(:last-child) .unit-dropdown select {
54
+ width: 0.6em;
34
55
  }
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "dependencies": [
3
3
  "ui/legacy/components/text_editor",
4
- "ui/legacy",
5
- "ui/legacy/components/object_ui"
4
+ "ui/legacy"
6
5
  ],
7
6
  "resources": [
8
7
  "fontView.css",
@@ -390,7 +390,7 @@ input::placeholder {
390
390
  .chrome-select:enabled:active,
391
391
  .chrome-select:enabled:focus,
392
392
  .chrome-select:enabled:hover {
393
- --override-select-box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
393
+ --override-select-box-shadow: 0 0 0 2px var(--color-button-outline-focus);
394
394
 
395
395
  background-color: var(--color-background-elevation-1);
396
396
  box-shadow: var(--override-select-box-shadow);
@@ -401,10 +401,7 @@ input::placeholder {
401
401
  }
402
402
 
403
403
  .chrome-select:enabled:focus {
404
- --override-extra-box-shadow-focus: 0 0 0 2px rgb(66 133 244 / 40%);
405
-
406
404
  border-color: transparent;
407
- box-shadow: var(--override-select-box-shadow), var(--override-extra-box-shadow-focus);
408
405
  }
409
406
 
410
407
  .-theme-with-dark-background .chrome-select:enabled:active,
@@ -413,14 +410,7 @@ input::placeholder {
413
410
  :host-context(.-theme-with-dark-background) .chrome-select:enabled:active,
414
411
  :host-context(.-theme-with-dark-background) .chrome-select:enabled:focus,
415
412
  :host-context(.-theme-with-dark-background) .chrome-select:enabled:hover {
416
- --override-select-box-shadow: 0 1px 2px rgb(230 230 230 / 10%);
417
- }
418
-
419
- /* Disabled so we can keep all the selectors above in one block */
420
- /* stylelint-disable-next-line no-descending-specificity */
421
- .-theme-with-dark-background .chrome-select:enabled:focus,
422
- :host-context(.-theme-with-dark-background) .chrome-select:enabled:focus {
423
- --override-extra-box-shadow-focus: 0 0 0 2px rgb(11 78 189 / 40%);
413
+ --override-select-box-shadow: 0 0 0 2px var(--color-button-outline-focus);
424
414
  }
425
415
 
426
416
  .chrome-select-label {
@@ -23,17 +23,6 @@ button.soft-dropdown > .title {
23
23
  text-overflow: ellipsis;
24
24
  }
25
25
 
26
- button.soft-dropdown:focus-visible::before {
27
- content: "";
28
- position: absolute;
29
- top: 2px;
30
- left: 2px;
31
- right: 2px;
32
- bottom: 2px;
33
- border-radius: 2px;
34
- background: var(--divider-line);
35
- }
36
-
37
26
  @media (forced-colors: active) {
38
27
  button.soft-dropdown {
39
28
  border: 1px solid ButtonText;
@@ -240,7 +240,7 @@
240
240
  --color-input-outline-disabled: rgba(189 193 198 / 20%);
241
241
  --color-input-text-disabled: rgba(128 134 139 / 70%);
242
242
  /* Colors for styling buttons */
243
- --color-button-outline-focus: rgb(138 180 248 / 80%);
243
+ --color-button-outline-focus: rgb(138 180 248 / 75%);
244
244
  --color-button-primary-background-hovering: rgb(174 203 250 / 100%);
245
245
  --color-button-primary-background-pressed: rgb(210 227 252 / 100%);
246
246
  --color-button-primary-text: rgb(0 0 0);
@@ -265,10 +265,10 @@
265
265
  --color-token-builtin: rgb(159 180 214);
266
266
  --color-token-variable-special: rgb(0 85 170);
267
267
  --color-token-keyword: rgb(154 127 213);
268
- --color-token-number: var(--color-token-number);
269
268
  --color-token-string: rgb(242 139 84);
270
269
  --color-token-string-special: var(--color-token-string);
271
270
  --color-token-atom: rgb(161 247 181);
271
+ --color-token-number: var(--color-token-atom);
272
272
  --color-token-comment: rgb(137 137 137);
273
273
  --color-token-tag: rgb(93 176 215);
274
274
  --color-token-attribute: rgb(155 187 220);
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.934857"
58
+ "version": "1.0.936663"
59
59
  }
@@ -75,6 +75,9 @@ export default commandLineArgs => ({
75
75
  options: {
76
76
  strategy: minifyHTMLStrategy,
77
77
  minifyOptions: {
78
+ collapseInlineTagWhitespace: false,
79
+ collapseWhitespace: true,
80
+ conservativeCollapse: true,
78
81
  minifyCSS: false,
79
82
  removeOptionalTags: true,
80
83
  },