chrome-devtools-frontend 1.0.1597448 → 1.0.1597624

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 (81) hide show
  1. package/front_end/core/host/AidaClient.ts +4 -0
  2. package/front_end/core/sdk/CPUThrottlingManager.ts +5 -1
  3. package/front_end/core/sdk/CSSMatchedStyles.ts +2 -0
  4. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +28 -0
  5. package/front_end/models/ai_assistance/AiConversation.ts +24 -8
  6. package/front_end/models/ai_assistance/ChangeManager.ts +16 -0
  7. package/front_end/models/ai_assistance/ExtensionScope.ts +11 -3
  8. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +127 -0
  9. package/front_end/models/ai_assistance/agents/AiAgent.ts +22 -3
  10. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +1 -1
  11. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +11 -8
  12. package/front_end/models/ai_assistance/agents/StylingAgent.ts +34 -4
  13. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  14. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +27 -0
  15. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +21 -0
  16. package/front_end/models/trace/Processor.ts +1 -0
  17. package/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +33 -0
  18. package/front_end/models/trace/insights/CharacterSet.ts +172 -0
  19. package/front_end/models/trace/insights/Models.ts +1 -0
  20. package/front_end/models/trace/insights/types.ts +1 -0
  21. package/front_end/models/trace/types/TraceEvents.ts +17 -0
  22. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +16 -3
  23. package/front_end/panels/ai_assistance/components/ChatMessage.ts +90 -46
  24. package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +18 -9
  25. package/front_end/panels/ai_assistance/components/chatMessage.css +11 -0
  26. package/front_end/panels/application/AppManifestView.ts +3 -4
  27. package/front_end/panels/application/DeviceBoundSessionsView.ts +18 -22
  28. package/front_end/panels/application/FrameDetailsView.ts +9 -15
  29. package/front_end/panels/application/OriginTrialTreeView.ts +2 -3
  30. package/front_end/panels/application/ReportingApiView.ts +13 -17
  31. package/front_end/panels/application/components/BackForwardCacheView.ts +3 -3
  32. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -3
  33. package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +3 -2
  34. package/front_end/panels/changes/ChangesView.ts +6 -4
  35. package/front_end/panels/console/ConsolePinPane.ts +3 -3
  36. package/front_end/panels/coverage/CoverageListView.ts +1 -1
  37. package/front_end/panels/css_overview/CSSOverviewPanel.ts +11 -15
  38. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +3 -5
  39. package/front_end/panels/elements/EventListenersWidget.ts +3 -2
  40. package/front_end/panels/elements/StandaloneStylesContainer.ts +21 -6
  41. package/front_end/panels/elements/StylePropertyTreeElement.ts +49 -4
  42. package/front_end/panels/layer_viewer/Layers3DView.ts +5 -4
  43. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +5 -6
  44. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +6 -11
  45. package/front_end/panels/network/RequestCookiesView.ts +3 -4
  46. package/front_end/panels/network/RequestInitiatorView.ts +7 -5
  47. package/front_end/panels/network/RequestResponseView.ts +10 -15
  48. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +3 -4
  49. package/front_end/panels/recorder/components/RecordingView.ts +31 -36
  50. package/front_end/panels/recorder/components/StepEditor.ts +6 -7
  51. package/front_end/panels/search/SearchView.ts +2 -3
  52. package/front_end/panels/settings/WorkspaceSettingsTab.ts +2 -5
  53. package/front_end/panels/timeline/components/LiveMetricsView.ts +5 -8
  54. package/front_end/panels/timeline/components/insights/Cache.ts +8 -10
  55. package/front_end/panels/timeline/components/insights/CharacterSet.ts +38 -0
  56. package/front_end/panels/timeline/components/insights/DOMSize.ts +16 -20
  57. package/front_end/panels/timeline/components/insights/DocumentLatency.ts +2 -6
  58. package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +3 -4
  59. package/front_end/panels/timeline/components/insights/FontDisplay.ts +3 -4
  60. package/front_end/panels/timeline/components/insights/ForcedReflow.ts +5 -7
  61. package/front_end/panels/timeline/components/insights/INPBreakdown.ts +3 -4
  62. package/front_end/panels/timeline/components/insights/ImageDelivery.ts +3 -4
  63. package/front_end/panels/timeline/components/insights/ImageRef.ts +2 -4
  64. package/front_end/panels/timeline/components/insights/InsightRenderer.ts +2 -0
  65. package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +5 -7
  66. package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +2 -4
  67. package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +3 -4
  68. package/front_end/panels/timeline/components/insights/ModernHTTP.ts +3 -4
  69. package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +7 -11
  70. package/front_end/panels/timeline/components/insights/NodeLink.ts +2 -4
  71. package/front_end/panels/timeline/components/insights/RenderBlocking.ts +3 -4
  72. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +7 -10
  73. package/front_end/panels/timeline/components/insights/ThirdParties.ts +5 -7
  74. package/front_end/panels/timeline/components/insights/insights.ts +2 -0
  75. package/front_end/panels/web_audio/WebAudioView.ts +3 -4
  76. package/front_end/ui/components/settings/SettingCheckbox.ts +2 -0
  77. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +3 -3
  78. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +8 -8
  79. package/front_end/ui/visual_logging/Debugging.ts +0 -32
  80. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  81. package/package.json +1 -1
@@ -20,7 +20,7 @@ import {Table} from './Table.js';
20
20
  const {UIStrings, i18nString} = Trace.Insights.Models.SlowCSSSelector;
21
21
 
22
22
  const {html} = Lit;
23
- const {widgetConfig} = UI.Widget;
23
+ const {widget} = UI.Widget;
24
24
 
25
25
  export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsightModel> {
26
26
  override internalName = 'slow-css-selector';
@@ -107,7 +107,7 @@ export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsight
107
107
  // clang-format off
108
108
  const sections = [html`
109
109
  <div class="insight-section">
110
- <devtools-widget .widgetConfig=${widgetConfig(Table, {
110
+ ${widget(Table, {
111
111
  data: {
112
112
  insight: this,
113
113
  headers: [i18nString(UIStrings.total), ''],
@@ -116,8 +116,7 @@ export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsight
116
116
  {values: [i18nString(UIStrings.matchCount), this.model.totalMatchCount]},
117
117
  {values: [i18nString(UIStrings.elapsed), i18n.TimeUtilities.millisToString(this.model.totalElapsedMs)]},
118
118
  ],
119
- }})}>
120
- </devtools-widget>
119
+ }})}
121
120
  </div>
122
121
  `];
123
122
  // clang-format on
@@ -127,14 +126,13 @@ export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsight
127
126
  // clang-format off
128
127
  sections.push(html`
129
128
  <div class="insight-section">
130
- <devtools-widget .widgetConfig=${widgetConfig(Table, {
129
+ ${widget(Table, {
131
130
  data: {
132
131
  insight: this,
133
132
  headers: [`${i18nString(UIStrings.topSelectorElapsedTime)}: ${time(Trace.Types.Timing.Micro(selector['elapsed (us)']))}`],
134
133
  rows: [{
135
134
  values: [html`${selector.selector} ${Lit.Directives.until(this.getSelectorLinks(cssModel, selector))}`]}]
136
- }})}>
137
- </devtools-widget>
135
+ }})}
138
136
  </div>
139
137
  `);
140
138
  // clang-format on
@@ -145,15 +143,14 @@ export class SlowCSSSelector extends BaseInsightComponent<SlowCSSSelectorInsight
145
143
  // clang-format off
146
144
  sections.push(html`
147
145
  <div class="insight-section">
148
- <devtools-widget .widgetConfig=${widgetConfig(Table, {
146
+ ${widget(Table, {
149
147
  data: {
150
148
  insight: this,
151
149
  headers: [`${i18nString(UIStrings.topSelectorMatchAttempt)}: ${selector['match_attempts']}`],
152
150
  rows: [{
153
151
  values: [html`${selector.selector} ${Lit.Directives.until(this.getSelectorLinks(cssModel, selector))}` as unknown as string],
154
152
  }]
155
- }})}>
156
- </devtools-widget>
153
+ }})}
157
154
  </div>
158
155
  `);
159
156
  // clang-format on
@@ -14,7 +14,7 @@ import {createLimitedRows, renderOthersLabel, type RowLimitAggregator, Table} fr
14
14
  const {UIStrings, i18nString, createOverlaysForSummary} = Trace.Insights.Models.ThirdParties;
15
15
 
16
16
  const {html} = Lit;
17
- const {widgetConfig} = UI.Widget;
17
+ const {widget} = UI.Widget;
18
18
 
19
19
  const MAX_TO_SHOW = 5;
20
20
 
@@ -79,13 +79,12 @@ export class ThirdParties extends BaseInsightComponent<ThirdPartiesInsightModel>
79
79
  // clang-format off
80
80
  sections.push(html`
81
81
  <div class="insight-section">
82
- <devtools-widget .widgetConfig=${widgetConfig(Table, {
82
+ ${widget(Table, {
83
83
  data: {
84
84
  insight: this,
85
85
  headers: [i18nString(UIStrings.columnThirdParty), i18nString(UIStrings.columnTransferSize)],
86
86
  rows,
87
- }})}>
88
- </devtools-widget>
87
+ }})}
89
88
  </div>
90
89
  `);
91
90
  // clang-format on
@@ -96,13 +95,12 @@ export class ThirdParties extends BaseInsightComponent<ThirdPartiesInsightModel>
96
95
  // clang-format off
97
96
  sections.push(html`
98
97
  <div class="insight-section">
99
- <devtools-widget .widgetConfig=${widgetConfig(Table, {
98
+ ${widget(Table, {
100
99
  data: {
101
100
  insight: this,
102
101
  headers: [i18nString(UIStrings.columnThirdParty), i18nString(UIStrings.columnMainThreadTime)],
103
102
  rows,
104
- }})}>
105
- </devtools-widget>
103
+ }})}
106
104
  </div>
107
105
  `);
108
106
  // clang-format on
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as BaseInsightComponent from './BaseInsightComponent.js';
6
6
  import * as Cache from './Cache.js';
7
+ import * as CharacterSet from './CharacterSet.js';
7
8
  import * as Checklist from './Checklist.js';
8
9
  import * as CLSCulprits from './CLSCulprits.js';
9
10
  import * as DocumentLatency from './DocumentLatency.js';
@@ -33,6 +34,7 @@ import * as Viewport from './Viewport.js';
33
34
  export {
34
35
  BaseInsightComponent,
35
36
  Cache,
37
+ CharacterSet,
36
38
  Checklist,
37
39
  CLSCulprits,
38
40
  DocumentLatency,
@@ -15,7 +15,7 @@ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
15
15
 
16
16
  import webAudioStyles from './webAudio.css.js';
17
17
  import {Events as ModelEvents, WebAudioModel} from './WebAudioModel.js';
18
- const {widgetConfig} = UI.Widget;
18
+ const {widget} = UI.Widget;
19
19
  const {bindToAction} = UI.UIUtils;
20
20
 
21
21
  const UIStrings = {
@@ -123,12 +123,11 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
123
123
  <div class="web-audio-content-container vbox flex-auto">
124
124
  ${!selectedContext ? html`
125
125
  <div class="web-audio-details-container vbox flex-auto">
126
- <devtools-widget .widgetConfig=${widgetConfig(UI.EmptyWidget.EmptyWidget,
126
+ ${widget(UI.EmptyWidget.EmptyWidget,
127
127
  {header: i18nString(UIStrings.noWebAudio),
128
128
  text: i18nString(UIStrings.openAPageThatUsesWebAudioApiTo),
129
129
  link: WEBAUDIO_EXPLANATION_URL,
130
- })}>
131
- </devtools-widget>
130
+ })}
132
131
  </div>` : html`<div class="web-audio-details-container vbox flex-auto">
133
132
  <div class="context-detail-container">
134
133
  <div class="context-detail-header">
@@ -85,6 +85,8 @@ export class SettingCheckbox extends HTMLElement {
85
85
  <devtools-button
86
86
  class="info-icon"
87
87
  aria-details=${id}
88
+ aria-disabled=true
89
+ accessibleLabel=${learnMore.tooltip()}
88
90
  .data=${data}
89
91
  ></devtools-button>
90
92
  <devtools-tooltip id=${id} variant="rich">
@@ -613,14 +613,14 @@ export const ifExpanded = Lit.Directive.directive(class extends Lit.Directive.Di
613
613
  #partInfo: {type: Lit.Directive.PartType, startNode: Node};
614
614
  constructor(partInfo: Lit.Directive.PartInfo) {
615
615
  if (partInfo.type !== Lit.Directive.PartType.CHILD) {
616
- throw new Error('expand directive must be used in a child node');
616
+ throw new Error('ifExpanded directive must be used in a child node');
617
617
  }
618
618
  super(partInfo);
619
619
  this.#partInfo = partInfo as {type: Lit.Directive.PartType, startNode: Node};
620
620
  }
621
621
 
622
- render(content: () => Lit.TemplateResult): Lit.LitTemplate {
623
- return this.#isInExpandedRow(this.#partInfo.startNode) ? content() : Lit.nothing;
622
+ render(content: Lit.LitTemplate|Iterable<Lit.LitTemplate>): Lit.LitTemplate|Iterable<Lit.LitTemplate> {
623
+ return this.#isInExpandedRow(this.#partInfo.startNode) ? content : Lit.nothing;
624
624
  }
625
625
 
626
626
  #isInExpandedRow(element: Node|null|undefined): boolean {
@@ -50,7 +50,7 @@ import objectPropertiesSectionStyles from './objectPropertiesSection.css.js';
50
50
  import objectValueStyles from './objectValue.css.js';
51
51
  import {RemoteObjectPreviewFormatter, renderNodeTitle} from './RemoteObjectPreviewFormatter.js';
52
52
 
53
- const {widgetConfig} = UI.Widget;
53
+ const {widget} = UI.Widget;
54
54
  const {ref, repeat, ifDefined, classMap} = Directives;
55
55
  const UIStrings = {
56
56
  /**
@@ -795,16 +795,13 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
795
795
  const text = JSON.stringify(description);
796
796
  const tooLong = description.length > maxRenderableStringLength;
797
797
  return html`<span class="value object-value-string" title=${ifDefined(tooLong ? undefined : description)}>${
798
- tooLong ? html`<devtools-widget .widgetConfig=${
799
- widgetConfig(ExpandableTextPropertyValue, {text})}></devtools-widget>` :
800
- text}</span>`;
798
+ tooLong ? widget(ExpandableTextPropertyValue, {text}) : text}</span>`;
801
799
  }
802
800
  if (type === 'object' && subtype === 'trustedtype') {
803
801
  const text = `${className} '${description}'`;
804
802
  const tooLong = text.length > maxRenderableStringLength;
805
803
  return html`<span class="value object-value-trustedtype" title=${ifDefined(tooLong ? undefined : text)}>${
806
- tooLong ? html`<devtools-widget .widgetConfig=${
807
- widgetConfig(ExpandableTextPropertyValue, {text})}></devtools-widget>` :
804
+ tooLong ? widget(ExpandableTextPropertyValue, {text}) :
808
805
  html`${className} <span class=object-value-string title=${description}>${
809
806
  JSON.stringify(description)}</span>`}</span>`;
810
807
  }
@@ -822,8 +819,11 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
822
819
  >${renderNodeTitle(description)}</span>`;
823
820
  }
824
821
  if (description.length > maxRenderableStringLength) {
825
- return html`<span class="value object-value-${subtype || type}" title=${description}><devtools-widget
826
- .widgetConfig=${widgetConfig(ExpandableTextPropertyValue, {text: description})}></devtools-widget></span>`;
822
+ // clang-format off
823
+ return html`<span class="value object-value-${subtype || type}" title=${description}>
824
+ ${widget(ExpandableTextPropertyValue, {text: description})}
825
+ </span>`;
826
+ // clang-format on
827
827
  }
828
828
  const hasPreview = value.preview && showPreview;
829
829
  return html`<span class="value object-value-${subtype || type}" title=${description}>${
@@ -13,7 +13,6 @@ let veDebuggingEnabled = false;
13
13
  let debugOverlay: HTMLElement|null = null;
14
14
  let debugPopover: HTMLElement|null = null;
15
15
  const highlightedElements: HTMLElement[] = [];
16
- const nonDomDebugElements = new WeakMap<Loggable, HTMLElement>();
17
16
  let onInspect: ((query: string) => void)|undefined = undefined;
18
17
 
19
18
  function ensureDebugOverlay(): void {
@@ -96,8 +95,6 @@ export function processForDebugging(loggable: Loggable): void {
96
95
  }
97
96
  if (loggable instanceof HTMLElement) {
98
97
  processElementForDebugging(loggable, loggingState);
99
- } else {
100
- processNonDomLoggableForDebugging(loggable, loggingState);
101
98
  }
102
99
  }
103
100
 
@@ -409,35 +406,6 @@ function processImpressionsForAdHocAnalysisDebugLog(states: LoggingState[]): voi
409
406
  }
410
407
  }
411
408
 
412
- function processNonDomLoggableForDebugging(loggable: Loggable, loggingState: LoggingState): void {
413
- let debugElement = nonDomDebugElements.get(loggable);
414
- if (!debugElement) {
415
- debugElement = document.createElement('div');
416
- debugElement.classList.add('ve-debug');
417
- debugElement.style.background = 'black';
418
- debugElement.style.color = 'white';
419
- debugElement.style.zIndex = '100000';
420
- debugElement.textContent = debugString(loggingState.config);
421
- nonDomDebugElements.set(loggable, debugElement);
422
- setTimeout(() => {
423
- if (!loggingState.size?.width || !loggingState.size?.height) {
424
- debugElement?.parentElement?.removeChild(debugElement);
425
- nonDomDebugElements.delete(loggable);
426
- }
427
- }, 10000);
428
- }
429
- const parentDebugElement =
430
- parent instanceof HTMLElement ? parent : nonDomDebugElements.get(parent as Loggable) || debugPopover;
431
- assertNotNullOrUndefined(parentDebugElement);
432
- if (!parentDebugElement.classList.contains('ve-debug')) {
433
- debugElement.style.position = 'absolute';
434
- parentDebugElement.insertBefore(debugElement, parentDebugElement.firstChild);
435
- } else {
436
- debugElement.style.marginLeft = '10px';
437
- parentDebugElement.appendChild(debugElement);
438
- }
439
- }
440
-
441
409
  function elementKey(config: LoggingConfig): string {
442
410
  return `${VisualElements[config.ve]}${config.context ? `: ${config.context}` : ''}`;
443
411
  }
@@ -4050,6 +4050,7 @@ export const knownContextValues = new Set([
4050
4050
  'timeline.insight-ask-ai.viewport',
4051
4051
  'timeline.insights-tab',
4052
4052
  'timeline.insights.cache',
4053
+ 'timeline.insights.character-set',
4053
4054
  'timeline.insights.cls-culprits',
4054
4055
  'timeline.insights.dismiss-field-mismatch',
4055
4056
  'timeline.insights.document-latency',
@@ -4124,6 +4125,7 @@ export const knownContextValues = new Set([
4124
4125
  'timeline.thread.worker',
4125
4126
  'timeline.timings',
4126
4127
  'timeline.toggle-insight.cache',
4128
+ 'timeline.toggle-insight.character-set',
4127
4129
  'timeline.toggle-insight.cls-culprits',
4128
4130
  'timeline.toggle-insight.document-latency',
4129
4131
  'timeline.toggle-insight.dom-size',
package/package.json CHANGED
@@ -105,5 +105,5 @@
105
105
  "flat-cache": "6.1.12"
106
106
  }
107
107
  },
108
- "version": "1.0.1597448"
108
+ "version": "1.0.1597624"
109
109
  }