chrome-devtools-frontend 1.0.954845 → 1.0.955092

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.
@@ -1,4 +1,4 @@
1
- // Copyright 2021 The Chromium Authors. All rights reserved.
1
+ // Copyright 2022 The Chromium Authors. All rights reserved.
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
 
@@ -627,7 +627,11 @@ export function registerCommands(inspectorBackend) {
627
627
  ScrollbarTrackPiece: 'scrollbar-track-piece',
628
628
  ScrollbarCorner: 'scrollbar-corner',
629
629
  Resizer: 'resizer',
630
- InputListButton: 'input-list-button'
630
+ InputListButton: 'input-list-button',
631
+ Transition: 'transition',
632
+ TransitionContainer: 'transition-container',
633
+ TransitionOldContent: 'transition-old-content',
634
+ TransitionNewContent: 'transition-new-content'
631
635
  });
632
636
  inspectorBackend.registerEnum('DOM.ShadowRootType', {UserAgent: 'user-agent', Open: 'open', Closed: 'closed'});
633
637
  inspectorBackend.registerEnum(
@@ -1,4 +1,4 @@
1
- // Copyright 2021 The Chromium Authors. All rights reserved.
1
+ // Copyright 2022 The Chromium Authors. All rights reserved.
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
 
@@ -65,14 +65,6 @@ export const generatedProperties = [
65
65
  {'name': '-webkit-tap-highlight-color', 'inherited': true},
66
66
  {'name': '-webkit-text-combine', 'inherited': true},
67
67
  {'name': '-webkit-text-decorations-in-effect', 'inherited': true},
68
- {
69
- 'longhands': ['-webkit-text-emphasis-style', '-webkit-text-emphasis-color'],
70
- 'name': '-webkit-text-emphasis',
71
- 'inherited': true
72
- },
73
- {'name': '-webkit-text-emphasis-color', 'inherited': true},
74
- {'name': '-webkit-text-emphasis-position', 'inherited': true},
75
- {'name': '-webkit-text-emphasis-style', 'inherited': true},
76
68
  {'name': '-webkit-text-fill-color', 'inherited': true},
77
69
  {'name': '-webkit-text-orientation', 'inherited': true},
78
70
  {'name': '-webkit-text-security', 'inherited': true, 'keywords': ['none', 'disc', 'circle', 'square']},
@@ -771,6 +763,10 @@ export const generatedProperties = [
771
763
  {'name': 'text-decoration-skip-ink', 'inherited': true, 'keywords': ['none', 'auto']},
772
764
  {'name': 'text-decoration-style', 'keywords': ['solid', 'double', 'dotted', 'dashed', 'wavy']},
773
765
  {'name': 'text-decoration-thickness', 'inherited': true, 'keywords': ['auto', 'from-font']},
766
+ {'longhands': ['text-emphasis-style', 'text-emphasis-color'], 'name': 'text-emphasis', 'inherited': true},
767
+ {'name': 'text-emphasis-color', 'inherited': true, 'keywords': ['currentcolor']},
768
+ {'name': 'text-emphasis-position', 'inherited': true},
769
+ {'name': 'text-emphasis-style', 'inherited': true},
774
770
  {'name': 'text-indent', 'inherited': true},
775
771
  {'name': 'text-justify', 'inherited': true, 'keywords': ['auto', 'none', 'inter-word', 'distribute']},
776
772
  {'name': 'text-orientation', 'inherited': true, 'keywords': ['sideways', 'mixed', 'upright']},
@@ -828,7 +824,7 @@ export const generatedProperties = [
828
824
  {
829
825
  'name': 'white-space',
830
826
  'inherited': true,
831
- 'keywords': ['none', 'normal', 'pre', 'pre-wrap', 'pre-line', 'nowrap', '-webkit-nowrap', 'break-spaces']
827
+ 'keywords': ['normal', 'pre', 'pre-wrap', 'pre-line', 'nowrap', '-webkit-nowrap', 'break-spaces']
832
828
  },
833
829
  {'name': 'widows', 'inherited': true},
834
830
  {'name': 'width', 'keywords': ['auto', 'fit-content', 'min-content', 'max-content']},
@@ -1160,6 +1156,7 @@ export const generatedPropertyValues = {
1160
1156
  'text-decoration-skip-ink': {'values': ['none', 'auto']},
1161
1157
  'text-decoration-style': {'values': ['solid', 'double', 'dotted', 'dashed', 'wavy']},
1162
1158
  'text-decoration-thickness': {'values': ['auto', 'from-font']},
1159
+ 'text-emphasis-color': {'values': ['currentcolor']},
1163
1160
  'text-justify': {'values': ['auto', 'none', 'inter-word', 'distribute']},
1164
1161
  'text-orientation': {'values': ['sideways', 'mixed', 'upright']},
1165
1162
  'text-overflow': {'values': ['clip', 'ellipsis']},
@@ -1189,8 +1186,7 @@ export const generatedPropertyValues = {
1189
1186
  'vector-effect': {'values': ['none', 'non-scaling-stroke']},
1190
1187
  'vertical-align': {'values': ['baseline', 'sub', 'super', 'text-top', 'text-bottom', 'middle']},
1191
1188
  'visibility': {'values': ['visible', 'hidden', 'collapse']},
1192
- 'white-space':
1193
- {'values': ['none', 'normal', 'pre', 'pre-wrap', 'pre-line', 'nowrap', '-webkit-nowrap', 'break-spaces']},
1189
+ 'white-space': {'values': ['normal', 'pre', 'pre-wrap', 'pre-line', 'nowrap', '-webkit-nowrap', 'break-spaces']},
1194
1190
  'width': {'values': ['auto', 'fit-content', 'min-content', 'max-content']},
1195
1191
  'will-change': {'values': ['auto']},
1196
1192
  'word-break': {'values': ['normal', 'break-all', 'keep-all', 'break-word']},
@@ -1201,9 +1197,9 @@ export const generatedPropertyValues = {
1201
1197
  export const generatedAliasesFor = new Map([
1202
1198
  ['-epub-caption-side', 'caption-side'],
1203
1199
  ['-epub-text-combine', '-webkit-text-combine'],
1204
- ['-epub-text-emphasis', '-webkit-text-emphasis'],
1205
- ['-epub-text-emphasis-color', '-webkit-text-emphasis-color'],
1206
- ['-epub-text-emphasis-style', '-webkit-text-emphasis-style'],
1200
+ ['-epub-text-emphasis', 'text-emphasis'],
1201
+ ['-epub-text-emphasis-color', 'text-emphasis-color'],
1202
+ ['-epub-text-emphasis-style', 'text-emphasis-style'],
1207
1203
  ['-epub-text-orientation', '-webkit-text-orientation'],
1208
1204
  ['-epub-text-transform', 'text-transform'],
1209
1205
  ['-epub-word-break', 'word-break'],
@@ -1290,6 +1286,10 @@ export const generatedAliasesFor = new Map([
1290
1286
  ['-webkit-shape-image-threshold', 'shape-image-threshold'],
1291
1287
  ['-webkit-shape-margin', 'shape-margin'],
1292
1288
  ['-webkit-shape-outside', 'shape-outside'],
1289
+ ['-webkit-text-emphasis', 'text-emphasis'],
1290
+ ['-webkit-text-emphasis-color', 'text-emphasis-color'],
1291
+ ['-webkit-text-emphasis-position', 'text-emphasis-position'],
1292
+ ['-webkit-text-emphasis-style', 'text-emphasis-style'],
1293
1293
  ['-webkit-text-size-adjust', 'text-size-adjust'],
1294
1294
  ['-webkit-transform', 'transform'],
1295
1295
  ['-webkit-transform-origin', 'transform-origin'],
@@ -2884,6 +2884,10 @@ declare namespace Protocol {
2884
2884
  ScrollbarCorner = 'scrollbar-corner',
2885
2885
  Resizer = 'resizer',
2886
2886
  InputListButton = 'input-list-button',
2887
+ Transition = 'transition',
2888
+ TransitionContainer = 'transition-container',
2889
+ TransitionOldContent = 'transition-old-content',
2890
+ TransitionNewContent = 'transition-new-content',
2887
2891
  }
2888
2892
 
2889
2893
  /**
@@ -14068,6 +14072,12 @@ declare namespace Protocol {
14068
14072
  * Defaults to false.
14069
14073
  */
14070
14074
  hasCredBlob?: boolean;
14075
+ /**
14076
+ * If set to true, the authenticator will support the minPinLength extension.
14077
+ * https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-extension
14078
+ * Defaults to false.
14079
+ */
14080
+ hasMinPinLength?: boolean;
14071
14081
  /**
14072
14082
  * If set to true, tests of user presence will succeed immediately.
14073
14083
  * Otherwise, they will not be resolved. Defaults to true.
@@ -14356,6 +14366,8 @@ declare namespace Protocol {
14356
14366
  location: Location;
14357
14367
  /**
14358
14368
  * JavaScript script name or url.
14369
+ * Deprecated in favor of using the `location.scriptId` to resolve the URL via a previously
14370
+ * sent `Debugger.scriptParsed` event.
14359
14371
  */
14360
14372
  url: string;
14361
14373
  /**
@@ -6,7 +6,7 @@ import * as SDK from '../../core/sdk/sdk.js';
6
6
  import * as Protocol from '../../generated/protocol.js';
7
7
  import * as TextUtils from '../../models/text_utils/text_utils.js';
8
8
 
9
- import type {ConsoleViewMessage} from './ConsoleViewMessage.js';
9
+ import type {ConsoleGroupViewMessage, ConsoleViewMessage} from './ConsoleViewMessage.js';
10
10
 
11
11
  export type LevelsMask = {
12
12
  [x: string]: boolean,
@@ -68,13 +68,28 @@ export class ConsoleFilter {
68
68
  }
69
69
 
70
70
  if (message.type === SDK.ConsoleModel.FrontendMessageType.Command ||
71
- message.type === SDK.ConsoleModel.FrontendMessageType.Result || message.isGroupMessage()) {
71
+ message.type === SDK.ConsoleModel.FrontendMessageType.Result ||
72
+ message.type === Protocol.Runtime.ConsoleAPICalledEventType.EndGroup) {
72
73
  return true;
73
74
  }
75
+
74
76
  if (message.level && !this.levelsMask[message.level as string]) {
75
77
  return false;
76
78
  }
77
79
 
80
+ return this.applyFilter(viewMessage) || this.parentGroupHasMatch(viewMessage.consoleGroup());
81
+ }
82
+
83
+ // A message is visible if there is a match in any of the parent groups' titles.
84
+ parentGroupHasMatch(viewMessage: ConsoleGroupViewMessage|null): boolean {
85
+ if (viewMessage === null) {
86
+ return false;
87
+ }
88
+ return this.applyFilter(viewMessage) || this.parentGroupHasMatch(viewMessage.consoleGroup());
89
+ }
90
+
91
+ applyFilter(viewMessage: ConsoleViewMessage): boolean {
92
+ const message = viewMessage.consoleMessage();
78
93
  for (const filter of this.parsedFilters) {
79
94
  if (!filter.key) {
80
95
  if (filter.regex && viewMessage.matchesFilterRegex(filter.regex) === filter.negative) {
@@ -5,8 +5,9 @@
5
5
  import type * as SDK from '../../core/sdk/sdk.js';
6
6
 
7
7
  // VGA color palette
8
- const ANSI_COLORS = ['#000000', '#AA0000', '#00AA00', '#AA5500', '#0000AA', '#AA00AA', '#00AAAA', '#AAAAAA'];
9
- const ANSI_BRIGHT_COLORS = ['#555555', '#FF5555', '#55FF55', '#FFFF55', '#5555FF', '#FF55FF', '#55FFFF', '#FFFFFF'];
8
+ const ANSI_COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'gray'];
9
+ const ANSI_BRIGHT_COLORS =
10
+ ['darkgray', 'lightred', 'lightgreen', 'lightyellow', 'lightblue', 'lightmagenta', 'lightcyan', 'white'];
10
11
 
11
12
  export type FormatToken = {
12
13
  type: 'generic'|'optimal',
@@ -167,11 +168,11 @@ export const format = (fmt: string, args: SDK.RemoteObject.RemoteObject[]): {
167
168
  default: {
168
169
  const color = ANSI_COLORS[code - 30] ?? ANSI_BRIGHT_COLORS[code - 90];
169
170
  if (color !== undefined) {
170
- currentStyle.set('color', color);
171
+ currentStyle.set('color', `var(--console-color-${color})`);
171
172
  } else {
172
173
  const background = ANSI_COLORS[code - 40] ?? ANSI_BRIGHT_COLORS[code - 100];
173
174
  if (background !== undefined) {
174
- currentStyle.set('background', background);
175
+ currentStyle.set('background-color', `var(--console-color-${background})`);
175
176
  }
176
177
  }
177
178
  break;
@@ -274,12 +274,10 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
274
274
  private viewportThrottler: Common.Throttler.Throttler;
275
275
  private pendingBatchResize: boolean;
276
276
  private readonly onMessageResizedBound: (e: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void;
277
- private topGroup: ConsoleGroup;
278
- private currentGroup: ConsoleGroup;
279
277
  private readonly promptElement: HTMLElement;
280
278
  private readonly linkifier: Components.Linkifier.Linkifier;
281
279
  private consoleMessages: ConsoleViewMessage[];
282
- private readonly viewMessageSymbol: symbol;
280
+ private consoleGroupStarts: ConsoleGroupViewMessage[];
283
281
  private readonly consoleHistorySetting: Common.Settings.Setting<string[]>;
284
282
  private prompt: ConsolePrompt;
285
283
  private immediatelyFilterMessagesForTest?: boolean;
@@ -485,9 +483,6 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
485
483
  this.onMessageResized(e);
486
484
  };
487
485
 
488
- this.topGroup = ConsoleGroup.createTopGroup();
489
- this.currentGroup = this.topGroup;
490
-
491
486
  this.promptElement = this.messagesElement.createChild('div', 'source-code');
492
487
  this.promptElement.id = 'console-prompt';
493
488
 
@@ -509,7 +504,7 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
509
504
  new Components.Linkifier.Linkifier(MaxLengthForLinks, /* useLinkDecorator */ undefined, refilterMessages);
510
505
 
511
506
  this.consoleMessages = [];
512
- this.viewMessageSymbol = Symbol('viewMessage');
507
+ this.consoleGroupStarts = [];
513
508
 
514
509
  this.consoleHistorySetting = Common.Settings.Settings.instance().createLocalSetting('consoleHistory', []);
515
510
 
@@ -801,6 +796,23 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
801
796
  const insertedInMiddle = insertAt < this.consoleMessages.length;
802
797
  this.consoleMessages.splice(insertAt, 0, viewMessage);
803
798
 
799
+ if (message.type !== SDK.ConsoleModel.FrontendMessageType.Command &&
800
+ message.type !== SDK.ConsoleModel.FrontendMessageType.Result) {
801
+ // Maintain group tree.
802
+ // Find parent group.
803
+ const consoleGroupStartIndex =
804
+ Platform.ArrayUtilities.upperBound(this.consoleGroupStarts, viewMessage, timeComparator) - 1;
805
+ if (consoleGroupStartIndex >= 0) {
806
+ const currentGroup = this.consoleGroupStarts[consoleGroupStartIndex];
807
+ addToGroup(viewMessage, currentGroup);
808
+ }
809
+ // Add new group.
810
+ if (message.isGroupStartMessage()) {
811
+ insertAt = Platform.ArrayUtilities.upperBound(this.consoleGroupStarts, viewMessage, timeComparator);
812
+ this.consoleGroupStarts.splice(insertAt, 0, viewMessage as ConsoleGroupViewMessage);
813
+ }
814
+ }
815
+
804
816
  this.filter.onMessageAdded(message);
805
817
  if (this.isSidebarOpen) {
806
818
  this.sidebar.onMessageAdded(viewMessage);
@@ -836,6 +848,29 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
836
848
  this.scheduleViewportRefresh();
837
849
  this.consoleMessageAddedForTest(viewMessage);
838
850
 
851
+ // Figure out whether the message should belong into this group or the parent group based on group end timestamp.
852
+ function addToGroup(viewMessage: ConsoleViewMessage, currentGroup: ConsoleGroupViewMessage): void {
853
+ const currentEnd = currentGroup.groupEnd();
854
+ if (currentEnd !== null) {
855
+ // Exceeds this group's end. It should belong into parent group.
856
+ if (timeComparator(viewMessage, currentEnd) > 0) {
857
+ const parent = currentGroup.consoleGroup();
858
+ // No parent group. We reached ungrouped messages. Don't establish group links.
859
+ if (parent === null) {
860
+ return;
861
+ } // Add to parent group.
862
+ addToGroup(viewMessage, parent);
863
+ return;
864
+ }
865
+ }
866
+ // Add message to this group, and set group of the message.
867
+ if (viewMessage.consoleMessage().type === Protocol.Runtime.ConsoleAPICalledEventType.EndGroup) {
868
+ currentGroup.setGroupEnd(viewMessage);
869
+ } else {
870
+ viewMessage.setConsoleGroup(currentGroup);
871
+ }
872
+ }
873
+
839
874
  function timeComparator(viewMessage1: ConsoleViewMessage, viewMessage2: ConsoleViewMessage): number {
840
875
  return (messagesSortedBySymbol.get(viewMessage1) || 0) - (messagesSortedBySymbol.get(viewMessage2) || 0);
841
876
  }
@@ -872,6 +907,18 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
872
907
  !this.showCorsErrorsSetting.get()) {
873
908
  return;
874
909
  }
910
+
911
+ const lastMessage = this.visibleViewMessages[this.visibleViewMessages.length - 1];
912
+ if (viewMessage.consoleMessage().type === Protocol.Runtime.ConsoleAPICalledEventType.EndGroup) {
913
+ if (lastMessage) {
914
+ const group = lastMessage.consoleGroup();
915
+ if (group && !group.messagesHidden()) {
916
+ lastMessage.incrementCloseGroupDecorationCount();
917
+ }
918
+ }
919
+ return;
920
+ }
921
+
875
922
  if (!this.shouldMessageBeVisible(viewMessage)) {
876
923
  this.hiddenByFilterCount++;
877
924
  return;
@@ -882,29 +929,36 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
882
929
  return;
883
930
  }
884
931
 
885
- const lastMessage = this.visibleViewMessages[this.visibleViewMessages.length - 1];
886
- if (viewMessage.consoleMessage().type === Protocol.Runtime.ConsoleAPICalledEventType.EndGroup) {
887
- if (lastMessage && !this.currentGroup.messagesHidden()) {
888
- lastMessage.incrementCloseGroupDecorationCount();
889
- }
890
- this.currentGroup = this.currentGroup.parentGroup() || this.currentGroup;
891
- return;
892
- }
893
- if (!this.currentGroup.messagesHidden()) {
932
+ const currentGroup = viewMessage.consoleGroup();
933
+
934
+ if (!currentGroup || !currentGroup.messagesHidden()) {
894
935
  const originatingMessage = viewMessage.consoleMessage().originatingMessage();
895
936
  if (lastMessage && originatingMessage && lastMessage.consoleMessage() === originatingMessage) {
896
937
  viewMessage.toMessageElement().classList.add('console-adjacent-user-command-result');
897
938
  }
898
-
939
+ showGroup(currentGroup, this.visibleViewMessages);
899
940
  this.visibleViewMessages.push(viewMessage);
900
941
  this.searchMessage(this.visibleViewMessages.length - 1);
901
942
  }
902
943
 
903
- if (viewMessage.consoleMessage().isGroupStartMessage()) {
904
- this.currentGroup = new ConsoleGroup(this.currentGroup, (viewMessage as ConsoleGroupViewMessage));
905
- }
906
-
907
944
  this.messageAppendedForTests();
945
+
946
+ // Show the group the message belongs to, and also show parent groups.
947
+ function showGroup(currentGroup: ConsoleGroupViewMessage|null, visibleViewMessages: ConsoleViewMessage[]): void {
948
+ if (currentGroup === null) {
949
+ return;
950
+ }
951
+ // Group is already being shown, no need to traverse to
952
+ // parent groups since they are also already being shown.
953
+ if (visibleViewMessages.includes(currentGroup)) {
954
+ return;
955
+ }
956
+ const parentGroup = currentGroup.consoleGroup();
957
+ if (parentGroup) {
958
+ showGroup(parentGroup, visibleViewMessages);
959
+ }
960
+ visibleViewMessages.push(currentGroup);
961
+ }
908
962
  }
909
963
 
910
964
  private messageAppendedForTests(): void {
@@ -912,29 +966,24 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
912
966
  }
913
967
 
914
968
  private createViewMessage(message: SDK.ConsoleModel.ConsoleMessage): ConsoleViewMessage {
915
- const nestingLevel = this.currentGroup.nestingLevel();
916
969
  switch (message.type) {
917
970
  case SDK.ConsoleModel.FrontendMessageType.Command:
918
971
  return new ConsoleCommand(
919
- message, this.linkifier, this.requestResolver, this.issueResolver, nestingLevel,
920
- this.onMessageResizedBound);
972
+ message, this.linkifier, this.requestResolver, this.issueResolver, this.onMessageResizedBound);
921
973
  case SDK.ConsoleModel.FrontendMessageType.Result:
922
974
  return new ConsoleCommandResult(
923
- message, this.linkifier, this.requestResolver, this.issueResolver, nestingLevel,
924
- this.onMessageResizedBound);
975
+ message, this.linkifier, this.requestResolver, this.issueResolver, this.onMessageResizedBound);
925
976
  case Protocol.Runtime.ConsoleAPICalledEventType.StartGroupCollapsed:
926
977
  case Protocol.Runtime.ConsoleAPICalledEventType.StartGroup:
927
978
  return new ConsoleGroupViewMessage(
928
- message, this.linkifier, this.requestResolver, this.issueResolver, nestingLevel,
929
- this.updateMessageList.bind(this), this.onMessageResizedBound);
979
+ message, this.linkifier, this.requestResolver, this.issueResolver, this.updateMessageList.bind(this),
980
+ this.onMessageResizedBound);
930
981
  case Protocol.Runtime.ConsoleAPICalledEventType.Table:
931
982
  return new ConsoleTableMessageView(
932
- message, this.linkifier, this.requestResolver, this.issueResolver, nestingLevel,
933
- this.onMessageResizedBound);
983
+ message, this.linkifier, this.requestResolver, this.issueResolver, this.onMessageResizedBound);
934
984
  default:
935
985
  return new ConsoleViewMessage(
936
- message, this.linkifier, this.requestResolver, this.issueResolver, nestingLevel,
937
- this.onMessageResizedBound);
986
+ message, this.linkifier, this.requestResolver, this.issueResolver, this.onMessageResizedBound);
938
987
  }
939
988
  }
940
989
 
@@ -970,6 +1019,7 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
970
1019
  this.linkifier.reset();
971
1020
  this.filter.clear();
972
1021
  this.requestResolver.clear();
1022
+ this.consoleGroupStarts = [];
973
1023
  if (hadFocus) {
974
1024
  this.prompt.focus();
975
1025
  }
@@ -1079,7 +1129,7 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
1079
1129
  return;
1080
1130
  }
1081
1131
  this.buildHiddenCacheTimeout =
1082
- this.element.window().requestAnimationFrame(this.buildHiddenCache.bind(this, i, viewMessages));
1132
+ this.element.window().requestAnimationFrame(this.buildHiddenCache.bind(this, i + 1, viewMessages));
1083
1133
  }
1084
1134
 
1085
1135
  private cancelBuildHiddenCache(): void {
@@ -1091,8 +1141,6 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
1091
1141
  }
1092
1142
 
1093
1143
  private updateMessageList(): void {
1094
- this.topGroup = ConsoleGroup.createTopGroup();
1095
- this.currentGroup = this.topGroup;
1096
1144
  this.regexMatchRanges = [];
1097
1145
  this.hiddenByFilterCount = 0;
1098
1146
  for (const visibleViewMessage of this.visibleViewMessages) {
@@ -1105,9 +1153,14 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
1105
1153
  } else {
1106
1154
  for (const consoleMessage of this.consoleMessages) {
1107
1155
  consoleMessage.setInSimilarGroup(false);
1156
+ if (consoleMessage.consoleMessage().isGroupable()) {
1157
+ // Since grouping similar messages is disabled, we need clear the
1158
+ // reference to the artificial console group start.
1159
+ consoleMessage.clearConsoleGroup();
1160
+ }
1108
1161
  this.appendMessageToEnd(
1109
1162
  consoleMessage,
1110
- true /* crbug.com/1082963: prevent collapse of same messages when "Group similar" is false */);
1163
+ true /* crbug.com/1082963: prevent collaps`e of same messages when "Group similar" is false */);
1111
1164
  }
1112
1165
  }
1113
1166
  this.updateFilterStatus();
@@ -1169,6 +1222,7 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
1169
1222
  for (const viewMessageInGroup of viewMessagesInGroup) {
1170
1223
  viewMessageInGroup.setInSimilarGroup(
1171
1224
  true, viewMessagesInGroup[viewMessagesInGroup.length - 1] === viewMessageInGroup);
1225
+ viewMessageInGroup.setConsoleGroup(startGroupViewMessage as ConsoleGroupViewMessage);
1172
1226
  this.appendMessageToEnd(viewMessageInGroup, true);
1173
1227
  alreadyAdded.add(viewMessageInGroup.consoleMessage());
1174
1228
  }
@@ -1656,35 +1710,6 @@ export class ConsoleViewFilter {
1656
1710
  }
1657
1711
  }
1658
1712
 
1659
- export class ConsoleGroup {
1660
- private readonly parentGroupInternal: ConsoleGroup|null;
1661
- private readonly nestingLevelInternal: number;
1662
- private readonly messagesHiddenInternal: boolean;
1663
-
1664
- constructor(parentGroup: ConsoleGroup|null, groupMessage: ConsoleGroupViewMessage|null) {
1665
- this.parentGroupInternal = parentGroup;
1666
- this.nestingLevelInternal = parentGroup ? parentGroup.nestingLevel() + 1 : 0;
1667
- this.messagesHiddenInternal = groupMessage && groupMessage.collapsed() ||
1668
- this.parentGroupInternal && this.parentGroupInternal.messagesHidden() || false;
1669
- }
1670
-
1671
- static createTopGroup(): ConsoleGroup {
1672
- return new ConsoleGroup(null, null);
1673
- }
1674
-
1675
- messagesHidden(): boolean {
1676
- return this.messagesHiddenInternal;
1677
- }
1678
-
1679
- nestingLevel(): number {
1680
- return this.nestingLevelInternal;
1681
- }
1682
-
1683
- parentGroup(): ConsoleGroup|null {
1684
- return this.parentGroupInternal;
1685
- }
1686
- }
1687
-
1688
1713
  let actionDelegateInstance: ActionDelegate;
1689
1714
 
1690
1715
  export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
@@ -206,7 +206,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
206
206
  private readonly linkifier: Components.Linkifier.Linkifier;
207
207
  private repeatCountInternal: number;
208
208
  private closeGroupDecorationCount: number;
209
- private readonly nestingLevelInternal: number;
209
+ private consoleGroupInternal: ConsoleGroupViewMessage|null;
210
210
  private selectableChildren: {
211
211
  element: HTMLElement,
212
212
  forceSelect: () => void,
@@ -238,14 +238,13 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
238
238
  constructor(
239
239
  consoleMessage: SDK.ConsoleModel.ConsoleMessage, linkifier: Components.Linkifier.Linkifier,
240
240
  requestResolver: Logs.RequestResolver.RequestResolver, issueResolver: IssuesManager.IssueResolver.IssueResolver,
241
- nestingLevel: number, onResize: (arg0: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void) {
241
+ onResize: (arg0: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void) {
242
242
  this.message = consoleMessage;
243
243
  this.linkifier = linkifier;
244
244
  this.requestResolver = requestResolver;
245
245
  this.issueResolver = issueResolver;
246
246
  this.repeatCountInternal = 1;
247
247
  this.closeGroupDecorationCount = 0;
248
- this.nestingLevelInternal = nestingLevel;
249
248
  this.selectableChildren = [];
250
249
  this.messageResized = onResize;
251
250
  this.elementInternal = null;
@@ -269,6 +268,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
269
268
  this.lastInSimilarGroup = false;
270
269
  this.groupKeyInternal = '';
271
270
  this.repeatCountElement = null;
271
+ this.consoleGroupInternal = null;
272
272
  }
273
273
 
274
274
  element(): HTMLElement {
@@ -906,6 +906,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
906
906
  // Make sure that allowed properties do not interfere with link visibility.
907
907
  const ALLOWED_PROPERTY_PREFIXES =
908
908
  ['background', 'border', 'color', 'font', 'line', 'margin', 'padding', 'text'];
909
+
909
910
  currentStyle.clear();
910
911
  const buffer = document.createElement('span');
911
912
  buffer.setAttribute('style', token.value);
@@ -959,7 +960,24 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
959
960
  }
960
961
 
961
962
  nestingLevel(): number {
962
- return this.nestingLevelInternal;
963
+ let nestingLevel = 0;
964
+ for (let group = this.consoleGroup(); group !== null; group = group.consoleGroup()) {
965
+ nestingLevel++;
966
+ }
967
+ return nestingLevel;
968
+ }
969
+
970
+ setConsoleGroup(group: ConsoleGroupViewMessage): void {
971
+ console.assert(this.consoleGroupInternal === null);
972
+ this.consoleGroupInternal = group;
973
+ }
974
+
975
+ clearConsoleGroup(): void {
976
+ this.consoleGroupInternal = null;
977
+ }
978
+
979
+ consoleGroup(): ConsoleGroupViewMessage|null {
980
+ return this.consoleGroupInternal;
963
981
  }
964
982
 
965
983
  setInSimilarGroup(inSimilarGroup: boolean, isLast?: boolean): void {
@@ -1170,7 +1188,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
1170
1188
  }
1171
1189
 
1172
1190
  this.nestingLevelMarkers = [];
1173
- for (let i = 0; i < this.nestingLevelInternal; ++i) {
1191
+ for (let i = 0; i < this.nestingLevel(); ++i) {
1174
1192
  this.nestingLevelMarkers.push(this.elementInternal.createChild('div', 'nesting-level-marker'));
1175
1193
  }
1176
1194
  this.updateCloseGroupDecorations();
@@ -1699,17 +1717,18 @@ export class ConsoleGroupViewMessage extends ConsoleViewMessage {
1699
1717
  private collapsedInternal: boolean;
1700
1718
  private expandGroupIcon: UI.Icon.Icon|null;
1701
1719
  private readonly onToggle: () => void;
1720
+ private groupEndMessageInternal: ConsoleViewMessage|null;
1702
1721
 
1703
1722
  constructor(
1704
1723
  consoleMessage: SDK.ConsoleModel.ConsoleMessage, linkifier: Components.Linkifier.Linkifier,
1705
1724
  requestResolver: Logs.RequestResolver.RequestResolver, issueResolver: IssuesManager.IssueResolver.IssueResolver,
1706
- nestingLevel: number, onToggle: () => void,
1707
- onResize: (arg0: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void) {
1725
+ onToggle: () => void, onResize: (arg0: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void) {
1708
1726
  console.assert(consoleMessage.isGroupStartMessage());
1709
- super(consoleMessage, linkifier, requestResolver, issueResolver, nestingLevel, onResize);
1727
+ super(consoleMessage, linkifier, requestResolver, issueResolver, onResize);
1710
1728
  this.collapsedInternal = consoleMessage.type === Protocol.Runtime.ConsoleAPICalledEventType.StartGroupCollapsed;
1711
1729
  this.expandGroupIcon = null;
1712
1730
  this.onToggle = onToggle;
1731
+ this.groupEndMessageInternal = null;
1713
1732
  }
1714
1733
 
1715
1734
  private setCollapsed(collapsed: boolean): void {
@@ -1760,6 +1779,28 @@ export class ConsoleGroupViewMessage extends ConsoleViewMessage {
1760
1779
  this.repeatCountElement.insertBefore(this.expandGroupIcon, this.repeatCountElement.firstChild);
1761
1780
  }
1762
1781
  }
1782
+
1783
+ messagesHidden(): boolean {
1784
+ if (this.collapsed()) {
1785
+ return true;
1786
+ }
1787
+ const parent = this.consoleGroup();
1788
+ return Boolean(parent && parent.messagesHidden());
1789
+ }
1790
+
1791
+ setGroupEnd(viewMessage: ConsoleViewMessage): void {
1792
+ if (viewMessage.consoleMessage().type !== Protocol.Runtime.ConsoleAPICalledEventType.EndGroup) {
1793
+ throw new Error('Invalid console message as group end');
1794
+ }
1795
+ if (this.groupEndMessageInternal !== null) {
1796
+ throw new Error('Console group already has an end');
1797
+ }
1798
+ this.groupEndMessageInternal = viewMessage;
1799
+ }
1800
+
1801
+ groupEnd(): ConsoleViewMessage|null {
1802
+ return this.groupEndMessageInternal;
1803
+ }
1763
1804
  }
1764
1805
 
1765
1806
  export class ConsoleCommand extends ConsoleViewMessage {
@@ -1768,8 +1809,8 @@ export class ConsoleCommand extends ConsoleViewMessage {
1768
1809
  constructor(
1769
1810
  consoleMessage: SDK.ConsoleModel.ConsoleMessage, linkifier: Components.Linkifier.Linkifier,
1770
1811
  requestResolver: Logs.RequestResolver.RequestResolver, issueResolver: IssuesManager.IssueResolver.IssueResolver,
1771
- nestingLevel: number, onResize: (arg0: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void) {
1772
- super(consoleMessage, linkifier, requestResolver, issueResolver, nestingLevel, onResize);
1812
+ onResize: (arg0: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void) {
1813
+ super(consoleMessage, linkifier, requestResolver, issueResolver, onResize);
1773
1814
  this.formattedCommand = null;
1774
1815
  }
1775
1816
 
@@ -1826,8 +1867,8 @@ export class ConsoleTableMessageView extends ConsoleViewMessage {
1826
1867
  constructor(
1827
1868
  consoleMessage: SDK.ConsoleModel.ConsoleMessage, linkifier: Components.Linkifier.Linkifier,
1828
1869
  requestResolver: Logs.RequestResolver.RequestResolver, issueResolver: IssuesManager.IssueResolver.IssueResolver,
1829
- nestingLevel: number, onResize: (arg0: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void) {
1830
- super(consoleMessage, linkifier, requestResolver, issueResolver, nestingLevel, onResize);
1870
+ onResize: (arg0: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>) => void) {
1871
+ super(consoleMessage, linkifier, requestResolver, issueResolver, onResize);
1831
1872
  console.assert(consoleMessage.type === Protocol.Runtime.ConsoleAPICalledEventType.Table);
1832
1873
  this.dataGrid = null;
1833
1874
  }
@@ -208,6 +208,42 @@
208
208
  display: flex;
209
209
  border-top: 1px solid var(--override-message-border-color);
210
210
  border-bottom: 1px solid transparent;
211
+
212
+ /* Console ANSI color */
213
+ --console-color-black: #000;
214
+ --console-color-red: #a00;
215
+ --console-color-green: #0a0;
216
+ --console-color-yellow: #a50;
217
+ --console-color-blue: #00a;
218
+ --console-color-magenta: #a0a;
219
+ --console-color-cyan: #0aa;
220
+ --console-color-gray: #aaa;
221
+ --console-color-darkgray: #555;
222
+ --console-color-lightred: #f55;
223
+ --console-color-lightgreen: #5f5;
224
+ --console-color-lightyellow: #ff5;
225
+ --console-color-lightblue: #55f;
226
+ --console-color-ightmagenta: #f5f;
227
+ --console-color-lightcyan: #5ff;
228
+ --console-color-white: #fff;
229
+ }
230
+
231
+ .-theme-with-dark-background .console-message-wrapper {
232
+ /* Dark theme console ANSI color */
233
+ --console-color-red: rgb(237 78 76);
234
+ --console-color-green: rgb(1 200 1);
235
+ --console-color-yellow: rgb(210 192 87);
236
+ --console-color-blue: rgb(39 116 240);
237
+ --console-color-magenta: rgb(161 66 244);
238
+ --console-color-cyan: rgb(18 181 203);
239
+ --console-color-gray: rgb(207 208 208);
240
+ --console-color-darkgray: rgb(137 137 137);
241
+ --console-color-lightred: rgb(242 139 130);
242
+ --console-color-lightgreen: rgb(161 247 181);
243
+ --console-color-lightyellow: rgb(221 251 85);
244
+ --console-color-lightblue: rgb(102 157 246);
245
+ --console-color-lightmagenta: rgb(214 112 214);
246
+ --console-color-lightcyan: rgb(132 240 255);
211
247
  }
212
248
 
213
249
  .console-message-wrapper:first-of-type {
@@ -244,10 +244,10 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
244
244
  this.nodeInternal = node;
245
245
  this.treeOutline = null;
246
246
 
247
- this.gutterContainer = this.listItemElement.createChild('div', 'gutter-container');
247
+ this.gutterContainer = this.contentElement.createChild('div', 'gutter-container');
248
248
  this.gutterContainer.addEventListener('click', this.showContextMenu.bind(this));
249
249
  const gutterMenuIcon = UI.Icon.Icon.create('largeicon-menu', 'gutter-menu-icon');
250
- this.gutterContainer.appendChild(gutterMenuIcon);
250
+ this.gutterContainer.append(gutterMenuIcon);
251
251
  this.decorationsElement = this.gutterContainer.createChild('div', 'hidden');
252
252
 
253
253
  this.isClosingTagInternal = isClosingTag;
@@ -267,7 +267,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
267
267
  this.highlightResult = [];
268
268
 
269
269
  if (!isClosingTag) {
270
- this.adornerContainer = this.listItemElement.createChild('div', 'adorner-container hidden');
270
+ this.adornerContainer = this.contentElement.createChild('div', 'adorner-container hidden');
271
271
  this.adorners = [];
272
272
  this.styleAdorners = [];
273
273
  this.adornersThrottler = new Common.Throttler.Throttler(100);
@@ -422,8 +422,8 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
422
422
  }
423
423
 
424
424
  private createSelection(): void {
425
- const listItemElement = this.listItemElement;
426
- if (!listItemElement) {
425
+ const contentElement = this.contentElement;
426
+ if (!contentElement) {
427
427
  return;
428
428
  }
429
429
 
@@ -431,13 +431,13 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
431
431
  this.selectionElement = document.createElement('div');
432
432
  this.selectionElement.className = 'selection fill';
433
433
  this.selectionElement.style.setProperty('margin-left', (-this.computeLeftIndent()) + 'px');
434
- listItemElement.insertBefore(this.selectionElement, listItemElement.firstChild);
434
+ contentElement.prepend(this.selectionElement);
435
435
  }
436
436
  }
437
437
 
438
438
  private createHint(): void {
439
- if (this.listItemElement && !this.hintElement) {
440
- this.hintElement = this.listItemElement.createChild('span', 'selected-hint');
439
+ if (this.contentElement && !this.hintElement) {
440
+ this.hintElement = this.contentElement.createChild('span', 'selected-hint');
441
441
  const selectedElementCommand = '$0';
442
442
  UI.Tooltip.Tooltip.install(
443
443
  this.hintElement, i18nString(UIStrings.useSInTheConsoleToReferToThis, {PH1: selectedElementCommand}));
@@ -1017,7 +1017,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
1017
1017
  this.childrenListElement.style.display = 'none';
1018
1018
  }
1019
1019
  // Append editor.
1020
- this.listItemElement.appendChild(this.htmlEditElement);
1020
+ this.listItemElement.append(this.htmlEditElement);
1021
1021
  this.htmlEditElement.addEventListener('keydown', event => {
1022
1022
  if (event.key === 'Escape') {
1023
1023
  event.consume(true);
@@ -1305,13 +1305,13 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
1305
1305
  }
1306
1306
  const highlightElement = document.createElement('span');
1307
1307
  highlightElement.className = 'highlight';
1308
- highlightElement.appendChild(nodeInfo);
1308
+ highlightElement.append(nodeInfo);
1309
1309
  // fixme: make it clear that `this.title = x` is a setter with significant side effects
1310
1310
  this.title = highlightElement;
1311
1311
  this.updateDecorations();
1312
- this.listItemElement.insertBefore(this.gutterContainer, this.listItemElement.firstChild);
1312
+ this.contentElement.prepend(this.gutterContainer);
1313
1313
  if (!this.isClosingTagInternal && this.adornerContainer) {
1314
- this.listItemElement.appendChild(this.adornerContainer);
1314
+ this.contentElement.append(this.adornerContainer);
1315
1315
  }
1316
1316
  this.highlightResult = [];
1317
1317
  delete this.selectionElement;
@@ -44,9 +44,13 @@
44
44
  min-width: 200px;
45
45
  }
46
46
 
47
+ .elements-disclosure li.parent {
48
+ display: flex;
49
+ }
50
+
47
51
  .elements-disclosure li.parent:not(.always-parent) {
48
52
  /** Keep it in sync with ElementsTreeElements.updateDecorations **/
49
- margin-left: -13px;
53
+ margin-left: -12px;
50
54
  }
51
55
 
52
56
  .elements-disclosure li .selected-hint::before {
@@ -67,6 +71,7 @@
67
71
  user-select: none;
68
72
  -webkit-mask-image: var(--image-file-treeoutlineTriangles);
69
73
  -webkit-mask-size: 32px 24px;
74
+ height: 16px;
70
75
  content: "\A0\A0";
71
76
  color: transparent;
72
77
  text-shadow: none;
@@ -432,6 +432,7 @@ export class TreeElement {
432
432
  private readonly boundOnFocus: () => void;
433
433
  private readonly boundOnBlur: () => void;
434
434
  readonly listItemNode: HTMLLIElement;
435
+ readonly contentNode: HTMLElement;
435
436
  titleElement: Node;
436
437
  titleInternal: string|Node;
437
438
  private childrenInternal: TreeElement[]|null;
@@ -458,8 +459,10 @@ export class TreeElement {
458
459
  this.boundOnFocus = this.onFocus.bind(this);
459
460
  this.boundOnBlur = this.onBlur.bind(this);
460
461
  this.listItemNode = document.createElement('li');
462
+ this.contentNode = this.listItemElement.createChild('div');
463
+ this.contentNode.classList.add('tree-element-content');
461
464
 
462
- this.titleElement = this.listItemNode.createChild('span', 'tree-element-title');
465
+ this.titleElement = this.contentNode.createChild('span', 'tree-element-title');
463
466
  treeElementBylistItemNode.set(this.listItemNode, this);
464
467
  this.titleInternal = '';
465
468
  if (title) {
@@ -729,6 +732,10 @@ export class TreeElement {
729
732
  return this.listItemNode;
730
733
  }
731
734
 
735
+ get contentElement(): HTMLElement {
736
+ return this.contentNode;
737
+ }
738
+
732
739
  get childrenListElement(): HTMLOListElement {
733
740
  return this.childrenListNode;
734
741
  }
@@ -751,13 +758,13 @@ export class TreeElement {
751
758
  this.tooltip = '';
752
759
  }
753
760
 
754
- this.listItemNode.removeChildren();
761
+ this.contentNode.removeChildren();
755
762
  if (this.leadingIconsElement) {
756
- this.listItemNode.appendChild(this.leadingIconsElement);
763
+ this.contentNode.appendChild(this.leadingIconsElement);
757
764
  }
758
- this.listItemNode.appendChild(this.titleElement);
765
+ this.contentNode.appendChild(this.titleElement);
759
766
  if (this.trailingIconsElement) {
760
- this.listItemNode.appendChild(this.trailingIconsElement);
767
+ this.contentNode.appendChild(this.trailingIconsElement);
761
768
  }
762
769
  this.ensureSelection();
763
770
  }
@@ -787,7 +794,7 @@ export class TreeElement {
787
794
  this.leadingIconsElement = document.createElement('div');
788
795
  this.leadingIconsElement.classList.add('leading-icons');
789
796
  this.leadingIconsElement.classList.add('icons-container');
790
- this.listItemNode.insertBefore(this.leadingIconsElement, this.titleElement);
797
+ this.contentNode.insertBefore(this.leadingIconsElement, this.titleElement);
791
798
  this.ensureSelection();
792
799
  }
793
800
  this.leadingIconsElement.removeChildren();
@@ -804,7 +811,7 @@ export class TreeElement {
804
811
  this.trailingIconsElement = document.createElement('div');
805
812
  this.trailingIconsElement.classList.add('trailing-icons');
806
813
  this.trailingIconsElement.classList.add('icons-container');
807
- this.listItemNode.appendChild(this.trailingIconsElement);
814
+ this.contentNode.appendChild(this.trailingIconsElement);
808
815
  this.ensureSelection();
809
816
  }
810
817
  this.trailingIconsElement.removeChildren();
@@ -93,6 +93,10 @@ ol.tree-outline:not(.hide-selection-when-blurred) li.selected:focus * {
93
93
  color: inherit;
94
94
  }
95
95
 
96
+ .tree-outline .tree-element-content {
97
+ display: flex;
98
+ }
99
+
96
100
  .tree-outline li .icons-container {
97
101
  align-self: center;
98
102
  display: flex;
package/package.json CHANGED
@@ -53,5 +53,5 @@
53
53
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
54
54
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
55
55
  },
56
- "version": "1.0.954845"
56
+ "version": "1.0.955092"
57
57
  }
@@ -9,6 +9,8 @@ const ruleTester = new (require('eslint').RuleTester)({
9
9
  parser: require.resolve('@typescript-eslint/parser'),
10
10
  });
11
11
 
12
+ const CURRENT_YEAR = new Date().getFullYear();
13
+
12
14
  ruleTester.run('check_license_header', rule, {
13
15
  valid: [
14
16
  {
@@ -116,7 +118,7 @@ main()
116
118
  code: 'import * as Action from \'./Action.js\';',
117
119
  filename: 'front_end/ui/ui.js',
118
120
  errors: [{message: 'Missing license header'}],
119
- output: `// Copyright 2021 The Chromium Authors. All rights reserved.
121
+ output: `// Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
120
122
  // Use of this source code is governed by a BSD-style license that can be
121
123
  // found in the LICENSE file.
122
124
 
@@ -131,7 +133,7 @@ import * as Action from './Action.js';
131
133
  filename: 'front_end/ui/ui.js',
132
134
  errors: [{message: 'Incorrect line license header'}],
133
135
  output: `
134
- // Copyright 2021 The Chromium Authors. All rights reserved.
136
+ // Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
135
137
  // Use of this source code is governed by a BSD-style license that can be
136
138
  // found in the LICENSE file.
137
139
 
@@ -147,7 +149,7 @@ import * as Action from './Action.js';
147
149
  (async function() {})();`,
148
150
  filename: 'test/webtests/http/tests/devtools/a11y-axe-core/sources/call-stack-a11y-test.js',
149
151
  errors: [{message: 'Incorrect line license header'}],
150
- output: `// Copyright 2021 The Chromium Authors. All rights reserved.
152
+ output: `// Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
151
153
  // Use of this source code is governed by a BSD-style license that can be
152
154
  // found in the LICENSE file.
153
155
 
@@ -168,7 +170,7 @@ import * as Action from './Action.js';
168
170
  filename: 'front_end/ui/ui.js',
169
171
  errors: [{message: 'Incorrect line license header'}],
170
172
  output: `
171
- // Copyright 2021 The Chromium Authors. All rights reserved.
173
+ // Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
172
174
  // Use of this source code is governed by a BSD-style license that can be
173
175
  // found in the LICENSE file.
174
176
 
@@ -191,7 +193,7 @@ import * as Action from './Action.js';
191
193
  filename: 'front_end/ui/ui.js',
192
194
  errors: [{message: 'Incorrect block license header'}],
193
195
  output: `
194
- // Copyright 2021 The Chromium Authors. All rights reserved.
196
+ // Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
195
197
  // Use of this source code is governed by a BSD-style license that can be
196
198
  // found in the LICENSE file.
197
199
 
@@ -225,7 +227,7 @@ interface String {
225
227
  filename: 'front_end/legacy/legacy-defs.d.ts',
226
228
  errors: [{message: 'Missing license header'}],
227
229
  output: `
228
- // Copyright 2021 The Chromium Authors. All rights reserved.
230
+ // Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
229
231
  // Use of this source code is governed by a BSD-style license that can be
230
232
  // found in the LICENSE file.
231
233
 
@@ -258,7 +260,7 @@ main()
258
260
  errors: [{message: 'Missing license header'}],
259
261
  output: `#!/usr/bin/env node
260
262
 
261
- // Copyright 2021 The Chromium Authors. All rights reserved.
263
+ // Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
262
264
  // Use of this source code is governed by a BSD-style license that can be
263
265
  // found in the LICENSE file.
264
266
 
@@ -279,7 +281,7 @@ main()
279
281
  errors: [{message: 'Incorrect line license header'}],
280
282
  output: `#!/usr/bin/env node
281
283
 
282
- // Copyright 2021 The Chromium Authors. All rights reserved.
284
+ // Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
283
285
  // Use of this source code is governed by a BSD-style license that can be
284
286
  // found in the LICENSE file.
285
287