chrome-devtools-frontend 1.0.1592362 → 1.0.1593959

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 (143) hide show
  1. package/docs/contributing/settings-experiments-features.md +75 -100
  2. package/front_end/Images/src/tab-move.svg +1 -0
  3. package/front_end/application_tokens.css +4 -4
  4. package/front_end/core/host/UserMetrics.ts +1 -2
  5. package/front_end/core/root/ExperimentNames.ts +0 -1
  6. package/front_end/entrypoints/main/MainImpl.ts +0 -6
  7. package/front_end/generated/InspectorBackendCommands.ts +8 -5
  8. package/front_end/generated/SupportedCSSProperties.js +2 -2
  9. package/front_end/generated/protocol-mapping.d.ts +14 -0
  10. package/front_end/generated/protocol-proxy-api.d.ts +10 -0
  11. package/front_end/generated/protocol.ts +106 -0
  12. package/front_end/models/ai_assistance/agents/AiAgent.ts +24 -1
  13. package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +26 -86
  14. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +14 -4
  15. package/front_end/models/ai_assistance/agents/StylingAgent.ts +16 -2
  16. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +1 -0
  17. package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
  18. package/front_end/models/issues_manager/IssuesManager.ts +0 -5
  19. package/front_end/models/issues_manager/issues_manager.ts +0 -4
  20. package/front_end/models/javascript_metadata/NativeFunctions.js +10 -6
  21. package/front_end/models/lighthouse/lighthouse.ts +9 -0
  22. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +5 -3
  23. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +29 -6
  24. package/front_end/panels/ai_assistance/README.md +61 -0
  25. package/front_end/panels/ai_assistance/components/ChatMessage.ts +141 -27
  26. package/front_end/panels/ai_assistance/components/ChatView.ts +5 -1
  27. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +19 -7
  28. package/front_end/panels/ai_assistance/components/chatMessage.css +30 -0
  29. package/front_end/panels/ai_assistance/components/walkthroughView.css +12 -7
  30. package/front_end/panels/animation/AnimationGroupPreviewUI.ts +1 -1
  31. package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +1 -0
  32. package/front_end/panels/application/components/BackForwardCacheView.ts +4 -2
  33. package/front_end/panels/autofill/AutofillView.ts +1 -1
  34. package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +161 -154
  35. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +1 -0
  36. package/front_end/panels/browser_debugger/domBreakpointsSidebarPane.css +58 -36
  37. package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +3 -0
  38. package/front_end/panels/common/AiCodeGenerationTeaser.ts +3 -0
  39. package/front_end/panels/console/ConsoleViewMessage.ts +1 -0
  40. package/front_end/panels/console/consoleView.css +7 -2
  41. package/front_end/panels/elements/ComputedStyleWidget.ts +5 -1
  42. package/front_end/panels/elements/ElementsTreeElement.ts +1 -0
  43. package/front_end/panels/elements/LayoutPane.ts +8 -7
  44. package/front_end/panels/elements/StandaloneStylesContainer.ts +254 -0
  45. package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -6
  46. package/front_end/panels/elements/StylesSidebarPane.ts +79 -0
  47. package/front_end/panels/elements/components/ComputedStyleTrace.ts +4 -0
  48. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  49. package/front_end/panels/elements/components/StylePropertyEditor.ts +2 -1
  50. package/front_end/panels/elements/components/computedStyleProperty.css +1 -1
  51. package/front_end/panels/elements/elements.ts +2 -0
  52. package/front_end/panels/emulation/DeviceModeToolbar.ts +181 -66
  53. package/front_end/panels/issues/HiddenIssuesRow.ts +1 -1
  54. package/front_end/panels/issues/IssueKindView.ts +2 -1
  55. package/front_end/panels/issues/IssueView.ts +2 -4
  56. package/front_end/panels/issues/IssuesPane.ts +2 -2
  57. package/front_end/panels/lighthouse/LighthouseController.ts +3 -3
  58. package/front_end/panels/lighthouse/LighthousePanel.ts +9 -5
  59. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +5 -5
  60. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +7 -8
  61. package/front_end/panels/lighthouse/LighthouseReportSelector.ts +4 -3
  62. package/front_end/panels/lighthouse/lighthouse.ts +0 -2
  63. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
  64. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
  65. package/front_end/panels/media/PlayerListView.ts +1 -1
  66. package/front_end/panels/network/NetworkLogViewColumns.ts +2 -1
  67. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -1
  68. package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
  69. package/front_end/panels/recorder/components/RecordingListView.ts +1 -1
  70. package/front_end/panels/recorder/components/StepEditor.ts +3 -3
  71. package/front_end/panels/settings/KeybindsSettingsTab.ts +2 -1
  72. package/front_end/panels/sources/components/HeadersView.ts +2 -2
  73. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +1 -1
  74. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +1 -1
  75. package/front_end/third_party/chromium/README.chromium +1 -1
  76. package/front_end/third_party/puppeteer/README.chromium +2 -2
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Navigation.d.ts.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Navigation.js +1 -0
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Navigation.js.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +1 -1
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +1 -0
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  94. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +6 -6
  95. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Navigation.d.ts.map +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Navigation.js +1 -0
  97. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Navigation.js.map +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +1 -1
  99. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +1 -1
  101. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +1 -0
  104. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  106. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  107. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  110. package/front_end/third_party/puppeteer/package/package.json +4 -4
  111. package/front_end/third_party/puppeteer/package/src/bidi/core/Navigation.ts +1 -0
  112. package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +1 -1
  113. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +1 -1
  114. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +1 -0
  115. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  116. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  117. package/front_end/third_party/source-map-scopes-codec/package/deno.json +1 -1
  118. package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
  119. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +1 -1
  120. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +1 -1
  121. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +1 -1
  122. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +1 -1
  123. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +1 -1
  124. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +2 -2
  125. package/front_end/ui/components/suggestion_input/SuggestionInput.ts +7 -12
  126. package/front_end/ui/components/tree_outline/TreeOutline.ts +6 -2
  127. package/front_end/ui/components/tree_outline/treeOutline.css +5 -0
  128. package/front_end/ui/legacy/ListControl.ts +5 -3
  129. package/front_end/ui/legacy/ListWidget.ts +1 -1
  130. package/front_end/ui/legacy/SoftContextMenu.ts +2 -1
  131. package/front_end/ui/legacy/SuggestBox.ts +4 -0
  132. package/front_end/ui/legacy/TextPrompt.ts +1 -1
  133. package/front_end/ui/legacy/Treeoutline.ts +1 -0
  134. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +4 -2
  135. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -1
  136. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +31 -0
  137. package/front_end/ui/visual_logging/KnownContextValues.ts +16 -0
  138. package/inspector_overlay/highlight_grid_common.ts +11 -8
  139. package/package.json +1 -1
  140. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +0 -78
  141. package/front_end/models/issues_manager/LowTextContrastIssue.ts +0 -63
  142. package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +0 -91
  143. /package/front_end/{panels → models}/lighthouse/LighthouseReporterTypes.ts +0 -0
@@ -475,7 +475,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
475
475
  aria-level=${depth + 1}
476
476
  aria-posinset=${positionInSet + 1}
477
477
  class=${listItemClasses}
478
- jslog=${VisualLogging.treeItem(node.jslogContext).track({click: true, keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Enter|Space|Home|End'})}
478
+ jslog=${VisualLogging.treeItem(node.jslogContext).track({click: true, resize: true, keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Enter|Space|Home|End'})}
479
479
  @click=${this.#onNodeClick}
480
480
  track-dom-node-to-tree-node=${trackDOMNodeToTreeNode(this.#domNodeToTreeNodeMap, node)}
481
481
  ${Lit.Directives.ref(domNode => {
@@ -523,6 +523,10 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
523
523
 
524
524
  this.#scheduledRender = true;
525
525
 
526
+ const hasChildrenInTree = this.#treeData.some(topLevelNode => isExpandableNode(topLevelNode));
527
+
528
+ const ulClasses = Lit.Directives.classMap({hasNoChildren: !hasChildrenInTree});
529
+
526
530
  await RenderCoordinator.write('TreeOutline render', () => {
527
531
  // Disabled until https://crbug.com/1079231 is fixed.
528
532
  // clang-format off
@@ -539,7 +543,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
539
543
  <style>${treeOutlineStyles}</style>
540
544
  <style>${CodeHighlighter.codeHighlighterStyles}</style>
541
545
  <div class="wrapping-container">
542
- <ul role="tree" @keydown=${this.#onTreeKeyDown}>
546
+ <ul role="tree" @keydown=${this.#onTreeKeyDown} class=${ulClasses}>
543
547
  ${this.#treeData.map((topLevelNode, index) => {
544
548
  return this.#renderNode(topLevelNode, {
545
549
  depth: 0,
@@ -45,6 +45,11 @@ li {
45
45
  flex: none;
46
46
  }
47
47
 
48
+ /* If the entire list has no children, we don't need to reserve space for the expandable icon */
49
+ ul.hasNoChildren .arrow-icon {
50
+ display: none;
51
+ }
52
+
48
53
  ul {
49
54
  margin: 0;
50
55
  padding: 0;
@@ -389,9 +389,11 @@ export class ListControl<T> {
389
389
  if (!element) {
390
390
  element = this.delegate.createElementForItem(item);
391
391
  if (!element.hasAttribute('jslog')) {
392
- element.setAttribute(
393
- 'jslog',
394
- `${VisualLogging.item().track({click: true, keydown: 'ArrowUp|ArrowDown|PageUp|PageDown|Home|End'})}`);
392
+ element.setAttribute('jslog', `${VisualLogging.item().track({
393
+ click: true,
394
+ resize: true,
395
+ keydown: 'ArrowUp|ArrowDown|PageUp|PageDown|Home|End'
396
+ })}`);
395
397
  }
396
398
  this.itemToElement.set(item, element);
397
399
  this.updateElementARIA(element, index);
@@ -150,7 +150,7 @@ export class ListWidget<T> extends VBox {
150
150
  }
151
151
  const content = this.delegate.renderItem(item, editable, this.#items.length - 1);
152
152
  if (!content.hasAttribute('jslog')) {
153
- element.setAttribute('jslog', `${VisualLogging.item()}`);
153
+ element.setAttribute('jslog', `${VisualLogging.item().track({resize: true})}`);
154
154
  }
155
155
  element.appendChild(content);
156
156
  if (editable) {
@@ -325,7 +325,8 @@ export class SoftContextMenu {
325
325
  menuItemElement.addEventListener('mouseleave', (this.menuItemMouseLeave.bind(this) as EventListener), false);
326
326
 
327
327
  if (item.jslogContext) {
328
- menuItemElement.setAttribute('jslog', `${VisualLogging.item().context(item.jslogContext)}`);
328
+ menuItemElement.setAttribute(
329
+ 'jslog', `${VisualLogging.item(item.jslogContext).track({click: true, resize: true})}`);
329
330
  }
330
331
  return menuItemElement;
331
332
  }
@@ -87,6 +87,10 @@ export class SuggestBox implements ListDelegate<Suggestion> {
87
87
  return this.glassPane.isShowing();
88
88
  }
89
89
 
90
+ completion(): Suggestion|null {
91
+ return this.list.selectedItem();
92
+ }
93
+
90
94
  setPosition(anchorBox: AnchorBox): void {
91
95
  this.glassPane.setContentAnchorBox(anchorBox);
92
96
  }
@@ -272,7 +272,7 @@ export class TextPrompt extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
272
272
  private boundClearAutocomplete?: (() => void);
273
273
  private boundOnBlur?: ((ev: Event) => void);
274
274
  private contentElement?: HTMLElement;
275
- private suggestBox?: SuggestBox;
275
+ protected suggestBox?: SuggestBox;
276
276
  private isEditing?: boolean;
277
277
  private focusRestorer?: ElementFocusRestorer;
278
278
  private blurListener?: ((arg0: Event) => void);
@@ -499,6 +499,7 @@ export class TreeElement {
499
499
  this.listItemNode.setAttribute(
500
500
  'jslog', `${VisualLogging.treeItem().parent('parentTreeItem').context(jslogContext).track({
501
501
  click: true,
502
+ resize: true,
502
503
  keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Backspace|Delete|Enter|Space|Home|End',
503
504
  })}`);
504
505
  ARIAUtils.markAsTreeitem(this.listItemNode);
@@ -1766,8 +1766,10 @@ export class DataGridNode<T> {
1766
1766
 
1767
1767
  protected createElement(): HTMLElement {
1768
1768
  this.elementInternal = document.createElement('tr');
1769
- this.elementInternal.setAttribute(
1770
- 'jslog', `${VisualLogging.tableRow().track({keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Enter|Space'})}`);
1769
+ this.elementInternal.setAttribute('jslog', `${VisualLogging.tableRow().track({
1770
+ resize: true,
1771
+ keydown: 'ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Enter|Space'
1772
+ })}`);
1771
1773
  this.elementInternal.classList.add('data-grid-data-grid-node');
1772
1774
  if (this.dataGrid) {
1773
1775
  this.dataGrid.elementToDataGridNode.set(this.elementInternal, this);
@@ -280,7 +280,7 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
280
280
  if (this.provider) {
281
281
  render(this.provider.renderItem(item, this.cleanValue()), wrapperElement);
282
282
  wrapperElement.setAttribute(
283
- 'jslog', `${VisualLogging.item(this.provider.jslogContextAt(item)).track({click: true})}`);
283
+ 'jslog', `${VisualLogging.item(this.provider.jslogContextAt(item)).track({click: true, resize: true})}`);
284
284
  }
285
285
  UI.ARIAUtils.markAsOption(wrapperElement);
286
286
  return wrapperElement;
@@ -34,6 +34,7 @@
34
34
  */
35
35
 
36
36
  import * as i18n from '../../../../core/i18n/i18n.js';
37
+ import * as Root from '../../../../core/root/root.js';
37
38
  import * as SDK from '../../../../core/sdk/sdk.js';
38
39
  import * as StackTrace from '../../../../models/stack_trace/stack_trace.js';
39
40
  import * as Workspace from '../../../../models/workspace/workspace.js';
@@ -242,6 +243,36 @@ export class StackTracePreviewContent extends UI.Widget.Widget {
242
243
  onShowLess: this.#onShowMoreLess.bind(this, false),
243
244
  };
244
245
  this.#view(input, {}, this.contentElement);
246
+ this.#updateHasNonIgnoredLinks();
247
+ }
248
+
249
+ // Propagate ignore-list state to the host element so that CSS outside the
250
+ // shadow DOM can coordinate ignore-list toggling across multiple stack
251
+ // traces (e.g. Error inline stack + console.error call stack).
252
+ // See crbug.com/379788109.
253
+ #updateHasNonIgnoredLinks = (): void => {
254
+ const hasNonIgnoredLinks = this.linkElements.some(link => {
255
+ const uiLocation = Linkifier.uiLocation(link);
256
+ if (uiLocation) {
257
+ return !uiLocation.isIgnoreListed();
258
+ }
259
+ return !link.classList.contains('ignore-list-link');
260
+ });
261
+ this.element.classList.toggle('has-non-ignored-links', hasNonIgnoredLinks);
262
+ };
263
+
264
+ override wasShown(): void {
265
+ super.wasShown();
266
+ if (Root.DevToolsContext.globalInstance().has(Workspace.IgnoreListManager.IgnoreListManager)) {
267
+ Workspace.IgnoreListManager.IgnoreListManager.instance().addChangeListener(this.#updateHasNonIgnoredLinks);
268
+ }
269
+ }
270
+
271
+ override willHide(): void {
272
+ if (Root.DevToolsContext.globalInstance().has(Workspace.IgnoreListManager.IgnoreListManager)) {
273
+ Workspace.IgnoreListManager.IgnoreListManager.instance().removeChangeListener(this.#updateHasNonIgnoredLinks);
274
+ }
275
+ super.willHide();
245
276
  }
246
277
 
247
278
  get linkElements(): readonly HTMLElement[] {
@@ -492,6 +492,7 @@ export const knownContextValues = new Set([
492
492
  'attribute',
493
493
  'attribute-modified',
494
494
  'attributes',
495
+ 'attribution-reporting',
495
496
  'attribution-reporting-details',
496
497
  'auction-worklet',
497
498
  'audio-context',
@@ -679,6 +680,7 @@ export const knownContextValues = new Set([
679
680
  'break-before',
680
681
  'break-inside',
681
682
  'break-on',
683
+ 'breaking-change',
682
684
  'breakpoint',
683
685
  'breakpoint-group',
684
686
  'breakpoint-tooltip',
@@ -928,6 +930,7 @@ export const knownContextValues = new Set([
928
930
  'content-encoding',
929
931
  'content-length',
930
932
  'content-policy',
933
+ 'content-security-policy',
931
934
  'content-type',
932
935
  'content-visibility',
933
936
  'context',
@@ -963,6 +966,7 @@ export const knownContextValues = new Set([
963
966
  'converter-puppeteer',
964
967
  'converter-puppeteer-firefox',
965
968
  'converter-puppeteer-replay',
969
+ 'cookie',
966
970
  'cookie-control-override-enabled',
967
971
  'cookie-flag-controls',
968
972
  'cookie-preview',
@@ -1054,6 +1058,7 @@ export const knownContextValues = new Set([
1054
1058
  'corner-top-right-shape',
1055
1059
  'corner-top-shape',
1056
1060
  'corners',
1061
+ 'cors',
1057
1062
  'cors-details',
1058
1063
  'count',
1059
1064
  'count-delta',
@@ -1087,6 +1092,7 @@ export const knownContextValues = new Set([
1087
1092
  'credential-id',
1088
1093
  'credentialId',
1089
1094
  'critical',
1095
+ 'cross-origin-embedder-policy',
1090
1096
  'cs',
1091
1097
  'css',
1092
1098
  'css-angle',
@@ -1777,6 +1783,7 @@ export const knownContextValues = new Set([
1777
1783
  'gen-ai-settings-panel',
1778
1784
  'general',
1779
1785
  'generative-ai-terms-of-service',
1786
+ 'generic',
1780
1787
  'generic-details',
1781
1788
  'geolocation',
1782
1789
  'geolocation.get-current-position',
@@ -1863,6 +1870,7 @@ export const knownContextValues = new Set([
1863
1870
  'heap-snapshot.retaining-paths-view',
1864
1871
  'heap-tracking-overview',
1865
1872
  'heavy',
1873
+ 'heavy-ad',
1866
1874
  'heavy-ad-details',
1867
1875
  'height',
1868
1876
  'help',
@@ -1875,6 +1883,7 @@ export const knownContextValues = new Set([
1875
1883
  'heuristic-mitigation-disabled',
1876
1884
  'hex',
1877
1885
  'hi',
1886
+ 'hidden-issues',
1878
1887
  'hide-all-others',
1879
1888
  'hide-children',
1880
1889
  'hide-data-urls',
@@ -1933,6 +1942,7 @@ export const knownContextValues = new Set([
1933
1942
  'import-har',
1934
1943
  'import-recording',
1935
1944
  'important',
1945
+ 'improvement',
1936
1946
  'in-range',
1937
1947
  'increase-priority',
1938
1948
  'indeterminate',
@@ -2504,6 +2514,7 @@ export const knownContextValues = new Set([
2504
2514
  'lostpointercapture',
2505
2515
  'low-contrast-details',
2506
2516
  'low-end-mobile',
2517
+ 'low-text-contrast',
2507
2518
  'lt',
2508
2519
  'lv',
2509
2520
  'macos',
@@ -2631,6 +2642,7 @@ export const knownContextValues = new Set([
2631
2642
  'min-width',
2632
2643
  'missing-debug-info',
2633
2644
  'mix-blend-mode',
2645
+ 'mixed-content',
2634
2646
  'mixed-content-details',
2635
2647
  'mk',
2636
2648
  'ml',
@@ -2898,6 +2910,7 @@ export const knownContextValues = new Set([
2898
2910
  'page-break-after',
2899
2911
  'page-break-before',
2900
2912
  'page-break-inside',
2913
+ 'page-error',
2901
2914
  'page-margin-safety',
2902
2915
  'page-orientation',
2903
2916
  'paint-order',
@@ -2946,6 +2959,7 @@ export const knownContextValues = new Set([
2946
2959
  'performance.sidebar-toggle',
2947
2960
  'periodic-background-sync',
2948
2961
  'periodic-sync-tag',
2962
+ 'permission-element',
2949
2963
  'permission-element-elements',
2950
2964
  'persist-flame-config',
2951
2965
  'persistence-automatic-workspace-folders',
@@ -3089,6 +3103,7 @@ export const knownContextValues = new Set([
3089
3103
  'quick-open.show',
3090
3104
  'quick-open.show-command-menu',
3091
3105
  'quickOpen.show',
3106
+ 'quirks-mode',
3092
3107
  'quota-override',
3093
3108
  'quotes',
3094
3109
  'r',
@@ -3721,6 +3736,7 @@ export const knownContextValues = new Set([
3721
3736
  'srgb',
3722
3737
  'stack-trace',
3723
3738
  'stalled',
3739
+ 'standalone-styles',
3724
3740
  'standard-emulated-device-list',
3725
3741
  'start',
3726
3742
  'start-conversation-drjones-file',
@@ -2,7 +2,7 @@
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 type {AreaBounds, Bounds} from './common.js';
5
+ import type {AreaBounds, Bounds, Position} from './common.js';
6
6
  import {drawGridLabels, type GridLabelState, isHorizontalWritingMode} from './css_grid_label_helpers.js';
7
7
  import {applyMatrixToPoint, buildPath, emptyBounds, hatchFillPath} from './highlight_common.js';
8
8
 
@@ -188,6 +188,7 @@ export const gridStyle = `
188
188
  export interface GridHighlight {
189
189
  gridBorder: Array<string|number>;
190
190
  writingMode: string;
191
+ writingModeRoot?: Position;
191
192
  rowGaps: Array<string|number>;
192
193
  rotationAngle: number;
193
194
  columnGaps: Array<string|number>;
@@ -222,7 +223,7 @@ export function drawLayoutGridHighlight(
222
223
 
223
224
  // Transform the context to match the current writing-mode.
224
225
  context.save();
225
- applyWritingModeTransformation(highlight.writingMode, gridBounds, context);
226
+ applyWritingModeTransformation(highlight.writingMode, gridBounds, context, highlight.writingModeRoot);
226
227
 
227
228
  // Draw grid background
228
229
  if (highlight.gridHighlightConfig.gridBackgroundColor) {
@@ -285,7 +286,8 @@ export function drawLayoutGridHighlight(
285
286
  writingModeMatrix);
286
287
  }
287
288
 
288
- function applyWritingModeTransformation(writingMode: string, gridBounds: Bounds, context: CanvasRenderingContext2D) {
289
+ function applyWritingModeTransformation(
290
+ writingMode: string, gridBounds: Bounds, context: CanvasRenderingContext2D, writingModeRoot?: Position) {
289
291
  if (isHorizontalWritingMode(writingMode)) {
290
292
  return;
291
293
  }
@@ -293,13 +295,14 @@ function applyWritingModeTransformation(writingMode: string, gridBounds: Bounds,
293
295
  const topLeft = gridBounds.allPoints[0];
294
296
  const topRight = gridBounds.allPoints[1];
295
297
  const bottomLeft = gridBounds.allPoints[3];
298
+ const origin = writingModeRoot ?? topLeft;
296
299
 
297
- // Move to the top-left corner to do all transformations there.
298
- context.translate(topLeft.x, topLeft.y);
300
+ // Move to the origin corner to do all transformations there.
301
+ context.translate(origin.x, origin.y);
299
302
 
300
303
  if (writingMode === 'vertical-rl' || writingMode === 'sideways-rl') {
301
304
  context.rotate(90 * Math.PI / 180);
302
- context.translate(0, -1 * (bottomLeft.y - topLeft.y));
305
+ context.translate(0, -(bottomLeft.y - topLeft.y));
303
306
  }
304
307
 
305
308
  if (writingMode === 'vertical-lr') {
@@ -309,11 +312,11 @@ function applyWritingModeTransformation(writingMode: string, gridBounds: Bounds,
309
312
 
310
313
  if (writingMode === 'sideways-lr') {
311
314
  context.rotate(-90 * Math.PI / 180);
312
- context.translate(-1 * (topRight.x - topLeft.x), 0);
315
+ context.translate(-(topRight.x - topLeft.x), 0);
313
316
  }
314
317
 
315
318
  // Move back to the original point.
316
- context.translate(topLeft.x * -1, topLeft.y * -1);
319
+ context.translate(-origin.x, -origin.y);
317
320
  }
318
321
 
319
322
  function drawGridLines(
package/package.json CHANGED
@@ -105,5 +105,5 @@
105
105
  "flat-cache": "6.1.12"
106
106
  }
107
107
  },
108
- "version": "1.0.1592362"
108
+ "version": "1.0.1593959"
109
109
  }
@@ -1,78 +0,0 @@
1
- // Copyright 2021 The Chromium Authors
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 * as Common from '../../core/common/common.js';
6
- import * as Root from '../../core/root/root.js';
7
- import * as SDK from '../../core/sdk/sdk.js';
8
-
9
- let contrastCheckTriggerInstance: ContrastCheckTrigger|null = null;
10
-
11
- export class ContrastCheckTrigger {
12
- #pageLoadListeners = new WeakMap<SDK.ResourceTreeModel.ResourceTreeModel, Common.EventTarget.EventDescriptor>();
13
- #frameAddedListeners = new WeakMap<SDK.ResourceTreeModel.ResourceTreeModel, Common.EventTarget.EventDescriptor>();
14
-
15
- constructor() {
16
- SDK.TargetManager.TargetManager.instance().observeModels(SDK.ResourceTreeModel.ResourceTreeModel, this);
17
- }
18
-
19
- static instance({forceNew}: {forceNew: boolean} = {forceNew: false}): ContrastCheckTrigger {
20
- if (!contrastCheckTriggerInstance || forceNew) {
21
- contrastCheckTriggerInstance = new ContrastCheckTrigger();
22
- }
23
-
24
- return contrastCheckTriggerInstance;
25
- }
26
-
27
- async modelAdded(resourceTreeModel: SDK.ResourceTreeModel.ResourceTreeModel): Promise<void> {
28
- this.#pageLoadListeners.set(
29
- resourceTreeModel,
30
- resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.Load, this.#pageLoaded, this));
31
- this.#frameAddedListeners.set(
32
- resourceTreeModel,
33
- resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameAdded, this.#frameAdded, this));
34
- }
35
-
36
- modelRemoved(resourceTreeModel: SDK.ResourceTreeModel.ResourceTreeModel): void {
37
- const pageLoadListener = this.#pageLoadListeners.get(resourceTreeModel);
38
- if (pageLoadListener) {
39
- Common.EventTarget.removeEventListeners([pageLoadListener]);
40
- }
41
- const frameAddedListeners = this.#frameAddedListeners.get(resourceTreeModel);
42
- if (frameAddedListeners) {
43
- Common.EventTarget.removeEventListeners([frameAddedListeners]);
44
- }
45
- }
46
-
47
- #checkContrast(resourceTreeModel: SDK.ResourceTreeModel.ResourceTreeModel): void {
48
- if (!Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.CONTRAST_ISSUES)) {
49
- return;
50
- }
51
- void resourceTreeModel.target().auditsAgent().invoke_checkContrast({});
52
- }
53
-
54
- #pageLoaded(event: Common.EventTarget
55
- .EventTargetEvent<{resourceTreeModel: SDK.ResourceTreeModel.ResourceTreeModel, loadTime: number}>):
56
- void {
57
- const {resourceTreeModel} = event.data;
58
- this.#checkContrast(resourceTreeModel);
59
- }
60
-
61
- async #frameAdded(event: Common.EventTarget.EventTargetEvent<SDK.ResourceTreeModel.ResourceTreeFrame>):
62
- Promise<void> {
63
- if (!Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.CONTRAST_ISSUES)) {
64
- return;
65
- }
66
- const frame = event.data;
67
- if (!frame.isMainFrame()) {
68
- return;
69
- }
70
- // If the target document finished loading, check the contrast immediately.
71
- // Otherwise, it should be triggered when the page load event fires.
72
- const response = await frame.resourceTreeModel().target().runtimeAgent().invoke_evaluate(
73
- {expression: 'document.readyState', returnByValue: true});
74
- if (response.result?.value === 'complete') {
75
- this.#checkContrast(frame.resourceTreeModel());
76
- }
77
- }
78
- }
@@ -1,63 +0,0 @@
1
- // Copyright 2020 The Chromium Authors
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 * as i18n from '../../core/i18n/i18n.js';
6
- import type * as SDK from '../../core/sdk/sdk.js';
7
- import type * as Protocol from '../../generated/protocol.js';
8
-
9
- import {Issue, IssueCategory, IssueKind} from './Issue.js';
10
- import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
11
-
12
- const UIStrings = {
13
- /**
14
- * @description Link title for the Low Text Contrast issue in the Issues panel
15
- */
16
- colorAndContrastAccessibility: 'Color and contrast accessibility',
17
- } as const;
18
- const str_ = i18n.i18n.registerUIStrings('models/issues_manager/LowTextContrastIssue.ts', UIStrings);
19
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
20
-
21
- export class LowTextContrastIssue extends Issue<Protocol.Audits.LowTextContrastIssueDetails> {
22
- constructor(
23
- issueDetails: Protocol.Audits.LowTextContrastIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel|null) {
24
- super('LowTextContrastIssue', issueDetails, issuesModel);
25
- }
26
-
27
- primaryKey(): string {
28
- // We intend to keep only one issue per element so other issues for the element will be discarded even
29
- // if the issue content is slightly different.
30
- return `${this.code()}-(${this.details().violatingNodeId})`;
31
- }
32
-
33
- getCategory(): IssueCategory {
34
- return IssueCategory.LOW_TEXT_CONTRAST;
35
- }
36
-
37
- getDescription(): MarkdownIssueDescription {
38
- return {
39
- file: 'LowTextContrast.md',
40
- links: [
41
- {
42
- link: 'https://web.dev/color-and-contrast-accessibility/',
43
- linkTitle: i18nString(UIStrings.colorAndContrastAccessibility),
44
- },
45
- ],
46
- };
47
- }
48
-
49
- getKind(): IssueKind {
50
- return IssueKind.IMPROVEMENT;
51
- }
52
-
53
- static fromInspectorIssue(
54
- issuesModel: SDK.IssuesModel.IssuesModel|null,
55
- inspectorIssue: Protocol.Audits.InspectorIssue): LowTextContrastIssue[] {
56
- const lowTextContrastIssueDetails = inspectorIssue.details.lowTextContrastIssueDetails;
57
- if (!lowTextContrastIssueDetails) {
58
- console.warn('LowTextContrast issue without details received.');
59
- return [];
60
- }
61
- return [new LowTextContrastIssue(lowTextContrastIssueDetails, issuesModel)];
62
- }
63
- }
@@ -1,91 +0,0 @@
1
- // Copyright 2021 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- /* eslint-disable @devtools/no-imperative-dom-api */
5
-
6
- import * as i18n from '../../core/i18n/i18n.js';
7
- import * as Platform from '../../core/platform/platform.js';
8
- import type * as IssuesManager from '../../models/issues_manager/issues_manager.js';
9
-
10
- import {AffectedElementsView} from './AffectedElementsView.js';
11
-
12
- export class AffectedElementsWithLowContrastView extends AffectedElementsView {
13
- #runningUpdatePromise: Promise<void> = Promise.resolve();
14
-
15
- override update(): void {
16
- // Ensure that doUpdate is invoked atomically by serializing the update calls
17
- // because it's not re-entrace safe.
18
- this.#runningUpdatePromise = this.#runningUpdatePromise.then(this.#doUpdate.bind(this));
19
- }
20
-
21
- async #doUpdate(): Promise<void> {
22
- this.clear();
23
- await this.#appendLowContrastElements(this.issue.getLowContrastIssues());
24
- }
25
-
26
- async #appendLowContrastElement(issue: IssuesManager.LowTextContrastIssue.LowTextContrastIssue): Promise<void> {
27
- const row = document.createElement('tr');
28
- row.classList.add('affected-resource-low-contrast');
29
-
30
- const details = issue.details();
31
- const target = issue.model()?.target() || null;
32
- row.appendChild(await this.createElementCell(
33
- {nodeName: details.violatingNodeSelector, backendNodeId: details.violatingNodeId, target},
34
- issue.getCategory()));
35
- this.appendIssueDetailCell(row, String(Platform.NumberUtilities.floor(details.contrastRatio, 2)));
36
- this.appendIssueDetailCell(row, String(details.thresholdAA));
37
- this.appendIssueDetailCell(row, String(details.thresholdAAA));
38
- this.appendIssueDetailCell(row, details.fontSize);
39
- this.appendIssueDetailCell(row, details.fontWeight);
40
-
41
- this.affectedResources.appendChild(row);
42
- }
43
-
44
- async #appendLowContrastElements(issues: Iterable<IssuesManager.LowTextContrastIssue.LowTextContrastIssue>):
45
- Promise<void> {
46
- const header = document.createElement('tr');
47
- this.appendColumnTitle(header, i18nString(UIStrings.element));
48
- this.appendColumnTitle(header, i18nString(UIStrings.contrastRatio));
49
- this.appendColumnTitle(header, i18nString(UIStrings.minimumAA));
50
- this.appendColumnTitle(header, i18nString(UIStrings.minimumAAA));
51
- this.appendColumnTitle(header, i18nString(UIStrings.textSize));
52
- this.appendColumnTitle(header, i18nString(UIStrings.textWeight));
53
-
54
- this.affectedResources.appendChild(header);
55
- let count = 0;
56
- for (const lowContrastIssue of issues) {
57
- count++;
58
- await this.#appendLowContrastElement(lowContrastIssue);
59
- }
60
- this.updateAffectedResourceCount(count);
61
- }
62
- }
63
-
64
- const UIStrings = {
65
- /**
66
- * @description Column title for the element column in the low contrast issue view
67
- */
68
- element: 'Element',
69
- /**
70
- * @description Column title for the contrast ratio column in the low contrast issue view
71
- */
72
- contrastRatio: 'Contrast ratio',
73
- /**
74
- * @description Column title for the minimum AA contrast ratio column in the low contrast issue view
75
- */
76
- minimumAA: 'Minimum AA ratio',
77
- /**
78
- * @description Column title for the minimum AAA contrast ratio column in the low contrast issue view
79
- */
80
- minimumAAA: 'Minimum AAA ratio',
81
- /**
82
- * @description Column title for the text size column in the low contrast issue view
83
- */
84
- textSize: 'Text size',
85
- /**
86
- * @description Column title for the text weight column in the low contrast issue view
87
- */
88
- textWeight: 'Text weight',
89
- } as const;
90
- const str_ = i18n.i18n.registerUIStrings('panels/issues/AffectedElementsWithLowContrastView.ts', UIStrings);
91
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);