chrome-devtools-frontend 1.0.1039659 → 1.0.1040337

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 (91) hide show
  1. package/front_end/core/i18n/locales/af.json +87 -18
  2. package/front_end/core/i18n/locales/am.json +100 -31
  3. package/front_end/core/i18n/locales/ar.json +91 -22
  4. package/front_end/core/i18n/locales/as.json +87 -18
  5. package/front_end/core/i18n/locales/az.json +87 -18
  6. package/front_end/core/i18n/locales/be.json +89 -20
  7. package/front_end/core/i18n/locales/bg.json +86 -17
  8. package/front_end/core/i18n/locales/bn.json +91 -22
  9. package/front_end/core/i18n/locales/bs.json +86 -17
  10. package/front_end/core/i18n/locales/ca.json +88 -19
  11. package/front_end/core/i18n/locales/cs.json +89 -20
  12. package/front_end/core/i18n/locales/cy.json +86 -17
  13. package/front_end/core/i18n/locales/da.json +87 -18
  14. package/front_end/core/i18n/locales/de.json +92 -23
  15. package/front_end/core/i18n/locales/el.json +90 -21
  16. package/front_end/core/i18n/locales/en-GB.json +86 -17
  17. package/front_end/core/i18n/locales/es-419.json +88 -19
  18. package/front_end/core/i18n/locales/es.json +88 -19
  19. package/front_end/core/i18n/locales/et.json +86 -17
  20. package/front_end/core/i18n/locales/eu.json +86 -17
  21. package/front_end/core/i18n/locales/fa.json +93 -24
  22. package/front_end/core/i18n/locales/fi.json +86 -17
  23. package/front_end/core/i18n/locales/fil.json +88 -19
  24. package/front_end/core/i18n/locales/fr-CA.json +86 -17
  25. package/front_end/core/i18n/locales/fr.json +87 -18
  26. package/front_end/core/i18n/locales/gl.json +87 -18
  27. package/front_end/core/i18n/locales/gu.json +89 -20
  28. package/front_end/core/i18n/locales/he.json +89 -20
  29. package/front_end/core/i18n/locales/hi.json +93 -24
  30. package/front_end/core/i18n/locales/hr.json +87 -18
  31. package/front_end/core/i18n/locales/hu.json +89 -20
  32. package/front_end/core/i18n/locales/hy.json +89 -20
  33. package/front_end/core/i18n/locales/id.json +89 -20
  34. package/front_end/core/i18n/locales/is.json +87 -18
  35. package/front_end/core/i18n/locales/it.json +86 -17
  36. package/front_end/core/i18n/locales/ja.json +87 -18
  37. package/front_end/core/i18n/locales/ka.json +86 -17
  38. package/front_end/core/i18n/locales/kk.json +99 -30
  39. package/front_end/core/i18n/locales/km.json +89 -20
  40. package/front_end/core/i18n/locales/kn.json +89 -20
  41. package/front_end/core/i18n/locales/ko.json +87 -18
  42. package/front_end/core/i18n/locales/ky.json +87 -18
  43. package/front_end/core/i18n/locales/lo.json +90 -21
  44. package/front_end/core/i18n/locales/lt.json +89 -20
  45. package/front_end/core/i18n/locales/lv.json +88 -19
  46. package/front_end/core/i18n/locales/mk.json +86 -17
  47. package/front_end/core/i18n/locales/ml.json +86 -17
  48. package/front_end/core/i18n/locales/mn.json +86 -17
  49. package/front_end/core/i18n/locales/mr.json +86 -17
  50. package/front_end/core/i18n/locales/ms.json +86 -17
  51. package/front_end/core/i18n/locales/my.json +107 -38
  52. package/front_end/core/i18n/locales/ne.json +87 -18
  53. package/front_end/core/i18n/locales/nl.json +87 -18
  54. package/front_end/core/i18n/locales/no.json +90 -21
  55. package/front_end/core/i18n/locales/or.json +89 -20
  56. package/front_end/core/i18n/locales/pa.json +87 -18
  57. package/front_end/core/i18n/locales/pl.json +87 -18
  58. package/front_end/core/i18n/locales/pt-PT.json +90 -21
  59. package/front_end/core/i18n/locales/pt.json +87 -18
  60. package/front_end/core/i18n/locales/ro.json +86 -17
  61. package/front_end/core/i18n/locales/ru.json +91 -22
  62. package/front_end/core/i18n/locales/si.json +87 -18
  63. package/front_end/core/i18n/locales/sk.json +91 -22
  64. package/front_end/core/i18n/locales/sl.json +89 -20
  65. package/front_end/core/i18n/locales/sq.json +92 -23
  66. package/front_end/core/i18n/locales/sr-Latn.json +87 -18
  67. package/front_end/core/i18n/locales/sr.json +87 -18
  68. package/front_end/core/i18n/locales/sv.json +88 -19
  69. package/front_end/core/i18n/locales/sw.json +89 -20
  70. package/front_end/core/i18n/locales/ta.json +87 -18
  71. package/front_end/core/i18n/locales/te.json +90 -21
  72. package/front_end/core/i18n/locales/th.json +86 -17
  73. package/front_end/core/i18n/locales/tr.json +87 -18
  74. package/front_end/core/i18n/locales/uk.json +91 -22
  75. package/front_end/core/i18n/locales/ur.json +86 -17
  76. package/front_end/core/i18n/locales/uz.json +86 -17
  77. package/front_end/core/i18n/locales/vi.json +88 -19
  78. package/front_end/core/i18n/locales/zh-HK.json +88 -19
  79. package/front_end/core/i18n/locales/zh-TW.json +88 -19
  80. package/front_end/core/i18n/locales/zh.json +87 -18
  81. package/front_end/core/i18n/locales/zu.json +87 -18
  82. package/front_end/core/sdk/CSSMatchedStyles.ts +32 -36
  83. package/front_end/core/sdk/CSSProperty.ts +26 -2
  84. package/front_end/core/sdk/CSSStyleDeclaration.ts +3 -19
  85. package/front_end/panels/application/AppManifestView.ts +1 -1
  86. package/front_end/panels/application/ApplicationPanelSidebar.ts +26 -2
  87. package/front_end/panels/application/components/BackForwardCacheView.ts +13 -13
  88. package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
  89. package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -7
  90. package/front_end/ui/legacy/ReportView.ts +7 -0
  91. package/package.json +1 -1
@@ -27,10 +27,12 @@ export class CSSProperty {
27
27
  #nameRangeInternal: TextUtils.TextRange.TextRange|null;
28
28
  #valueRangeInternal: TextUtils.TextRange.TextRange|null;
29
29
  #invalidString?: Common.UIString.LocalizedString;
30
+ #longhandProperties: CSSProperty[] = [];
30
31
 
31
32
  constructor(
32
33
  ownerStyle: CSSStyleDeclaration, index: number, name: string, value: string, important: boolean,
33
- disabled: boolean, parsedOk: boolean, implicit: boolean, text?: string|null, range?: Protocol.CSS.SourceRange) {
34
+ disabled: boolean, parsedOk: boolean, implicit: boolean, text?: string|null, range?: Protocol.CSS.SourceRange,
35
+ longhandProperties?: Protocol.CSS.CSSProperty[]) {
34
36
  this.ownerStyle = ownerStyle;
35
37
  this.index = index;
36
38
  this.name = name;
@@ -44,6 +46,24 @@ export class CSSProperty {
44
46
  this.#active = true;
45
47
  this.#nameRangeInternal = null;
46
48
  this.#valueRangeInternal = null;
49
+
50
+ if (longhandProperties && longhandProperties.length > 0) {
51
+ for (const property of longhandProperties) {
52
+ this.#longhandProperties.push(new CSSProperty(
53
+ ownerStyle, this.#longhandProperties.length, property.name, property.value, important, disabled, parsedOk,
54
+ true));
55
+ }
56
+ } else {
57
+ // Blink would not parse shorthands containing 'var()' functions:
58
+ // https://drafts.csswg.org/css-variables/#variables-in-shorthands).
59
+ // Therefore we manually check if the current property is a shorthand,
60
+ // and fills its longhand components with empty values.
61
+ const longhandNames = cssMetadata().getLonghands(name);
62
+ for (const longhandName of longhandNames || []) {
63
+ this.#longhandProperties.push(new CSSProperty(
64
+ ownerStyle, this.#longhandProperties.length, longhandName, '', important, disabled, parsedOk, true));
65
+ }
66
+ }
47
67
  }
48
68
 
49
69
  static parsePayload(ownerStyle: CSSStyleDeclaration, index: number, payload: Protocol.CSS.CSSProperty): CSSProperty {
@@ -55,7 +75,7 @@ export class CSSProperty {
55
75
  const result = new CSSProperty(
56
76
  ownerStyle, index, payload.name, payload.value, payload.important || false, payload.disabled || false,
57
77
  ('parsedOk' in payload) ? Boolean(payload.parsedOk) : true, Boolean(payload.implicit), payload.text,
58
- payload.range);
78
+ payload.range, payload.longhandProperties);
59
79
  return result;
60
80
  }
61
81
 
@@ -302,4 +322,8 @@ export class CSSProperty {
302
322
  getInvalidStringForInvalidProperty(): Common.UIString.LocalizedString|undefined {
303
323
  return this.#invalidString;
304
324
  }
325
+
326
+ getLonghandProperties(): CSSProperty[] {
327
+ return this.#longhandProperties;
328
+ }
305
329
  }
@@ -62,19 +62,15 @@ export class CSSStyleDeclaration {
62
62
 
63
63
  if (payload.cssText && this.range) {
64
64
  const cssText = new TextUtils.Text.Text(payload.cssText);
65
- let start: {
66
- line: number,
67
- column: number,
68
- }|{
69
- line: number,
70
- column: number,
71
- } = {line: this.range.startLine, column: this.range.startColumn};
65
+ let start = {line: this.range.startLine, column: this.range.startColumn};
72
66
  for (const cssProperty of payload.cssProperties) {
73
67
  const range = cssProperty.range;
74
68
  if (range) {
75
69
  parseUnusedText.call(this, cssText, start.line, start.column, range.startLine, range.startColumn);
76
70
  start = {line: range.endLine, column: range.endColumn};
77
71
  }
72
+ // TODO(changhaohan): we should try not including longhand properties anymore, because
73
+ // they are already included in the longhandProperties field in a shorthand property.
78
74
  this.#allPropertiesInternal.push(
79
75
  CSSProperty.parsePayload(this, this.#allPropertiesInternal.length, cssProperty));
80
76
  }
@@ -303,18 +299,6 @@ export class CSSStyleDeclaration {
303
299
  return property ? property.implicit : false;
304
300
  }
305
301
 
306
- longhandProperties(name: string): CSSProperty[] {
307
- const longhands = cssMetadata().getLonghands(name.toLowerCase());
308
- const result = [];
309
- for (let i = 0; longhands && i < longhands.length; ++i) {
310
- const property = this.#activePropertyMap.get(longhands[i]);
311
- if (property) {
312
- result.push(property);
313
- }
314
- }
315
- return result;
316
- }
317
-
318
302
  propertyAt(index: number): CSSProperty|null {
319
303
  return (index < this.allProperties().length) ? this.allProperties()[index] : null;
320
304
  }
@@ -458,7 +458,7 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
458
458
  this.presentationSection = this.reportView.appendSection(i18nString(UIStrings.presentation));
459
459
  this.protocolHandlersSection = this.reportView.appendSection(i18nString(UIStrings.protocolHandlers));
460
460
  this.protocolHandlersView = new ApplicationComponents.ProtocolHandlersView.ProtocolHandlersView();
461
- this.protocolHandlersSection.contentElement.append(this.protocolHandlersView);
461
+ this.protocolHandlersSection.appendFieldWithCustomView(this.protocolHandlersView);
462
462
  this.iconsSection = this.reportView.appendSection(i18nString(UIStrings.icons), 'report-section-icons');
463
463
  this.shortcutSections = [];
464
464
  this.screenshotsSections = [];
@@ -981,7 +981,8 @@ export class AppManifestTreeElement extends ApplicationPanelTreeElement {
981
981
  for (const section of staticSections) {
982
982
  const sectionElement = section.getTitleElement();
983
983
  const childTitle = section.title();
984
- const child = new ManifestChildTreeElement(this.resourcesPanel, sectionElement, childTitle);
984
+ const sectionFieldElement = section.getFieldElement();
985
+ const child = new ManifestChildTreeElement(this.resourcesPanel, sectionElement, childTitle, sectionFieldElement);
985
986
  this.appendChild(child);
986
987
  }
987
988
  }
@@ -998,12 +999,15 @@ export class AppManifestTreeElement extends ApplicationPanelTreeElement {
998
999
 
999
1000
  export class ManifestChildTreeElement extends ApplicationPanelTreeElement {
1000
1001
  #sectionElement: Element;
1001
- constructor(storagePanel: ResourcesPanel, element: Element, childTitle: string) {
1002
+ #sectionFieldElement: HTMLElement;
1003
+ constructor(storagePanel: ResourcesPanel, element: Element, childTitle: string, fieldElement: HTMLElement) {
1002
1004
  super(storagePanel, childTitle, false);
1003
1005
  const icon = UI.Icon.Icon.create('mediumicon-manifest', 'resource-tree-item');
1004
1006
  this.setLeadingIcons([icon]);
1005
1007
  this.#sectionElement = element;
1008
+ this.#sectionFieldElement = fieldElement;
1006
1009
  self.onInvokeElement(this.listItemElement, this.onInvoke.bind(this));
1010
+ this.listItemElement.addEventListener('keydown', this.onInvokeElementKeydown.bind(this));
1007
1011
  UI.ARIAUtils.setAccessibleName(
1008
1012
  this.listItemElement, i18nString(UIStrings.beforeInvokeAlert, {PH1: this.listItemElement.title}));
1009
1013
  }
@@ -1018,6 +1022,26 @@ export class ManifestChildTreeElement extends ApplicationPanelTreeElement {
1018
1022
  UI.ARIAUtils.alert(i18nString(UIStrings.onInvokeAlert, {PH1: this.listItemElement.title}));
1019
1023
  Host.userMetrics.manifestSectionSelected(this.listItemElement.title);
1020
1024
  }
1025
+ // direct focus to the corresponding element
1026
+ onInvokeElementKeydown(event: KeyboardEvent): void {
1027
+ if (event.key !== 'Tab' || event.shiftKey) {
1028
+ return;
1029
+ }
1030
+ const checkBoxElement = this.#sectionFieldElement.querySelector('.mask-checkbox');
1031
+ let focusableElement: HTMLElement|null = this.#sectionFieldElement.querySelector('[tabindex="0"]');
1032
+ if (checkBoxElement && checkBoxElement.shadowRoot) {
1033
+ focusableElement = checkBoxElement.shadowRoot.querySelector('input') || null;
1034
+ } else if (!focusableElement) {
1035
+ // special case for protocol handler section since it is a custom Element and has different structure than the others
1036
+ focusableElement = this.#sectionFieldElement.querySelector('devtools-protocol-handlers-view')
1037
+ ?.shadowRoot?.querySelector('[tabindex="0"]') ||
1038
+ null;
1039
+ }
1040
+ if (focusableElement) {
1041
+ focusableElement?.focus();
1042
+ event.consume(true);
1043
+ }
1044
+ }
1021
1045
  }
1022
1046
 
1023
1047
  export class ClearStorageTreeElement extends ApplicationPanelTreeElement {
@@ -280,11 +280,11 @@ export class BackForwardCacheView extends HTMLElement {
280
280
  // clang-format off
281
281
  return LitHtml.html`
282
282
  ${this.#renderBackForwardCacheStatus(this.#frame.backForwardCacheDetails.restoredFromCache)}
283
- <div class='report-line'>
284
- <div class='report-key'>
283
+ <div class="report-line">
284
+ <div class="report-key">
285
285
  ${i18nString(UIStrings.url)}
286
286
  </div>
287
- <div class='report-value'>
287
+ <div class="report-value">
288
288
  ${this.#frame.url}
289
289
  </div>
290
290
  </div>
@@ -339,11 +339,11 @@ export class BackForwardCacheView extends HTMLElement {
339
339
  topFrameElement.setLeadingIcons([UI.Icon.Icon.create('mediumicon-frame')]);
340
340
  }
341
341
  return LitHtml.html`
342
- <div class='report-line'>
343
- <div class='report-key'>
342
+ <div class="report-line">
343
+ <div class="report-key">
344
344
  ${i18nString(UIStrings.framesTitle)}
345
345
  </div>
346
- <div class='report-value'>
346
+ <div class="report-value">
347
347
  ${treeOutline.element}
348
348
  </div>
349
349
  </div>`;
@@ -395,7 +395,7 @@ export class BackForwardCacheView extends HTMLElement {
395
395
  // clang-format off
396
396
  return LitHtml.html`
397
397
  <${ReportView.ReportView.ReportSection.litTagName}>
398
- <div class='status'>
398
+ <div class="status">
399
399
  <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
400
400
  iconName: 'ic_checkmark_16x16',
401
401
  color: 'green',
@@ -412,7 +412,7 @@ export class BackForwardCacheView extends HTMLElement {
412
412
  // clang-format off
413
413
  return LitHtml.html`
414
414
  <${ReportView.ReportView.ReportSection.litTagName}>
415
- <div class='status'>
415
+ <div class="status">
416
416
  <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
417
417
  iconName: 'circled_backslash_icon',
418
418
  color: 'var(--color-text-secondary)',
@@ -496,7 +496,7 @@ export class BackForwardCacheView extends HTMLElement {
496
496
  ${explanations.length > 0 ? LitHtml.html`
497
497
  <${ReportView.ReportView.ReportSectionHeader.litTagName}>
498
498
  ${category}
499
- <div class='help-outline-icon'>
499
+ <div class="help-outline-icon">
500
500
  <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
501
501
  iconName: 'help_outline',
502
502
  color: 'var(--color-text-secondary)',
@@ -530,9 +530,9 @@ export class BackForwardCacheView extends HTMLElement {
530
530
  return LitHtml.nothing;
531
531
  }
532
532
  const rows = [LitHtml.html`<div>${i18nString(UIStrings.framesPerIssue, {n: frames.length})}</div>`];
533
- rows.push(...frames.map(url => LitHtml.html`<div class='text-ellipsis' title=${url}>${url}</div>`));
533
+ rows.push(...frames.map(url => LitHtml.html`<div class="text-ellipsis" title=${url}>${url}</div>`));
534
534
  return LitHtml.html`
535
- <div class='explanation-frames'>
535
+ <div class="explanation-frames">
536
536
  <${ExpandableList.ExpandableList.ExpandableList.litTagName} .data=${
537
537
  {rows} as
538
538
  ExpandableList.ExpandableList.ExpandableListData}></${ExpandableList.ExpandableList.ExpandableList.litTagName}>
@@ -558,7 +558,7 @@ export class BackForwardCacheView extends HTMLElement {
558
558
  <${ReportView.ReportView.ReportSection.litTagName}>
559
559
  ${(explanation.reason in NotRestoredReasonDescription) ?
560
560
  LitHtml.html`
561
- <div class='circled-exclamation-icon'>
561
+ <div class="circled-exclamation-icon">
562
562
  <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
563
563
  iconName: 'circled_exclamation_icon',
564
564
  color: 'orange',
@@ -574,7 +574,7 @@ export class BackForwardCacheView extends HTMLElement {
574
574
  </div>` :
575
575
  LitHtml.nothing}
576
576
  </${ReportView.ReportView.ReportSection.litTagName}>
577
- <div class='gray-text'>
577
+ <div class="gray-text">
578
578
  ${explanation.reason}
579
579
  </div>
580
580
  ${this.#renderFramesPerReason(frames)}
@@ -971,7 +971,7 @@ export class StylePropertiesSection {
971
971
  break;
972
972
  }
973
973
  count++;
974
- const isShorthand = Boolean(style.longhandProperties(property.name).length);
974
+ const isShorthand = property.getLonghandProperties().length > 0;
975
975
  const inherited = this.isPropertyInherited(property.name);
976
976
  const overloaded = this.isPropertyOverloaded(property);
977
977
  if (style.parentRule && style.parentRule.isUserAgent() && inherited) {
@@ -558,19 +558,19 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
558
558
  return;
559
559
  }
560
560
 
561
- const longhandProperties = this.style.longhandProperties(this.name);
561
+ const longhandProperties = this.property.getLonghandProperties();
562
562
  const leadingProperties = this.style.leadingProperties();
563
563
 
564
- for (let i = 0; i < longhandProperties.length; ++i) {
565
- const name = longhandProperties[i].name;
564
+ for (const property of longhandProperties) {
565
+ const name = property.name;
566
566
  let inherited = false;
567
567
  let overloaded = false;
568
568
 
569
569
  const section = this.section();
570
570
  if (section) {
571
571
  inherited = section.isPropertyInherited(name);
572
- overloaded = this.matchedStylesInternal.propertyState(longhandProperties[i]) ===
573
- SDK.CSSMatchedStyles.PropertyState.Overloaded;
572
+ overloaded =
573
+ this.matchedStylesInternal.propertyState(property) === SDK.CSSMatchedStyles.PropertyState.Overloaded;
574
574
  }
575
575
 
576
576
  const leadingProperty = leadingProperties.find(property => property.name === name && property.activeInStyle());
@@ -579,8 +579,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
579
579
  }
580
580
 
581
581
  const item = new StylePropertyTreeElement(
582
- this.parentPaneInternal, this.matchedStylesInternal, longhandProperties[i], false, inherited, overloaded,
583
- false);
582
+ this.parentPaneInternal, this.matchedStylesInternal, property, false, inherited, overloaded, false);
584
583
  item.setComputedStyles(this.computedStyles);
585
584
  item.setParentsComputedStyles(this.parentsComputedStyles);
586
585
  this.appendChild(item);
@@ -130,6 +130,13 @@ export class Section extends VBox {
130
130
  return this.titleElement;
131
131
  }
132
132
 
133
+ getFieldElement(): HTMLElement {
134
+ return this.fieldList;
135
+ }
136
+ appendFieldWithCustomView(customElement: HTMLElement): void {
137
+ this.fieldList.append(customElement);
138
+ }
139
+
133
140
  setTitle(title: string, tooltip?: string): void {
134
141
  if (this.titleElement.textContent !== title) {
135
142
  this.titleElement.textContent = title;
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.1039659"
59
+ "version": "1.0.1040337"
60
60
  }