chrome-devtools-frontend 1.0.1036726 → 1.0.1037221

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.
@@ -298,7 +298,7 @@ export class MainImpl {
298
298
  'https://developer.chrome.com/blog/new-in-devtools-92/#source-order');
299
299
  Root.Runtime.experiments.register('webauthnPane', 'WebAuthn Pane');
300
300
  Root.Runtime.experiments.register(
301
- 'keyboardShortcutEditor', 'Enable keyboard shortcut editor', true,
301
+ 'keyboardShortcutEditor', 'Enable keyboard shortcut editor', false,
302
302
  'https://developer.chrome.com/blog/new-in-devtools-88/#keyboard-shortcuts');
303
303
 
304
304
  // Back/forward cache
@@ -429,6 +429,7 @@ export class MainImpl {
429
429
  Root.Runtime.ExperimentName.CSS_LAYERS,
430
430
  ...('EyeDropper' in window ? [Root.Runtime.ExperimentName.EYEDROPPER_COLOR_PICKER] : []),
431
431
  'lighthousePanelFR',
432
+ 'keyboardShortcutEditor',
432
433
  ]);
433
434
 
434
435
  Root.Runtime.experiments.setNonConfigurableExperiments([
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as i18n from '../../core/i18n/i18n.js';
6
6
  import * as Platform from '../../core/platform/platform.js';
7
+ import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
7
8
  import * as UI from '../../ui/legacy/legacy.js';
8
9
 
9
10
  import playerPropertiesViewStyles from './playerPropertiesView.css.js';
@@ -136,7 +137,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
136
137
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
137
138
 
138
139
  type TabData = {
139
- [x: string]: string,
140
+ [x: string]: string|object,
140
141
  };
141
142
 
142
143
  // Keep this enum in sync with panels/media/base/media_log_properties.h
@@ -179,7 +180,7 @@ export class PropertyRenderer extends UI.Widget.VBox {
179
180
  super();
180
181
  this.contentElement.classList.add('media-property-renderer');
181
182
  const titleElement = this.contentElement.createChild('span', 'media-property-renderer-title');
182
- this.contents = this.contentElement.createChild('span', 'media-property-renderer-contents');
183
+ this.contents = this.contentElement.createChild('div', 'media-property-renderer-contents');
183
184
  UI.UIUtils.createTextChild(titleElement, title);
184
185
  this.title = title;
185
186
  this.value = null;
@@ -213,16 +214,36 @@ export class PropertyRenderer extends UI.Widget.VBox {
213
214
  }
214
215
  }
215
216
 
217
+ protected unsetNestedContents(): void {
218
+ this.contentElement.classList.add('media-property-renderer-hidden');
219
+ if (this.pseudoColorProtectionElement === null) {
220
+ this.pseudoColorProtectionElement = document.createElement('div');
221
+ this.pseudoColorProtectionElement.classList.add('media-property-renderer');
222
+ this.pseudoColorProtectionElement.classList.add('media-property-renderer-hidden');
223
+ (this.contentElement.parentNode as HTMLElement)
224
+ .insertBefore(this.pseudoColorProtectionElement, this.contentElement);
225
+ }
226
+ }
227
+
228
+ changeNestedContents(value: object): void {
229
+ if (value === null || Object.keys(value).length === 0) {
230
+ this.unsetNestedContents();
231
+ } else {
232
+ if (this.pseudoColorProtectionElement !== null) {
233
+ this.pseudoColorProtectionElement.remove();
234
+ this.pseudoColorProtectionElement = null;
235
+ }
236
+ this.contentElement.classList.remove('media-property-renderer-hidden');
237
+ this.contents.removeChildren();
238
+ const jsonWrapperElement =
239
+ new SourceFrame.JSONView.JSONView(new SourceFrame.JSONView.ParsedJSON(value, '', ''), true);
240
+ jsonWrapperElement.show(this.contents);
241
+ }
242
+ }
243
+
216
244
  changeContents(value: string|null): void {
217
245
  if (value === null) {
218
- this.contentElement.classList.add('media-property-renderer-hidden');
219
- if (this.pseudoColorProtectionElement === null) {
220
- this.pseudoColorProtectionElement = document.createElement('div');
221
- this.pseudoColorProtectionElement.classList.add('media-property-renderer');
222
- this.pseudoColorProtectionElement.classList.add('media-property-renderer-hidden');
223
- (this.contentElement.parentNode as HTMLElement)
224
- .insertBefore(this.pseudoColorProtectionElement, this.contentElement);
225
- }
246
+ this.unsetNestedContents();
226
247
  } else {
227
248
  if (this.pseudoColorProtectionElement !== null) {
228
249
  this.pseudoColorProtectionElement.remove();
@@ -260,6 +281,13 @@ export class DefaultPropertyRenderer extends PropertyRenderer {
260
281
  }
261
282
  }
262
283
 
284
+ export class NestedPropertyRenderer extends PropertyRenderer {
285
+ constructor(title: Platform.UIString.LocalizedString, content: object) {
286
+ super(title);
287
+ this.changeNestedContents(content);
288
+ }
289
+ }
290
+
263
291
  export class DimensionPropertyRenderer extends PropertyRenderer {
264
292
  private width: number;
265
293
  private height: number;
@@ -337,7 +365,11 @@ export class TrackManager {
337
365
  addNewTab(tabs: GenericTrackMenu|NoTracksPlaceholderMenu, tabData: TabData, tabNumber: number): void {
338
366
  const tabElements = [];
339
367
  for (const [name, data] of Object.entries(tabData)) {
340
- tabElements.push(new DefaultPropertyRenderer(i18n.i18n.lockedString(name), data));
368
+ if (typeof data === 'object') {
369
+ tabElements.push(new NestedPropertyRenderer(i18n.i18n.lockedString(name), data));
370
+ } else {
371
+ tabElements.push(new DefaultPropertyRenderer(i18n.i18n.lockedString(name), data));
372
+ }
341
373
  }
342
374
  const newTab = new AttributesView(tabElements);
343
375
 
@@ -12,6 +12,8 @@
12
12
  line-height: 20px;
13
13
  min-height: 28px;
14
14
  padding: 4px 10px;
15
+ display: block;
16
+ overflow: hidden;
15
17
  }
16
18
 
17
19
  .media-property-renderer-hidden {
@@ -19,14 +21,23 @@
19
21
  }
20
22
 
21
23
  .media-property-renderer-title {
22
- font-size: 14px;
24
+ font-size: 12px;
25
+ float: left;
26
+ width: 150px;
27
+ }
28
+
29
+ .media-property-renderer-title::first-letter {
30
+ text-transform: uppercase;
23
31
  }
24
32
 
25
33
  .media-property-renderer-contents {
26
- position: absolute;
34
+ position: relative;
27
35
  left: 200px;
36
+ }
37
+
38
+ .media-property-renderer-contents > .json-view {
28
39
  overflow: hidden;
29
- height: 20px;
40
+ padding: 0;
30
41
  }
31
42
 
32
43
  .media-property-renderer:nth-child(even) {
@@ -37,10 +48,18 @@
37
48
  background: var(--color-background-hover-overlay);
38
49
  }
39
50
 
51
+ .media-property-renderer:has(.json-view) {
52
+ padding-bottom: 0;
53
+ }
54
+
40
55
  .-theme-with-dark-background .media-property-renderer:nth-child(even) {
41
56
  background: rgb(41 41 41);
42
57
  }
43
58
 
59
+ .media-property-renderer:has(.json-view > .expanded) {
60
+ padding-bottom: 4px;
61
+ }
62
+
44
63
  .media-properties-frame {
45
64
  display: block;
46
65
  overflow-x: hidden;
@@ -119,19 +119,14 @@ export class BreakpointsView extends HTMLElement {
119
119
  }
120
120
 
121
121
  #renderBreakpointGroup(group: BreakpointGroup): LitHtml.TemplateResult {
122
- const groupClassMap = {
123
- 'expanded': group.expanded,
124
- };
125
122
  // clang-format off
126
123
  return LitHtml.html`
127
- <div data-group='true' class=${LitHtml.Directives.classMap(groupClassMap)}>
128
- <div class='group-header' @click=${(): void => this.#onGroupExpandToggled(group)}>
129
- <span class='triangle'></span>
130
- ${this.#renderFileIcon()}
131
- <span class='group-header-title'>${group.name}</span>
132
- </div>
133
- ${group.expanded? LitHtml.html`
134
- ${group.breakpointItems.map(entry => this.#renderBreakpointEntry(entry))}` : LitHtml.nothing}
124
+ <details data-group='true' ?open=${group.expanded} @click=${(e: Event): void => this.#onGroupExpandToggled(e, group)}>
125
+ <summary>
126
+ <span class='group-header'>${this.#renderFileIcon()}<span class='group-header-title'>${group.name}</span></span>
127
+ </summary>
128
+ ${LitHtml.html`
129
+ ${group.breakpointItems.map(entry => this.#renderBreakpointEntry(entry))}`}
135
130
  </div>
136
131
  `;
137
132
  // clang-format on
@@ -155,7 +150,7 @@ export class BreakpointsView extends HTMLElement {
155
150
 
156
151
  // clang-format off
157
152
  return LitHtml.html`
158
- <div class=${LitHtml.Directives.classMap(classMap)} aria-label=${breakpointItemDescription} tabIndex=${breakpointItem.isHit ? 0 : 1}>
153
+ <div class=${LitHtml.Directives.classMap(classMap)} aria-label=${breakpointItemDescription} tabIndex=${breakpointItem.isHit ? 0 : -1}>
159
154
  <label class='checkbox-label'>
160
155
  <input type='checkbox' aria-label=${breakpointItem.location} ?indeterminate=${breakpointItem.status === BreakpointStatus.INDETERMINATE} ?checked=${breakpointItem.status === BreakpointStatus.ENABLED} @change=${(e: Event): void => this.#onCheckboxToggled(e, breakpointItem)}>
161
156
  </label>
@@ -185,10 +180,10 @@ export class BreakpointsView extends HTMLElement {
185
180
  return i18nString(UIStrings.breakpointHit, {PH1: checkboxDescription});
186
181
  }
187
182
 
188
- #onGroupExpandToggled(group: BreakpointGroup): void {
189
- group.expanded = !group.expanded;
190
- this.dispatchEvent(new ExpandedStateChangedEvent(group.url, group.expanded));
191
- void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
183
+ #onGroupExpandToggled(e: Event, group: BreakpointGroup): void {
184
+ const detailsElement = e.target as HTMLDetailsElement;
185
+ group.expanded = detailsElement.open;
186
+ this.dispatchEvent(new ExpandedStateChangedEvent(group.url, detailsElement.open));
192
187
  }
193
188
 
194
189
  #onCheckboxToggled(e: Event, item: BreakpointItem): void {
@@ -35,26 +35,34 @@ input {
35
35
  margin: 3px 0;
36
36
  }
37
37
 
38
- .triangle {
39
- margin-left: 6px;
40
- margin-right: 4px;
41
- display: inline-block;
38
+ details > summary {
39
+ height: 18px;
40
+ list-style: none;
41
+ display: flex;
42
+ padding: 4px 4px 4px 6px;
43
+ align-items: center;
44
+ }
45
+
46
+ details > summary::before {
47
+ display: block;
48
+ user-select: none;
42
49
  -webkit-mask-image: var(--image-file-treeoutlineTriangles);
43
50
  -webkit-mask-size: 32px 24px;
44
51
  -webkit-mask-position: 0 0;
45
- background-color: var(--color-text-primary);
52
+ background-color: var(--color-text-secondary);
53
+ content: "";
46
54
  height: 12px;
47
- width: 8px;
55
+ width: 9px;
56
+ overflow: hidden;
48
57
  }
49
58
 
50
- .group-header {
51
- display: flex;
52
- align-items: center;
53
- height: 18px;
59
+ details[open] > summary::before {
60
+ -webkit-mask-position: -16px 0;
54
61
  }
55
62
 
56
- .expanded > .group-header > .triangle {
57
- -webkit-mask-position: -16px 0;
63
+ .group-header {
64
+ display: inline-flex;
65
+ align-items: center;
58
66
  }
59
67
 
60
68
  .group-header-title {
@@ -84,7 +92,7 @@ input {
84
92
  }
85
93
 
86
94
  .checkbox-label {
87
- padding-left: 24px;
95
+ padding-left: 20px;
88
96
  display: flex;
89
97
  align-items: center;
90
98
  }
@@ -136,7 +136,7 @@ export class TimelineLoader implements Common.StringOutputStream.OutputStream {
136
136
  this.firstRawChunk = false;
137
137
 
138
138
  if (this.state === State.Initial) {
139
- if (chunk.startsWith('{"nodes":[')) {
139
+ if (chunk.match(/^{(\s)*"nodes":(\s)*\[/)) {
140
140
  this.state = State.LoadingCPUProfileFormat;
141
141
  } else if (chunk[0] === '{') {
142
142
  this.state = State.LookingForEvents;
@@ -68,7 +68,7 @@ export class TextPrompt extends HTMLElement {
68
68
 
69
69
  onInput(): void {
70
70
  this.#suggestion().value = this.#text();
71
- this.dispatchEvent(new PromptInputEvent(this.#text().trim()));
71
+ this.dispatchEvent(new PromptInputEvent(this.#text()));
72
72
  }
73
73
 
74
74
  onKeyDown(event: KeyboardEvent): void {
@@ -209,7 +209,7 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
209
209
  }
210
210
 
211
211
  private cleanValue(): string {
212
- return this.query.substring(this.prefix.length);
212
+ return this.query.substring(this.prefix.length).trim();
213
213
  }
214
214
 
215
215
  wasShown(): void {
package/package.json CHANGED
@@ -56,5 +56,5 @@
56
56
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
57
57
  "watch": "vpython third_party/node/node.py --output scripts/watch_build.js"
58
58
  },
59
- "version": "1.0.1036726"
59
+ "version": "1.0.1037221"
60
60
  }